401 Unauthorized on Extension when Receiving Incoming Calls

Hi Everyone!

I feel really dumb posting this here but I have nowhere else to go :’(

I have a Grandstream adapter (HTC502) that is currently setup with two different FreePBX extensions. Both extensions can make outgoing calls. One extension can make and receive outgoing calls. However, the second extension, on the same device, cannot receive incoming calls. The calls go straight to voicemail, as if the peer wasn’t registered (qualify=yes is setup for both extensions)

Both extensions are showing as registered, but I can’t figure out why the second extension is not receiving calls! Here’s what the CLI shows when I place a phone call to the extension:

    -- Called SIP/CLIENTEXTENSION#
[2015-06-16 17:58:06] NOTICE[11198][C-00011685]: chan_sip.c:23006 handle_response_invite: Failed to authenticate on INVITE to '"MY NAME HERE" <sip:[email protected]>;tag=as31f7ce15'
    -- SIP/CLIENTEXTENSION#-0000e711 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)

I’ve checked to see if DND is enabled, and it is not. When I ran a SIP trace through Wireshark, this came up:

|

Time     | my.freepbx.com                         |
|         |                   | their.network.com      |                   
|10.228872|         INVITE SDP (g711U g7          |SIP From: "MY CID" <sip:[email protected] To:<sip:theirextension#@their.network.com:5060
|         |(5060)   ------------------>  (5060)   |
|10.263968|         100 Trying|                   |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.270198|         401 Unauthorized              |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.270430|         ACK       |                   |SIP Request
|         |(5060)   ------------------>  (5060)   |
|10.270786|         INVITE SDP (g711U g7          |SIP From: "MY CID" <sip:[email protected] To:<sip:theirextension#@their.network.com:5060
|         |(5060)   ------------------>  (5060)   |
|10.315136|         100 Trying|                   |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.321283|         401 Unauthorized              |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.321505|         ACK       |                   |SIP Request
|         |(5060)   ------------------>  (5060)   |
|10.321856|         INVITE SDP (g711U g7          |SIP From: "MY CID" <sip:[email protected] To:<sip:theirextension#@their.network.com:5060
|         |(5060)   ------------------>  (5060)   |
|10.379295|         100 Trying|                   |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.385345|         401 Unauthorized              |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.385581|         ACK       |                   |SIP Request
|         |(5060)   ------------------>  (5060)   |
|10.385875|         INVITE SDP (g711U g7          |SIP From: "MY CID" <sip:[email protected] To:<sip:theirextension#@their.network.com:5060
|         |(5060)   ------------------>  (5060)   |
|10.436845|         100 Trying|                   |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.443112|         401 Unauthorized              |SIP Status
|         |(5060)   <------------------  (5060)   |
|10.443361|         ACK       |                   |SIP Request
|         |(5060)   ------------------>  (5060)   |

What could be causing there to be the 401 error that is refusing the incoming calls? Any help would be much appreciated!

https://www.grandstream.com/products/ht_series/ht502/documents/ht502_usermanual_english.pdf

check what ports the interfaces are using by default.

Thanks for the super quick response. I haven’t changed any ports on the device but I can double check. Which interfaces would you be referring to please? Thank you once again!

The one that’s not working perhaps?

When you say “interface” do you mean the account on the adapter?

Oh dear, when I ReadTFM it quite clearly stated:-

Local SIP port
Defines the local SIP port the HT502 will listen and transmit. The default value for FXS
port 1 is 5060. The default value for FXS port 2 is 5062.

You are presumably using 5060 for both, correct, that rarely works as ip/port pairs need to be unique for the network to work.

1 Like

Hi Dicko,

Thanks for the clarification. No, neither SIP ports are using 5060 and both ports are different from each other. I’ve change them both to 5060 as well as to two different 506X port numbers and the problem still persists.

Then you are doing it wrong, your previous posts absolutely show that you are using 5060 for the call that failed from your server to your FXS2, it just isn’t there FXS1 is what is on that IP/port , which you say works.

If you RTFM , then without doubt you should realize that fxs1 IS signalling and expecting resonses on 5060 and fxs2 IS signalling and expecting responses on 5062 and assuming your server is doing that correctly, you have to be in agreement as to how you have configured your “extensions” port.

As you plainly stated:-

“I haven’t changed any ports on the device but I can double check”

please do that double-checking, both in the device configuration and your server configuration :wink:

I’ve changed the ports to match whats in the manual with 5060 for FXS1 and 5062 for FX2. The problem is being experienced on FXS1 where the port is 5060. FXS2 can make and recieve calls without any hiccup. Is there somewhere else that I should be looking?

Sorry, I tried my best , If I were you I’d go for paid support from Sangoma (link at top)

Thanks for the help.

It turned out being an issue with some settings on the ATA that were used to prevent ghost calls from appearing… No need to spend $150/hour on that… Especially for a client that brings in less than that in 1 year of service. #justsaying