public void onByeEvent(RequestEvent event, ActivityContextInterface aci) { log.info("************Received BYEEEE**************"); if (log.isDebugEnabled()) { log.debug("Received BYE"); } releaseMediaConnectionAndDialog(); try { sipUtils.sendStatefulOk(event); } catch (ParseException e) { e.printStackTrace(); } catch (SipException e) { e.printStackTrace(); } catch (InvalidArgumentException invalidArgEx) { invalidArgEx.printStackTrace(); } // executeRequestState(event); }
/** * Handles a BYE * * @param calleeCallId * @param request */ public void handleBye(String calleeCallId, Request request) { // Send OK to callee try { sipUtils.sendOk(request); } catch (ParseException e) { e.printStackTrace(); } catch (SipException e) { e.printStackTrace(); } // Send Cancel to caller sendRequestCancel(getPeerDialog(calleeCallId)); setState(new UATerminationState(), calleeCallId); }
public void sendCallerAck(ResponseEvent event) { try { Dialog dialog = sipUtils.getDialog(event); Request ackRequest = sipUtils.buildAck(dialog, null); dialog.sendAck(ackRequest); } catch (SipException e) { e.printStackTrace(); } }
/** * The cancel request uses the same sequence number as the invite it is ment * to cancel and thus needs to be treated specially. I.e. retrive the * sequence number from this invite and use this in the new cancel request. * * @param dialog * The dialog of the UA where the cancel is to be sent. */ private void sendRequestCancel(Dialog dialog) { // Send to callee try { // Retrieve the client transacation to cancel Session session = getSession(dialog); ClientTransaction ct = session.getToBeCancelledClientTransaction(); sipUtils.sendCancel(ct); } catch (SipException e) { e.printStackTrace(); } }
public StringBuilder encodeBody(StringBuilder encoding) { // StringBuilder encoding = new StringBuilder(); /* * no need to check for the presence of icid-value. According to the * spec above this is a mandatory field. if it does not exist, then we * should throw an exception * * JvB 26/5: fix for issue #159, check for quotes around icid value * * Aayush: 29th November 2011 : Added fix for P-Charging-Vector header's parameters to accept quoted string values. */ gov.nist.core.NameValue nv = getNameValue( ParameterNamesIms.ICID_VALUE ); if(nv!=null) this.parameters.encode(encoding); else try { throw new SipException("icid-value is mandatory"); } catch (SipException e) { e.printStackTrace(); } return encoding; }
public void execute(RequestEvent event) { Request request = event.getRequest(); final String method = request.getMethod(); if (method.equals(Request.BYE)) { final String callId = ((CallIdHeader) request .getHeader(CallIdHeader.NAME)).getCallId(); Dialog dialog = getPeerDialog(callId); try { sipUtils.sendOk(request); sendRequest(dialog, Request.BYE); } catch (ParseException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (SipException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } setState(new UATerminationState(), callId); } } }
/** * Accepts a response event and sends an ACK (containing the sdp from this * event) to the callee. * * @param event */ private void sendCalleeAck(ResponseEvent event) { log.debug("Sending Calee ACK event ResposneEvent = " + event); try { ClientTransaction ct = event.getClientTransaction(); final String callerCallId = ((CallIdHeader) ct.getRequest() .getHeader(CallIdHeader.NAME)).getCallId(); Dialog calleeDialog = getPeerDialog(callerCallId); Object content = event.getResponse().getContent(); log.debug("Building ACK content = " + content + " Dialog = " + calleeDialog); Request ackRequest = sipUtils.buildAck(calleeDialog, content); calleeDialog.sendAck(ackRequest); } catch (SipException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void onConnectionCreated(MsConnectionEvent evt, ActivityContextInterface aci) { log.info("--------------onConnectionCreated--------------"); MsConnection connection = evt.getConnection(); log.info("Created RTP connection [" + connection.getEndpoint() + "]"); try { Dialog dialog = sipUtils.getDialog(getResponseEventCmp()); Request ackRequest = sipUtils.buildAck(dialog, connection .getLocalDescriptor()); dialog.sendAck(ackRequest); } catch (SipException e) { e.printStackTrace(); } MsSession session = connection.getSession(); MsLink link = session.createLink(MsLinkMode.FULL_DUPLEX); ActivityContextInterface linkActivity = null; try { linkActivity = mediaAcif.getActivityContextInterface(link); } catch (UnrecognizedActivityException ex) { ex.printStackTrace(); } linkActivity.attach(getParentCmp()); link.join(connection.getEndpoint(), ANNOUNCEMENT_ENDPOINT); }
} catch (SipException e) { e.printStackTrace();