List ports = c.getJipPorts().getJipPort();
Iterator iter = ports.iterator();
while (iter.hasNext() == true)
{
JipPort port = (JipPort) iter.next();
boolean defaultPort = port.isDefault();
String porttype = port.getType().trim();
String address = port.getAddress();
if ((address == null) || (address.trim().length() == 0))
{
address = defaultAddress;
JipletLogger
.info("No IP address was specified for the port with type = "
+ port.getType()
+ ", port number = "
+ port.getPort()
+ ". Going to use "
+ address
+ " as the IP address for this port.");
}
else
{
address = address.trim();
}
if (JipletLogger.isDebugEnabled() == true)
{
JipletLogger.debug("Connector " + c.getName() + " port ("
+ address + "," + porttype + "," + port.getPort()
+ (defaultPort == true ? ",default" : "")
+ ") being added");
}
ListeningPoint lp = sipStack.createListeningPoint(address, port
.getPort(), porttype);
SipProvider provider = findSipProvider(address, port.getPort());
if (provider == null)
{
provider = sipStack.createSipProvider(lp);
addSipProvider(provider);
if (JipletLogger.isDebugEnabled() == true)
{
JipletLogger.debug("Connector " + c.getName()
+ ": created new SipProvider for IP address "
+ address + ", port " + port.getPort()
+ "; added ListeningPoint for transport "
+ porttype);
}
}
else
{
if (providerSupportsProtocol(provider, porttype) == false)
{
provider.addListeningPoint(lp);
if (JipletLogger.isDebugEnabled() == true)
{
JipletLogger.debug("Connector " + c.getName()
+ ": added new ListeningPoint for transport "
+ porttype
+ " to existing SipProvider for IP address "
+ address + ", port " + port.getPort());
}
}
else
{
sipStack.deleteListeningPoint(lp);
JipletLogger.warn("Connector " + c.getName() + " port ("
+ address + "," + porttype + ","
+ port.getPort()
+ (defaultPort == true ? ",default" : "")
+ ") is a duplicate - discarding this entry");
continue;
}