Twilio FreePBX Firewall Nat

Hello! I have issue with inbound calls are disconnecting after 30 seconds is because the contact IP address that’s in the 200 OK my FreePBX is sending when the call is answered is not the same IP address that my PBX is answering the call from.

My PBX is answering from IP address 45.73.., however the contact IP address in the SDP is 127.0.0.1 on my sip trunk provider (twilio).

I use Mikrotik router and FreePBX 15.0.37

Make sure that under Settings → Asterisk SIP settings you have your external IP address properly set in the External Address field.

You may have to restart Asterisk after making a change there.

What @dobrosavljevic noted is the most likely issue, but if that was already correct or doesn’t help:

In Mikrotik IP->Firewall->Service Ports, try disabling SIP ALG.

In your Twilio trunk, confirm that Match (Permit) includes the relevant signaling addresses. IP Addresses for SIP Services | Twilio

If you still have trouble, with pjsip logger on, make a test call in, paste the Asterisk log for the call at pastebin.com or similar, and post the link here. If you are too new to post links, put the link as preformatted text.

I always have problems with incoming calls hanging up after 32 seconds. Here is a copy of the pjsip log as requested

Please re-run the logging, with verbosity set to five and taking the logs from /var/log/asterisk/full, which should be enabled for all logging categories, not a console screen scrape. There is no timestamp information in your logs, so no proof that 32 seconds is an issue, and no obvious sign of re-transmissions.

Are you using RasPBX, as that is known to have an inadequate default logging level (probably to avoid wear on the SD card).

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