SIP configuration problem

Hello, I'm currently having a problem with a SIP extension.

Context: Two servers are being used as SIP extensions; one works and the other doesn't. (Same VLAN and same network settings)
During testing, the connection is established for 25 to 28 seconds and then drops.
In parallel, we discovered that the IAX link was constantly renegotiating the keys between them, so we disabled it.

These devices were also available with port 60450, which we modified to port 5060.

thank you
do

You need to provide a SIP trace, in PJSIP this is done using the “pjsip set logger on” CLI command after which you do a call that fails and then provide the output. It is most commonly NAT/Firewall/IP related.

On Tuesday 13 October 2026 at 18:05:58, mado_0699 wrote:

Hello, I’m currently having a problem with a SIP extension.

Context: Two servers are being used as SIP extensions; one works and the
other doesn’t.

Give us enough information about your setup so that we can reproduce the
problem.

If we don’t have enough information, we can only guess, which is probably a
waste of time.

Antony.

–
The lottery is a tax for people who can’t do maths.

A drop at 25 to 32 seconds is very often the 200 OK to the INVITE never being acknowledged. One side keeps retransmitting the 200 OK, never sees the ACK, and gives up after 64 × T1 = 32 seconds. Audio often works in the meantime, so the call looks fine until it drops.

When you capture the pjsip set logger on trace jcolp asked for, look for the same 200 OK being sent several times with no ACK between them. If that is what you see, the usual causes are:

  • The ACK goes to an address taken from the Contact header that is not reachable, such as a private IP or the wrong port. Your change from port 60450 to 5060 fits this pattern. On that endpoint check rewrite_contact=yes, force_rport=yes and rtp_symmetric=yes, and check local_net and external_signaling_address / external_media_address on the transport.
  • A SIP ALG on a router or firewall that rewrites packets on one path and not on the other. Since one device works and the other does not, compare what sits between each of them and Asterisk, and turn SIP ALG off.

We had calls dropping at exactly 32 seconds on our own system. In our case the transport’s external address was a host name that /etc/hosts resolved to 127.0.1.1, so Asterisk advertised a loopback address. Putting the public IP in as a literal fixed it.

Hello,
thank you for taking the time to reply. Regarding the public IP address, the IP PBX only acts as a relay, so I don't think I'm affected by this change.

What's extremely surprising is that another device on the same network, with the same functions, works perfectly.

Without logs there’s nothing else any of us can really say.

full_852.zip (9.9 MB)

Is this file sufficient?

The file does not contain the SIP trace I mentioned previously, so we are unable to see what happened from a SIP level. Since I see chan_sip usage in the file, the command for that is “sip set debug on”.

jcolp’s note about chan_sip is the important one, so to be concrete about what to send — the 9.9 MB zip almost certainly has everything except the one thing needed.

On the box, as root:

asterisk -rvvv
core set verbose 5
sip set debug on          ; chan_sip, which is what your file shows
pjsip set logger on       ; harmless if the endpoint is actually PJSIP

Place the call that fails, let it drop, then sip set debug off and paste the console text from the INVITE through to the BYE, as text in a post. 50 lines of SIP beats 10 MB of anything else.

Two things to look at in that trace, given the 25–28 s drop:

  1. The same 200 OK (or the same INVITE) being sent several times in a row with no ACK in between. If that is there, the ACK is going to an address nobody answers at, and the transaction times out at 64 × T1 = 32 s. The symptom is a call that sounds fine and then dies on the clock, which matches what you describe. On chan_sip the knobs are nat=force_rport,comedia on that peer (not the PJSIP names I gave earlier), plus externip/localnet in the [general] section.
  2. directmedia (canreinvite). If it is on, Asterisk steps out of the media path after answer and the two devices are expected to send RTP to each other directly. That is a very good explanation for “same VLAN, same settings, one works and one doesn’t” — the working pair can reach each other and the other pair cannot. Set directmedia=no on the failing peer and retest; if the drop goes away, that is your answer and you can then decide whether to fix the reachability or leave media anchored.

Also run sip show peer <working> and sip show peer <failing> and diff the two outputs. “Same network settings” has a way of not surviving that comparison, and whatever differs is usually the bug.

Your note that the PBX is only a relay doesn’t exclude the address problem, by the way — a relay still puts its own address in Contact: and in the SDP, so if that address is wrong for one path the leg still breaks there. But the trace will tell you in seconds rather than us guessing.