[OpenSIPS-Users] $ai transformation
Ehrny
y at jettel.ru
Wed Nov 23 11:19:55 CET 2016
Hi Răzvan,
Yes I can. Would you please shoot me e–mail so I’ll be able to send it.
Thanks for your kind help,
Ehrny
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Wednesday, November 23, 2016 12:25 PM
To: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] $ai transformation
Hi, Ehrny!
I've just tested, and for me it works as it should - the reply goes through the interface it came from. Is there any chance you could send me your script (privately)? Perhaps I can spot some problems by looking at it.
Best regards,
Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com<http://www.opensips-solutions.com>
On 11/22/2016 07:45 PM, Ehrny wrote:
Hi Răzvan,
I’ve tried both
# force_send_socket(udp:10.197.26.170:5060);
and
$fs="udp:10.197.26.170:5060";
with no luck ((
Without any of these lines it doesn’t work either ((
Ps.. in the main request routing logic I use
force_send_socket(udp:x.x.82.39:5060);
Best 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: Tuesday, November 22, 2016 8:33 PM
To: users at lists.opensips.org<mailto:users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] $ai transformation
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 will try to replicate this and let you know if it works or not.
Best regards,
Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com<http://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<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
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/20161123/b8fc831d/attachment-0001.htm>
More information about the Users
mailing list