<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Jon,<br>
      <br>
      Could you (off list) provide the content of your dr_gateways and
      the value of the AVP, so I can run some tests on my side ? And of
      course, the exact OpenSIPS revision.<br>
      <br>
      Thanks,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
OpenSIPS Summit 2018
  <a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
    <div class="moz-cite-prefix">On 01/09/2018 06:34 PM, Jonathan Hunter
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DB4PR02MB0336BFB2247361700AFAD05ABD100@DB4PR02MB0336.eurprd02.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
        dir="ltr">
        <p style="margin-top:0;margin-bottom:0">Hi Bogdan,</p>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0">Thanks for the reply!</p>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0">Yes correct the <span
            style="font-family: monospace; font-size: 16px;">$avp(originURI)
            I set to;</span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><br>
          </span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span>$avp(originURI)
              = "sip:" + $si + ":" + $sp;</span><br>
          </span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span><br>
            </span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span>Then
              use it a few times;</span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span><br>
            </span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span>if(dr_is_gw("$avp(originURI)","1"))
              {</span><br>
          </span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 12pt;">####Do some
            stuff</span><br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 12pt;">}</span><br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><font face="monospace"><br>
          </font></p>
        <p style="margin-top:0;margin-bottom:0"><font face="monospace"><span>if(dr_is_gw("$avp(originURI)",
              "2")) {</span><br>
          </font></p>
        <p style="margin-top:0;margin-bottom:0"><span style="font-size:
            12pt;">##### Do some other stuff</span><br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><span style="font-size:
            12pt;">}</span><br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0">However since the
          upgrade from 2.2.5 to 2.3.2  <span style="font-family:
            monospace; font-size: 16px;">$avp(originURI) which as you
            say is coming from FS, and is in type 2, is actually
            matching on <span style="font-family: monospace; font-size:
              16px;">dr_is_gw("$avp(originURI)","1"), as well as <span
                style="font-family: monospace; font-size: 16px;">dr_is_gw("$avp(originURI)","2").</span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;"><br>
              </span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;">Where
                type 1 is just SBC and has always been.</span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;"><br>
              </span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;">So it
                doesnt fail on a look up on 2, but matches on a lookup
                of 1.</span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;"><br>
              </span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;">I have
                tried changing the type number but still same.</span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;"><br>
              </span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;">Thanks</span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;"><br>
              </span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;">Jon</span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;"><br>
              </span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><span
              style="font-family: monospace; font-size: 16px;"><span
                style="font-family: monospace; font-size: 16px;"><br>
              </span></span></span></p>
        <p style="margin-top:0;margin-bottom:0"><font face="monospace"><br>
          </font></p>
        <p style="margin-top:0;margin-bottom:0"><br>
        </p>
        <p style="margin-top:0;margin-bottom:0"><span
            style="font-family: monospace; font-size: 16px;"><br>
          </span></p>
        <br>
        <br>
        <div style="color: rgb(0, 0, 0);">
          <hr style="display:inline-block;width:98%" tabindex="-1">
          <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
              color="#000000" face="Calibri, sans-serif"><b>From:</b>
              Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org"><bogdan@opensips.org></a><br>
              <b>Sent:</b> 09 January 2018 14:59<br>
              <b>To:</b> OpenSIPS users mailling list; Jonathan Hunter<br>
              <b>Subject:</b> Re: [OpenSIPS-Users] dr_is_gw function
              when upgrading from 2.2.5 to 2.3 not working in same way</font>
            <div> </div>
          </div>
          <div style="background-color:#FFFFFF"><tt>Hi Jon,<br>
              <br>
              So, the $avp(originURI) holds a SIP URI pointing to a FS
              box. But the check against group 2 fails and against group
              1 succeeds ?<br>
              <br>
              Regards,<br>
            </tt>
            <pre class="x_moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="x_moz-txt-link-freetext" href="http://www.opensips-solutions.com" id="LPlnk234543" previewremoved="true" moz-do-not-send="true">http://www.opensips-solutions.com</a>
OpenSIPS Summit 2018
  <a class="x_moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam" id="LPlnk491513" previewremoved="true" moz-do-not-send="true">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
            <div id="LPBorder_GT_15155151016180.17402550386616555"
              style="margin-bottom: 20px; overflow: auto; width: 100%;
              text-indent: 0px;">
              <table id="LPContainer_15155151016160.3713937843877506"
                role="presentation" style="width: 90%; background-color:
                rgb(255, 255, 255); position: relative; overflow: auto;
                padding-top: 20px; padding-bottom: 20px; margin-top:
                20px; border-top: 1px dotted rgb(200, 200, 200);
                border-bottom: 1px dotted rgb(200, 200, 200);"
                cellspacing="0">
                <tbody>
                  <tr style="border-spacing: 0px;" valign="top">
                    <td id="TextCell_15155151016160.8448753059992378"
                      colspan="2" style="vertical-align: top; position:
                      relative; padding: 0px; display: table-cell;">
                      <div id="LPTitle_15155151016160.13892007739813472"
                        style="top: 0px; color: rgb(0, 120, 215);
                        font-weight: 400; font-size: 21px; font-family:
                        wf_segoe-ui_light, "Segoe UI Light",
                        "Segoe WP Light", "Segoe
                        UI", "Segoe WP", Tahoma, Arial,
                        sans-serif; line-height: 21px;">
                        <a
                          id="LPUrlAnchor_15155151016170.35976704806188864"
                          href="http://www.opensips-solutions.com/"
                          target="_blank" style="text-decoration: none;"
                          moz-do-not-send="true">Home — OpenSIPS
                          Solutions</a></div>
                      <div
                        id="LPMetadata_15155151016170.8938353732875353"
                        style="margin: 10px 0px 16px; color: rgb(102,
                        102, 102); font-weight: 400; font-family:
                        wf_segoe-ui_normal, "Segoe UI",
                        "Segoe WP", Tahoma, Arial, sans-serif;
                        font-size: 14px; line-height: 14px;">
                        <a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></div>
                      <div
                        id="LPDescription_15155151016180.4241059894813548"
                        style="display: block; color: rgb(102, 102,
                        102); font-weight: 400; font-family:
                        wf_segoe-ui_normal, "Segoe UI",
                        "Segoe WP", Tahoma, Arial, sans-serif;
                        font-size: 14px; line-height: 20px; max-height:
                        100px; overflow: hidden;">
                        OpenSIPS is a mature Open Source implementation
                        of a SIP server. OpenSIPS is more than a SIP
                        proxy/router as it includes application-level
                        functionalities.</div>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <br>
            <div id="LPBorder_GT_15155151015330.7420152580139359"
              style="margin-bottom: 20px; overflow: auto; width: 100%;
              text-indent: 0px;">
              <table id="LPContainer_15155151015290.6210920811213327"
                role="presentation" style="width: 90%; background-color:
                rgb(255, 255, 255); position: relative; overflow: auto;
                padding-top: 20px; padding-bottom: 20px; margin-top:
                20px; border-top: 1px dotted rgb(200, 200, 200);
                border-bottom: 1px dotted rgb(200, 200, 200);"
                cellspacing="0">
                <tbody>
                  <tr style="border-spacing: 0px;" valign="top">
                    <td id="TextCell_15155151015310.7043440600674484"
                      colspan="2" style="vertical-align: top; position:
                      relative; padding: 0px; display: table-cell;">
                      <div id="LPTitle_15155151015310.8947761434112951"
                        style="top: 0px; color: rgb(0, 120, 215);
                        font-weight: 400; font-size: 21px; font-family:
                        wf_segoe-ui_light, "Segoe UI Light",
                        "Segoe WP Light", "Segoe
                        UI", "Segoe WP", Tahoma, Arial,
                        sans-serif; line-height: 21px;">
                        <a
                          id="LPUrlAnchor_15155151015310.240970720940485"
href="http://www.opensips.org/events/Summit-2018Amsterdam"
                          target="_blank" style="text-decoration: none;"
                          moz-do-not-send="true">Summit 2018 - OpenSIPS</a></div>
                      <div
                        id="LPMetadata_15155151015320.9955609853317133"
                        style="margin: 10px 0px 16px; color: rgb(102,
                        102, 102); font-weight: 400; font-family:
                        wf_segoe-ui_normal, "Segoe UI",
                        "Segoe WP", Tahoma, Arial, sans-serif;
                        font-size: 14px; line-height: 14px;">
                        <a class="moz-txt-link-abbreviated" href="http://www.opensips.org">www.opensips.org</a></div>
                      <div
                        id="LPDescription_15155151015320.11652417968621687"
                        style="display: block; color: rgb(102, 102,
                        102); font-weight: 400; font-family:
                        wf_segoe-ui_normal, "Segoe UI",
                        "Segoe WP", Tahoma, Arial, sans-serif;
                        font-size: 14px; line-height: 20px; max-height:
                        100px; overflow: hidden;">
                        Next Stop OpenSIPS Summit. Join fellow VoIP
                        & RTC experts, developers and users from all
                        over the world for 3+1 days of talks, inspiring
                        presentations ...</div>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <br>
            <div class="x_moz-cite-prefix">On 01/09/2018 02:54 PM,
              Jonathan Hunter wrote:<br>
            </div>
            <blockquote type="cite">
              <div id="x_divtagdefaultwrapper" dir="ltr"
                style="font-size:12pt; color:#000000;
                font-family:Calibri,Helvetica,sans-serif">
                <div>Hi Guys,</div>
                <div><br>
                </div>
                <div>Is there any reason why after moving from version
                  2.2.5 to 2.3.2 that I would then get issues with
                  drouting module, in particular dr_is_gw ?</div>
                <div><br>
                </div>
                <div>As if I test between the two versions the same
                  statement doesnt match correctly.</div>
                <div><br>
                </div>
                <div>Essentially I have 2 main gateways types in
                  dr_gateways, type=1 for our SBC and type=2 for our
                  freeswitch servers.</div>
                <div><br>
                </div>
                <div>I normally match using dr_is_gw to determine if
                  traffic is from SBC or FreeSWITCH, however this now no
                  longer works and on the first occurrence of me writing
                  this statement;</div>
                <div><br>
                </div>
                <div>if(dr_is_gw("$avp(originURI)","1"))</div>
                <div><br>
                </div>
                <div>Where $avp(originURI) = source IP of freeswitch
                  type=2, opensips keeps stating its from the SBC,
                  type=1.</div>
                <div><br>
                </div>
                <div>This only happens after upgrade, so works fine with
                  2.2</div>
                <div><br>
                </div>
                <div>Has this function changed between versions? Has
                  anyone else had this issue where its matching the
                  source IP against the wrong type?   </div>
                <div><br>
                </div>
                <div>Please let me know if I need to change the syntax I
                  am adding to the function!</div>
                <div><br>
                </div>
                <div>Many thanks</div>
                <div><br>
                </div>
                <div>Jon</div>
                <br>
              </div>
              <br>
              <fieldset class="x_mimeAttachmentHeader"></fieldset>
              <br>
              <pre>_______________________________________________
Users mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="x_moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
            </blockquote>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>