No Audio on Public-facing FreePBX 15 and Asterisk 16 on CentOS 7


(Rodrigue) #1

Hi everyone,

I have installed FreePBX 15 and Asterisk 16 on one of my virtual servers running CentOS 7 64-bit at Linode. This server has a public static IP; therefore I can access both FreePBX and Asterisk on that IP with no problem. I have 2 extensions for testing 112 and 113. I’ve configured them on softphones (3CX Phone on PC and GS Wave on Android) and they register successfully.

The problem is that, when either extension calls the other, there is no audio and the call is dropped on the 30th second with the following message:
NOTICE[1670]: chan_sip.c:29981 check_rtp_timeout: Disconnecting call 'SIP/100-00000001' for lack of RTP activity in 31 seconds

Since last week, I have been attempting different configuration suggestions found online but nothing worked. Tried enabling and disabling NAT with no luck.
What is the best way to configure FreePBX 15 and Asterisk 16 so that it works when the box is connected directly to the Internet?
I’m posting here because I have tried everything, now I just don’t know what else to do. The same installation and configuration works perfectly on the server in the office. The box in the office connects to a 4G router, to which my PC and mobile also connect. This is the same router through which all these devices connect to the Internet. When I change the IP of the SIP Server, extensions are registered successfull, but calls only last 30 seconds with no audio both ways.

I have tried allowing all necessary ports through firewalld and even disabling the freiwall altogether with no luck. Selinux and IPTables are also disabled.

I look forward to your assistance. Thanks.

As for the current configuration:

  1. sip_general_additional contains the following information (IP is not the real one):

    rtpend=20000
    rtpstart=10000
    rtptimeout=30
    canreinvite=no
    rtpkeepalive=0
    nat=force_rport,comedia
    externip=172.68.92.47

  2. rtp_additional contains:

    [general]
    rtpstart=10000
    rtpend=20000
    rtpchecksums=yes
    strictrtp=yes

  3. sip_additional

All extensions contains the following:

canreinvite=yes
session-timers=accept
nat=force_rport,comedia

(Lorne Gaetz) #2

Asterisk SIP Settings: Set the public IP in the external address field, no local networks. On chan_sip set Nat=no, IP=public. Restart asterisk.

For chan_sip extensions, advanced tab, set Nat=yes if not already. You can change the default setting for this param in Advanced Settings so new extensions have it set already. PJSIP extensions require no specific setting.


(Rodrigue) #3

Hi Lorne,
Thank you very much for your reply.

I have tried that but it didn’t work. Calls are still dropped after 30 seconds.
Under Asterisk SIP Settings, I’ve also tried NAT=no and IP=static (same as External IP) with no luck.
Is there any other place I can look?
Thanks.


#4

Have you disabled SIP handling (called SIP ALG, SIP Helper, or similar) on your NAT/firewall?

Asterisk will handle the NAT situation of your phones using the settings @lgaetz explained. But you must make sure your firewall is not also trying to handle the SIP NAT problem.


(Lorne Gaetz) #5

If using pjsip extensions, check the advanced tab an ensure direct media = no. Otherwise, I think it likely that your router is interfering. If you have the option of using TLS signalling, that may resolve.


(Rodrigue) #6

Thank you for your post @billsimon, I’ve been checking my router’s settings to see whether I can find anything that deals with SIP; this I cannot see anything.
Up until 3 months ago, I had another server at Linode that was running CentOS 7 64-bit, Asterisk 13 and FreePBX 14.
On my Android phone I configured one extension on Zoiper app, and this extension was connected successfully and there was no audio issues. I’ve not change the router settings.

One day the Asterisk stops connecting and I decided to re-install.


(Rodrigue) #7

Thank you @lgaetz, I’m not using pjsip, only chan_sip. Thanks.


#8

Capture SIP debugs of a call and put them in https://pastebin.freepbx.org

To start the capture, issue sip set debug on at the Asterisk CLI (asterisk -r from ssh).

When the call is done, issue sip set debug off to stop the SIP logging.


#10

Double check that your extensions are configured for NAT. This is in the extension settings not in the general Asterisk SIP settings.

Your 3cx phone appears to be doing STUN and filling in its own external IP address and port. I recommend turning off the phone’s STUN lookup and let Asterisk handle the extension’s NAT.


(Lorne Gaetz) #11

signalling:

<--- SIP read from UDP:154.73.23.35:15548 --->

media:

o=3cxVCE 372053610 155127270 IN IP4 154.73.22.35

Why the IP mismatch?


#12

Nice catch!


(Rodrigue) #13

@lgaetz: wow, I wouldn’t have seen that, thank you for checking. This is something to do with the ISP changing the public dynamic IP as I’m using a 4G router.
Let me try another mobile network.
I’ll post soon.


#14

That’s not correct; it should be set to no. However, that’s not your trouble, because no actual re-invite occurred.

I suggest doing simpler tests. For example, dial *43 (echo test) from each extension. If both fail, try GS wave over mobile data. If you have a working trunk on this system, make an outbound call to your mobile to see whether outgoing audio is working.

Otherwise, use tcpdump on the PBX to capture a failing call between the extensions (including any RTP received and sent). Move the capture file to your PC and analyze it with Wireshark. If you have trouble interpreting it, make a .tgz from the capture file and upload it here.


(Rodrigue) #15

Hi all,
Thank you very much for your assistance.

I’ve asked someone to test using softphones on 2 smartphones that connect to a WiFi with a public dynamic IP that changes rarely and this worked perfectly.
Therefore I can confirm that the issue is not with my configuration but the fact that the public IP from the mobile operator changes more often.

To make sure that it’s working, I’ve used the server that I have at home. Like I mentioned before, this works as expected.
So, I set up an IAX2 trunk between 2 servers (through a VPN tunnel) and an extension from one server could call one from the other with no problem. Call quality was perfect.
I didn’t think about asking people to try for me, as it used to work, so was trying to fix it from my end.

@Stewart1 : I’ll change to ensure canreinvite=no

Thank you very much.

Regards,
Rodrigue.


(system) closed #16

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