logger.debug("Removing the Sip Application Dispatcher as a sip listener for listening point " + extendedListeningPoint); extendedListeningPoint.getSipProvider().removeSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().removeExtendedListeningPoint(extendedListeningPoint); if(extendedListeningPoint.getSipProvider().getListeningPoints().length == 1) { sipStack.deleteSipProvider(extendedListeningPoint.getSipProvider()); if(logger.isDebugEnabled()) { logger.debug("Removing the following Listening Point " + extendedListeningPoint + " from the sip provider"); extendedListeningPoint.getSipProvider().removeListeningPoint(extendedListeningPoint.getListeningPoint());
configuration.setListeningPoint(listeningPoint); provider = sipStack.createSipProvider(configuration.getListeningPoint()); provider.addSipListener(sipSubscriptionListener); configuration.setCallIdHeader(provider.getNewCallId()); configuration.setCallIdHeader(provider.getNewCallId()); Request request = configuration.createSipRequest(1, Request.SUBSCRIBE, configuration.getEventHeaderName()); ClientTransaction subscriberTransactionId = provider.getNewClientTransaction(request);
if(sipStack.getSipProviders().hasNext()) { sipProvider = (SipProvider) sipStack.getSipProviders().next(); for (ListeningPoint listeningPointTemp : sipProvider.getListeningPoints()) { if(!(listeningPointTemp.getIPAddress().equalsIgnoreCase(listeningPoint.getIPAddress()) && listeningPointTemp.getPort() == listeningPoint.getPort())) { createSipProvider = true; sipProvider = sipStack.createSipProvider(listeningPoint); } else { sipProvider.addListeningPoint(listeningPoint); logger.debug("Adding the Sip Application Dispatcher as a sip listener for connector listening on port " + port); sipProvider.addSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().addExtendedListeningPoint(extendedListeningPoint);
public void addConnector(SipProtocolHandler connector) { MobicentsExtendedListeningPoint extendedListeningPoint = null; extendedListeningPoint = (MobicentsExtendedListeningPoint) connector.getAttribute(ExtendedListeningPoint.class .getSimpleName()); if (extendedListeningPoint != null) { try { extendedListeningPoint.getSipProvider().addSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().addExtendedListeningPoint(extendedListeningPoint); } catch (TooManyListenersException e) { logger.error("Connector.initialize", e); } } // connector.setPort(((SipProtocolHandler)protocolHandler).getPort()); connector.setSipStack(sipStack); connector.setAttribute(SipApplicationDispatcher.class.getSimpleName(), sipApplicationDispatcher); // registerSipConnector(connector); synchronized (connectors) { // connector.setContainer(this.container); // connector.setService(this); SipProtocolHandler[] results = new SipProtocolHandler[connectors.length + 1]; System.arraycopy(connectors, 0, results, 0, connectors.length); results[connectors.length] = connector; connectors = results; } }
public void stop() throws Exception { // Tomcat specific unloading case // Issue 1411 http://code.google.com/p/mobicents/issues/detail?id=1411 // Sip Connectors should be removed after removing all Sip Servlets to allow them to send BYE to terminate cleanly synchronized (connectors) { for (SipProtocolHandler connector : connectors) { MobicentsExtendedListeningPoint extendedListeningPoint = null; if (connector instanceof SipProtocolHandler) { extendedListeningPoint = (MobicentsExtendedListeningPoint) ((SipProtocolHandler) connector) .getAttribute(ExtendedListeningPoint.class.getSimpleName()); } if (extendedListeningPoint != null) { extendedListeningPoint.getSipProvider().removeSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().removeExtendedListeningPoint( extendedListeningPoint); } } } if (!connectorsStartedExternally) { sipApplicationDispatcher.stop(); } // super.stop(); if (logger.isDebugEnabled()) { logger.debug("SIP Standard Service Stopped."); } // setState(LifecycleState.STOPPING); }
logger.debug("Getting new Client Tx for request " + request); final ClientTransaction ctx = sipProvider.getNewClientTransaction(request); JainSipUtils.setTransactionTimers((TransactionExt) ctx, sipFactoryImpl.getSipApplicationDispatcher()); Dialog dialog = null; dialog = sipProvider.getNewDialog(ctx); ((DialogExt)dialog).disableSequenceNumberValidation(); session.setSessionCreatingDialog(dialog); final ClientTransaction ctx = sipProvider.getNewClientTransaction(request); JainSipUtils.setTransactionTimers((TransactionExt) ctx, sipFactoryImpl.getSipApplicationDispatcher());
@Override protected void doStart() throws Exception { super.doStart(); Properties properties = configuration.createInitialProperties(); setSipStack(configuration.getSipFactory().createSipStack(properties)); configuration.parseURI(); if (sipPublishListener == null) { sipPublishListener = new SipPublishListener(this); } configuration.setListeningPoint( sipStack.createListeningPoint(configuration.getFromHost(), Integer.valueOf(configuration.getFromPort()).intValue(), configuration.getTransport())); boolean found = false; if (provider != null) { for (ListeningPoint listeningPoint : provider.getListeningPoints()) { if (listeningPoint.getIPAddress().equalsIgnoreCase(configuration.getListeningPoint().getIPAddress()) && (listeningPoint.getPort() == configuration.getListeningPoint().getPort())) { found = true; } } } if (!found) { provider = getSipStack().createSipProvider(configuration.getListeningPoint()); provider.addSipListener(sipPublishListener); configuration.setCallIdHeader(provider.getNewCallId()); } }
ClientTransaction ct = sipProvider.getNewClientTransaction(request); ActivityContextInterface acIntf = activityContextInterfaceFactory .getActivityContextInterface(ct);
public void tearDown(){ if (sipStack != null && sipStack.getSipProvider().getListeningPoints().length>0){ //SipStack.dispose() will cause previously reserved port to be released sipStack.dispose(); sipStack = null; } } }
dialog = sipProvider.getNewDialog(transaction); ((DialogExt)dialog).disableSequenceNumberValidation(); final SipProvider sipProvider = sipFactoryImpl.getSipNetworkInterfaceManager().findMatchingListeningPoint( transport, false).getSipProvider(); sipProvider.sendResponse((Response)this.message); } else if(sendReliably) { if(logger.isDebugEnabled()) {
if (serverTransactionId == null) { LOG.info("ServerTransaction is null. Creating new Server transaction"); serverTransactionId = provider.getNewServerTransaction(notify);
@Override public CallIdHeader getCallId( MobicentsExtendedListeningPoint extendedListeningPoint, String callId) throws ParseException { String callIdString = callId; if(callIdString == null) { callIdString = extendedListeningPoint.getSipProvider().getNewCallId().getCallId(); } if(callIdMaxLength > 0 && callIdString.length() > callIdMaxLength) { callIdString = callIdString.substring(0, callIdMaxLength); } return SipFactoryImpl.headerFactory.createCallIdHeader(callIdString); }
if(sipStack.getSipProviders() != null && sipStack.getSipProviders().hasNext()) { sipProvider = (SipProvider) sipStack.getSipProviders().next(); for (ListeningPoint listeningPointTemp : sipProvider.getListeningPoints()) { if(!(listeningPointTemp.getIPAddress().equalsIgnoreCase(listeningPoint.getIPAddress()) && listeningPointTemp.getPort() == listeningPoint.getPort())) { createSipProvider = true; sipProvider = sipStack.createSipProvider(listeningPoint); } else { sipProvider.addListeningPoint(listeningPoint); logger.debug("Adding the Sip Application Dispatcher as a sip listener for connector listening on port " + port); sipProvider.addSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().addExtendedListeningPoint(extendedListeningPoint);
public void addConnector(SipProtocolHandler connector) { MobicentsExtendedListeningPoint extendedListeningPoint = null; extendedListeningPoint = (MobicentsExtendedListeningPoint) connector.getAttribute(ExtendedListeningPoint.class .getSimpleName()); if (extendedListeningPoint != null) { try { extendedListeningPoint.getSipProvider().addSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().addExtendedListeningPoint(extendedListeningPoint); } catch (TooManyListenersException e) { logger.error("Connector.initialize", e); } } // connector.setPort(((SipProtocolHandler)protocolHandler).getPort()); connector.setSipStack(sipStack); connector.setAttribute(SipApplicationDispatcher.class.getSimpleName(), sipApplicationDispatcher); // registerSipConnector(connector); synchronized (connectors) { // connector.setContainer(this.container); // connector.setService(this); SipProtocolHandler[] results = new SipProtocolHandler[connectors.length + 1]; System.arraycopy(connectors, 0, results, 0, connectors.length); results[connectors.length] = connector; connectors = results; } }
public void stop() throws Exception { // Tomcat specific unloading case // Issue 1411 http://code.google.com/p/mobicents/issues/detail?id=1411 // Sip Connectors should be removed after removing all Sip Servlets to allow them to send BYE to terminate cleanly synchronized (connectors) { for (SipProtocolHandler connector : connectors) { MobicentsExtendedListeningPoint extendedListeningPoint = null; if (connector instanceof SipProtocolHandler) { extendedListeningPoint = (MobicentsExtendedListeningPoint) ((SipProtocolHandler) connector) .getAttribute(ExtendedListeningPoint.class.getSimpleName()); } if (extendedListeningPoint != null) { extendedListeningPoint.getSipProvider().removeSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().removeExtendedListeningPoint( extendedListeningPoint); } } } if (!connectorsStartedExternally) { sipApplicationDispatcher.stop(); } // super.stop(); if (logger.isDebugEnabled()) { logger.debug("SIP Standard Service Stopped."); } // setState(LifecycleState.STOPPING); }
+ request); ct = sipProvider.getNewClientTransaction(request); } catch (TransactionUnavailableException e) { e.printStackTrace(); dialog = sipProvider.getNewDialog(ct); if (log.isDebugEnabled()) { log
/** * Voice Mail will hang up on caller sending a BYE Request. * */ private void sendByeRequest() { log.info("########## VOICE MAIL SBB: sendByRequest ##########"); try { SipProvider sipProvider = getSipFactoryProvider(); Dialog dialog = this.getDialog(); if(dialog == null) { return; } Request request = dialog.createRequest(Request.BYE); ClientTransaction ct = sipProvider.getNewClientTransaction(request); dialog.sendRequest(ct); releaseState(); } catch (TransactionUnavailableException e) { log.severe(e.getMessage(), e); } catch (SipException e) { log.severe(e.getMessage(), e); } }
request.setHeader(SipFactoryImpl.headerFactory.createMaxForwardsHeader(70)); requestTransaction = sipProvider.getNewServerTransaction(request); JainSipUtils.setTransactionTimers(((TransactionExt)requestTransaction), this); } catch ( TransactionUnavailableException tae) {
logger.debug("Removing the Sip Application Dispatcher as a sip listener for listening point " + extendedListeningPoint); extendedListeningPoint.getSipProvider().removeSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().removeExtendedListeningPoint(extendedListeningPoint); if(extendedListeningPoint.getSipProvider().getListeningPoints().length == 1) { sipStack.deleteSipProvider(extendedListeningPoint.getSipProvider()); if(logger.isDebugEnabled()) { logger.debug("Removing the following Listening Point " + extendedListeningPoint + " from the sip provider"); extendedListeningPoint.getSipProvider().removeListeningPoint(extendedListeningPoint.getListeningPoint());
if (sipStack.getSipProviders() != null && sipStack.getSipProviders().hasNext()) { sipProvider = (SipProvider) sipStack.getSipProviders().next(); for (ListeningPoint listeningPointTemp : sipProvider.getListeningPoints()) { if (!(listeningPointTemp.getIPAddress().equalsIgnoreCase(listeningPoint.getIPAddress()) && listeningPointTemp .getPort() == listeningPoint.getPort())) { sipProvider = sipStack.createSipProvider(listeningPoint); } else { sipProvider.addListeningPoint(listeningPoint); + port); sipProvider.addSipListener(sipApplicationDispatcher); sipApplicationDispatcher.getSipNetworkInterfaceManager().addExtendedListeningPoint(extendedListeningPoint);