[Kamailio-Devel] dialog callback - locks?

Klaus Darilion klaus.mailinglists at pernau.at
Thu Sep 18 21:15:50 CEST 2008



Ovidiu Sas schrieb:
> Hello Klaus,
> 
> During the callbacks (from the dialog module into another module), the
> dialog is not under a lock and therefore a collision may occur if you
> access the dialog data and you have more then one child.

What do you mean with "more then one child".

In pua_dialoginfo module I create the XML body and therefore access the 
dlg_cell structure, e.g. dlg_cell->callid.

What if during the generation of the XML dcoument the dialog gets 
deleted (e.g. BYE request was sent immediately after the 
INVITE-200-ACK). Would the dlg_cell* pointer point to an invalid address 
   causing segfaults?

So, do I have to lock the dialog list to avoid deletion of the current 
dialog structure? or is the dialog marked as "currently in use" to avoid 
deletion while it is used?

thanks
klaus

> 
> 
> Regards,
> Ovidiu Sas
> 
> On Wed, Sep 17, 2008 at 7:09 AM, Klaus Darilion
> <klaus.mailinglists at pernau.at> wrote:
>> Hi!
>>
>> If the dialog callbacks are executed, is it safe to access the elements
>> in the dialog structure or do I have to obtain any locks before?
>>
>> thanks
>> klaus
>>
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at lists.kamailio.org
>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/devel
>>



More information about the Devel mailing list