Re: [OpenSIPS-Users] $ai transformation

2016-11-23 Thread Ehrny
Hi Răzvan,
if it’s possible, you can shoot me email to 
settest...@aol.com<mailto:settest...@aol.com>
Thanks as ever


From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Ehrny
Sent: Wednesday, November 23, 2016 1:20 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] $ai transformation

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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Wednesday, November 23, 2016 12:25 PM
To: users@lists.opensips.org<mailto:users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Tuesday, November 22, 2016 8:33 PM
To: users@lists.opensips.org<mailto:users@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>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-23 Thread Ehrny
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-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Wednesday, November 23, 2016 12:25 PM
To: users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Tuesday, November 22, 2016 8:33 PM
To: users@lists.opensips.org<mailto:users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 21, 2016 1:32 PM
To: users@lists.opensips.org<mailto:users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 21, 2016 11:50 AM
To: users@lists.opensips.org<mailto:users@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@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users





___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-23 Thread Răzvan Crainea

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 problemsby looking 
at it.


Best regards,

Răzvan Crainea
OpenSIPS Solutions
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-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Razvan Crainea

*Sent:* Tuesday, November 22, 2016 8:33 PM
*To:* users@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-boun...@lists.opensips.org
<mailto:users-boun...@lists.opensips.org>
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Razvan
Crainea
*Sent:* Monday, November 21, 2016 1:32 PM
*To:* users@lists.opensips.org <mailto:users@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-boun...@lists.opensips.org
<mailto:users-boun...@lists.opensips.org>
[mailto:users-boun...@lists.opensips.org] *On Behalf Of
*Razvan Crainea
*Sent:* Monday, November 21, 2016 11:50 AM
*To:* users@lists.opensips.org <mailto:users@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@lists.opensips.org <mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-22 Thread Ehrny
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-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Tuesday, November 22, 2016 8:33 PM
To: users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 21, 2016 1:32 PM
To: users@lists.opensips.org<mailto:users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 21, 2016 11:50 AM
To: users@lists.opensips.org<mailto:users@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@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-22 Thread Răzvan Crainea

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-boun...@lists.opensips.org 
<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Razvan Crainea

*Sent:* Monday, November 21, 2016 1:32 PM
*To:* users@lists.opensips.org <mailto:users@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-boun...@lists.opensips.org
<mailto:users-boun...@lists.opensips.org>
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Razvan
Crainea
*Sent:* Monday, November 21, 2016 11:50 AM
*To:* users@lists.opensips.org <mailto:users@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@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-21 Thread Ehrny
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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 21, 2016 1:32 PM
To: users@lists.opensips.org<mailto:users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 21, 2016 11:50 AM
To: users@lists.opensips.org<mailto:users@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@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-21 Thread Răzvan Crainea

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

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-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Razvan Crainea

*Sent:* Monday, November 21, 2016 11:50 AM
*To:* users@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>

On 11/19/2016 10:40 PM, Ehrny wrote:

Dear Răzvan,

… I’ve tried to add variable to onreply_route[1]

$var(upstream0) = $(hdr(Via)[0]{via.param,received});

xlog("upstream0  =  $var(upstream0) \n");

and in the log I get critical alert:

CRITICAL:tm:tm_pv_context_reply: no picked branch (-1) for a final
response

*From:*users-boun...@lists.opensips.org
<mailto:users-boun...@lists.opensips.org>
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Ehrny
*Sent:* Saturday, November 19, 2016 2:06 PM
*To:* OpenSIPS users mailling list
*Subject:* Re: [OpenSIPS-Users] $ai transformation

Hi Răzvan,

I gues so.

I’ve got  t_on_reply("1");   in the route

and at the end of the script there is:

onreply_route[1] {

force_send_socket(udp:10.197.26.170:5060);

}

But it doesn’t seem to change send_socket back to priv IP addr ((

Kind regards,

Ehrny

*From:*users-boun...@lists.opensips.org
<mailto:users-boun...@lists.opensips.org>
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Razvan
Crainea
*Sent:* Friday, November 18, 2016 12:22 PM
*To:* users@lists.opensips.org <mailto:users@lists.opensips.org>
*Subject:* Re: [OpenSIPS-Users] $ai transformation

Hi, Ehrny!

Did you try setting the private socket on the reply?

Best regards,


Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com <http://www.opensips-solutions.com>

On 11/17/2016 01:00 AM, Ehrny wrote:

Dear Răzvan,

Thanks again for the prompt help. I was able to change the
headers as needed but I’m stuck with another problem(

I’ve got opensips with two Ethernet adapters, eth1 as a
private and another one eth0 as public.  Opensips works fine
when the call is coming on the public eth0 and leaves opensips
through the same public adapter. (All the GWs are behind that
public eth0 instead of one ). The problem happens when the
call comes in through the private eth1, please see the drawing
in attachment.

-sip1.  After I’ve got invite from provider on the private
eth1 , I send it through the public eth0.

-sip2.  I use force_send_socket(udp:PUBLIC_IP:PORT) for the
call to be able to pass through the opensips and come back
from external GW (x.x.82.139). I also change SIP Request's URI
and use uac_replace_to () to change these fields as needed.

-sip4.  Opensips has got 180 Ringing from external GW
(x.x.82.139)

-sip5.  Opensips tries to send it back to originator
(10.250.242.74) which is behind private NIC eth0 (10.197.26.170)

the call can not be set up because I send reply from my public
eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060

SIP/2.0 *180* Ringing Via: SIP/2.0/UDP
10.250.242.74:5060;branch=*z9hG4bKqci5ec *Record-Route:
<sip:x.x.80.43;r2=on;lr;ftag=*2F81324631*;did=3a2.4667b68
<sip:x.x.80.43;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
Record-Route:
<sip:10.197.26.170;r2=on;lr;ftag=*2F81324631*;did=3a2.4667b68

<sip:10.197.26.170;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
From: sip:300...@domain.com;tag=*2F81324631*
<sip:300...@domain.com;tag=2F81324631353641A405EA00> To:
sip:300...@domain.com:5060;tag=231469dIr894
<sip:300...@domain.com:5060;tag=231469dIr894p0D461D0t66>
Call-ID: *020A3EA03A8@SFESIP4-id1-ext* CSeq: 1 INVITE Contact:
<sip:54321@x.x.82.139:5060>

I’m not sure if I do it righ

Re: [OpenSIPS-Users] $ai transformation

2016-11-21 Thread Ehrny
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-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 21, 2016 11:50 AM
To: users@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>
On 11/19/2016 10:40 PM, Ehrny wrote:
Dear Răzvan,
… I’ve tried to add variable to onreply_route[1]
$var(upstream0) = $(hdr(Via)[0]{via.param,received});
xlog("upstream0  =  $var(upstream0) \n");

and in the log I get critical alert:
CRITICAL:tm:tm_pv_context_reply: no picked branch (-1) for a final response




From: users-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Ehrny
Sent: Saturday, November 19, 2016 2:06 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] $ai transformation

Hi Răzvan,
I gues so.
I’ve got  t_on_reply("1");   in the route

and at the end of the script there is:

onreply_route[1] {
force_send_socket(udp:10.197.26.170:5060);
}

But it doesn’t seem to change send_socket back to priv IP addr ((

Kind regards,
Ehrny




From: users-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Friday, November 18, 2016 12:22 PM
To: users@lists.opensips.org<mailto:users@lists.opensips.org>
Subject: Re: [OpenSIPS-Users] $ai transformation

Hi, Ehrny!

Did you try setting the private socket on the reply?

Best regards,



Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com<http://www.opensips-solutions.com>
On 11/17/2016 01:00 AM, Ehrny wrote:
Dear Răzvan,
Thanks again for the prompt help. I was able to change the headers as needed 
but I’m stuck with another problem(
I’ve got opensips with two Ethernet adapters, eth1 as a private and another one 
eth0 as public.  Opensips works fine when the call is coming on the public eth0 
and leaves opensips through the same public adapter. (All the GWs are behind 
that public eth0 instead of one ). The problem happens when the call comes in 
through the private eth1, please see the drawing in attachment.

-  sip1.  After I’ve got invite from provider on the private eth1 , I 
send it through the public eth0.

-  sip2.  I use   force_send_socket(udp:PUBLIC_IP:PORT) for the call to 
be able to pass through the opensips and come back from external GW 
(x.x.82.139). I also change SIP Request's URI and use uac_replace_to () to 
change these fields as needed.

-  sip4.  Opensips has got 180 Ringing from external GW (x.x.82.139)

-  sip5.  Opensips tries to send it back to originator (10.250.242.74) 
which is behind private NIC eth0 (10.197.26.170)
the call can not be set up because I send reply from my public eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060
SIP/2.0 180 Ringing Via: SIP/2.0/UDP 10.250.242.74:5060;branch=z9hG4bKqci5ec 
Record-Route: 
<sip:x.x.80.43;r2=on;lr;ftag=2F81324631;did=3a2.4667b68<sip:x.x.80.43;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
 Record-Route: 
<sip:10.197.26.170;r2=on;lr;ftag=2F81324631;did=3a2.4667b68<sip:10.197.26.170;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
 From: 
sip:300...@domain.com;tag=2F81324631<sip:300...@domain.com;tag=2F81324631353641A405EA00>
 To: 
sip:300...@domain.com:5060;tag=231469dIr894<sip:300...@domain.com:5060;tag=231469dIr894p0D461D0t66>
 Call-ID: 020A3EA03A8@SFESIP4-id1-ext CSeq: 1 INVITE Contact: 
<sip:54321@x.x.82.139:5060>

I’m not sure if I do it right way because the packet (sip5) goes to 
10.250.242.74 with the source ip of public eth0 and not the one it should pass 
through to be able to come back.
What is the right way in my case to get the call through?
Thank you for all of your help,
Regards,
Ehrny






___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users





___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-21 Thread Răzvan Crainea

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

On 11/19/2016 10:40 PM, Ehrny wrote:


Dear Răzvan,

… I’ve tried to add variable to onreply_route[1]

$var(upstream0) = $(hdr(Via)[0]{via.param,received});

xlog("upstream0  =  $var(upstream0) \n");

and in the log I get critical alert:

CRITICAL:tm:tm_pv_context_reply: no picked branch (-1) for a final 
response


*From:*users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Ehrny

*Sent:* Saturday, November 19, 2016 2:06 PM
*To:* OpenSIPS users mailling list
*Subject:* Re: [OpenSIPS-Users] $ai transformation

Hi Răzvan,

I gues so.

I’ve got  t_on_reply("1");   in the route

and at the end of the script there is:

onreply_route[1] {

force_send_socket(udp:10.197.26.170:5060);

}

But it doesn’t seem to change send_socket back to priv IP addr ((

Kind regards,

Ehrny

*From:*users-boun...@lists.opensips.org 
<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] *On Behalf Of *Razvan Crainea

*Sent:* Friday, November 18, 2016 12:22 PM
*To:* users@lists.opensips.org <mailto:users@lists.opensips.org>
*Subject:* Re: [OpenSIPS-Users] $ai transformation

Hi, Ehrny!

Did you try setting the private socket on the reply?

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com <http://www.opensips-solutions.com>

On 11/17/2016 01:00 AM, Ehrny wrote:

Dear Răzvan,

Thanks again for the prompt help. I was able to change the headers
as needed but I’m stuck with another problem(

I’ve got opensips with two Ethernet adapters, eth1 as a private
and another one eth0 as public.  Opensips works fine when the call
is coming on the public eth0 and leaves opensips through the same
public adapter. (All the GWs are behind that public eth0 instead
of one ). The problem happens when the call comes in through the
private eth1, please see the drawing in attachment.

-sip1.  After I’ve got invite from provider on the private eth1 ,
I send it through the public eth0.

-sip2.  I use force_send_socket(udp:PUBLIC_IP:PORT) for the call
to be able to pass through the opensips and come back from
external GW (x.x.82.139). I also change SIP Request's URI and use
uac_replace_to () to change these fields as needed.

-sip4.  Opensips has got 180 Ringing from external GW (x.x.82.139)

-sip5.  Opensips tries to send it back to originator
(10.250.242.74) which is behind private NIC eth0 (10.197.26.170)

the call can not be set up because I send reply from my public eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060

SIP/2.0 *180* Ringing Via: SIP/2.0/UDP
10.250.242.74:5060;branch=*z9hG4bKqci5ec *Record-Route:
<sip:x.x.80.43;r2=on;lr;ftag=*2F81324631*;did=3a2.4667b68
<sip:x.x.80.43;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
Record-Route:
<sip:10.197.26.170;r2=on;lr;ftag=*2F81324631*;did=3a2.4667b68
<sip:10.197.26.170;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
From: sip:300...@domain.com;tag=*2F81324631*
<sip:300...@domain.com;tag=2F81324631353641A405EA00> To:
sip:300...@domain.com:5060;tag=231469dIr894
<sip:300...@domain.com:5060;tag=231469dIr894p0D461D0t66> Call-ID:
*020A3EA03A8@SFESIP4-id1-ext* CSeq: 1 INVITE Contact:
<sip:54321@x.x.82.139:5060>

I’m not sure if I do it right way because the packet (sip5) goes
to 10.250.242.74 with the source ip of public eth0 and not the one
it should pass through to be able to come back.

What is the right way in my case to get the call through?

Thank you for all of your help,

Regards,

Ehrny



___

Users mailing list

Users@lists.opensips.org <mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-19 Thread Ehrny
Dear Răzvan,
… I’ve tried to add variable to onreply_route[1]
$var(upstream0) = $(hdr(Via)[0]{via.param,received});
xlog("upstream0  =  $var(upstream0) \n");

and in the log I get critical alert:
CRITICAL:tm:tm_pv_context_reply: no picked branch (-1) for a final response




From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Ehrny
Sent: Saturday, November 19, 2016 2:06 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] $ai transformation

Hi Răzvan,
I gues so.
I’ve got  t_on_reply("1");   in the route

and at the end of the script there is:

onreply_route[1] {
force_send_socket(udp:10.197.26.170:5060);
}

But it doesn’t seem to change send_socket back to priv IP addr ((

Kind regards,
Ehrny




From: users-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org> 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Friday, November 18, 2016 12:22 PM
To: users@lists.opensips.org<mailto:users@lists.opensips.org>
Subject: Re: [OpenSIPS-Users] $ai transformation

Hi, Ehrny!

Did you try setting the private socket on the reply?

Best regards,


Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com<http://www.opensips-solutions.com>
On 11/17/2016 01:00 AM, Ehrny wrote:
Dear Răzvan,
Thanks again for the prompt help. I was able to change the headers as needed 
but I’m stuck with another problem(
I’ve got opensips with two Ethernet adapters, eth1 as a private and another one 
eth0 as public.  Opensips works fine when the call is coming on the public eth0 
and leaves opensips through the same public adapter. (All the GWs are behind 
that public eth0 instead of one ). The problem happens when the call comes in 
through the private eth1, please see the drawing in attachment.

-  sip1.  After I’ve got invite from provider on the private eth1 , I 
send it through the public eth0.

-  sip2.  I use   force_send_socket(udp:PUBLIC_IP:PORT) for the call to 
be able to pass through the opensips and come back from external GW 
(x.x.82.139). I also change SIP Request's URI and use uac_replace_to () to 
change these fields as needed.

-  sip4.  Opensips has got 180 Ringing from external GW (x.x.82.139)

-  sip5.  Opensips tries to send it back to originator (10.250.242.74) 
which is behind private NIC eth0 (10.197.26.170)
the call can not be set up because I send reply from my public eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060
SIP/2.0 180 Ringing Via: SIP/2.0/UDP 10.250.242.74:5060;branch=z9hG4bKqci5ec 
Record-Route: 
<sip:x.x.80.43;r2=on;lr;ftag=2F81324631;did=3a2.4667b68<sip:x.x.80.43;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
 Record-Route: 
<sip:10.197.26.170;r2=on;lr;ftag=2F81324631;did=3a2.4667b68<sip:10.197.26.170;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
 From: 
sip:300...@domain.com;tag=2F81324631<sip:300...@domain.com;tag=2F81324631353641A405EA00>
 To: 
sip:300...@domain.com:5060;tag=231469dIr894<sip:300...@domain.com:5060;tag=231469dIr894p0D461D0t66>
 Call-ID: 020A3EA03A8@SFESIP4-id1-ext CSeq: 1 INVITE Contact: 
<sip:54321@x.x.82.139:5060>

I’m not sure if I do it right way because the packet (sip5) goes to 
10.250.242.74 with the source ip of public eth0 and not the one it should pass 
through to be able to come back.
What is the right way in my case to get the call through?
Thank you for all of your help,
Regards,
Ehrny





___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-19 Thread Ehrny
Hi Răzvan,
I gues so.
I’ve got  t_on_reply("1");   in the route

and at the end of the script there is:

onreply_route[1] {
force_send_socket(udp:10.197.26.170:5060);
}

But it doesn’t seem to change send_socket back to priv IP addr ((

Kind regards,
Ehrny




From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Friday, November 18, 2016 12:22 PM
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] $ai transformation

Hi, Ehrny!

Did you try setting the private socket on the reply?

Best regards,



Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com<http://www.opensips-solutions.com>
On 11/17/2016 01:00 AM, Ehrny wrote:
Dear Răzvan,
Thanks again for the prompt help. I was able to change the headers as needed 
but I’m stuck with another problem(
I’ve got opensips with two Ethernet adapters, eth1 as a private and another one 
eth0 as public.  Opensips works fine when the call is coming on the public eth0 
and leaves opensips through the same public adapter. (All the GWs are behind 
that public eth0 instead of one ). The problem happens when the call comes in 
through the private eth1, please see the drawing in attachment.

-  sip1.  After I’ve got invite from provider on the private eth1 , I 
send it through the public eth0.

-  sip2.  I use   force_send_socket(udp:PUBLIC_IP:PORT) for the call to 
be able to pass through the opensips and come back from external GW 
(x.x.82.139). I also change SIP Request's URI and use uac_replace_to () to 
change these fields as needed.

-  sip4.  Opensips has got 180 Ringing from external GW (x.x.82.139)

-  sip5.  Opensips tries to send it back to originator (10.250.242.74) 
which is behind private NIC eth0 (10.197.26.170)
the call can not be set up because I send reply from my public eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060
SIP/2.0 180 Ringing Via: SIP/2.0/UDP 10.250.242.74:5060;branch=z9hG4bKqci5ec 
Record-Route: 
<sip:x.x.80.43;r2=on;lr;ftag=2F81324631;did=3a2.4667b68<sip:x.x.80.43;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
 Record-Route: 
<sip:10.197.26.170;r2=on;lr;ftag=2F81324631;did=3a2.4667b68<sip:10.197.26.170;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>>
 From: 
sip:300...@domain.com;tag=2F81324631<sip:300...@domain.com;tag=2F81324631353641A405EA00>
 To: 
sip:300...@domain.com:5060;tag=231469dIr894<sip:300...@domain.com:5060;tag=231469dIr894p0D461D0t66>
 Call-ID: 020A3EA03A8@SFESIP4-id1-ext CSeq: 1 INVITE Contact: 
<sip:54321@x.x.82.139:5060>

I’m not sure if I do it right way because the packet (sip5) goes to 
10.250.242.74 with the source ip of public eth0 and not the one it should pass 
through to be able to come back.
What is the right way in my case to get the call through?
Thank you for all of your help,
Regards,
Ehrny






___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-19 Thread xiaofeng
>> I’ve got opensips with two Ethernet adapters, eth1 as a private and
another one eth0 as public.  Opensips works fine when the call is coming on
the public eth0 and leaves opensips through the same public adapter. (All
the GWs are behind that public eth0 instead of one ). The problem happens
when the call comes in through the private eth1, please see the drawing in
attachment.
>>

This maybe helpful.
https://www.opensips.org/Documentation/Script-CoreParameters-1-11#toc72
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-18 Thread Răzvan Crainea

Hi, Ehrny!

Did you try setting the private socket on the reply?

Best regards,

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

On 11/17/2016 01:00 AM, Ehrny wrote:


Dear Răzvan,

Thanks again for the prompt help. I was able to change the headers as 
needed but I’m stuck with another problem(


I’ve got opensips with two Ethernet adapters, eth1 as a private and 
another one eth0 as public.  Opensips works fine when the call is 
coming on the public eth0 and leaves opensips through the same public 
adapter. (All the GWs are behind that public eth0 instead of one ). 
The problem happens when the call comes in through the private eth1, 
please see the drawing in attachment.


-sip1.  After I’ve got invite from provider on the private eth1 , I 
send it through the public eth0.


-sip2.  I use force_send_socket(udp:PUBLIC_IP:PORT) for the call to be 
able to pass through the opensips and come back from external GW 
(x.x.82.139). I also change SIP Request's URI and use uac_replace_to 
() to change these fields as needed.


-sip4.  Opensips has got 180 Ringing from external GW (x.x.82.139)

-sip5.  Opensips tries to send it back to originator (10.250.242.74) 
which is behind private NIC eth0 (10.197.26.170)


the call can not be set up because I send reply from my public eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060

SIP/2.0 *180*Ringing Via: SIP/2.0/UDP 
10.250.242.74:5060;branch=*z9hG4bKqci5ec***Record-Route: 
> 
Record-Route: 
> 
From: sip:300...@domain.com;tag=*2F81324631* 
 To: 
sip:300...@domain.com:5060;tag=231469dIr894 
 Call-ID: 
*020A3EA03A8@SFESIP4-id1-ext*CSeq: 1 INVITE Contact: 



I’m not sure if I do it right way because the packet (sip5) goes to 
10.250.242.74 with the source ip of public eth0 and not the one it 
should pass through to be able to come back.


What is the right way in my case to get the call through?

Thank you for all of your help,

Regards,

Ehrny



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-17 Thread Ehrny
Dear Răzvan,
Thanks again for the prompt help. I was able to change the headers as needed 
but I’m stuck with another problem(
I’ve got opensips with two Ethernet adapters, eth1 as a private and another one 
eth0 as public.  Opensips works fine when the call is coming on the public eth0 
and leaves opensips through the same public adapter. (All the GWs are behind 
that public eth0 instead of one ). The problem happens when the call comes in 
through the private eth1, please see the drawing in attachment.

-  sip1.  After I’ve got invite from provider on the private eth1 , I 
send it through the public eth0.

-  sip2.  I use   force_send_socket(udp:PUBLIC_IP:PORT) for the call to 
be able to pass through the opensips and come back from external GW 
(x.x.82.139). I also change SIP Request's URI and use uac_replace_to () to 
change these fields as needed.

-  sip4.  Opensips has got 180 Ringing from external GW (x.x.82.139)

-  sip5.  Opensips tries to send it back to originator (10.250.242.74) 
which is behind private NIC eth0 (10.197.26.170)
the call can not be set up because I send reply from my public eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060
SIP/2.0 180 Ringing Via: SIP/2.0/UDP 10.250.242.74:5060;branch=z9hG4bKqci5ec 
Record-Route: 
>
 Record-Route: 
>
 From: 
sip:300...@domain.com;tag=2F81324631
 To: sip:300...@domain.com:5060;tag=231469dIr894p0D461D0t66 Call-ID: 
020A3EA03A8@SFESIP4-id1-ext CSeq: 1 INVITE Contact: 

I’m not sure if I do it right way because the packet (sip5) goes to 
10.250.242.74 with the source ip of public eth0 and not the one it should pass 
through to be able to come back.
What is the right way in my case to get the call through?
Thank you for all of your help,
Regards,
Ehrny


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-16 Thread Ehrny
Dear Răzvan,
Thanks again for the prompt help. I was able to change the headers as needed 
but I’m stuck with another problem(
I’ve got opensips with two Ethernet adapters, eth1 as a private and another one 
eth0 as public.  Opensips works fine when the call is coming on the public eth0 
and leaves opensips through the same public adapter. (All the GWs are behind 
that public eth0 instead of one ). The problem happens when the call comes in 
through the private eth1, please see the drawing in attachment.

-  sip1.  After I’ve got invite from provider on the private eth1 , I 
send it through the public eth0.

-  sip2.  I use   force_send_socket(udp:PUBLIC_IP:PORT) for the call to 
be able to pass through the opensips and come back from external GW 
(x.x.82.139). I also change SIP Request's URI and use uac_replace_to () to 
change these fields as needed.

-  sip4.  Opensips has got 180 Ringing from external GW (x.x.82.139)

-  sip5.  Opensips tries to send it back to originator (10.250.242.74) 
which is behind private NIC eth0 (10.197.26.170)
the call can not be set up because I send reply from my public eth1

2016-11-16 18:56:14  : x.x.80.43:5060 -> 10.250.242.74:5060
SIP/2.0 180 Ringing Via: SIP/2.0/UDP 10.250.242.74:5060;branch=z9hG4bKqci5ec 
Record-Route: 
>
 Record-Route: 
>
 From: 
sip:300...@domain.com;tag=2F81324631
 To: 
sip:300...@domain.com:5060;tag=231469dIr894
 Call-ID: 020A3EA03A8@SFESIP4-id1-ext CSeq: 1 INVITE Contact: 


I’m not sure if I do it right way because the packet (sip5) goes to 
10.250.242.74 with the source ip of public eth0 and not the one it should pass 
through to be able to come back.
What is the right way in my case to get the call through?
Thank you for all of your help,
Regards,
Ehrny


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] $ai transformation

2016-11-14 Thread Ehrny
Hi, Răzvan,
Very helpful,
Thank you very much.
Best Regards,
Ehrny

From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan Crainea
Sent: Monday, November 14, 2016 11:03 AM
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] $ai transformation

Hi, Ehrny!

Yes, you can transform the P-Asserted-Identity header as you wish, by dropping 
the existing one and creating a new one. Use the remove_hf()[1] and 
append_hf()[2] headers for that, i.e.:

if (is_present_hf("P-Asserted-Identity")) {
remove_hf("P-Asserted-Identity");
$avp(rpid) = "new-header";
append_hf("P-Asserted-Identity: $avp(rpid) 
<sip:$avp(rpid)@opensips.org><mailto:sip:$avp(rpid)@opensips.org>\r\n");
}

[1] http://www.opensips.org/html/docs/modules/2.2.x/sipmsgops.html#id293937
[2] http://www.opensips.org/html/docs/modules/2.2.x/sipmsgops.html#id249696

Best regards,


Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com<http://www.opensips-solutions.com>
On 11/13/2016 08:55 PM, Ehrny wrote:
Hello team,
I’m trying to follow my carrier’s request to transform P-Asserted-Identity 
header.
Is there any possibilities to do that on the fly with opensips (v2.2.2)?
Yet another project assume to add the redirecting number even if it’s not 
exists. Would it be possible to add it in the route?
Your help is really appreciated,

Best Regards,
Ehrny






___

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users