[OpenSIPS-Users] Testing for dialog values

Pete Kelly pkelly at gmail.com
Tue Aug 17 11:20:59 CEST 2010


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



More information about the Users mailing list