<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Volga</p>
<p>Maybe I'm missing something but "<font face="Cantarell">if($avp(tls-frompbx)==$var(usr_check_tls))</font>"
!!! AVP = VAR !!!</p>
<p>In xlog both vars are AVP.<br>
</p>
<p><br>
</p>
<p>On 4/23/20 5:31 PM, volga629 wrote:</p>
<blockquote type="cite"
cite="mid:48421947-340b-8cee-45de-fe3ccb3c4457@skillsearch.ca">Hello
Ivailo,
<br>
<br>
I tested md5 and values are the same.
<br>
<br>
<br>
xlog("MD5 over cached user ~> $(avp(tls-frompbx){s.md5})
checked user ~> $(avp(usr_check_tls){s.md5})\n");
<br>
<br>
<br>
Log
<br>
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: ---setting as BLF
callee <a class="moz-txt-link-rfc2396E" href="sip:201%40demo.sip.lan@192.168.50.10:5060"><sip:201%40demo.sip.lan@192.168.50.10:5060></a>
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: Number of calls
from user <a class="moz-txt-link-abbreviated" href="mailto:100@demo.sip.lan">100@demo.sip.lan</a> is 2
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: Number of calls
from domain demo.sip.lan is 0
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: Is [INVITE] from fs
~> 192.168.50.12 and <a class="moz-txt-link-freetext" href="sip:201%40demo.sip.lan@192.168.50.10:5060">sip:201%40demo.sip.lan@192.168.50.10:5060</a>
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: looking up
[<a class="moz-txt-link-freetext" href="sip:201%40demo.sip.lan@192.168.50.10:5060">sip:201%40demo.sip.lan@192.168.50.10:5060</a>]
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: WSS: [INVITE] found
transport ~> tls
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: [INVITE] fetched
var ~> tls_201
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12598]: MD5 over cached
user ~> b384583ffd6d280b18286afa30399850 checked user ~>
b384583ffd6d280b18286afa30399850
<br>
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]
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12583]: OnReply_Route3:
[INVITE] fetched var ~> plain_100
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12583]: OnReply_Route3:
[INVITE] and call status 183 and transport plain_100
<br>
Apr 23 16:23:11 pr1 /usr/sbin/opensips[12583]: OnReply_Route3:
[INVITE] [183] Default match [FS ~> Client]
<br>
Apr 23 16:23:12 pr1 /usr/sbin/opensips[12591]: OnReply_Route3:
[INVITE] fetched var ~> plain_100
<br>
<br>
<br>
volga629
<br>
<br>
<br>
On 4/23/20 11:05 AM, Ivailo Dobrev wrote:
<br>
<blockquote type="cite">Hi Volga,
<br>
<br>
xlog md5 of both vars before if statement. I'm pretty sure they
will be different. Maybe not printable character ?
<br>
<br>
On 4/23/20 4:43 PM, volga629 via Users wrote:
<br>
<blockquote type="cite">Hello John,
<br>
<br>
I tested var to var
<br>
<br>
and test still failing
<br>
<br>
Tried
<br>
<br>
if($var(tls-frompbx)=="$var(usr_check_tls)")
<br>
<br>
or this
<br>
<br>
if($var(tls-frompbx)==$var(usr_check_tls))
<br>
<br>
volga629
<br>
<br>
<br>
On 4/23/20 9:41 AM, John Quick wrote:
<br>
<blockquote type="cite">Hi Volga
<br>
<br>
Please could you always format your emails to the users
group as plain text,
<br>
not HTML.
<br>
I had to copy and paste then save and re-open just to read
your question.
<br>
<br>
I would think the most likely explanation for the string
comparison failing
<br>
is that you are comparing an $avp with a $var
<br>
They are different - in particular, an AVP can hold several
values, somewhat
<br>
like an array type in other languages.
<br>
Can you try the same test but with a var for both sides of
the comparison.
<br>
<br>
John Quick
<br>
Smartvox Limited
<br>
<br>
<br>
<br>
</blockquote>
<br>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
<br>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
</blockquote>
</body>
</html>