[OpenSIPS-Users] dr_is_gw function when upgrading from 2.2.5 to 2.3 not working in same way

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Jan 10 04:08:27 EST 2018


Hi Jon,

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.

Thanks,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Summit 2018
   http://www.opensips.org/events/Summit-2018Amsterdam

On 01/09/2018 06:34 PM, Jonathan Hunter wrote:
>
> Hi Bogdan,
>
>
> Thanks for the reply!
>
>
> Yes correct the $avp(originURI) I set to;
>
>
> $avp(originURI) = "sip:" + $si + ":" + $sp;
>
>
> Then use it a few times;
>
>
> if(dr_is_gw("$avp(originURI)","1")) {
>
> ####Do some stuff
>
> }
>
>
> if(dr_is_gw("$avp(originURI)", "2")) {
>
> ##### Do some other stuff
>
> }
>
>
> However since the upgrade from 2.2.5 to 2.3.2 $avp(originURI) which as 
> you say is coming from FS, and is in type 2, is actually matching on 
> dr_is_gw("$avp(originURI)","1"), as well as 
> dr_is_gw("$avp(originURI)","2").
>
>
> Where type 1 is just SBC and has always been.
>
>
> So it doesnt fail on a look up on 2, but matches on a lookup of 1.
>
>
> I have tried changing the type number but still same.
>
>
> Thanks
>
>
> Jon
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
> *From:* Bogdan-Andrei Iancu <bogdan at opensips.org>
> *Sent:* 09 January 2018 14:59
> *To:* OpenSIPS users mailling list; Jonathan Hunter
> *Subject:* Re: [OpenSIPS-Users] dr_is_gw function when upgrading from 
> 2.2.5 to 2.3 not working in same way
> Hi Jon,
>
> 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 ?
>
> Regards,
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>    http://www.opensips-solutions.com
> OpenSIPS Summit 2018
>    http://www.opensips.org/events/Summit-2018Amsterdam
> Home — OpenSIPS Solutions <http://www.opensips-solutions.com/>
> www.opensips-solutions.com
> 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.
>
>
> Summit 2018 - OpenSIPS 
> <http://www.opensips.org/events/Summit-2018Amsterdam>
> www.opensips.org
> 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 ...
>
>
> On 01/09/2018 02:54 PM, Jonathan Hunter wrote:
>> Hi Guys,
>>
>> 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 ?
>>
>> As if I test between the two versions the same statement doesnt match 
>> correctly.
>>
>> Essentially I have 2 main gateways types in dr_gateways, type=1 for 
>> our SBC and type=2 for our freeswitch servers.
>>
>> 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;
>>
>> if(dr_is_gw("$avp(originURI)","1"))
>>
>> Where $avp(originURI) = source IP of freeswitch type=2, opensips 
>> keeps stating its from the SBC, type=1.
>>
>> This only happens after upgrade, so works fine with 2.2
>>
>> Has this function changed between versions? Has anyone else had this 
>> issue where its matching the source IP against the wrong type?
>>
>> Please let me know if I need to change the syntax I am adding to the 
>> function!
>>
>> Many thanks
>>
>> Jon
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org <mailto: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/20180110/70481b2c/attachment.html>


More information about the Users mailing list