public void modify(final ConnectionDescriptor remoteDescriptor, final ConnectionMode connectionMode) throws MgcpConnectionException { final List<State> possibleStates = new ArrayList<State>(); possibleStates.add(HALF_OPEN); possibleStates.add(OPEN); assertState(possibleStates); // Make sure there is something to modify. if(remoteDescriptor == null && connectionMode == null) { return; } try { final CallIdentifier callId = new CallIdentifier(Integer.toString(session.getId())); final ModifyConnection mdcx = new ModifyConnection(this, callId, endpoint.getId(), connectionId); // Modify the remote session description. if(remoteDescriptor != null) { mdcx.setRemoteConnectionDescriptor(remoteDescriptor); } // Modify the connection mode. if(connectionMode != null) { mdcx.setMode(connectionMode); } server.sendCommand(mdcx, this); } catch(final MgcpServerException exception) { throw new MgcpConnectionException(exception); } }
/** * Receive notification of the header of a message. Parser will call * this method to report about header reading. * * @param header * the header from the message. */ public void header(String header) throws ParseException { command = new ModifyConnection(source != null ? source : stack, new CallIdentifier("00"), endpoint, new ConnectionIdentifier("00")); command.setTransactionHandle(remoteTID); }
@Override public void execute(final Object message) throws Exception { final UpdateLink request = (UpdateLink) message; final String sessionId = Integer.toString(session.id()); final CallIdentifier callId = new CallIdentifier(sessionId); ModifyConnection mdcx = null; switch (request.type()) { case PRIMARY: { mdcx = new ModifyConnection(source, callId, primaryEndpointId, primaryConnId); } case SECONDARY: { mdcx = new ModifyConnection(source, callId, secondaryEndpointId, secondaryConnId); } } final ConnectionMode mode = request.mode(); if (mode != null) { mdcx.setMode(mode); } gateway.tell(mdcx, source); // Make sure we don't wait for a response indefinitely. getContext().setReceiveTimeout(Duration.create(timeout, TimeUnit.MILLISECONDS)); } }
public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new ModifyConnection(source != null ? source : stack, new CallIdentifier("00"), endpoint,new ConnectionIdentifier("00")); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (IOException e) { logger.error("Decoding of MDCX command failed", e); } NotifiedEntity notifiedEntity = command.getNotifiedEntity(); if (command.getNotifiedEntity() != null) this.stack.provider.setNotifiedEntity(notifiedEntity); return command; }
public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new ModifyConnection(source != null ? source : stack, new CallIdentifier("00"), endpoint,new ConnectionIdentifier("00")); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (IOException e) { logger.error("Decoding of MDCX command failed", e); } NotifiedEntity notifiedEntity = command.getNotifiedEntity(); if (command.getNotifiedEntity() != null) this.stack.provider.setNotifiedEntity(notifiedEntity); return command; }
@Override public void execute(final Object message) throws Exception { final UpdateConnection request = (UpdateConnection) message; final String sessionId = Integer.toString(session.id()); final CallIdentifier callId = new CallIdentifier(sessionId); requestedConnId = request.connectionIdentifier(); requestedConnId = requestedConnId==null ? connId:requestedConnId; final ModifyConnection mdcx = new ModifyConnection(source, callId, endpointId, requestedConnId); final ConnectionMode mode = request.mode(); if (mode != null) { mdcx.setMode(mode); } final ConnectionDescriptor descriptor = request.descriptor(); if (descriptor != null) { mdcx.setRemoteConnectionDescriptor(descriptor); remoteDesc = descriptor; } gateway.tell(mdcx, source); // Make sure we don't wait for a response indefinitely. getContext().setReceiveTimeout(Duration.create(timeout, TimeUnit.MILLISECONDS)); } }
@Override public void execute(final Object message) throws Exception { final UpdateConnection request = (UpdateConnection) message; final String sessionId = Integer.toString(session.id()); final CallIdentifier callId = new CallIdentifier(sessionId); ConnectionIdentifier requestedConnId = request.connectionIdentifier(); requestedConnId = requestedConnId==null ? connId:requestedConnId; final ModifyConnection mdcx = new ModifyConnection(source, callId, endpointId, requestedConnId); final ConnectionMode mode = request.mode(); if (mode != null) { mdcx.setMode(mode); } final ConnectionDescriptor descriptor = request.descriptor(); if (descriptor != null) { mdcx.setRemoteConnectionDescriptor(descriptor); remoteDesc = descriptor; } gateway.tell(mdcx, source); // Make sure we don't wait for a response indefinitely. getContext().setReceiveTimeout(Duration.create(timeout, TimeUnit.MILLISECONDS)); } }
public void process(State state) { //prepear callID and endpointID parameters for request CallIdentifier callId = connection.getMediaSession().getCallID(); EndpointIdentifier endpointID = connection.getEndpoint().getIdentifier(); ConnectionIdentifier connectionID = connection.getConnectionID(); //ask for new unique transaction handler int txHandle = connection.getMediaSession().getUniqueHandler(); ModifyConnection req = new ModifyConnection(this, callId, endpointID, connectionID); req.setMode(ConnectionMode.Confrnce); req.setTransactionHandle(txHandle); try { req.setRemoteConnectionDescriptor(new ConnectionDescriptor(connection.sdpPortManager.remoteSdp.toString())); } catch (Exception e) { } //send request connection.getMediaSession().getDriver().attach(txHandle, new ModifyConnectionResponseHandler(connection)); connection.getMediaSession().getDriver().send(req); }
public void process(State state) { //prepear callID and endpointID parameters for request CallIdentifier callId = connection.getMediaSession().getCallID(); EndpointIdentifier endpointID = connection.getEndpoint().getIdentifier(); ConnectionIdentifier connectionID = connection.getConnectionID(); //ask for new unique transaction handler int txHandle = connection.getMediaSession().getUniqueHandler(); ModifyConnection req = new ModifyConnection(this, callId, endpointID, connectionID); req.setMode(ConnectionMode.Confrnce); req.setTransactionHandle(txHandle); try { req.setRemoteConnectionDescriptor(new ConnectionDescriptor(connection.sdpPortManager.remoteSdp.toString())); } catch (Exception e) { } //send request connection.getMediaSession().getDriver().attach(txHandle, new ModifyConnectionResponseHandler(connection)); connection.getMediaSession().getDriver().send(req); }
ModifyConnection mdcx = new ModifyConnection(this, containers[0].session.getCallID(), containers[0].endpoint.getIdentifier(), connections[0]); mdcx.setMode(mode0); ConnectionMode mode1 = getMode1(containers[1]); mdcx = new ModifyConnection(this, containers[1].session.getCallID(), containers[1].endpoint.getIdentifier(), connections[1]); mdcx.setMode(mode1);
ModifyConnection mdcx = new ModifyConnection(this, containers[0].session.getCallID(), containers[0].endpoint.getIdentifier(), connections[0]); mdcx.setMode(mode0); ConnectionMode mode1 = getMode1(containers[1]); mdcx = new ModifyConnection(this, containers[1].session.getCallID(), containers[1].endpoint.getIdentifier(), connections[1]); mdcx.setMode(mode1);