|
|
|
|
@ -231,6 +231,13 @@ public class ProtocolProviderServiceSipImpl
|
|
|
|
|
*/
|
|
|
|
|
private final XCapClient xCapClient = new XCapClientImpl();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A list of early processors that can do early processing of received
|
|
|
|
|
* messages (requests or responses).
|
|
|
|
|
*/
|
|
|
|
|
private final List<SipMessageProcessor> earlyProcessors =
|
|
|
|
|
new ArrayList<SipMessageProcessor>();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the XCAP client.
|
|
|
|
|
*
|
|
|
|
|
@ -749,6 +756,23 @@ public void processResponse(ResponseEvent responseEvent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Response response = responseEvent.getResponse();
|
|
|
|
|
|
|
|
|
|
synchronized(earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
for (SipMessageProcessor listener : earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if(!listener.processResponse(responseEvent, null))
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
catch(Throwable t)
|
|
|
|
|
{
|
|
|
|
|
logger.error("Error pre-processing message", t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String method = ( (CSeqHeader) response.getHeader(CSeqHeader.NAME))
|
|
|
|
|
.getMethod();
|
|
|
|
|
|
|
|
|
|
@ -797,6 +821,22 @@ public void processTimeout(TimeoutEvent timeoutEvent)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
synchronized(earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
for (SipMessageProcessor listener : earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if(!listener.processTimeout(timeoutEvent, null))
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
catch(Throwable t)
|
|
|
|
|
{
|
|
|
|
|
logger.error("Error pre-processing message", t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Request request = transaction.getRequest();
|
|
|
|
|
if (logger.isDebugEnabled())
|
|
|
|
|
logger.debug("received timeout for req=" + request);
|
|
|
|
|
@ -926,6 +966,22 @@ public void processRequest(RequestEvent requestEvent)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
synchronized(earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
for (SipMessageProcessor listener : earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if(!listener.processMessage(requestEvent))
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
catch(Throwable t)
|
|
|
|
|
{
|
|
|
|
|
logger.error("Error pre-processing message", t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// test if an Event header is present and known
|
|
|
|
|
EventHeader eventHeader = (EventHeader)
|
|
|
|
|
request.getHeader(EventHeader.NAME);
|
|
|
|
|
@ -3167,5 +3223,31 @@ private boolean checkPreferIPv6Addresses()
|
|
|
|
|
// if there is no default setting return the system wide value.
|
|
|
|
|
return Boolean.getBoolean("java.net.preferIPv6Addresses");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Registers early message processor.
|
|
|
|
|
* @param processor early message processor.
|
|
|
|
|
*/
|
|
|
|
|
void addEarlyMessageProcessor(SipMessageProcessor processor)
|
|
|
|
|
{
|
|
|
|
|
synchronized (earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
if (!earlyProcessors.contains(processor))
|
|
|
|
|
{
|
|
|
|
|
this.earlyProcessors.add(processor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Removes the early message processor.
|
|
|
|
|
* @param processor early message processor.
|
|
|
|
|
*/
|
|
|
|
|
void removeEarlyMessageProcessor(SipMessageProcessor processor)
|
|
|
|
|
{
|
|
|
|
|
synchronized (earlyProcessors)
|
|
|
|
|
{
|
|
|
|
|
this.earlyProcessors.remove(processor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|