Want to send PUBLSIH message to C during INVITE processing

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Want to send PUBLSIH message to C during INVITE processing

sunil.shirsat
This post has NOT been accepted by the mailing list yet.
Hi,

I have 3 users registered as Alice, Bob and Adem.

Alice calls Bob.
Alice sends INVITE for Bob to Sailfin and Sailfin sends INVITE to Bob.

After INVITE to Bob is Sent, I want to send PUBLISH message to Adem to inform that there is call between Alice and Bob.

I am not sure how to get this done.

I am not able to get the contact of Adem also.

Can you please help me.

Code as Below-

    @Override
    protected void doInvite(SipServletRequest request)
            throws ServletException, IOException {
        log("Received INVITE request SUNIL:\n" + request);
        if (request.isInitial()) {
            Proxy proxy = request.getProxy();
            proxy.setRecordRoute(true);
            proxy.setSupervised(true);

            // Get registration details and proxy the request to user's phone.
            SipApplicationSession sas =
                    request.getSession(false).getApplicationSession();
            SipURI contactURI = (SipURI) sas.getAttribute(
                    RegistrarServlet.CONTACT_URI);

        {
            if (contactURI != null) {
                proxy.proxyTo(contactURI);
                log("Proxied INVITE request to \n" + contactURI);
            } else {
                SipServletResponse resp = request.createResponse(404);
                String toUser = ((SipURI) request.getTo().getURI()).getUser();
                log("Unable to find contact URI for " + toUser +
                        ". Hence, responding with\n" + resp);
                resp.send();
            }
        }
    }

I want to send PUBLISH to Adem after                 proxy.proxyTo(contactURI);

Sunil
Loading...