[OpenSIPS-Users] Store dialog value and fetch it
Alexander Mustafin
mustafin.aleksandr at gmail.com
Sat Nov 9 10:33:30 CET 2013
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
08 нояб. 2013 г., в 17:03, Răzvan Crainea <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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20131109/ca037f21/attachment.htm>
More information about the Users
mailing list