public interface SipApplicationSessionExt
((SipApplicationSessionExt)sipApplicationSession).scheduleAsynchronousWork(new SipApplicationSessionAsynchronousWork() {
private static final long serialVersionUID = 1L;
public void doAsynchronousWork(SipApplicationSession sipApplicationSession) {
String textMessageToSend = (String) sipApplicationSession.getAttribute("textMessageToSend");
try {
SipServletRequest sipServletRequest = sipFactory.createRequest(
sipApplicationSession,
"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 |
|---|---|
void |
scheduleAsynchronousWork(SipApplicationSessionAsynchronousWork work)
Deprecated.
in favor of SipSessionsUtilExt.scheduleAsynchronousWork(String sipApplicationSessionId, SipApplicationSessionAsynchronousWork work);
|
void scheduleAsynchronousWork(SipApplicationSessionAsynchronousWork work)
work - the work to be performed on this SipApplicationSession.Copyright © 2015. All Rights Reserved.