Handle_response_invite: Failed to authenticate on INVITE to '"

I can´t establish outgoing calls from an Asterisk to other using the SIP Trunk - GoVOIPGate. Both servers belong to me. The caller extension is the 28814 and the called one is the 37971. The error I’ve got is the following:

Executing [37971@refer_nacional:3] Dial(“SIP/28814-00000286”, “SIP/TRUNKSIP-GOVOIPGATE/37971,200,tT”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/TRUNKSIP-GOVOIPGATE/37971
[Sep 22 12:35:20] NOTICE[19641][C-0000012e]: chan_sip.c:23830 handle_response_invite: Failed to authenticate on INVITE to ‘"(“28814"” sip:28814@10.192.231.240;tag=as09235bbb’
– SIP/TRUNKSIP-GOVOIPGATE-00000287 is circuit-busy

I don’t understand this error. Could you help me, please?

The SIP.conf of the originator Server, named TEL:

[TRUNKSIP-GOVOIPGATE]
type=peer
host=10.192.231.244
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=yes
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.192.231.244/255.255.255.255

And in the GoVOIPGate server:

[TRUNKSIP-TEL]
type=peer
host=10.192.230.240
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=yes
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.192.230.240/255.255.255.255

In the dialplan:


exten => s,2440,Dial(${TRUNKGOVOIPGATE}/${ARG1},tT)

We’ve got the following information from the originator Server (TEL) from SIP debug:

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Audio is at 19898
Adding codec ulaw to SDP
Reliably Transmitting (no NAT) to 10.192.231.244:5060:
INVITE sip:37971@10.192.231.244 SIP/2.0
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK7092991c
Max-Forwards: 70
From: "(“28814"” sip:28814@10.192.231.240;tag=as2e745b3d
To: sip:37971@10.192.231.244
Contact: sip:28814@10.192.231.240:5060
Call-ID: 55c0177f39f9e7e67931e0937ad7507e@10.192.231.240:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.10.0
Date: Thu, 22 Sep 2016 14:49:05 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: "(“28814"” sip:28814@10.192.231.240;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 198

v=0
o=root 980203542 980203542 IN IP4 10.192.231.240
s=Asterisk PBX 13.10.0
c=IN IP4 10.192.231.240
t=0 0
m=audio 19898 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv


-- Called SIP/TRUNKSIP-GOVOIPGATE/37971

<— SIP read from UDP:10.192.231.244:5060 —>
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK7092991c;received=10.192.231.240
From: "(“28814"” sip:28814@10.192.231.240;tag=as2e745b3d
To: sip:37971@10.192.231.244;tag=as1168c622
Call-ID: 55c0177f39f9e7e67931e0937ad7507e@10.192.231.240:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Proxy-Authenticate: Digest algorithm=MD5, realm=“Jar209Reftel.refertelecom.pt”, nonce="3ced8606"
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Transmitting (no NAT) to 10.192.231.244:5060:
ACK sip:37971@10.192.231.244 SIP/2.0
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK7092991c
Max-Forwards: 70
From: "(“28814"” sip:28814@10.192.231.240;tag=as2e745b3d
To: sip:37971@10.192.231.244;tag=as1168c622
Contact: sip:28814@10.192.231.240:5060
Call-ID: 55c0177f39f9e7e67931e0937ad7507e@10.192.231.240:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.10.0
Content-Length: 0


[Sep 22 15:49:05] NOTICE[19641][C-00000258]: chan_sip.c:23830 handle_response_invite: Failed to authenticate on INVITE to ‘"(“28814"” sip:28814@10.192.231.240;tag=as2e745b3d’
– SIP/TRUNKSIP-GOVOIPGATE-000004df is circuit-busy

And in destination server:


Scheduling destruction of call ‘4277196131@10_156_218_1’ in 15000 ms
govoipgate*CLI>
<-- SIP read from 10.192.231.240:5060:
INVITE sip:37971@10.192.231.244 SIP/2.0
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK59dcac13
Max-Forwards: 70
From: "(“28814"” sip:28814@10.192.231.240;tag=as20bd92ca
To: sip:37971@10.192.231.244
Contact: sip:28814@10.192.231.240:5060
Call-ID: 2693973874c38a0b70c2d09e24358b5a@10.192.231.240:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.10.0
Date: Thu, 22 Sep 2016 15:13:18 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: "(“28814"” sip:28814@10.192.231.240;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 200

v=0
o=root 1714989549 1714989549 IN IP4 10.192.231.240
s=Asterisk PBX 13.10.0
c=IN IP4 10.192.231.240
t=0 0
m=audio 11264 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv

— (15 headers 10 lines) —
Using INVITE request as basis request - 2693973874c38a0b70c2d09e24358b5a@10.192.231.240:5060
Sending to 10.192.231.240 : 5060 (non-NAT)
Reliably Transmitting (no NAT) to 10.192.231.240:5060:
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK59dcac13;received=10.192.231.240
From: "(“28814"” sip:28814@10.192.231.240;tag=as20bd92ca
To: sip:37971@10.192.231.244;tag=as78f6fcd7
Call-ID: 2693973874c38a0b70c2d09e24358b5a@10.192.231.240:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Proxy-Authenticate: Digest algorithm=MD5, realm=“Jar209Reftel.refertelecom.pt”, nonce="110cfdf1"
Content-Length: 0


Scheduling destruction of call ‘2693973874c38a0b70c2d09e24358b5a@10.192.231.240:5060’ in 15000 ms
Found user '28814’
govoipgate*CLI>
<-- SIP read from 10.192.231.240:5060:
ACK sip:37971@10.192.231.244 SIP/2.0
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK59dcac13
Max-Forwards: 70
From: "(“28814"” sip:28814@10.192.231.240;tag=as20bd92ca
To: sip:37971@10.192.231.244;tag=as78f6fcd7
Contact: sip:28814@10.192.231.240:5060
Call-ID: 2693973874c38a0b70c2d09e24358b5a@10.192.231.240:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.10.0
Content-Length: 0

— (10 headers 0 lines) —
govoipgate*CLI>
<-- SIP read from 10.192.231.240:5060:
INVITE sip:37971@10.192.231.244 SIP/2.0
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK1a239c9f
Max-Forwards: 70
From: "(“28814"” sip:28814@10.192.231.240;tag=as7335f03e
To: sip:37971@10.192.231.244
Contact: sip:28814@10.192.231.240:5060
Call-ID: 447dcab375745c385ba1e0a83485caa9@10.192.231.240:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.10.0
Date: Thu, 22 Sep 2016 15:13:18 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: "(“28814"” sip:28814@10.192.231.240;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 200

v=0
o=root 1333574835 1333574835 IN IP4 10.192.231.240
s=Asterisk PBX 13.10.0
c=IN IP4 10.192.231.240
t=0 0
m=audio 16660 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv

— (15 headers 10 lines) —
Using INVITE request as basis request - 447dcab375745c385ba1e0a83485caa9@10.192.231.240:5060
Sending to 10.192.231.240 : 5060 (non-NAT)
Reliably Transmitting (no NAT) to 10.192.231.240:5060:
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK1a239c9f;received=10.192.231.240
From: "(“28814"” sip:28814@10.192.231.240;tag=as7335f03e
To: sip:37971@10.192.231.244;tag=as3c01cdbf
Call-ID: 447dcab375745c385ba1e0a83485caa9@10.192.231.240:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Proxy-Authenticate: Digest algorithm=MD5, realm=“Jar209Reftel.refertelecom.pt”, nonce="73082bab"
Content-Length: 0


Scheduling destruction of call ‘447dcab375745c385ba1e0a83485caa9@10.192.231.240:5060’ in 15000 ms
Found user '28814’
govoipgate*CLI>
<-- SIP read from 10.192.231.240:5060:
ACK sip:37971@10.192.231.244 SIP/2.0
Via: SIP/2.0/UDP 10.192.231.240:5060;branch=z9hG4bK1a239c9f
Max-Forwards: 70
From: "(“28814"” sip:28814@10.192.231.240;tag=as7335f03e
To: sip:37971@10.192.231.244;tag=as3c01cdbf
Contact: sip:28814@10.192.231.240:5060
Call-ID: 447dcab375745c385ba1e0a83485caa9@10.192.231.240:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.10.0
Content-Length: 0

Please use preformatted text markup for your quotes, as the forum suppresses the contents of angle brackets if you don’t, and that is where the issue lies.

It looks like you are forwarding a somewhat garbled caller ID. They are asking for proxy authentication, buy you have no authentication section and no other authentication data. It is also conceivable that they require fromuser.

Note that canreinvite is deprecated; use directmedia for any currently supported version of Asterisk. However, the lack of a version number in your user agent does suggest an obsolete version of Asterisk which may need canreinvite.

Hi David,

I not quite understand what you indicated regarding the text formatting, So, I send some more information below, which I hope will be relevant to the discovery of the resolution of the problem (including the issue of reinvite):

indent preformatted text by 4 spaces

SIP.conf in TEL (originator) version 13.10

[general]
realm=Jar209Reftel.refertelecom.pt
context=default
allowoverlap=yes
srvlookup=yes
defaultexpiry=90
videosupport=yes
notifyringing = yes
notifyhold = yes
callcounter = yes
counteronpeer = yes
alwaysauthreject = yes
disallow=all
allow = alaw
allow = ulaw
allow = g729
allow = gsm
rtptimeout=300
nat=no

udpbindaddr=0.0.0.0
tcpenable=no
tcpbindaddr=0.0.0.0
tos_sip=ef
tos_audio=ef
tos_video=af41
tos_text=af41
cos_sip=5;
cos_audio=5
cos_video=4
cos_text=3

sendrpid=yes
trustrpid=yes

[TRUNKSIP-GOVOIPGATE]
type=peer
host=10.192.231.244
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=yes
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.192.231.244/255.255.255.255

SIP.conf in Voipgate (destination) version 1.2.31

[general]
realm=Jar209Reftel.refertelecom.pt
context=default
allowoverlap=yes
srvlookup=yes
defaultexpiry=90
;qualify=5000
videosupport=yes
notifyringing = yes
notifyhold = yes
callcounter = yes
counteronpeer = yes
alwaysauthreject = yes
disallow=all
allow = alaw
allow = ulaw
allow = g729
allow = gsm
rtptimeout=300
nat=no

;Remote-Party-Id/P-Asserted-Identity
sendrpid = yes
trustrpid = no

bindaddr=0.0.0.0
bindport=5060
tos=0xb8

[TRUNKSIP-TEL]
type=peer
host=10.192.230.240
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=yes
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.192.230.240/255.255.255.255

////////////////////////////////////////////

Originator extensions.conf - TEL asterisk

[28814]
type=friend
callerid=(“28814” <28814>)
context=refer_nacional
secret=28814
host=dynamic
dtmfmode=rfc2833
username=28814
progressinband=no
promiscredir=yes
;deny=0.0.0.0/0.0.0.0
;permit=10.200.64.99/255.255.255.255

Destination extensions.conf - Govoipgate Asterisk:

[37971]
type=friend
callerid=(“37971” <37971>)
context=cp_nacional
secret=…ppool…
host=dynamic
dtmfmode=rfc2833
username=37971_ata
progressinband=no
promiscredir=yes
canreinvite=no
qualify=no

I meant select the text and use the </> button, otherwise:

irrelevant details <very important stuff>

comes out as

irrelevant details

Your caller ID is mangled because of the parentheses

You have no authentication data for the ITSP, which is almost unheard of, and you have no registration information, which is also unusual.

nat=no is disabling something that very rarely does any harm.

I’m fairly sure that cos and tos are competing for the same parameter. Using ef for audio is a bit aggressive if your routers are configured to interpret these normally.

dtmfmode=inband is unusual and is incompatible with allowing g729 and gam.

But David, all information I put is as it is…it wasn’t truncated…

These SIP Trunks are internal ones, not intended to connect to an ITSP. Their goal is to interconnect two private/internal Asterisk VoIP Systems,

What really should I alter in the configurations I sent?

This may depend on the way that your browser handles undefined HTML tags. It may be applying some broken error recovery and displaying the raw tag. In my example, I do not see the important information in case without preformatting.

You should change type=friend to type=peer.

You should remove the () from the caller ID.

You should remove g729 and gsm, or replace inband by rfc2833.

You can delete nat=.

Change canreinvite to directmedia (although, for a private network, I can’t think why you would want to disable it.

Remove alwaysauthreject until you have it working properly.

Include verbose logs from the destination side.

Hi!

Thanks!!! It’s fixed!!

The only problem was:

;callerid=(“28814” <28814>)
callerid=“28814” <28814>

:slight_smile:

But can you give an example of how to provide information to the correct format, I still do not understand how to proceed

See RFC 3261 for the allowable formats.

I assume you are talking about how to provide information in correct format on forum while replying.
When you reply to someone on this forum and your reply contains <>, then you should select the text and apply </> button (which you can see as 6th button from left on top menu of your reply)

–Satish Barot

Ok can you see if this is ok now (preformatted text)?

Executing [37971@refer_nacional:1] Ringing(“SIP/28814-000010de”, “”) in new stack
– Executing [37971@refer_nacional:2] Macro(“SIP/28814-000010de”, “sacaprefixos,1000”) in new stack
– Executing [s@macro-sacaprefixos:1] NoOp(“SIP/28814-000010de”, “”) in new stack
– Executing [s@macro-sacaprefixos:2] Set(“SIP/28814-000010de”, “tamanho=4”) in new stack
– Executing [s@macro-sacaprefixos:3] GotoIf(“SIP/28814-000010de”, “0?10:4”) in new stack
– Goto (macro-sacaprefixos,s,4)
– Executing [s@macro-sacaprefixos:4] GotoIf(“SIP/28814-000010de”, “0?20:5”) in new stack
– Goto (macro-sacaprefixos,s,5)
– Executing [s@macro-sacaprefixos:5] Set(“SIP/28814-000010de”, “prefixo=1000”) in new stack
– Executing [s@macro-sacaprefixos:6] GotoIf(“SIP/28814-000010de”, “0?7:20”) in new stack
– Goto (macro-sacaprefixos,s,20)
– Executing [s@macro-sacaprefixos:20] NoOp(“SIP/28814-000010de”, “”) in new stack
– Executing [37971@refer_nacional:3] Dial(“SIP/28814-000010de”, “SIP/TRUNKSIP-GOVOIPGATE/37971,200,tT”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/TRUNKSIP-GOVOIPGATE/37971
– SIP/TRUNKSIP-GOVOIPGATE-000010df is ringing
– SIP/TRUNKSIP-GOVOIPGATE-000010df is ringing

For the callerid option the parser will accept the following if you want to set both name and number:

callerid=“28814” <28814>
callerid=28814 <28814>