check for NULL values

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

check for NULL values

OpenSIPS - Users mailing list
Hi Guys,

I have a check for NULL for $tu var in the script, But when the value is missing I'm getting the following error.

ERROR:core:comp_scriptvar: cannot get left var value

WARNING:core:do_action: error in expression at /etc/opensips/opensips.cfg:806

and line 806 contains following.

    if ( $tu != NULL ) {
        remove("location","$tu");
    }

any suggestion on how to test for NULL values without getting above error. I'm using opensips 2.3.5




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: check for NULL values

OpenSIPS - Users mailing list
Hey,

Anyone have a suggestion for this?

On Thursday, 8 November 2018, 8:09:50 AM GMT+5:30, Pasan Meemaduma <[hidden email]> wrote:


Hi Guys,

I have a check for NULL for $tu var in the script, But when the value is missing I'm getting the following error.

ERROR:core:comp_scriptvar: cannot get left var value

WARNING:core:do_action: error in expression at /etc/opensips/opensips.cfg:806

and line 806 contains following.

    if ( $tu != NULL ) {
        remove("location","$tu");
    }

any suggestion on how to test for NULL values without getting above error. I'm using opensips 2.3.5




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: check for NULL values

Robert Dyck
In reply to this post by OpenSIPS - Users mailing list

Just a guess. Try

 

if $tu {
        remove("location","$tu");
    }

Not tested. A nonzero value may evaluate as TRUE.

 

On Tuesday, November 13, 2018 12:56:42 AM PST Pasan Meemaduma via Users wrote:

Hey,


Anyone have a suggestion for this?


On Thursday, 8 November 2018, 8:09:50 AM GMT+5:30, Pasan Meemaduma <[hidden email]> wrote:



ERROR:core:comp_scriptvar: cannot get left var value

WARNING:core:do_action: error in expression at /etc/opensips/opensips.cfg:806


and line 806 contains following.


    if ( $tu != NULL ) {
        remove("location","$tu");
    }

any suggestion on how to test for NULL values without getting above error. I'm using opensips 2.3.5







_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users