[OpenSIPS-Users] $ai transformation

Răzvan Crainea razvan at opensips.org
Tue Nov 22 18:32:36 CET 2016


Hi, Ehrny!

If you completely remove the force_send_socket() and any $fs settings in 
onreply_route, is it doing the same thing?
Normally the reply should be automatically routed through the same 
interface the request came from. Not sure why your reply goes over the 
other one. I willtry to replicate this and let you know if it works or not.

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 11/21/2016 06:40 PM, Ehrny wrote:
>
> Hi Răzvan,
>
> Thanks for your help.
>
> The call needs to be done through multi homed OpenSIPs  (I don’t use 
> mhomed flag)
>
> Caller  -> Carrier1 -> OpenSIPs(eth1)---OpenSIPs(eth0) -> pbx -> Callee
>
> $var(upstream1) = $(hdr(Via)[0]{via.host});     returned the IP 
>  address I needed
>
> OpenSIPs(eth1) has private IP , so on requests I use 
> force_send_socket(udp:OpenSIPs_PUB_IP:5060)  to be able to send call 
> to further destinations. When replies are back I need to change send 
> _socket back to privateIP for the answers to Carrier1.
>
> I’ve got the IP address of the Carrier1 in the onreply_route .
>
> onreply_route[1] {
>
>>
> if ($(var(upstream1)) == "10.250.242.74") {
>
> force_send_socket(udp:10.197.26.170:5060);
>
> }
>
>>
> }
>
> It doesn’t seem to change ip address for replies .
>
> Would you please advise me how to change send_socket in onreply_route ?
>
> Kind regards,
>
> Ehrny
>
> *From:*users-bounces at lists.opensips.org 
> <mailto:users-bounces at lists.opensips.org> 
> [mailto:users-bounces at lists.opensips.org] *On Behalf Of *Razvan Crainea
> *Sent:* Monday, November 21, 2016 1:32 PM
> *To:* users at lists.opensips.org <mailto:users at lists.opensips.org>
> *Subject:* Re: [OpenSIPS-Users] $ai transformation
>
> Hi, Ehrny!
>
> You need the IP address of whom? Caller? Callee?
> $rd is null because a reply does not have a R-URI. Perhaps the reply 
> doesn't have a received parameter in the reply either, that's why it 
> is empty.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutions
> www.opensips-solutions.com <http://www.opensips-solutions.com>
>
> On 11/21/2016 12:13 PM, Ehrny wrote:
>
>     Hello Răzvan,
>
>     I need to do some routing in onreply_route[] based on destination IP.
>
>     Tried  $rd with no avail , it returns null
>
>     If I get you right regarding context, the var  
>          $var(upstream0) = $(hdr(Via)[0]{via.received});   Is empty also.
>
>     What is the right way to get an IP address in replies and do
>     further routing?
>
>     Kind regards,
>
>     Ehrny
>
>     *From:*users-bounces at lists.opensips.org
>     <mailto:users-bounces at lists.opensips.org>
>     [mailto:users-bounces at lists.opensips.org] *On Behalf Of *Razvan
>     Crainea
>     *Sent:* Monday, November 21, 2016 11:50 AM
>     *To:* users at lists.opensips.org <mailto:users at lists.opensips.org>
>     *Subject:* Re: [OpenSIPS-Users] $ai transformation
>
>     Hi, Ehrny!
>
>     You don't need to use contexts in the onreply_route[], because
>     that route is already ran in the context of the reply message.
>
>     Best regards,
>
>
>     Răzvan Crainea
>
>     OpenSIPS Solutions
>
>     www.opensips-solutions.com <http://www.opensips-solutions.com>
>
>
>
> _______________________________________________
> Users mailing list
> 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/20161122/d6e77080/attachment.htm>


More information about the Users mailing list