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); } }
command.setConnectionIdentifier(new ConnectionIdentifier(value)); } else if (name.equalsIgnoreCase("m")) { command.setMode(utils.decodeConnectionMode(value)); } else if (name.equalsIgnoreCase("L")) { command.setLocalConnectionOptions(utils.decodeLocalOptionValueList(value));
@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)); } }
@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); }
case StringFunctions.LOW_M_BYTE: case StringFunctions.HIGH_M_BYTE: command.setMode(ConnectionModeHandler.decode(data,value.getOffset(),value.getLength())); break; case StringFunctions.LOW_L_BYTE:
case StringFunctions.LOW_M_BYTE: case StringFunctions.HIGH_M_BYTE: command.setMode(ConnectionModeHandler.decode(data,value.getOffset(),value.getLength())); break; case StringFunctions.LOW_L_BYTE: