[OpenSIPS-Users] {param.value, field} problem with quoted values

Anca Vamanu anca at opensips.org
Fri Oct 22 16:34:09 CEST 2010


Hi Jeff,

I have just tried like this with 1.6 and it works:

$var(text)="<sip:2165551212 at 192.168.32.2;rn=+12166210000;ocn=9321;carrier=\"AT&T\";cat=\"RBOC\";lata=320>";
$avp(s:call_carname) = $(var(text){param.value,carrier});
xlog("carrier = $avp(s:call_carname)\n");

=>  carrier = AT&T

But if you take it from a header, you don't have the quotes escaped. Do 
you see any error in the log?

Regards,

-- 
Anca Vamanu
www.voice-system.ro




On 10/21/2010 07:15 AM, Jeff Pyle wrote:
> Hello,
>
> I'm pulling some data out of a script variable using the {param.value,field} string manipulator.  It works fine, unless the value is in quotes.  For example, $var(ct) is like this:
>
> <sip:2165551212 at 192.168.32.2;rn=+12166210000;ocn=9321;carrier="AT&T";cat="RBOC";lata=320>
>
> I can pull out the ocn, lata and rn successfully with functions like this:
>
>                  if !($(var(ct){param.value,ocn}) == '') {
>                          $avp(s:call_ocn) = $(var(lrnct){param.value,ocn});
>                  }
>
> But, the following 'if' statement returns false and never sets the AVP:
>
>                  if !($(var(ct){param.value,carrier}) == '') {
>                          $avp(s:call_carname) = $(var(lrnct){param.value,carrier});
>                  }
>
> If I skip the 'if' and set the AVP directly, it's empty.
>
> This is on Opensips 1.5.3.  Obviously it's possible this has already been addressed in more recent versions.  This server is scheduled for an upgrade to 1.6 in the coming weeks, but we're not there yet.  I thought I'd ask anyway.
>
>
> - Jeff
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>    



More information about the Users mailing list