401 unauthorized when using SIP

I have around 40 extensions, we occasionally suffer with jitter issues so i’ve been investigating setting up the Jitter Buffer.

I couldn’t work out how to do it when using PJSIP but noticed there’s Jitter Buffer settings for the Chan_SIP. So i’ve converted the extension to chan_SIP on one extension, rebuilt and send the config using the EPM.

I can’t figure out why i’m getting a 401.

Trouble i have now is it won’t connect, i’ve checked the ports are all correct which they are. Checking in the log file i can see the following;

<------------->
[2018-06-27 15:49:24] VERBOSE[11670] chan_sip.c: --- (13 headers 0 lines) ---
[2018-06-27 15:49:24] VERBOSE[11670] chan_sip.c: Sending to IP:5060 (no NAT)
[2018-06-27 15:49:24] VERBOSE[11670] chan_sip.c:
<--- Transmitting (no NAT) to IP:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP IP:5060;branch=z9hG4bK4109056552;received=IP
From: "1205" <sip:[email protected]:5160>;tag=b7ca7d139510605
To: "1205" <sip:[email protected]:5160>;tag=as2ea0d159
Call-ID: [email protected]
CSeq: 1 REGISTER
Server: FPBX-14.0.3.6(13.19.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="66cb1543"
Content-Length: 0


<------------>
[2018-06-27 15:49:24] VERBOSE[11670] chan_sip.c: Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: REGISTER)
[2018-06-27 15:49:27] VERBOSE[11670] chan_sip.c:
<--- SIP read from UDP:IP:41092 --->


<------------->
[2018-06-27 15:49:47] VERBOSE[11670] chan_sip.c:
<--- SIP read from UDP:IP:41092 --->

SIP registration from the device is always done first without any authorization. Asterisk responds with 401 Unauthorized, and the header of the 401 includes a www-auth line with details.The client must then send another REGISTER packet, this time with the CSeq incremented by 1 and including the necessary authorization details. The PBX will then respond with 200 okay.

If the extension is not on the same LAN as the PBX (PBX in cloud or extension remote), set
nat=yes
for the extension.

If it is on the same LAN and local, jitter buffer is unlikely to help.

If it is on the same LAN and remote (VPN, etc.), please describe your network configuration.

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