Using dynamic DNS causes incoming calls cut off at 32 seconds

I know this is a tired topic… outgoing calls are fine, incoming calls drop after 32 seconds.

I was able to solve the problem by changing my External address in NAT settings under Asterisk SIP settings to my external IP address instead of my dynamic DNS address ( The problem is I have a dynamic IP address, so I can’t leave that as an IP address.

I thought the point of having a dynamic DNS address was so I could put that in the external address field. Am I mistaken? Will the external address auto-update if the external IP address changes?

(Oh, and yes, the dynamic DNS domain resolves to the correct external IP address, the same as the IP entered in “external address” that works.)

Yes, by definition , if your address is dynamic it means it changes,

You need a ‘dynamic DNS’ service that updates your ‘name’ to your changing IP address, but by nature, your underlying A record will take it’s TTL (time to live) to propagate around the internet which depending on the NS resolver the client uses, expect many minutes, If you want that not to happen, you need to get a static IP, there is no other resolution

The point of dynamic DNS is to work around the use of a low grade consumer quality internet service, but there are various levels of such service. Good ones will stick on the same address unless, you disconnect from them for an extended period. Some may not survive a short disconnection. Some may change the address at intervals (possibly to discourage the use of servers). And some may change the address each time a TCP or UDP session starts.

I understand the limitations of dynamic DNS as opposed to a static IP.

What I don’t understand is why I cannot use my dynamic dns hostname in the external address field.

Edit: To clarify, this isn’t a TTL problem. The DNS is resolving correctly, but the audio on inbound calls drops after 30 seconds if I don’t use the IP address as the "external address. "

Are you by chance using a chan_sip trunk?

1 Like

No. PJSIP with Twilio.

Show a PCAP of the call so we can see what is being used in the SDP for the audio IP.

1 Like

I don’t have a PCAP yet, but I can get one later today. In the meantime, I have an asterisk log from yesterday if that helps…

As I look at it (as a newbie), this line stands out to me:

17281 [2024-04-11 16:15:03] VERBOSE[8717][C-00000004] app_dial.c: Connected line update to PJSIP/Twilio-00000006 prevented.

At the Asterisk command prompt, type
pjsip set logger on
make another failing incoming call and paste a new log (which will now include a SIP trace).

BTW, please leave ‘Paste Expiration’ at the default setting of Never, so future readers who come across this thread will be able to follow along.

1 Like

That isn’t related. Is this PBX behind a firewall/NAT?

Here’s a capture with pjsip logging enabled. I think I cut it at the beginning and end correctly. But I didn’t try to remove any of the chatter in the middle between all my extensions, etc.

Yes. It is behind a firewall that is forwarding all UDP and TCP traffic coming in on ports 5060,5061,10000-60000 to the local Freepbx server internal IP address.

Line 192:
Contact: <sip:>

I’m guessing that is also your host name and has an entry in /etc/hosts mapping it to This overrides the dynamic DNS value, causing the bad Contact header.

If this is indeed the case, either change the dynamic DNS name (which does correctly map to your Fuse IP address) or the local hostname, so they don’t conflict. Otherwise, provide details about /etc/hosts or other location that is causing the bad mapping.



At some point I must have been confused about hostname, thinking it needed to be the FQDN the machine is reachable at (which is the dynamic DNS name). After reading more, I think I understand what I did wrong.

After changing the machine hostname and restarting, it appears to be working properly. Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.