[OpenSIPS-Users] Testing for dialog values

Pete Kelly pkelly at gmail.com
Fri Aug 20 15:25:40 CEST 2010


Hi Bogdan,

Thank you for that patch, it does indeed solve the problem. (I patched
against 1.6 branch)

Out of interest, can you tell me how opensips evaluates the following
if statement:

if($dlg_val(name) != NULL && $dlg_val(name) == 'value')

I would expect it to stop evaluating if "$dlg_val(name) != NULL" did
not return true, but I*think* from my experimentation that it
continues to evaluate "$dlg_val(name) == 'value'"


On 18 August 2010 15:51, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
> 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
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
> --
> Bogdan-Andrei Iancu
> OpenSIPS Bootcamp
> 20 - 24 September 2010, Frankfurt, Germany
> www.voice-system.ro
>
>



More information about the Users mailing list