Hi Aleksander,

I have read through all your posts on the mailing list and I would
like to implement the same 1 listener , multiple worker model that you
are mentioning here.

I have question about how to use the SU api to sprawn thread for each
incoming INVITE.  Can you please share with me the structure of your
code?

Thanks you so much.

Pete

On Wed, Sep 23, 2009 at 10:12 AM, Aleksander Morgado
<sofia-sip-de...@aleksander.es> wrote:
> 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&reg; 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&#45;12, 2009. Register now&#33;
> 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
>
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to