private void releaseMediaConnectionAndDialog() { ActivityContextInterface[] activities = sbbContext.getActivities(); SbbLocalObject sbbLocalObject = getSbbContext().getSbbLocalObject(); MsConnection msConnection = null; for (ActivityContextInterface attachedAci : activities) { if (attachedAci.getActivity() instanceof Dialog) { attachedAci.detach(sbbLocalObject); attachedAci.detach(this.getParentCmp()); } if (attachedAci.getActivity() instanceof MsConnection) { attachedAci.detach(sbbLocalObject); msConnection = (MsConnection) attachedAci.getActivity(); attachedAci.detach(this.getParentCmp()); } } if (msConnection != null) { msConnection.release(); } }
public void onAppUsageRemovedEvent(AppUsageRemovedEvent event, ActivityContextInterface aci) { aci.detach(sbbContext.getSbbLocalObject()); if (!event.getAuid().equals(XCAPCapsAppUsage.ID)) { // update xcap caps global doc try { updateXCAPCapsGlobalDoc(); } catch (InternalServerErrorException e) { tracer.severe("failed to update xcap caps global doc", e); } } }
public void onAppUsageAddedEvent(AppUsageAddedEvent event, ActivityContextInterface aci) { aci.detach(sbbContext.getSbbLocalObject()); if (!event.getAuid().equals(XCAPCapsAppUsage.ID)) { // update xcap caps global doc try { updateXCAPCapsGlobalDoc(); } catch (InternalServerErrorException e) { tracer.severe("failed to update xcap caps global doc", e); } } }
/** * @return */ private ServerTransaction getRegisterTransactionToReply() { ActivityContextInterface[] acis = this.sbbContextExt.getActivities(); Object activity = null; for (ActivityContextInterface aci : acis) { activity = aci.getActivity(); if (activity instanceof ServerTransaction) { // detach to not handle the activity end aci.detach(sbbContextExt.getSbbLocalObject()); return (ServerTransaction) activity; } } return null; }
public void onOrderCancelled(CustomEvent event, ActivityContextInterface ac) { logger.info("======== OrderDeliverDateSbb ORDER_CANCELLED ========"); if (this.getTimerID() != null) { timerFacility.cancelTimer(this.getTimerID()); ac.detach(getSbbContext().getSbbLocalObject()); } }
public void on4xxResponse(javax.sip.ResponseEvent event, ActivityContextInterface aci) { Response response = event.getResponse(); if(tracer.isInfoEnabled()) { tracer.info("Received SIP 4xx >> " + response.getStatusCode()); } // Is it a 404? if(response.getStatusCode() == 404) { // Let's see from whom to whom String to = ((ToHeader) response.getHeader("To")).getAddress().toString(); String from = ((FromHeader) response.getHeader("From")).getAddress().toString(); if(tracer.isInfoEnabled()) { tracer.info("From[" + from + "], To [" + to + "]"); } String toAddress = to.substring(to.indexOf("sip:"), to.indexOf(">")); // Create the MissedCall object MissedCall mC = new MissedCall(from, new Date()); Collection<MissedCall> mCs = missedCalls.get(toAddress); if(mCs == null) { mCs = new ArrayList<MissedCall>(); missedCalls.put(toAddress, mCs); } if(!mCs.contains(mC)) { mCs.add(mC); } } aci.detach(this.getSbbContext().getSbbLocalObject()); }
aci.detach(this.getSbbContext().getSbbLocalObject());
public void onCustomEvent(CustomEvent event, ActivityContextInterface aci) { // detach from ACI, it is created per call, its null activity ACI, it // wont be reclaimed // until this SBBE is attached. logger.info("Received event on activity: " + aci.getActivity()); // detach aci.detach(this.getSbbContext().getSbbLocalObject()); logger.info("Message received from event originator: " + event.getMessage()); }
public void onTimerEvent(TimerEvent timer, ActivityContextInterface aci) { // detach from this activity, we don't want to handle any other event on it aci.detach(this.sbbContextExt.getSbbLocalObject()); if (tracer.isInfoEnabled()) { tracer.info("[--] " + sidString + " Forcing Activity Termination '" + aci.getActivity() + "' due to timeout expire."); } // TODO: allow for different options, such as sending a RAR request. ((RoServerSessionActivity) aci.getActivity()).endActivity(); }
/** * */ private void terminateSipSession() { SbbLocalObject sbbLocalObject = sbbContext.getSbbLocalObject(); ActivityContextInterface dialogACI = getDialogACI(); if (dialogACI != null) { dialogACI.detach(sbbLocalObject); try { DialogActivity dialog = (DialogActivity) dialogACI .getActivity(); Request bye = dialog.createRequest(Request.BYE); dialog.sendRequest(bye); } catch (Exception e) { tracer.severe("failed to abort sip dialog.", e); } } }
/** * */ private void terminateSipSession() { SbbLocalObject sbbLocalObject = sbbContext.getSbbLocalObject(); ActivityContextInterface dialogACI = getDialogACI(); if (dialogACI != null) { dialogACI.detach(sbbLocalObject); try { DialogActivity dialog = (DialogActivity) dialogACI .getActivity(); Request bye = dialog.createRequest(Request.BYE); dialog.sendRequest(bye); } catch (Exception e) { tracer.severe("failed to abort sip dialog.", e); } } }
mediaGroupACI.detach(sbbLocalObject); try { MediaGroup mediaGroup = (MediaGroup) mediaGroupACI networkConnectionACI.detach(sbbLocalObject); try { NetworkConnection networkConnection = (NetworkConnection) networkConnectionACI mediaSessionACI.detach(sbbLocalObject); try { MediaSession mediaSession = (MediaSession) mediaSessionACI
private void abortSipSessionSetup() { SbbLocalObject sbbLocalObject = sbbContext.getSbbLocalObject(); ActivityContextInterface dialogACI = getDialogACI(); if (dialogACI != null) { dialogACI.detach(sbbLocalObject); try { Dialog dialog = (Dialog) dialogACI.getActivity(); dialog.delete(); } catch (Exception e) { tracer.severe("failed to abort sip dialog.", e); } } ActivityContextInterface serverTransactionACI = getServerTransactionACI(); if (serverTransactionACI != null) { serverTransactionACI.detach(sbbLocalObject); ServerTransaction serverTransaction = (ServerTransaction) serverTransactionACI .getActivity(); try { Response response = sipRaSbbInterface.getMessageFactory() .createResponse(Response.SERVER_INTERNAL_ERROR, serverTransaction.getRequest()); serverTransaction.sendResponse(response); } catch (Exception e) { tracer.severe("failed to abort sip server tx.", e); } } }
private void abortSipSessionSetup() { SbbLocalObject sbbLocalObject = sbbContext.getSbbLocalObject(); ActivityContextInterface dialogACI = getDialogACI(); if (dialogACI != null) { dialogACI.detach(sbbLocalObject); try { Dialog dialog = (Dialog) dialogACI.getActivity(); dialog.delete(); } catch (Exception e) { tracer.severe("failed to abort sip dialog.", e); } } ActivityContextInterface serverTransactionACI = getServerTransactionACI(); if (serverTransactionACI != null) { serverTransactionACI.detach(sbbLocalObject); ServerTransaction serverTransaction = (ServerTransaction) serverTransactionACI .getActivity(); try { Response response = sipRaSbbInterface.getMessageFactory() .createResponse(Response.SERVER_INTERNAL_ERROR, serverTransaction.getRequest()); serverTransaction.sendResponse(response); } catch (Exception e) { tracer.severe("failed to abort sip server tx.", e); } } }
/** * Event handler from the timer event, which signals that a message must be * sent back to the UA * * @param event * @param aci */ public void onTimerEvent(TimerEvent event, ActivityContextInterface aci) { // detaching so the null AC is claimed after the event handling aci.detach(sbbContext.getSbbLocalObject()); try { DataSourceChildSbbLocalInterface child = (DataSourceChildSbbLocalInterface) getLocationChildRelation().create(); child.getBindings(getSender().getURI().toString()); } catch (Exception e) { tracer.severe("failed to create sip registrar child sbb, to lookup the sender's contacts",e); return; } }
tracer.fine("[><] " + sidString + " Detaching from ACI."); aci.detach(this.getSbbContext().getSbbLocalObject());
public void onDIALOG_REQUEST(org.mobicents.slee.resource.cap.events.DialogRequest event, ActivityContextInterface aci/* , EventContext eventContext */) { CAPDialog capDialog = event.getCAPDialog(); XmlCAPDialog dialog = new XmlCAPDialog(capDialog.getApplicationContext(), capDialog.getLocalAddress(), capDialog.getRemoteAddress(), capDialog.getLocalDialogId(), capDialog.getRemoteDialogId()); int networkId = capDialog.getNetworkId(); dialog.setNetworkId(networkId); this.setXmlCAPDialog(dialog); NetworkRoutingRule networkRoutingRule = networkRoutingRuleManagement.getNetworkRoutingRule(networkId); if (networkRoutingRule == null) { String route = camlePropertiesManagement.getRoute(); if (logger.isFineEnabled()) { logger.fine("No NetworkRoutingRule configured for network-id " + networkId + " Using the default one " + route); } networkRoutingRule = new NetworkRoutingRule(); networkRoutingRule.setRuleUrl(route); } this.setNetworkRoutingRule(networkRoutingRule); if (networkRoutingRule.getRuleUrl() == null) { logger.warning("No routing rule defined for networkId " + networkId + " Disconnecting from ACI, no new messages will be processed"); aci.detach(this.sbbContext.getSbbLocalObject()); } camelStatAggregator.updateDialogsAllEstablished(); this.setStartDialogTime(System.currentTimeMillis()); }
DialogActivity dialogActivity = (DialogActivity) ac.getActivity(); if (dialogActivity != null) { ac.detach(sbbContext.getSbbLocalObject()); cancelExpiresTimer(ac); dialogActivity.delete();