/** * 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 DeleteConnection(source != null ? source : stack, endpoint); command.setTransactionHandle(remoteTID); }
public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new DeleteConnection(source != null ? source : stack, endpoint); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (IOException e) { logger.error("Decode of DLCX command failed", e); } return command; }
public JainMgcpCommandEvent decodeCommand(byte[] data,SplitDetails[] message) throws ParseException { command = new DeleteConnection(source != null ? source : stack, endpoint); command.setTransactionHandle(remoteTID); try { (new CommandContentHandle()).parse(data,message); } catch (IOException e) { logger.error("Decode of DLCX command failed", e); } return command; }
protected void onDestroyEndpoint(DestroyEndpoint message, ActorRef self, ActorRef sender) { if (!id.getLocalEndpointName().contains("$")) { if (!this.destroying.get()) { if (logger.isInfoEnabled()) { String msg = String.format("About to destroy endoint %s", id); logger.info(msg); } this.destroying.set(true); DeleteConnection dlcx = new DeleteConnection(self, this.id); this.gateway.tell(dlcx, self); // Make sure we don't wait forever getContext().setReceiveTimeout(Duration.create(timeout, TimeUnit.MILLISECONDS)); } } else { this.pendingDestroy.set(true); this.pendingDestroyEndpointSender = sender; this.pendingDestroyEndpointMessage = message; if (logger.isInfoEnabled()) { String msg = String.format("DestroyEndoint %s will be set to pending until previous transaction completes", id); logger.info(msg); } } }
@Override public void execute(final Object message) throws Exception { final String sessionId = Integer.toString(session.id()); final CallIdentifier callId = new CallIdentifier(sessionId); final DeleteConnection dlcx = new DeleteConnection(source, callId, endpointId, connId); gateway.tell(dlcx, 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 String sessionId = Integer.toString(session.id()); final CallIdentifier callId = new CallIdentifier(sessionId); final DeleteConnection dlcx = new DeleteConnection(source, callId, primaryEndpointId, primaryConnId); gateway.tell(dlcx, 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 String sessionId = Integer.toString(session.id()); final CallIdentifier callId = new CallIdentifier(sessionId); final DeleteConnection dlcx = new DeleteConnection(source, callId, endpointId, connId); gateway.tell(dlcx, 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 { /* Stop the timer here. */ final UntypedActorContext context = getContext(); context.setReceiveTimeout(Duration.Undefined()); final String sessionId = Integer.toString(session.id()); final CallIdentifier callId = new CallIdentifier(sessionId); final DeleteConnection dlcx = new DeleteConnection(source, callId, secondaryEndpointId, secondaryConnId); gateway.tell(dlcx, source); // Make sure we don't wait for a response indefinitely. getContext().setReceiveTimeout(Duration.create(timeout, TimeUnit.MILLISECONDS)); } }
public void disconnect() throws MgcpConnectionException { final State state = getState(); if(HALF_OPEN.equals(state) || OPEN.equals(state)) { try { final CallIdentifier callId = new CallIdentifier(Integer.toString(session.getId())); final DeleteConnection dlcx = new DeleteConnection(this, callId, endpoint.getId(), connectionId); server.sendCommand(dlcx, this); setState(DISCONNECTED); } catch(final MgcpServerException exception) { setState(FAILED); fireFailed(); throw new MgcpConnectionException(exception); } } }
public void onCallTerminated(RequestEvent evt, ActivityContextInterface aci) { EndpointIdentifier endpointID = new EndpointIdentifier(this.getEndpointName(), JBOSS_BIND_ADDRESS + ":" + MGCP_PEER_PORT); DeleteConnection deleteConnection = new DeleteConnection(this, endpointID); deleteConnection.setTransactionHandle(mgcpProvider.getUniqueTransactionHandler()); mgcpProvider.sendMgcpEvents(new JainMgcpEvent[] { deleteConnection }); ServerTransaction tx = evt.getServerTransaction(); Request request = evt.getRequest(); try { Response response = messageFactory.createResponse(Response.OK, request); tx.sendResponse(response); } catch (Exception e) { logger.severe("Error while sending DLCX ", e); } }
public void onCallTerminated(RequestEvent evt, ActivityContextInterface aci) { try { MgcpConnectionActivity activity = getMgcpConnectionActivity(); DeleteConnection deleteConnection = new DeleteConnection(this, activity.getEndpointIdentifier()); deleteConnection.setTransactionHandle(mgcpProvider.getUniqueTransactionHandler()); mgcpProvider.sendMgcpEvents(new JainMgcpEvent[] { deleteConnection }); ServerTransaction tx = evt.getServerTransaction(); Request request = evt.getRequest(); Response response = messageFactory.createResponse(Response.OK, request); tx.sendResponse(response); cancelTimer(); } catch (Exception e) { logger.severe("Error while sending OK for BYE", e); } }
public void onCallTerminated(CustomEvent evt, ActivityContextInterface aci) { logger.info("Conference Terminated " + this.getEndpointIdentifier() + " Connection Id " + this.getConnectionIdentifier().toString() + " callId = " + this.getCallIdentifier().toString()); EndpointIdentifier endpointID = this.getEndpointIdentifier(); ConnectionIdentifier connectionID=this.getConnectionIdentifier(); DeleteConnection deleteConnection = new DeleteConnection(this, this.getCallIdentifier(), endpointID,connectionID); deleteConnection.setTransactionHandle(this.mgcpProvider.getUniqueTransactionHandler()); mgcpProvider.sendMgcpEvents(new JainMgcpEvent[] { deleteConnection }); }
public void onEvent(State state) { //first leg if (connections[0] != null) { int txID = containers[0].getMediaSession().getDriver().getNextTxID(); DeleteConnection req = new DeleteConnection(this, containers[0].session.getCallID(), containers[0].endpoint.getIdentifier(), connections[0]); req.setTransactionHandle(txID); containers[0].session.getDriver().attach(txID, new UnjoinResponse()); containers[0].session.getDriver().send(req); } else { signalAsync("success"); } //second leg if (connections[1] != null) { int txID = containers[1].getMediaSession().getDriver().getNextTxID(); DeleteConnection req = new DeleteConnection(this, containers[1].session.getCallID(), containers[1].endpoint.getIdentifier(), connections[1]); req.setTransactionHandle(txID); containers[1].session.getDriver().attach(txID, new UnjoinResponse()); containers[1].session.getDriver().send(req); } else { signalAsync("success"); } } }
public void onEvent(State state) { //first leg if (connections[0] != null) { int txID = containers[0].getMediaSession().getDriver().getNextTxID(); DeleteConnection req = new DeleteConnection(this, containers[0].session.getCallID(), containers[0].endpoint.getIdentifier(), connections[0]); req.setTransactionHandle(txID); containers[0].session.getDriver().attach(txID, new UnjoinResponse()); containers[0].session.getDriver().send(req); } else { signalAsync("success"); } //second leg if (connections[1] != null) { int txID = containers[1].getMediaSession().getDriver().getNextTxID(); DeleteConnection req = new DeleteConnection(this, containers[1].session.getCallID(), containers[1].endpoint.getIdentifier(), connections[1]); req.setTransactionHandle(txID); containers[1].session.getDriver().attach(txID, new UnjoinResponse()); containers[1].session.getDriver().send(req); } else { signalAsync("success"); } } }
public void onEvent(State state) { //if connection has not concrete name then it was not created if (!connection.getEndpoint().hasConcreteName()) { return; } //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(); //ask for new unique transaction handler DeleteConnection req = new DeleteConnection(this, callId, endpointID, connectionID); req.setTransactionHandle(txHandle); connection.getMediaSession().getDriver().attach(txHandle, new DeleteConnectionResponseHandler(connection)); //send request connection.getMediaSession().getDriver().send(req); }
public void onEvent(State state) { //if connection has not concrete name then it was not created if (!connection.getEndpoint().hasConcreteName()) { return; } //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(); //ask for new unique transaction handler DeleteConnection req = new DeleteConnection(this, callId, endpointID, connectionID); req.setTransactionHandle(txHandle); connection.getMediaSession().getDriver().attach(txHandle, new DeleteConnectionResponseHandler(connection)); //send request connection.getMediaSession().getDriver().send(req); }
DeleteConnection deleteConnection = new DeleteConnection(this, mgcpEndpoint.getEndpointIdentifier()); deleteConnection.setCallIdentifier(this.getCallIdentifier());