<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font face="Cantarell">Hello Liviu,</font></p>
    <p><font face="Cantarell">The issue that even avp to avp or var to
        var failing always false there no routes or  special operation.
        <br>
      </font></p>
    <p><font face="Cantarell">I posted log with md5 strings and the both
        the same and == still return false </font>.<br>
      <font face="Cantarell"><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>
      </font></p>
    <p><font face="Cantarell"><br>
      </font></p>
    <p><font face="Cantarell">Script <br>
      </font></p>
    <p><font face="Cantarell">route[RTP_MANAGE] {<br>
            if(!is_method("INVITE|UPDATE|BYE|CANCEL"))<br>
                return;<br>
        <br>
            if(cache_fetch("redis:wss-grp","wss-frompbx",
        $var(wss-frompbx))) {<br>
                xlog("[$rm] fetched var ~> $var(wss-frompbx)\n");<br>
                cache_remove("redis:wss-grp","wss-frompbx");<br>
            }<br>
        <br>
                if(cache_fetch("redis:wss-grp","tls-frompbx",
        $var(tls-frompbx))) {<br>
                        xlog("[$rm] fetched var ~>
        $avp(tls-frompbx)\n");<br>
                        cache_remove("redis:wss-grp","tls-frompbx");<br>
                }<br>
        <br>
            if(is_method("INVITE|UPDATE|ACK") &&
        has_body("application/sdp")) {<br>
                if(isflagset("FLAG_FROM_FS")) {<br>
                    $var(usr_check) = "wss_" + $tU;<br>
                    $var(usr_check_tls) = "tls_" + $(tU{s.select,0,%});<br>
                    $var(dir) = "in-iface=internal out-iface=external";<br>
                    $var(codec_flag_frompbx) = "codec-strip-G722
        codec-strip-CN codec-strip-G726 codec-strip-PCMA
        transcode-opus";<br>
                    $var(wss_codec_trans) = "transcode-VP8
        transcode-H264";<br>
                    $var(trns) = "UDP/TLS/RTP/SAVPF SDES-no";<br>
                     $var(transport) = '';<br>
                    if($var(tls-frompbx)==$var(usr_check_tls)) {<br>
                        $var(transport) = "tls";<br>
                        if(!codec_exists("opus")) {<br>
                            $var(codec_flag_frompbx_tls) =
        "transcode-opus";<br>
                        }<br>
                        rtpengine_offer("replace-origin
        replace-session-connection $var(codec_flag_frompbx_tls) RTP/SAVP
        ICE=remove $var(dir)");<br>
                    }<br>
                    if($var(wss-frompbx)==$var(usr_check)) {<br>
                        $var(transport) = "wss";<br>
                        rtpengine_offer(" $var(wss_codec_trans)
        $var(codec_flag_frompbx) replace-session-connection
        replace-origin $var(trns) $var(dir)");<br>
                    }</font></p>
    <p><font face="Cantarell"><font face="Cantarell"><br>
        </font></font></p>
    <p><font face="Cantarell"></font>volga629<br>
    </p>
    <div class="moz-cite-prefix">On 4/23/20 10:34 AM, Liviu Chircu
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:9362669e-d19f-a1f3-f90c-f53dd7668fb4@opensips.org">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class="moz-cite-prefix">On 23.04.2020 15:26, volga629 via
        Users wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:5e6e5656-a785-5b86-a6e9-c591f4442249@skillsearch.ca">
        <p><font face="Cantarell">$var(usr_check_tls) = "tls_" +
            $(tU{s.select,0,%});</font></p>
        <p><font face="Cantarell">Second  var</font></p>
        <p><font face="Cantarell">cache_fetch("redis:wss-grp","tls-frompbx",
            $avp(tls-frompbx))</font></p>
        <p><font face="Cantarell">This return always false<br>
          </font></p>
        <p><font face="Cantarell">if($avp(tls-frompbx)==$var(usr_check_tls))
            {</font></p>
      </blockquote>
      <p><tt>Hi, Volga!</tt></p>
      <p><tt>Maybe there is some route being called in the meantime or
          some other logic.  The comparison operators are working well
          on all latest 2.4+ versions, you can test for yourself with a
          simple opensips.cfg:</tt></p>
      <p><tt>    $var(x) = "201%123";<br>
              $var(usr_check_tls) = "tls_" + $(var(x){s.select,0,%});<br>
              $avp(tls-frompbx) = "tls_201";<br>
              $avp(tls-frompbx) = "tls_201";<br>
          <br>
              assert($avp(tls-frompbx) == $var(usr_check_tls),
          "avp-var-1");</tt></p>
      <p><tt>Regards,<br>
        </tt></p>
      <pre class="moz-signature" cols="72">-- 
Liviu Chircu
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/liviuchircu" moz-do-not-send="true">www.twitter.com/liviuchircu</a> | <a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" moz-do-not-send="true">www.opensips-solutions.com</a>

OpenSIPS Summit, Amsterdam, Fall 2020
  <a class="moz-txt-link-abbreviated" href="http://www.opensips.org/events" moz-do-not-send="true">www.opensips.org/events</a></pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<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>
</pre>
    </blockquote>
  </body>
</html>