[Kamailio-Devel] dialog callback - locks?

Ovidiu Sas osas at voipembedded.com
Wed Oct 15 16:29:34 CEST 2008


On Mon, Oct 13, 2008 at 12:01 PM, Klaus Darilion
<klaus.mailinglists at pernau.at> wrote:
> Hi Ovidiu!
>
> Ovidiu Sas schrieb:
>>
>> [osas]
>> I think you will need to lock the dialog if you want to access the
>> content of the dialog structure during subsequent dialog callbacks.
>> One option would be to copy all the info that you might need during
>> the first callback from the dialog context into your module context
>> and then use then local one.  This will avoid the necessity to lock
>> the dialog context.  The whole purpose of passing a pointer back to
>> the dialog module during the initial dialog callback is to create a
>> link back into the local module context.
>
> This works for most of the dlg_cell parameters, except lifetime. How can I
> read dlg->lifetime in hte callback in a safe way?
>

The params structure should be enhanced and the lifetime should be
passed via the existing API (see how CURR_DLG_LIFETIME is computed
inside dlg_handlers.c:dlg_onroute() ).
BTW, the lifetime is available in the script via $DLG_lifetime pv.



More information about the Devel mailing list