Calls from External Extension to Internal extension cuts at 32 seconds, i know whats wrong but not sure how to fix it

The problem is simple, when i call from a external extension to any of my internal extensions, the call will always end at 32 seconds, BUT if i call from my internal extension to my external extension everything is fine.
On top of this i also have a sip trunk that works whiout issues (on my internal extensions).

This is a call started from my external extension (801)to my internal extension 300

As you can see it saying “invite from sip [email protected] external pbx dns and port” this is definately wrong. If i call from internal to external extension the correct sip [email protected] extension ip" is used and call is not cut.

And im not sure what im doing wrong, on my sip settings i have my dns on the external adress, and my local networks setup correctly.
On my router i have both the non-standart sip port and the UDP port range forwarded to my pbx.

I need help because i run out of ideas. Not sure what to do.

I suspect that your router is forwarding (for example) external UDP port 5678 to 192.168.80.4 port 5060. But the PBX doesn’t know that, so the Contact header sent in the 200 OK response to the external extension is wrong.

IMO the ‘right’ fix would be to change pjsip Port to Listen On to 5678 (requires Asterisk restart) and change the router to forward external UDP port 5678 to 192.168.80.4 port 5678. Unfortunately, that also requires your internal extensions changed to register to 192.168.80.4 port 5678.

To fix it the other way, you need to set external_signaling_port for the transport. This is not exposed in the FreePBX GUI so you’d put it in an override config file manually. See https://community.asterisk.org/t/pjsip-specify-external-port-in-transport/78754 .

Using different ports internally and externally has various issues, for example a smartphone SIP app wouldn’t work correctly both on local Wi-Fi and on mobile data.

2 Likes

Yeah that exactly what the router is doing, redirecting ext port to 192.168.80.4:5060 as well as the rtp port range to 192.168.80.4.

I will look intro the external_signaling_port, but as a option, lets say i change chan_sip to the external port and i let pjsip on 5060, and i use chan_sip for external external extensions, that should work, i guess.

Mobile softphone apps right now are working ok on internal wifi and are suffering from the same 32 seconds cuts when calling to internal extensions on mobile data.

I see no problem running chan_sip on a nonstandard port, along with pjsip on 5060. You can also define multiple pjsip transports, but that’s not exposed in the FreePBX GUI and would require manual config file edits.

BTW, 192.168.80.x smells of Mikrotik; if that’s what you’re using and have hairpin issues with mobile apps, see https://wiki.mikrotik.com/wiki/Hairpin_NAT .

1 Like

Setting the chan_sip to the external port did the trick, i had to change nothing on the external phones, so it was a very simple fix, just converting the extensions to chan_sip using the gui.

Thank you very much.

btw, yes it is a mikrotik router.

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