linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] sending NOTIFY packet


From: Ivica Babarovic
Subject: [Linphone-developers] sending NOTIFY packet
Date: Tue, 22 Jul 2003 12:56:38 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Hello!

As I wrote couple of months ago I was interested in event notification
in Linphone. I finnaly got some time to work with it and I managed to get
some results. Scenario goes like this.

I have a Windows machine and two Linux workstations. There are two clients and
one server.

 ____________________          ________________         ______________________
|Windows client(WMSN)| <----->|SIP server (SER)|<----->|Linux client(linphone)|
 --------------------          ----------------         ----------------------

WMSN has Linux client in his adressbook so immediatly after registering on SER
it wants to subscribe it. I added a function to osipua/src/nist_callbacks.c
that responds to incomming SUBSCRIBE packets. As we need to respond to the
SUBSCRIBE with 200 OK and then send NOTIFY packet I wrote the following.
The function looks like this:

void nist_subscribe_received(transaction_t * trn, sip_t *sipmsg)
{
        OsipDialog *dia;
        OsipUA *ua;
        int error;
        char *url;

        osip_trace (OSIP_WARNING, ("nist_subscribe_received(): not fully 
implemented.\n"));
        dia = osip_dialog_new_from_incoming_trn (trn);
        if (dia!=NULL){
                /* answer 200 OK ? */
                osip_dialog_respond(dia,trn,200);
                HERE SHOULD BE SOMETHING LIKE
                SEND NOTIFY. I NEED TO CREATE THE NOTIFY
                PACKET AND SEND IT TO WMSN!
}

I wrote a simple function to send NOTIFY packet but it always responds with
a call-leg doesnt exist. Main problem for me now is to extract data from an
existing call-leg and create a NOTIFY packet and then send it to MSN.
How do I extract that info from incomming packets and how do I create a NOTIFY
packet.

Am I on the right way or am I totaly astray?

Subscribe process shold go like this:
1.)MSN -------SUBSCRIBE linphone ------------------->SER
2.)SER -------MSN WANTS TO SUBSCRIBE YOU ----------->Linphone
3.)Linphone----OK NO PROBLEM... 200 OK-------------->SER
4.)SER ------Linphone said OK----------------------->MSN
5.)Linphone------->NOTIFY packet to MSN------------->MSN
6.)MSN------------>200 OK I received NOTIFY--------->Linphone

So far I managed to achieve the first 4 stages.

Please help ... I'm stuck ... need some guidance. I'm working on an older
version of Linphone 0.9.0 but that is not the problem. Once I master this
on this version it'll be easy to port it to newest version of Linphone.

TIA,
IB





reply via email to

[Prev in Thread] Current Thread [Next in Thread]