Hi Pete,
Could you try the attached patch to see if it solves the problem ?
IF ok, I will upload it on SVN
Regards,
Bogdan
Pete Kelly wrote:
Hi
I am currently storing some dialog values in opensips 1.6.3, using the
following format:
$dlg_val(name) = "value";
I then retrieve the value in the same way:
if($dlg_val(name) == "value") { // do some stuff }
However, if the dialog no longer exists on a subsequent request (BYE
for example), the read part produces some errors in the opensips log
like this:
CRITICAL:core:comp_scriptvar: cannot get left var value
WARNING:core:do_action: error in expression (l=542)
Does anyone know how I can test for the existence of the variable
before trying to access it? I have tried
if($dlg_val(name) != NULL && $dlg_val(name) == "value") { // do some stuff }
but this produces the same effect.
Thanks
Pete
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
--
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
20 - 24 September 2010, Frankfurt, Germany
www.voice-system.ro
Index: modules/dialog/dlg_vals.c
===================================================================
--- modules/dialog/dlg_vals.c (revision 7112)
+++ modules/dialog/dlg_vals.c (working copy)
@@ -225,9 +225,6 @@
{
struct dlg_cell *dlg;
- if ( (dlg=get_current_dialog())==NULL )
- return -1;
-
if (param==NULL || param->pvn.type!=PV_NAME_INTSTR ||
param->pvn.u.isname.type!=AVP_NAME_STR ||
param->pvn.u.isname.name.s.s==NULL ) {
@@ -235,6 +232,9 @@
return -1;
}
+ if ( (dlg=get_current_dialog())==NULL )
+ return pv_get_null(msg, param, res);
+
if (fetch_dlg_value( dlg, ¶m->pvn.u.isname.name.s, ¶m->pvv, 1)!=0)
return pv_get_null(msg, param, res);
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users