FreePBX / Random loss of audio ...



  • I'm setting up a FreePBX instance and doing some testing. Right now I have two extensions, one a SIP extension using Zoiper softphone and the other a virtual extension with voicemail enabled, just for something to test with.

    I seem to be able to make a call from the softphone to the virtual extension with no problem in that it seems to connect each time but the audio to hear the voicemail greeting is not received most of the time.

    I've broke out wireshark to see if I could determine anything. One thing I noticed is that when my Zoiper softphone first registers with the server it seems to receive a 401 Unauthorized from the server before successfully registering. Is it normal to receive receive 401 Unauthorized before a successful registration? .248 is the server and .139 is the softphone.

    Source,Destination,Protocol,Length,Info
    192.168.2.139,192.168.2.248,SIP,619,Request: REGISTER sip:192.168.2.248;transport=UDP  (1 binding) | 
    192.168.2.248,192.168.2.139,SIP,604,Status: 401 Unauthorized | 
    192.168.2.139,192.168.2.248,SIP,787,Request: REGISTER sip:192.168.2.248;transport=UDP  (1 binding) | 
    192.168.2.248,192.168.2.139,SIP,683,Request: OPTIONS sip:[email protected]:56778;rinstance=b05461348c8fdb80;transport=UDP | 
    192.168.2.248,192.168.2.139,SIP,661,Status: 200 OK  (1 binding) | 
    192.168.2.139,192.168.2.248,SIP,712,Status: 200 OK | 
    192.168.2.139,192.168.2.248,SIP,784,Request: REGISTER sip:192.168.2.248;transport=UDP  (remove 1 binding) | 
    192.168.2.248,192.168.2.139,SIP,616,Status: 401 Unauthorized | 
    192.168.2.139,192.168.2.248,SIP,784,Request: REGISTER sip:192.168.2.248;transport=UDP  (remove 1 binding) | 
    192.168.2.248,192.168.2.139,SIP,567,Status: 200 OK  (0 bindings) | 
    192.168.2.139,192.168.2.248,SIP,619,Request: REGISTER sip:192.168.2.248;transport=UDP  (1 binding) | 
    192.168.2.248,192.168.2.139,SIP,604,Status: 401 Unauthorized | 
    192.168.2.139,192.168.2.248,SIP,787,Request: REGISTER sip:192.168.2.248;transport=UDP  (1 binding) | 
    192.168.2.248,192.168.2.139,SIP,683,Request: OPTIONS sip:[email protected]:56778;rinstance=3b911898cd7a2274;transport=UDP | 
    192.168.2.248,192.168.2.139,SIP,661,Status: 200 OK  (1 binding) | 
    192.168.2.139,192.168.2.248,SIP,712,Status: 200 OK | 
    192.168.2.139,192.168.2.248,UDP,46,56778  >  5060 Len=4
    

    I notice also that if I capture then the softphone is constantly sending RTP packets to the server but the server is not sending any RTP packets back to the softphone, which I presume is why I'm not hearing the audio of the voicemail greeting from the server.



  • Audio issues tend to be due to codec issues.



  • What your initial issue sounds like is 1 way audio, so I'd start with checking here.



  • @DustinB3403 said in FreePBX / Random loss of audio ...:

    Audio issues tend to be due to codec issues.

    Thanks, you were right it was codec issue which I hadn't even considered. I changed zoiper to exclude some of the one's it was saying were available and have had zero issues in about 15 test calls since then.



  • @DustinB3403 said in FreePBX / Random loss of audio ...:

    Audio issues tend to be due to codec issues.

    That's pretty rare. Never seen that happen.



  • What's the networking situation? Is this all on one LAN? Are there routers or anything in the midst of the channels?



  • Looks like your phones are on a private network separate from the PBX. That's normal, but that's the kind of starting point we need for diagnosis.

    By far these issues tend to come from router / firewall issues. The most common of those is having SIP-ALG turned on (it's normally on my default.) SIP-ALG more or less seems to exist to create these kinds of headaches (to help vendors sell more services.)

    If SIP-ALG is disabled, make sure your STUN settings are correct. That's common, too.



  • @scottalanmiller said in FreePBX / Random loss of audio ...:

    Looks like your phones are on a private network separate from the PBX. That's normal, but that's the kind of starting point we need for diagnosis.

    By far these issues tend to come from router / firewall issues. The most common of those is having SIP-ALG turned on (it's normally on my default.) SIP-ALG more or less seems to exist to create these kinds of headaches (to help vendors sell more services.)

    If SIP-ALG is disabled, make sure your STUN settings are correct. That's common, too.

    It did seem to be the codec, in this particular instance at least. I changed Zoiper to only allow G.711a/u and that seemed to fix the issue. I'm going to do some more testing tomorrow and verify.

    The PBX and the phones are all on the same network, 192.168.2.0/24

    They run through an unmanaged netgear switch that sits behind a Cisco ASA 5505. The Zoiper client was running on a laptop connected wirelessly to a Ubiquiti AC Pro which itself feeds into the netgear switch.

    I didn't think the STUN server would play into this particular call test since it was extension to extension on the same network segment and never had to exit the WAN interface on the router.



  • @BraswellJay said in FreePBX / Random loss of audio ...:

    It did seem to be the codec, in this particular instance at least. I changed Zoiper to only allow G.711a/u and that seemed to fix the issue. I'm going to do some more testing tomorrow and verify.

    That's a first. What was it set to choose first before? And what is your server set to accept?



  • @BraswellJay said in FreePBX / Random loss of audio ...:

    I didn't think the STUN server would play into this particular call test since it was extension to extension on the same network segment and never had to exit the WAN interface on the router.

    It doesn't. The PBX has a public IP though, that it is advertising in the logs.



  • @scottalanmiller said in FreePBX / Random loss of audio ...:

    @BraswellJay said in FreePBX / Random loss of audio ...:

    It did seem to be the codec, in this particular instance at least. I changed Zoiper to only allow G.711a/u and that seemed to fix the issue. I'm going to do some more testing tomorrow and verify.

    That's a first. What was it set to choose first before? And what is your server set to accept?

    It is strange. This image shows my current codecs. The two left columns are from Zoiper and the rightmost from FreePBX. Yesterday when I was having the issue, all of the codecs from Zoiper were in the selected codec list. When I moved all but G.711 a/mu over to the available but not selected then all of my issues cleared up.

    codecs.JPG

    How does the SIP negotiation work for selecting codec? Is the client or the server the master when determining which one to use?



  • @BraswellJay said in FreePBX / Random loss of audio ...:

    How does the SIP negotiation work for selecting codec? Is the client or the server the master when determining which one to use?

    That's a setting in your SIP settings on the PBX. It can be either party, depending on configuration.



  • The codec you probably want on both is Opus. Since you paid for that in your Gold package on Zoiper.



  • @BraswellJay said in FreePBX / Random loss of audio ...:

    @scottalanmiller said in FreePBX / Random loss of audio ...:

    @BraswellJay said in FreePBX / Random loss of audio ...:

    It did seem to be the codec, in this particular instance at least. I changed Zoiper to only allow G.711a/u and that seemed to fix the issue. I'm going to do some more testing tomorrow and verify.

    That's a first. What was it set to choose first before? And what is your server set to accept?

    It is strange. This image shows my current codecs. The two left columns are from Zoiper and the rightmost from FreePBX. Yesterday when I was having the issue, all of the codecs from Zoiper were in the selected codec list. When I moved all but G.711 a/mu over to the available but not selected then all of my issues cleared up.

    codecs.JPG

    How does the SIP negotiation work for selecting codec? Is the client or the server the master when determining which one to use?

    The PBX is always the master.

    I recommend that you never leave a PBX default to all the codecs like that.

    Reduce it to the fewest possible. Typically only ULAW and OPUS unless you are outside the US. Then ALAW instead of ULAW is common.

    Adding G722 is required for video or "HD" audio.

    Also your SIP trunk has CODEC settings. Your provider may only use certain ones.



  • @scottalanmiller said in FreePBX / Random loss of audio ...:

    The codec you probably want on both is Opus. Since you paid for that in your Gold package on Zoiper.

    I didn't pay for Zoiper. I downloaded the client from their site and when it starts it offers me to upgrade to Pro or something like that but I just choose the option that says continue with a free account. This is Zoiper5. I did just install it yesterday right before I started testing so perhaps they are letting me use that as a trial but will go away? Not sure, but I haven't paid for it for sure.



  • @BraswellJay said in FreePBX / Random loss of audio ...:

    @scottalanmiller said in FreePBX / Random loss of audio ...:

    The codec you probably want on both is Opus. Since you paid for that in your Gold package on Zoiper.

    I didn't pay for Zoiper. I downloaded the client from their site and when it starts it offers me to upgrade to Pro or something like that but I just choose the option that says continue with a free account. This is Zoiper5. I did just install it yesterday right before I started testing so perhaps they are letting me use that as a trial but will go away? Not sure, but I haven't paid for it for sure.

    ZoIPer 5 is not allowed for commercial use.



  • When I was trying out FreePBX, I was using linphone and it worked a lot better.
    https://www.linphone.org/



  • @black3dynamite said in FreePBX / Random loss of audio ...:

    When I was trying out FreePBX, I was using linphone and it worked a lot better.
    https://www.linphone.org/

    So I was going to switch to linphone. After installing I had same problem with it that I had yesterday with Zoiper, no audio. Checked codecs and all seems ok so doesn't appear to be the same issue.

    Checked a SIP message trace from the Asterisk CLI and noticed the following :

    From Linphone message trace, in one of the SIP messages I see:

    Peer audio RTP is at port xxx.xxx.xxx.150:7078
    

    This is the WAN IP (x'd out) of my router.

    When I compare that to one I had taken when I was using the Zoiper client (that had no audio issues) I see the corresponding :

    Peer audio RTP is at port 192.168.2.57:8000
    

    This is the LAN IP of the machine the zoiper client was installed on.

    I'm thinking that for the linphone client somehow the RTP stream is being sent to the router instead of back to the machine the client is on thus no audio. Is that a correct interpretation of what I'm seeing here?

    I don't see anything obvious that's different about the extension setups in FreePBX for each. The setting that I thought might control this on a per extension basis was NAT Mode but that is set to No for both types of clients.

    I don't see anything in the Linphone setup that would make me think I can control that from the application. I had thought that if all my extensions resided on the same LAN subnet that I wouldn't need to worry about any of the RTP traffic going to the router like that but perhaps I'm mistaken.




  • @BraswellJay what Did you put in the client for SIP server? The FQDN? What does the FQDN resolve as? The internal IP or your public IP?



  • @JaredBusch said in FreePBX / Random loss of audio ...:

    @BraswellJay what Did you put in the client for SIP server? The FQDN? What does the FQDN resolve as? The internal IP or your public IP?

    Did not use the FQDN, just the IP address.

    192.168.2.248 is the FreePBX server and 201 is the assigned extension.

    linphone00.JPG



  • @BraswellJay this is what my setup look like in Linphone on my iPhone.

    Is the STUN server getting used on yours? That would make the call go out and back again.

    7F54CCB9-5F13-459D-9994-128EE9E938B3.png



  • @JaredBusch said in FreePBX / Random loss of audio ...:

    @BraswellJay this is what my setup look like in Linphone on my iPhone.

    Is the STUN server getting used on yours? That would make the call go out and back again.

    No, there is no STUN server configured.

    linphone01.JPG

    When I get a chance this afternoon I may configure one and see if that at least resolves the issue, though I didn't think I needed STUN for this particular use case.

    Thanks



  • @BraswellJay said in FreePBX / Random loss of audio ...:

    though I didn't think I needed STUN for this particular use case.

    Correct you do not.



  • @BraswellJay said in FreePBX / Random loss of audio ...:

    When I get a chance this afternoon I may configure one and see if that at least resolves the issue, though I didn't think I needed STUN for this particular use case.

    So I haven't totally found root cause but it appears to be an issue with my windows profile on the machine I was running Linphone on.

    I installed Linphone app on my phone and everything worked perfectly.
    Installed desktop app on a spare laptop and everything worked perfectly.
    Logged in as different user on original machine and everything worked perfectly.
    Logged back in as myself on original machine and no go.

    I only need this for some testing. Once we get set up we'll be using Yealink phones so I may not look anymore since I can use my phone for the testing.

    Thanks to all for the help.


Log in to reply