SIP Softphone works , Asterisk does not

I have an account on IncrediblePBX on a Public IP .

I can register a softphone or hard phone to that account and make and receive calls.

When I try to use Asterisk on Raspberry Pi from the same location (shutting down hard phone and softphone) as the softphone or hardphone I can register, and receive calls but outbound calls show
SIP/2.0 401 Unauthorized

I have tried oh so many variations in sip.conf that it makes my head spin, and could not possibly post them all.

Currently I have something like this

[general]

register => 7870:Password@my.domain.com/7870

[7870]
; insecure=invite,port
; insecure=invite
insecure=invite
dtmfmode=rfc2833
secret=Password
; type=peer
type=friend
nat=yes
qualify=yes
keepalive=45
monitor=yes
; callerid=“7870” <7870>
host=my.domain.com ; This device needs to register
directmedia=no ; Typically set to NO if behind NAT
disallow=all
fromuser=7870
authuser=7870
username=7870
;fromdomain=my.domain.com
;allow=gsm ; GSM consumes far less bandwidth than ulaw
allow=ulaw
context=from-pstn

testing with ths dial plan primarily
exten => 411,1,Dial(SIP/1800373341160@7870,1)
exten => 411,2,Hangup()

I have tested without the “,1” (timeout?) in line 1

can we see the configuration of extensions.conf file?

SANOGO Touna

This is what I have been testing with primarily

exten => 411,1,Dial(SIP/1800373341160@7870,1)
exten => 411,2,Hangup()

I have tested without the “,1” (timeout?) in line 1

Show please the SIP trace for the above reply

sip set debug on

Reliably Transmitting (NAT) to 199.199.199.199:5060:
OPTIONS sip:my.domain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK54de31c8;rport
Max-Forwards: 70
From: “asterisk” sip:7870@192.168.1.50;tag=as7085f995
To: sip:my.domain.com
Contact: sip:7870@192.168.1.50:5060
Call-ID: 36022dff3fd5334e754f9ed314cc431c@192.168.1.50:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Date: Mon, 22 Jul 2019 00:43:48 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:199.199.199.199:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK54de31c8;received=192.168.1.50;rport=5060
From: “asterisk” sip:7870@192.168.1.50:5060;tag=as7085f995
To: sip:my.domain.com;tag=as33cf13ad
Call-ID: 36022dff3fd5334e754f9ed314cc431c@192.168.1.50:5060
CSeq: 102 OPTIONS
Server: YoMaMa
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:199.199.199.199:5060
Accept: application/sdp
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Really destroying SIP dialog ‘36022dff3fd5334e754f9ed314cc431c@192.168.1.50:5060’ Method: OPTIONS
== Using SIP RTP CoS mark 5
> 0x3048d38 – Strict RTP learning after remote address set to: 192.168.1.49:13456
– Executing [411@from-internal:1] Dial(“SIP/5901-0000000d”, “SIP/1800373341160@7870,1”) in new stack
== Using SIP RTP CoS mark 5
Audio is at 15560
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 199.199.199.199:5060:
INVITE sip:1800373341160@my.domain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK4dfbbc73;rport
Max-Forwards: 70
From: “UTSTAR1” sip:7870@192.168.1.50;tag=as54f61e8c
To: sip:1800373341160@my.domain.com
Contact: sip:7870@192.168.1.50:5060
Call-ID: 669b2260338a832320f155eb6120cbf2@192.168.1.50:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Date: Mon, 22 Jul 2019 00:43:51 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 264

v=0
o=root 302216126 302216126 IN IP4 192.168.1.50
s=Asterisk PBX 13.14.1~dfsg-2+deb9u4
c=IN IP4 192.168.1.50
t=0 0
m=audio 15560 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv


-- Called SIP/1800373341160@7870

<— SIP read from UDP:199.199.199.199:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK4dfbbc73;received=192.168.1.50;rport=5060
From: “UTSTAR1” sip:7870@192.168.1.50:5060;tag=as54f61e8c
To: sip:1800373341160@my.domain.com;tag=as2f73c1dd
Call-ID: 669b2260338a832320f155eb6120cbf2@192.168.1.50:5060
CSeq: 102 INVITE
Server: YoMaMa
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“6df06d37”
Content-Length: 0

<------------->
— (11 headers 0 lines) —
Transmitting (NAT) to 199.199.199.199:5060:
ACK sip:1800373341160@my.domain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK4dfbbc73;rport
Max-Forwards: 70
From: “UTSTAR1” sip:7870@192.168.1.50;tag=as54f61e8c
To: sip:1800373341160@my.domain.com;tag=as2f73c1dd
Contact: sip:7870@192.168.1.50:5060
Call-ID: 669b2260338a832320f155eb6120cbf2@192.168.1.50:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Content-Length: 0


Audio is at 15560
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 199.199.199.199:5060:
INVITE sip:1800373341160@my.domain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK59b1364e;rport
Max-Forwards: 70
From: “UTSTAR1” sip:7870@192.168.1.50;tag=as54f61e8c
To: sip:1800373341160@my.domain.com
Contact: sip:7870@192.168.1.50:5060
Call-ID: 669b2260338a832320f155eb6120cbf2@192.168.1.50:5060
CSeq: 103 INVITE
User-Agent: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Authorization: Digest username=“7870”, realm=“asterisk”, algorithm=MD5, uri="sip:1800373341160@my.domain.com", nonce=“6df06d37”, response=“50f98f21acb736da31028d6e5f7acd93”
Date: Mon, 22 Jul 2019 00:43:51 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 264

v=0
o=root 302216126 302216127 IN IP4 192.168.1.50
s=Asterisk PBX 13.14.1~dfsg-2+deb9u4
c=IN IP4 192.168.1.50
t=0 0
m=audio 15560 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv


Retransmitting #1 (NAT) to 199.199.199.199:5060:
INVITE sip:1800373341160@my.domain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK59b1364e;rport
Max-Forwards: 70
From: “UTSTAR1” sip:7870@192.168.1.50;tag=as54f61e8c
To: sip:1800373341160@my.domain.com
Contact: sip:7870@192.168.1.50:5060
Call-ID: 669b2260338a832320f155eb6120cbf2@192.168.1.50:5060
CSeq: 103 INVITE
User-Agent: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Authorization: Digest username=“7870”, realm=“asterisk”, algorithm=MD5, uri="sip:1800373341160@my.domain.com", nonce=“6df06d37”, response=“50f98f21acb736da31028d6e5f7acd93”
Date: Mon, 22 Jul 2019 00:43:51 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 264

v=0
o=root 302216126 302216127 IN IP4 192.168.1.50
s=Asterisk PBX 13.14.1~dfsg-2+deb9u4
c=IN IP4 192.168.1.50
t=0 0
m=audio 15560 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv


<— SIP read from UDP:199.199.199.199:5060 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK59b1364e;received=192.168.1.50;rport=5060
From: “UTSTAR1” sip:7870@192.168.1.50:5060;tag=as54f61e8c
To: sip:1800373341160@my.domain.com;tag=as2f73c1dd
Call-ID: 669b2260338a832320f155eb6120cbf2@192.168.1.50:5060
CSeq: 103 INVITE
Server: YoMaMa
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Transmitting (NAT) to 199.199.199.199:5060:
ACK sip:1800373341160@my.domain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.50:5060;branch=z9hG4bK59b1364e;rport
Max-Forwards: 70
From: “UTSTAR1” sip:7870@192.168.1.50;tag=as54f61e8c
To: sip:1800373341160@my.domain.com;tag=as2f73c1dd
Contact: sip:7870@192.168.1.50:5060
Call-ID: 669b2260338a832320f155eb6120cbf2@192.168.1.50:5060
CSeq: 103 ACK
User-Agent: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Content-Length: 0


Scheduling destruction of SIP dialog ‘669b2260338a832320f155eb6120cbf2@192.168.1.50:5060’ in 6400 ms (Method: INVITE)
== Everyone is busy/congested at this time (1:0/0/1)
– Auto fallthrough, channel ‘SIP/5901-0000000d’ status is ‘CHANUNAVAIL’
Really destroying S

After the 401 the INVITE is sent with the correct Authorization , then final reponse from YoMaMa server is SIP/2.0 404 Not Found, are you sure you re dialing in th correct format have you verify with them if is needed some kind of prefix

figured out my errors

Among other things:
exten => 411,1,Dial(SIP/1800373341160@7870,1)

should be
exten => 411,1,Dial(SIP/18003733411@7870,1)

how the “60” got there is beyond me.

That’s why you got the SIP/2.0 404 Not Found,