[OpenSIPS-Users] $ai transformation

Ehrny y at jettel.ru
Wed Nov 16 23:29:57 CET 2016

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 ( which is behind private NIC eth0 (
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 ->
SIP/2.0 180 Ringing Via: SIP/2.0/UDP;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:;r2=on;lr;ftag=2F81324631;did=3a2.4667b68<sip:;r2=on;lr;ftag=2F81324631353641A405EA00;did=3a2.4667b68>> From: sip:300940 at domain.com;tag=2F81324631<sip:300940 at domain.com;tag=2F81324631353641A405EA00> To: sip:300905 at domain.com:5060;tag=231469dIr894p0D461D0t66 Call-ID: 020A3EA03A8 at SFESIP4-id1-ext CSeq: 1 INVITE Contact: <sip:54321 at x.x.82.139:5060>

I’m not sure if I do it right way because the packet (sip5) goes to 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,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20161116/1ffc951c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2016-11-16.jpg
Type: image/jpeg
Size: 27645 bytes
Desc: 2016-11-16.jpg
URL: <http://lists.opensips.org/pipermail/users/attachments/20161116/1ffc951c/attachment-0001.jpg>

More information about the Users mailing list