Trying to dialing internal (in between extension) Call not initialting, it is trying. And SIP log says "SIP/2.0 401 Unauthorized"

v=0
o=- 3933750613 3933750613 IN IP4 10.20.10.2
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4002 RTP/AVP 8 0 101
c=IN IP4 10.20.10.2
b=TIAS:64000
a=rtcp:4003 IN IP4 10.20.10.2
a=sendrecv
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ssrc:1235250376 cname:39a9711b58c304bf
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:4yteguas6chfjJFGc4lCoJ0KfDTjxRfcoBpwzSEi
a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:X3DqbMwmQ1SZlqaNkMiDNgoXLJLc7v1dczRjrU3I

<— Transmitting SIP response (335 bytes) to UDP:10.20.10.2:49408 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.20.10.2:49408;rport=49408;received=10.20.10.2;branch=z9hG4bKPjfd588b7e6b324c03af5f9c5e970c3548
Call-ID: 0857809b8fd44e2fa1c666d9076f4a08
From: sip:1000@10.20.10.3;tag=13f4e550a1944f6893d1c0da01632f29
To: sip:1001@10.20.10.3
CSeq: 20347 INVITE
Server: Asterisk 20
Content-Length: 0

<— Received SIP request (351 bytes) from UDP:10.20.10.2:49408 —>
CANCEL sip:1001@10.20.10.3 SIP/2.0
Via: SIP/2.0/UDP 10.20.10.2:49408;rport;branch=z9hG4bKPjfd588b7e6b324c03af5f9c5e970c3548
Max-Forwards: 70
From: sip:1000@10.20.10.3;tag=13f4e550a1944f6893d1c0da01632f29
To: sip:1001@10.20.10.3
Call-ID: 0857809b8fd44e2fa1c666d9076f4a08
CSeq: 20347 CANCEL
User-Agent: MicroSIP/3.21.4
Content-Length: 0

<— Transmitting SIP response (372 bytes) to UDP:10.20.10.2:49408 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.20.10.2:49408;rport=49408;received=10.20.10.2;branch=z9hG4bKPjfd588b7e6b324c03af5f9c5e970c3548
Call-ID: 0857809b8fd44e2fa1c666d9076f4a08
From: sip:1000@10.20.10.3;tag=13f4e550a1944f6893d1c0da01632f29
To: sip:1001@10.20.10.3;tag=2e9bd88c-e842-49bb-ac67-989a219ded36
CSeq: 20347 CANCEL
Server: Asterisk 20
Content-Length: 0

<— Transmitting SIP response (388 bytes) to UDP:10.20.10.2:49408 —>
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 10.20.10.2:49408;rport=49408;received=10.20.10.2;branch=z9hG4bKPjfd588b7e6b324c03af5f9c5e970c3548
Call-ID: 0857809b8fd44e2fa1c666d9076f4a08
From: sip:1000@10.20.10.3;tag=13f4e550a1944f6893d1c0da01632f29
To: sip:1001@10.20.10.3;tag=2e9bd88c-e842-49bb-ac67-989a219ded36
CSeq: 20347 INVITE
Server: Asterisk 20
Content-Length: 0

<— Received SIP request (357 bytes) from UDP:10.20.10.2:49408 —>
ACK sip:1001@10.20.10.3 SIP/2.0
Via: SIP/2.0/UDP 10.20.10.2:49408;rport;branch=z9hG4bKPjfd588b7e6b324c03af5f9c5e970c3548
Max-Forwards: 70
From: sip:1000@10.20.10.3;tag=13f4e550a1944f6893d1c0da01632f29
To: sip:1001@10.20.10.3;tag=2e9bd88c-e842-49bb-ac67-989a219ded36
Call-ID: 0857809b8fd44e2fa1c666d9076f4a08
CSeq: 20347 ACK
Content-Length: 0

Your log does not show a 401 response, and, in any case, 401 is a normal response by a UAS that wants the UAC to authenticate itself. Asterisk is the UAS in your log.

You have screen scraped the log, but you should enable the full log and take it from the file, as the file contains timestamps. Without those, I can’t tell if the call is taking an unreasonable time, or the caller simply gave up too soon.

You also do not have enough verbosity to see how Asterisk is handling the call, and where the delay may be. 5 is typically recommended for debugging.

Here is attached the Wireshark flow sequence

Please provide /var/log/asterisk/full, with “pjsip set logger on” and “core set verbose 3” in effect. If not using chan_pjisp, first change to using it.

Your message sequence chart shows a call that was abandoned, by the caller, before it was answered, and after only about 7 seconds. It is normally assumed that people won’t abandon before about 20 seconds, but, in this case, it is the caller that has applied the time limit, and Asterisk only applies a limit if you set one.