[OpenSIPS-Users] Store dialog value and fetch it

Răzvan Crainea razvan at opensips.org
Mon Nov 11 11:42:46 CET 2013


Hi, Alexander!

Well, this is pretty weird, since if in the previous route (the one that 
calls the BYE route) you can access the variables you should be able to 
see them here too.
Are you sure you are talking about the same request? Can you print some 
logs in the previous route (the one that calls match_dialog()) with the 
dialog status, method and callid and match them with the logs in the BYE 
route?

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 11/11/2013 09:24 AM, Alexander Mustafin wrote:
> Hello!
>
> I’ve tried many variants, but unsuccessfully.
>
> After BYE message, dialog change state to [5] and fetch_dlg_val doesn’t
> export any stored values.
>
> Are the other ways to save dialog-related values after BYE message?
>
> Best regards,
> Alexander Mustafin
> mustafin.aleksandr at gmail.com <mailto:mustafin.aleksandr at gmail.com>
>
>
>
>
> 09 нояб. 2013 г., в 15:33, Alexander Mustafin
> <mustafin.aleksandr at gmail.com <mailto:mustafin.aleksandr at gmail.com>>
> написал(а):
>
>> Hi, Răzvan!
>>
>> I’m using topology_hiding() function - and loose_route() will always
>> false.
>> match_dialog() in this route return TRUE and $DLG_status return 5
>> (dialog ended)
>>
>> route[BYE] {
>>         xlog("L_DEBUG", "~~~~~ Enter in [BYE] section ~~~~~");
>>         xlog("---- DIALOG status [$DLG_status]"); #DEBUG
>>
>>         $avp(radius_user) = $dlg_val("incoming_gate");
>>         $var(setup_time) = $dlg_val("start_time»);
>> }
>>
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]: ~~~~~ Enter in [BYE]
>> section ~~~~~
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]: ---- DIALOG status [5]
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]:
>> DBG:dialog:fetch_dlg_value: looking for <"incoming_gate">
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]:
>> DBG:dialog:fetch_dlg_value: var NOT found!
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]: ERROR:core:do_assign:
>> no value in right expression
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]: ERROR:core:do_assign:
>> error at line: 501
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]:
>> DBG:dialog:fetch_dlg_value: looking for <"start_time">
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]:
>> DBG:dialog:fetch_dlg_value: var NOT found!
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]: ERROR:core:do_assign:
>> no value in right expression
>> Nov  9 09:23:54 ops /usr/sbin/opensips[26665]: ERROR:core:do_assign:
>> error at line: 502
>>
>>
>> Best regards,
>> Alexander Mustafin
>> mustafin.aleksandr at gmail.com <mailto:mustafin.aleksandr at gmail.com>
>>
>>
>>
>>
>> 08 нояб. 2013 г., в 17:03, Răzvan Crainea <razvan at opensips.org
>> <mailto:razvan at opensips.org>> написал(а):
>>
>>> So basically you're saying that after the loose_route() call you can
>>> no longer access the dialog variable? Are you sure you are calling
>>> the BYE route only in this place?
>>> You should check if you are really in a dialog context. Inside the
>>> BYE route, just print the $DLG_status variable. If it is NULL, then
>>> match_dialog() and loose_route() failed to match a dialog, therefore
>>> you won't be able to retrieve the value.
>>> Adding the match_dialog() call inside the BYE route only makes sense
>>> if the dialog was not mached yet. So in your case, it makes sense
>>> only if you call route(BYE); from a different part of script.
>>>
>>> You can't really extract internal dialog values, unless you
>>> explicitely save them as values, or take them from the request.
>>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list