Hi Pete,

> I am trying to use sofia to implement a stateful SIP proxy.   I have a
> question about the sofia API.
> 
> When a 200 OK is received, how do I know which INVITE is the 200 OK
> correlates to?  How do I match the corresponding INVITE with the
> incoming 200 OK?
> 

Actually, sofia-sip already matches the response to the proper outgoing
request sent. Once sofia-sip matches both, it will call the callback
specified in nta_outgoing_tcreate(). The format of the callback is the
following:

int my_response_callback(nta_outgoing_magic_t *magic,
                         nta_outgoing_t *request,
                         sip_t const *sip);

* In the callback you already have the original nta_outgoing_t request
you generated. You can even get the request message from the
nta_outgoing_t using nta_outgoing_get_request().
* You also have the magic context you specified in
nta_outgoing_tcreate(), which can be different for each outgoing request
you send.

Cheers,
-Aleksander


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to