Revision: 9482
Author: jean.deruelle
Date: Thu Jan 14 12:25:30 2010
Log: Fixes Issue 1161
http://code.google.com/p/mobicents/source/detail?r=9482
Modified:
/trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManager.java
/trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/startup/SipStandardService.java
=======================================
---
/trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManager.java
Tue Jan 12 02:28:12 2010
+++
/trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManager.java
Thu Jan 14 12:25:30 2010
@@ -148,6 +148,12 @@
* @param extendedListeningPoint
*/
public void removeExtendedListeningPoint(ExtendedListeningPoint
extendedListeningPoint) {
+ // notifying the applications before removing the listening point so
that apps can still try to send a message on it
+ Iterator<SipContext> sipContextIterator =
sipApplicationDispatcher.findSipApplications();
+ while (sipContextIterator.hasNext()) {
+ SipContext sipContext = (SipContext)
sipContextIterator.next();
+ sipContext.notifySipContextListeners(new
SipContextEvent(SipContextEventType.SIP_CONNECTOR_REMOVED,
extendedListeningPoint.getSipConnector()));
+ }
extendedListeningPointList.remove(extendedListeningPoint);
computeOutboundInterfaces();
// removing from the transport cache map
@@ -162,12 +168,7 @@
if(extendedListeningPoint.getGlobalIpAddress() != null) {
extendedListeningPointsCacheMap.remove(extendedListeningPoint.getGlobalIpAddress()
+ "/" + extendedListeningPoint.getPort() + ":" +
extendedListeningPoint.getTransport().toLowerCase());
extendedListeningPointsCacheMap.remove(extendedListeningPoint.getGlobalIpAddress()
+ "/" + extendedListeningPoint.getGlobalPort() + ":" +
extendedListeningPoint.getTransport().toLowerCase());
- }
- Iterator<SipContext> sipContextIterator =
sipApplicationDispatcher.findSipApplications();
- while (sipContextIterator.hasNext()) {
- SipContext sipContext = (SipContext)
sipContextIterator.next();
- sipContext.notifySipContextListeners(new
SipContextEvent(SipContextEventType.SIP_CONNECTOR_REMOVED,
extendedListeningPoint.getSipConnector()));
- }
+ }
}
/**
=======================================
---
/trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/startup/SipStandardService.java
Mon Jan 4 01:53:52 2010
+++
/trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/startup/SipStandardService.java
Thu Jan 14 12:25:30 2010
@@ -555,6 +555,8 @@
.getProtocolHandler();
protocolHandler.setSipConnector(sipConnector);
connector.setService(this);
+ // added for Issue 1161 : Only the last sip connector (which was added
programmatically using JMX) is working
+ connector.initialize();
connector.init();
addConnector(connector);
ExtendedListeningPoint extendedListeningPoint =
(ExtendedListeningPoint)