[OpenSIPS-Users] string comparison

Ivailo Dobrev ivailod at telera.eu
Thu Apr 23 14:44:22 EST 2020


Hi Volga

Maybe I'm missing something but 
"if($avp(tls-frompbx)==$var(usr_check_tls))" !!! AVP = VAR !!!

In xlog both vars are AVP.


On 4/23/20 5:31 PM, volga629 wrote:

> Hello Ivailo,
>
> I tested md5 and  values are the same.
>
>
> xlog("MD5 over cached user ~> $(avp(tls-frompbx){s.md5}) checked user 
> ~> $(avp(usr_check_tls){s.md5})\n");
>
>
> Log
>
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: ---setting as BLF 
> callee <sip:201%40demo.sip.lan at 192.168.50.10:5060>
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: Number of calls from 
> user 100 at demo.sip.lan is 2
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: Number of calls from 
> domain demo.sip.lan is 0
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: Is [INVITE] from fs ~> 
> 192.168.50.12 and sip:201%40demo.sip.lan at 192.168.50.10:5060
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: looking up 
> [sip:201%40demo.sip.lan at 192.168.50.10:5060]
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: WSS: [INVITE] found 
> transport ~> tls
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: [INVITE] fetched var ~> 
> tls_201
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: MD5 over cached user ~> 
> b384583ffd6d280b18286afa30399850 checked user ~> 
> b384583ffd6d280b18286afa30399850
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: [INVITE] Call going 
> from LAN SouceIP <192.168.50.12> to WAN with transport set ~> [tcp 
> MobileFlag] original transport [tls_201] and checked transport [tls_201]
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12583]: OnReply_Route3: 
> [INVITE] fetched var ~> plain_100
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12583]: OnReply_Route3: 
> [INVITE] and call status 183 and transport plain_100
> Apr 23 16:23:11 pr1 /usr/sbin/opensips[12583]: OnReply_Route3: 
> [INVITE] [183] Default match [FS ~> Client]
> Apr 23 16:23:12 pr1 /usr/sbin/opensips[12591]: OnReply_Route3: 
> [INVITE] fetched var ~> plain_100
>
>
> volga629
>
>
> On 4/23/20 11:05 AM, Ivailo Dobrev wrote:
>> Hi Volga,
>>
>> xlog  md5 of both vars before if statement. I'm pretty sure they will 
>> be different. Maybe not printable character ?
>>
>> On 4/23/20 4:43 PM, volga629 via Users wrote:
>>> Hello John,
>>>
>>> I tested var to var
>>>
>>> and test still failing
>>>
>>> Tried
>>>
>>>  if($var(tls-frompbx)=="$var(usr_check_tls)")
>>>
>>> or this
>>>
>>>  if($var(tls-frompbx)==$var(usr_check_tls))
>>>
>>> volga629
>>>
>>>
>>> On 4/23/20 9:41 AM, John Quick wrote:
>>>> Hi Volga
>>>>
>>>> Please could you always format your emails to the users group as 
>>>> plain text,
>>>> not HTML.
>>>> I had to copy and paste then save and re-open just to read your 
>>>> question.
>>>>
>>>> I would think the most likely explanation for the string comparison 
>>>> failing
>>>> is that you are comparing an $avp with a $var
>>>> They are different - in particular, an AVP can hold several values, 
>>>> somewhat
>>>> like an array type in other languages.
>>>> Can you try the same test but with a var for both sides of the 
>>>> comparison.
>>>>
>>>> John Quick
>>>> Smartvox Limited
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200423/4359c27a/attachment-0001.html>


More information about the Users mailing list