public interface SipSessionExt
((SipSessionExt)sipSession).scheduleAsynchronousWork(new SipSessionAsynchronousWork() {
private static final long serialVersionUID = 1L;
public void doAsynchronousWork(SipSession sipSession) {
String textMessageToSend = (String) sipSession.getAttribute("textMessageToSend");
try {
SipServletRequest sipServletRequest = sipFactory.createRequest(
sipSession.getSipApplicationSession(),
"MESSAGE",
"sip:sender@sip-servlets.com",
"sip:receiver@sip-servlets.com");
SipURI sipUri = sipFactory.createSipURI("receiver", "127.0.0.1:5060");
sipServletRequest.setRequestURI(sipUri);
sipServletRequest.setContentLength(content.length());
sipServletRequest.setContent(content, "text/plain;charset=UTF-8");
sipServletRequest.send();
} catch (ServletParseException e) {
logger.error("Exception occured while parsing the addresses",e);
} catch (IOException e) {
logger.error("Exception occured while sending the request",e);
}
}
});
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBypassLoadBalancer()
Allows for application to bypass routing to LoadBalancer for a request (if LoadBalancer is in use)
This is useful to cope with NAT issues, where sip client has open NAT port to container but not to LoadBalancer
|
boolean |
getBypassProxy()
Allows for application to bypass routing to Proxy for a request (if Proxy is in use)
This is useful to cope with NAT issues, where sip client has open NAT port to container but not to Proxy
|
boolean |
getCopyRecordRouteHeadersOnSubsequentResponses()
Allows for applications to copy the record route headers on the responses to subsequent INVITE requests
where the dialog route set shouldn't normally be changed to cope with non compliant RFC 3261 servers.
|
void |
scheduleAsynchronousWork(SipSessionAsynchronousWork work)
Deprecated.
in favor of SipSessionsUtilExt.scheduleAsynchronousWork(String sipSessionId, SipSessionAsynchronousWork work)
|
void |
setBypassLoadBalancer(boolean bypassLoadBalancer)
Allows for application to bypass routing to LoadBalancer for a request (if LoadBalancer is in use)
This is useful to cope with NAT issues, where sip client has open NAT port to container but not to LoadBalancer
|
void |
setBypassProxy(boolean bypassProxy)
Allows for application to bypass routing to Proxy for a request (if Proxy is in use)
This is useful to cope with NAT issues, where sip client has open NAT port to container but not to Proxy
|
void |
setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
Allows for applications to copy the record route headers on the responses to subsequent INVITE requests
where the dialog route set shouldn't normally be changed to cope with non compliant RFC 3261 servers.
|
void |
setOutboundInterface(SipURI outboundInterface)
In multi-homed environment this method can be used to select the outbound interface to use when sending requests for this SipSession.
|
void setOutboundInterface(SipURI outboundInterface)
outboundInterface - the sip uri representing the outbound interface to use when sending requests outNullPointerException - on null sip uriIllegalArgumentException - if the sip uri is not understood by the container as one of its outbound interfacevoid scheduleAsynchronousWork(SipSessionAsynchronousWork work)
work - the work to be performed on this SipSession.void setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
copyRecordRouteHeadersOnSubsequentResponses - false by default, if true will exhibit the behavior described aboveboolean getCopyRecordRouteHeadersOnSubsequentResponses()
copyRecordRouteHeadersOnSubsequentResponses - true if the session currently exhibit the behavior described abovevoid setBypassLoadBalancer(boolean bypassLoadBalancer)
bypassLoadBalancer - boolean getBypassLoadBalancer()
void setBypassProxy(boolean bypassProxy)
bypassProxy - boolean getBypassProxy()
bypassProxy - Copyright © 2016. All Rights Reserved.