[Kamailio-Users] [OpenSIPS-Users] Where are going my pua_dialoginfo publishes ?
Daniel-Constantin Mierla
miconda at gmail.com
Fri Mar 6 09:44:29 CET 2009
On 03/05/2009 12:14 PM, Klaus Darilion wrote:
> Eric PTAK schrieb:
>
>> Hi all for a new debug day ;)
>>
>>
>> You're right Klaus, from my understanding :
>> - the expires value is taken from the dialog struct, or from
>> override_lifetime if it's set.
>> ==> at this point, dialog->lifetime = 0, so if override_lifetime isn't
>> set the expires will equal 0 too. so we need to go more deeply.
>>
>> (not in call order)
>> - the dialog struct is given via the callback and filled by the dialog
>> module
>> - the dialog module calls get_dlg_timeout function which return the avp
>> lifetime or default_timeout if the avp doesn't exist
>> - the dialog module calls run_create_callbacks which then calls
>> registered callbacks like pua_dialoginfo's one
>>
>> the weird thing, from dialog/dlg_handlers.c line 470 to 510, the dialog
>> struct is built but the lifetime field is filled after the
>> run_create_callbacks call...
>>
>
> I remember I have come across this before. Currently the order is:
>
> /* first INVITE seen (dialog created, unconfirmed) */
> run_create_callbacks( dlg, msg);
>
> if ( seq_match_mode!=SEQ_MATCH_NO_ID &&
> add_dlg_rr_param( msg, dlg->h_entry, dlg->h_id)<0 ) {
> LM_ERR("failed to add RR param\n");
> goto error;
> }
>
> if ( d_tmb.register_tmcb( msg, t,
> TMCB_RESPONSE_OUT|TMCB_RESPONSE_FWDED,
> dlg_onreply, (void*)dlg, unref_new_dialog)<0 ) {
> LM_ERR("failed to register TMCB\n");
> goto error;
> }
>
> dlg->lifetime = get_dlg_timeout(msg);
>
>
>
> I wonder if it should be changed. Shouldn't run_create_callbacks()
> executed later? E.g. If there is an error creating the dialog IMO it
> makes no sense to call the callback at all.
>
> Daniel, what do you think?
>
Seems the right way to do it. You can commit on trunk and let it there
for testing, then backport.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
More information about the Users
mailing list