Hi Daniel,
> When NTA receives a request which doesn't match an existing transaction it
> passes a pointer to the callback function of type sip_t. Can this pointer
> be dereferenced through the lifetime of the transaction or does it go poof
> as soon as I exit the callback function?
>
>
My understanding is that the pointer to the sip_t struct can be used as long
as you don't set a reply to the SIP message.
> I ask because I'm writing a multi-threaded UAS which has to pass some
> objects from the callback function on to another thread. The callback
> function exits while the other thread is busy processing the request. I
> need to know if I have to make a copy of whatever sip_t * points to first
> before I pass it along for processing.
>
>
I use same approach, with a "listener thread" getting all requests and
passing them to several "worker threads", using sofia-sip built-in clones
and communication based on su_msg_r structures. Take care, because you must
synchronize the access to the nta object when replying the incoming
transactions from the threads. You can't just call nta_incoming_treply()
from another thread and think it will internally sync access to the members
of the nta object, which is used by all threads. You can synchronize it
"obtaining" and "releasing" the root object where the nta object is attached
to.
Cheers,
-Aleksander
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel