DSIP sending internal IP in SDP packet instead of external

71 views
Skip to first unread message

Eris

unread,
Apr 7, 2025, 12:24:35 PMApr 7
to dSIPRouter
Hello, I just set up DSIP behind a router with 1 interface on it. The external and internal IPs are set in the kamailio.cfg file. I am passing through traffic to a FreePBX server. When I register a phone and try to make the call the SDP packet from DSIP has a record-route that has the internal IP instead of the external.

Airsay

unread,
Apr 8, 2025, 10:44:12 AMApr 8
to dSIPRouter

Is your endpoint registered to FreePBX with DSR as the outbound proxy? If yes, is your registration to DSR on your LAN or from an external network? I had a ton of trouble with one-way audio when I had a similar setup as you a couple of years ago when I first spun up DSR. Share redacted pcaps if you can

Eris

unread,
Apr 14, 2025, 8:16:58 AMApr 14
to dSIPRouter
Yes, endpoint is registered with dsip as the outbound proxy. registration is from an external IP to DSIP. I will grab a PCAP shortly.

Eris

unread,
Apr 14, 2025, 9:07:46 AMApr 14
to dSIPRouter
OK see attached. DSIP is at 74.208.211.105, customer is at 192.0.50.211.
DSIP has 1 NIC at 10.0.90.104.
The FPBX server is at 10.0.91.11.

If you look at the sdp sent to the phone, the header has the private IP instead of the external IP that the responses actually need to be sent to.

I did check the kamailio.cfg and see:


#!substdef "!EXTERNAL_IP_ADDR!74.208.211.105!g"

So i know that is at least defined.

On Tuesday, April 8, 2025 at 10:44:12 AM UTC-4 airsay...@gmail.com wrote:
dsip_san.pcap

Airsay

unread,
Apr 14, 2025, 10:41:48 AMApr 14
to Eris, dSIPRouter
On a road trip at the moment. Will try to take a look when I get some time later on Tuesday 
Sent from my iPhone

On 14 Apr 2025, at 14:07, Eris <wesmp...@gmail.com> wrote:

OK see attached. DSIP is at 74.208.211.105, customer is at 192.0.50.211.
--
You received this message because you are subscribed to a topic in the Google Groups "dSIPRouter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dSIPRouter/2C5uaC38leg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dSIPRouter+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dSIPRouter/f44317ef-718d-464b-8948-099db0d1babdn%40googlegroups.com.
<dsip_san.pcap>

Eris

unread,
Apr 17, 2025, 9:18:54 AMApr 17
to dSIPRouter
Hey there -  I dont mean to rush you and realize you're helping on your own time - just wanted to check if you had any chance to check that pcap?

Micah Quinn

unread,
May 22, 2025, 12:12:58 AMMay 22
to dSIPRouter
Hello Eris,

I find myself in a very similar situation to you. I'm currently running v0.76 of dSIPRouter. I'm attempting to connect phones to PBXs hosted behind a firewall. I've setup domains and endpoint groups as pass-through proxies. I also had the issues you described with one-way audio and PBXs trying to send RTP to the phones LAN address. I've recently had some success by adding "rtpengine_manage()" at two locations within kamailio.cfg (Base on https://nickvsnetworking.com/kamailio-bytes-rtp-media-proxying-with-rtpengine/). I'll document them here for you. Perpahs you can reproduce my results:

1622-                route(SET_DST_SIGNALLING);
1623-                route(SET_DST_MEDIA);
1624-        }
1625- # check for serverside NAT
1626- route(SERVERNATDETECT);
1627: rtpengine_manage();
1628- # only set Record-Route and destination info for dialog creating/updating requests
1629- if (is_method("INVITE|SUBSCRIBE|REFER") && !has_totag()) {
1630- route(SET_RECORD_ROUTE);
1631- }
1632-
--
3724- xlog("L_ERR", "could not update sdp\n");
3725- }
3726- }
3727- }
3728- }
3729: rtpengine_manage();
3730- # TODO: why are we dropping 183 replies to MSTEAMS? - marked for review/validation
3731- if (t_check_status("183") && isbflagset(FLB_DST_MSTEAMS)) {
3732- drop();
3733- }
3734-

Micah Quinn

unread,
May 22, 2025, 7:37:02 AMMay 22
to dSIPRouter

In addition to the above two adds, I also changed a couple of things related to our firewall.

1. I made sure the default gateway for the PBX and dSIPRouter were the same. I'm not 100% sure this is necessary, but I noticed that the PBX would attempt to send outbound RTP via it's gateway instead of back through the RTP proxy. Aligning default gateways along with #2 below seems to have mitigated that issue.
2. I enabled NAT reflection on the RTP firewall port forwarding rules. I did this after noticing that extension-to-PBX calls like voice-mail and the like were not getting audio. I also saw that the PBX was reaching out again through the external IP of the proxy, so hairpinning allows this.

I'm not sure that any of this is the "correct" way to solve these issues, but this is the most consistent I've had dSIPRouter for my use-case since I tried implementing it.

Alfredo Salas

unread,
Jun 16, 2025, 5:29:58 PMJun 16
to dSIPRouter
Hello,

Just to let you know I had the same issue.  The dSIPRouter v0.77 as a SIP Proxy for 2 FreePBX using chan_sip. All devices behind a NAT. The Firewall did port forwaded UDP 5060 and range UDP 10000-20000 and TCP 5061 to dSIPRouter Private IP.  One way audio when trying to call from IP Phone located in the internet.  The (c ) atribute in DSP  returning to IPPHONE from dSIPRouter is comming with the FreePBX Internal IP instead of the dSIPRouter Public IP.

I made the change you suggested (adding  " rtpengine_manage();"  to lines 1627 and 3729) and it fixed the issue.  The DSP is coming with ( c ) with the Public IP.

Thanks!

Alfredo 
Reply all
Reply to author
Forward
0 new messages