<html>
<head>
<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>
</head>
<body dir="ltr">
<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">And thanks for your help, works perfectly now!</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Many thanks</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Jon</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 face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Bogdan-Andrei Iancu <bogdan@opensips.org><br>
<b>Sent:</b> 11 January 2018 10:17<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>
Thank you for your report and help. The fixes are available on git, so if you update you should be able to get the right behavior.<br>
<br>
Best 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="LPlnk784482" previewremoved="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="LPlnk411632" previewremoved="true">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
<div id="LPBorder_GT_15156688284430.9643976432210504" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15156688284410.08645586152672102" role="presentation" cellspacing="0" 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);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15156688284410.42140296917299436" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15156688284410.6822140478575842"></div>
<div id="LPTitle_15156688284410.8058000256688926" 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_15156688284420.5391718318965313" href="http://www.opensips.org/events/Summit-2018Amsterdam" target="_blank" style="text-decoration: none;">Summit 2018 - OpenSIPS</a></div>
<div id="LPMetadata_15156688284420.11802025082996792" 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;">
www.opensips.org</div>
<div id="LPDescription_15156688284430.6131126836975083" 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 id="LPBorder_GT_15156688283060.2675452650604926" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15156688283030.33530712922234285" role="presentation" cellspacing="0" 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);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15156688283040.9201118838865741" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15156688283040.052238155203811365"></div>
<div id="LPTitle_15156688283040.9026068107887466" 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_15156688283050.4839739958120257" href="http://www.opensips-solutions.com/" target="_blank" style="text-decoration: none;">Home — OpenSIPS Solutions</a></div>
<div id="LPMetadata_15156688283050.10635263162695807" 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;">
www.opensips-solutions.com</div>
<div id="LPDescription_15156688283060.8995299076692878" 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 class="x_moz-cite-prefix">On 01/10/2018 11:08 AM, Bogdan-Andrei Iancu wrote:<br>
</div>
<blockquote type="cite"><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="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="LPlnk11209">http://www.opensips-solutions.com</a>
OpenSIPS Summit 2018
  <a class="x_moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
<div class="x_moz-cite-prefix">On 01/09/2018 06:34 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">
<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 tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri,
                sans-serif" style="font-size:11pt"><b>From:</b> Bogdan-Andrei Iancu
<a class="x_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_x_moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="x_x_moz-txt-link-freetext" href="http://www.opensips-solutions.com" id="LPlnk234543" previewremoved="true">http://www.opensips-solutions.com</a>
OpenSIPS Summit 2018
  <a class="x_x_moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam" id="LPlnk491513" previewremoved="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" contenteditable="false">
<table id="LPContainer_15155151016160.3713937843877506" cellspacing="0" style="width:90%; background-color:rgb(255,255,255); 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)">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td id="x_TextCell_15155151016160.8448753059992378" colspan="2" style="vertical-align:top; padding:0px; display:table-cell">
<div id="LPTitle_15155151016160.13892007739813472" style=""><a id="LPUrlAnchor_15155151016170.35976704806188864" href="http://www.opensips-solutions.com/" target="_blank" style="text-decoration:none">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="x_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" contenteditable="false">
<table id="LPContainer_15155151015290.6210920811213327" cellspacing="0" style="width:90%; background-color:rgb(255,255,255); 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)">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td id="x_TextCell_15155151015310.7043440600674484" colspan="2" style="vertical-align:top; padding:0px; display:table-cell">
<div id="LPTitle_15155151015310.8947761434112951" style=""><a id="LPUrlAnchor_15155151015310.240970720940485" href="http://www.opensips.org/events/Summit-2018Amsterdam" target="_blank" style="text-decoration:none">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="x_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_x_moz-cite-prefix">On 01/09/2018 02:54 PM, Jonathan Hunter wrote:<br>
</div>
<blockquote type="cite">
<div id="x_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_x_mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
Users mailing list
<a class="x_x_moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="x_x_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>
<br>
</div>
</div>
</div>
</blockquote>
<br>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
Users mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="x_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>
<br>
</div>
</div>
</div>
</body>
</html>