// Creating Media Session
MsSession mediaSession = msProvider.createSession();
// Setting Media Session
this.setMediaSession(mediaSession);
MsConnection msConnection = mediaSession
.createNetworkConnection(ENDPOINT_NAME);
// Attaching session AC
ActivityContextInterface msAci = null;
try {
msAci = msActivityFactory
.getActivityContextInterface(msConnection);
msAci.attach(this.getSbbLocalObject());
} catch (Exception ex) {
log.error("Internal server error", ex);
getMessageFactory().createResponse(
Response.SERVER_INTERNAL_ERROR, request);
return;
}
// Attaching to SIP Dialog activity
Dialog dial = getSipFactoryProvider().getSipProvider()
.getNewDialog((Transaction) st);
ActivityContextInterface dialogAci = sipACIF
.getActivityContextInterface(dial);
// attach this SBB object to the Dialog activity to receive
// subsequent events on this Dialog
dialogAci.attach(this.getSbbLocalObject());
// Notify caller that we're TRYING to reach voice mail. Just a
// formality, we know we can go further than TRYING at this
// point
response = getMessageFactory().createResponse(Response.TRYING,
request);
st.sendResponse(response);
// RINGING. Another formality of the SIP protocol.
response = getMessageFactory().createResponse(Response.RINGING,
request);
st.sendResponse(response);
log.info("Creating RTP connection [" + ENDPOINT_NAME + "]");
msConnection.modify("$", sdp);
}
// Voice Mail service disabled
else {
response = getMessageFactory().createResponse(