503 error on dialing out using same trunk as incoming call

I have 3 trunks registered in my asterisk config. I am using this config in my extensions.conf:

[from-trunk2]
exten => _[0-9].,1,NoOp(#### [from-trunk2] ####)
same => n,Set(CALLERID(num)=0${EXTEN:2})
same => n,Dial(SIP/Rental-Landline,15)
same => n,Playback(queue-periodic-announce)
same => n,Dial(SIP/trunk3/447123456789,15)
same => n,Playback(queue-periodic-announce)
same => n,Dial(SIP/trunk3/447123456789,15)
same => n,Playback(please-try-call-later)
same => n,Playback(goodbye)
same => n,Hangup()

However, I get a 503 error from the cli when the call falls through to dial out over trunk3 to both mobile numbers. If I use trunk1 in the same scenario it works fine. The trunk2 is an account with VOIP.ms and the trunk3 is a sub account with VOIPS.ms. Trunk1 is an account with GoTrunk but I do not want to use this as the transferred provider, as they do not offer the option to set the CALLERID.

Any ideas on why this isn’t working? I can contacted VOIP.ms and they assure me that the account has the ability to have 5 simultaneous calls so I should not even need to use the sub account (registered as trunk3) and should be able to dial back out on trunk2.

I’d suggest providing an actual SIP trace using “sip set debug on” and configuration minus password.

Thanks for the reply:

[general]
allowguest=no
context=default
bindport=8888
bindaddr=0.0.0.0
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
allow=gsm
allow=g723
allow=g726
canreinvite=yes
qualify=no
pedantic=no
externip=external-wan
localnet=10.0.1.115/24
nat=yes

register => user:secret@trunk
register => user1:secret@trunk2
register => user2:secret@trunk3

[Rental-Landline]
type=friend
host=dynamic
context=from-internal3
username=1000
secret=secret
qualify=yes
nat=force_rport,comedia

[Rental-Landline]
type=friend
host=dynamic
context=from-internal3
username=1000
secret=secret
qualify=yes
nat=force_rport,comedia

[1001]
type=friend
host=dynamic
context=from-internal3
username=1001
secret=secret
qualify=yes
nat=force_rport,comedia

[trunk]
type=peer
host=eu.st.ssl7.net  ; Europe POP
context=from-trunk
qualify=yes
defaultuser=user
remotesecret=sercret

[trunk2]
type=peer
host=london1.voip.ms  ; UK POP
context=from-trunk2
secret=secret
username=user1
fromuser=user1
trustrpid=yes
sendrpid=yes
insecure=invite

[trunk3]
type=peer
host=london1.voip.ms  ; UK POP
context=from-trunk3
secret=secret
username=user2
fromuser=user2
trustrpid=yes
sendrpid=yes
insecure=invite

and for the log when the call tries to pass the incoming call out to the mobile numbers:

== Using SIP RTP CoS mark 5
    -- Executing [443455280496@from-trunk2:1] NoOp("SIP/trunk2-00000000", "#### [from-trunk2] ####") in new stack
    -- Executing [443455280496@from-trunk2:2] Set("SIP/trunk2-00000000", "CALLERID(num)=03455280496") in new stack
    -- Executing [443455280496@from-trunk2:3] Dial("SIP/trunk2-00000000", "SIP/Rental-Landline,15") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/Rental-Landline
    -- SIP/Rental-Landline-00000001 is ringing
    -- Nobody picked up in 15000 ms
    -- Executing [443455280496@from-trunk2:4] Playback("SIP/trunk2-00000000", "queue-periodic-announce") in new stack
    -- <SIP/trunk2-00000000> Playing 'queue-periodic-announce.gsm' (language 'en')
       > 0x7f6b6800e360 -- Probation passed - setting RTP source address to 208.100.60.34:19520
    -- Executing [443455280496@from-trunk2:5] Dial("SIP/trunk2-00000000", "SIP/trunk3/447123456789,15") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/trunk3/44123456789
    -- Got SIP response 503 "Service Unavailable" back from 208.100.60.34:5060
    -- SIP/trunk3-00000002 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Executing [443455280496@from-trunk2:6] Playback("SIP/trunk2-00000000", "queue-periodic-announce") in new stack
    -- <SIP/trunk2-00000000> Playing 'queue-periodic-announce.gsm' (language 'en')
    -- Executing [443455280496@from-trunk2:7] Dial("SIP/trunk2-00000000", "SIP/trunk3/447123456789,15") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/trunk3/447123456789
    -- Got SIP response 503 "Service Unavailable" back from 208.100.60.34:5060
    -- SIP/trunk3-00000003 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Executing [443455280496@from-trunk2:8] Playback("SIP/trunk2-00000000", "please-try-call-later") in new stack
    -- <SIP/trunk2-00000000> Playing 'please-try-call-later.gsm' (language 'en')
    -- Executing [443455280496@from-trunk2:9] Playback("SIP/trunk2-00000000", "goodbye") in new stack
    -- <SIP/trunk2-00000000> Playing 'goodbye.gsm' (language 'en')
    -- Executing [443455280496@from-trunk2:10] Hangup("SIP/trunk2-00000000", "") in new stack
  == Spawn extension (from-trunk2, 443455280496, 10) exited non-zero on 'SIP/trunk2-00000000'

I don’t see any “sip set debug on” SIP trace in that log.

It sounds like you are trying to us a single mobile air interface gateway SIM in two directions at once.

Apologies. Forgot to add that one:

<--- Reliably Transmitting (NAT) to 208.100.60.34:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 208.100.60.34:5060;branch=z9hG4bK408fe745;received=208.100.60.34;rport=5060
From: "anonymous" <sip:anonymous@208.100.60.34>;tag=as7992c37f
To: <sip:443455280496@10.0.1.115:8888>;tag=as785708ed
Call-ID: 562f44d379fa19fd1ce059a7577df3e7@208.100.60.34:5060
CSeq: 102 INVITE
Server: Asterisk PBX certified/13.8-cert1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:443455280496@my-wan-ip:8888>
Content-Type: application/sdp
Require: timer
Content-Length: 267

v=0
o=root 972976230 972976230 IN IP4 my-wan-ip
s=Asterisk PBX certified/13.8-cert1
c=IN IP4 my-wan-ip
t=0 0
m=audio 12826 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:208.100.60.34:5060 --->
ACK sip:443455280496@10.0.1.115:8888 SIP/2.0
Via: SIP/2.0/UDP 208.100.60.34:5060;branch=z9hG4bK404bc5f1;rport
Max-Forwards: 70
From: "anonymous" <sip:anonymous@208.100.60.34>;tag=as7992c37f
To: <sip:443455280496@10.0.1.115:8888>;tag=as785708ed
Contact: <sip:anonymous@208.100.60.34:5060>
Call-ID: 562f44d379fa19fd1ce059a7577df3e7@208.100.60.34:5060
CSeq: 102 ACK
User-Agent: voip.ms
Content-Length: 0


<------------->
--- (10 headers 0 lines) ---

<--- SIP read from UDP:10.0.1.96:8888 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK06b55071;rport=8888;received=10.0.1.115
From: "anonymous" <sip:03455280496@10.0.1.115:8888>;tag=as555baed4
To: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>;tag=764725141
Call-ID: 28ccd2db6def48e21f3aad5a3b321697@10.0.1.115:8888
CSeq: 102 INVITE
Content-Length: 0


<------------->
--- (7 headers 0 lines) ---
Transmitting (NAT) to 10.0.1.96:8888:
ACK sip:Rental-Landline@10.0.1.96:8888;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK06b55071;rport
Max-Forwards: 70
From: "anonymous" <sip:03455280496@10.0.1.115:8888>;tag=as555baed4
To: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>;tag=764725141
Contact: <sip:03455280496@10.0.1.115:8888>
Call-ID: 28ccd2db6def48e21f3aad5a3b321697@10.0.1.115:8888
CSeq: 102 ACK
User-Agent: Asterisk PBX certified/13.8-cert1
Content-Length: 0


---
Scheduling destruction of SIP dialog '28ccd2db6def48e21f3aad5a3b321697@10.0.1.115:8888' in 6400 ms (Method: INVITE)

<--- SIP read from UDP:10.0.1.96:8888 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK06b55071;rport=8888;received=10.0.1.115
From: "anonymous" <sip:03455280496@10.0.1.115:8888>;tag=as555baed4
To: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>
Call-ID: 28ccd2db6def48e21f3aad5a3b321697@10.0.1.115:8888
CSeq: 102 CANCEL
Contact: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>
Content-Length: 0
Server: (Ascom Myco 3 1.2.1/Ascom Experience 1.2.0 [13.1857])


<------------->
--- (9 headers 0 lines) ---
    -- <SIP/trunk2-00000004> Playing 'queue-periodic-announce.gsm' (language 'en')
       > 0x7f6b68032390 -- Probation passed - setting RTP source address to 208.100.60.34:15452

<--- SIP read from UDP:109.233.115.107:5060 --->
OPTIONS sip:s@my-wan-ip:8888 SIP/2.0
Via: SIP/2.0/UDP 109.233.115.107:5060;branch=z9hG4bK00cd9b11
From: sip:keepalive@109.233.115.107;tag=f8542c33
To: sip:s@my-wan-ip:8888
Call-ID: 5bbf5c15-00cd9b11-22f406@109.233.115.107
CSeq: 1 OPTIONS
Max-Forwards: 70
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
Sending to 109.233.115.107:5060 (NAT)
Looking for s in default (domain my-wan-ip)

<--- Transmitting (NAT) to 109.233.115.107:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 109.233.115.107:5060;branch=z9hG4bK00cd9b11;received=109.233.115.107;rport=5060
From: sip:keepalive@109.233.115.107;tag=f8542c33
To: sip:s@my-wan-ip:8888;tag=as3ff4861f
Call-ID: 5bbf5c15-00cd9b11-22f406@109.233.115.107
CSeq: 1 OPTIONS
Server: Asterisk PBX certified/13.8-cert1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Accept: application/sdp
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '5bbf5c15-00cd9b11-22f406@109.233.115.107' in 32000 ms (Method: OPTIONS)
Really destroying SIP dialog '5bbf5c15-abad9b11-40f406@109.233.115.107' Method: OPTIONS
Really destroying SIP dialog '28ccd2db6def48e21f3aad5a3b321697@10.0.1.115:8888' Method: INVITE
    -- Executing [443455280496@from-trunk2:5] Dial("SIP/trunk2-00000004", "SIP/trunk3/447123456789,15") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 12110
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g723 to SDP
Adding codec g726 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 208.100.60.34:5060:
INVITE sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK104d21c9;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0d5b0d22
To: <sip:447123456789@london1.voip.ms>
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888
CSeq: 102 INVITE
User-Agent: Asterisk PBX certified/13.8-cert1
Date: Wed, 05 Jul 2023 11:40:25 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: "anonymous" <sip:03455280496@my-wan-ip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 391

v=0
o=root 2098125699 2098125699 IN IP4 my-wan-ip
s=Asterisk PBX certified/13.8-cert1
c=IN IP4 my-wan-ip
t=0 0
m=audio 12110 RTP/AVP 0 8 3 4 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---
    -- Called SIP/trunk3/447123456789

<--- SIP read from UDP:208.100.60.34:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK104d21c9;received=10.0.1.115;rport=8888
From: "anonymous" <sip:239596_1@10.0.1.115:8888>;tag=as0d5b0d22
To: <sip:447123456789@london1.voip.ms>;tag=as02c0cec9
Call-ID: 6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888
CSeq: 102 INVITE
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="london1.voip.ms", nonce="640baa6f"
Content-Length: 0


<------------->
--- (11 headers 0 lines) ---
Transmitting (NAT) to 208.100.60.34:5060:
ACK sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK104d21c9;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0d5b0d22
To: <sip:447123456789@london1.voip.ms>;tag=as02c0cec9
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888
CSeq: 102 ACK
User-Agent: Asterisk PBX certified/13.8-cert1
Content-Length: 0


---
Audio is at 12110
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g723 to SDP
Adding codec g726 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 208.100.60.34:5060:
INVITE sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK078854a3;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0d5b0d22
To: <sip:447123456789@london1.voip.ms>
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888
CSeq: 103 INVITE
User-Agent: Asterisk PBX certified/13.8-cert1
Authorization: Digest username="239596_1", realm="london1.voip.ms", algorithm=MD5, uri="sip:447123456789@london1.voip.ms", nonce="640baa6f", response="5859c676b0385b234c9a041b1ed1f762"
Date: Wed, 05 Jul 2023 11:40:25 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: "anonymous" <sip:03455280496@my-wan-ip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 391

v=0
o=root 2098125699 2098125700 IN IP4 my-wan-ip
s=Asterisk PBX certified/13.8-cert1
c=IN IP4 my-wan-ip
t=0 0
m=audio 12110 RTP/AVP 0 8 3 4 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:208.100.60.34:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK078854a3;received=10.0.1.115;rport=8888
From: "anonymous" <sip:239596_1@10.0.1.115:8888>;tag=as0d5b0d22
To: <sip:447123456789@london1.voip.ms>
Call-ID: 6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888
CSeq: 103 INVITE
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:447123456789@208.100.60.34:5060>
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:208.100.60.34:5060 --->
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK078854a3;received=10.0.1.115;rport=8888
From: "anonymous" <sip:239596_1@10.0.1.115:8888>;tag=as0d5b0d22
To: <sip:447123456789@london1.voip.ms>;tag=as0086fecc
Call-ID: 6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888
CSeq: 103 INVITE
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Content-Length: 0


<------------->
--- (11 headers 0 lines) ---
    -- Got SIP response 503 "Service Unavailable" back from 208.100.60.34:5060
Transmitting (NAT) to 208.100.60.34:5060:
ACK sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK078854a3;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0d5b0d22
To: <sip:447123456789@london1.voip.ms>;tag=as0086fecc
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888
CSeq: 103 ACK
User-Agent: Asterisk PBX certified/13.8-cert1
Content-Length: 0


---
    -- SIP/trunk3-00000006 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Executing [443455280496@from-trunk2:6] Playback("SIP/trunk2-00000004", "queue-periodic-announce") in new stack
    -- <SIP/trunk2-00000004> Playing 'queue-periodic-announce.gsm' (language 'en')
Really destroying SIP dialog '6326040a196d5d1753fbfc5e56a176a0@my-wan-ip:8888' Method: INVITE

<--- SIP read from UDP:109.233.115.107:5060 --->
OPTIONS sip:s@my-wan-ip:8888 SIP/2.0
Via: SIP/2.0/UDP 109.233.115.107:5060;branch=z9hG4bK1ccd9b11
From: sip:keepalive@109.233.115.107;tag=05642c33
To: sip:s@my-wan-ip:8888
Call-ID: 5bbf5c15-1ccd9b11-c2f406@109.233.115.107
CSeq: 1 OPTIONS
Max-Forwards: 70
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
Sending to 109.233.115.107:5060 (NAT)
Looking for s in default (domain my-wan-ip)

<--- Transmitting (NAT) to 109.233.115.107:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 109.233.115.107:5060;branch=z9hG4bK1ccd9b11;received=109.233.115.107;rport=5060
From: sip:keepalive@109.233.115.107;tag=05642c33
To: sip:s@my-wan-ip:8888;tag=as6e8347a8
Call-ID: 5bbf5c15-1ccd9b11-c2f406@109.233.115.107
CSeq: 1 OPTIONS
Server: Asterisk PBX certified/13.8-cert1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Accept: application/sdp
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '5bbf5c15-1ccd9b11-c2f406@109.233.115.107' in 32000 ms (Method: OPTIONS)
    -- Executing [443455280496@from-trunk2:7] Dial("SIP/trunk2-00000004", "SIP/trunk3/447123456789,15") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 14964
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g723 to SDP
Adding codec g726 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 208.100.60.34:5060:
INVITE sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK2bf26b0c;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0c825cbf
To: <sip:447123456789@london1.voip.ms>
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888
CSeq: 102 INVITE
User-Agent: Asterisk PBX certified/13.8-cert1
Date: Wed, 05 Jul 2023 11:40:33 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: "anonymous" <sip:03455280496@my-wan-ip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 391

v=0
o=root 1382513468 1382513468 IN IP4 my-wan-ip
s=Asterisk PBX certified/13.8-cert1
c=IN IP4 my-wan-ip
t=0 0
m=audio 14964 RTP/AVP 0 8 3 4 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---
    -- Called SIP/trunk3/447123456789

<--- SIP read from UDP:208.100.60.34:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK2bf26b0c;received=10.0.1.115;rport=8888
From: "anonymous" <sip:239596_1@10.0.1.115:8888>;tag=as0c825cbf
To: <sip:447123456789@london1.voip.ms>;tag=as3c43f288
Call-ID: 7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888
CSeq: 102 INVITE
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="london1.voip.ms", nonce="31645dfd"
Content-Length: 0


<------------->
--- (11 headers 0 lines) ---
Transmitting (NAT) to 208.100.60.34:5060:
ACK sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK2bf26b0c;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0c825cbf
To: <sip:447123456789@london1.voip.ms>;tag=as3c43f288
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888
CSeq: 102 ACK
User-Agent: Asterisk PBX certified/13.8-cert1
Content-Length: 0


---
Audio is at 14964
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g723 to SDP
Adding codec g726 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 208.100.60.34:5060:
INVITE sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK4457473f;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0c825cbf
To: <sip:447123456789@london1.voip.ms>
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888
CSeq: 103 INVITE
User-Agent: Asterisk PBX certified/13.8-cert1
Authorization: Digest username="239596_1", realm="london1.voip.ms", algorithm=MD5, uri="sip:447123456789@london1.voip.ms", nonce="31645dfd", response="795211b1d38b1f3095744445fddea24b"
Date: Wed, 05 Jul 2023 11:40:33 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: "anonymous" <sip:03455280496@my-wan-ip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 391

v=0
o=root 1382513468 1382513469 IN IP4 my-wan-ip
s=Asterisk PBX certified/13.8-cert1
c=IN IP4 my-wan-ip
t=0 0
m=audio 14964 RTP/AVP 0 8 3 4 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:208.100.60.34:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK4457473f;received=10.0.1.115;rport=8888
From: "anonymous" <sip:239596_1@10.0.1.115:8888>;tag=as0c825cbf
To: <sip:447123456789@london1.voip.ms>
Call-ID: 7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888
CSeq: 103 INVITE
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:447123456789@208.100.60.34:5060>
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:208.100.60.34:5060 --->
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK4457473f;received=10.0.1.115;rport=8888
From: "anonymous" <sip:239596_1@10.0.1.115:8888>;tag=as0c825cbf
To: <sip:447123456789@london1.voip.ms>;tag=as79bff240
Call-ID: 7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888
CSeq: 103 INVITE
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Content-Length: 0


<------------->
--- (11 headers 0 lines) ---
    -- Got SIP response 503 "Service Unavailable" back from 208.100.60.34:5060
Transmitting (NAT) to 208.100.60.34:5060:
ACK sip:447123456789@london1.voip.ms SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK4457473f;rport
Max-Forwards: 70
From: "anonymous" <sip:239596_1@my-wan-ip:8888>;tag=as0c825cbf
To: <sip:447123456789@london1.voip.ms>;tag=as79bff240
Contact: <sip:239596_1@my-wan-ip:8888>
Call-ID: 7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888
CSeq: 103 ACK
User-Agent: Asterisk PBX certified/13.8-cert1
Content-Length: 0


---
    -- SIP/trunk3-00000007 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Executing [443455280496@from-trunk2:8] Playback("SIP/trunk2-00000004", "please-try-call-later") in new stack
    -- <SIP/trunk2-00000004> Playing 'please-try-call-later.gsm' (language 'en')
Really destroying SIP dialog '5bbf5c15-83bd9b11-e0f406@109.233.115.107' Method: OPTIONS
Really destroying SIP dialog '7a29477f5b0e9aa57f40e60b447ecd55@my-wan-ip:8888' Method: INVITE

<--- SIP read from UDP:10.0.1.96:8888 --->
REGISTER sip:10.0.1.115 SIP/2.0
Authorization: Digest username="Rental-Landline",realm="asterisk",nonce="3e21baea",response="092e3ab11a9ee5bbf76e3d959cdaeea4",uri="sip:10.0.1.115",algorithm=MD5
Via: SIP/2.0/UDP 10.0.1.96:8888;branch=z9hG4bK-715DB7A8;rport
From: <sip:Rental-Landline@10.0.1.115>;tag=764725143
To: <sip:Rental-Landline@10.0.1.115>
Call-ID: 8ef27fd445a564017ddd00013e603351
CSeq: 1098 REGISTER
Contact: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>;expires=120
Accept: innovaphone/data
Content-Length: 0
Expires: 120
Max-Forwards: 70
User-Agent: (Ascom Myco 3 1.2.1/Ascom Experience 1.2.0 [13.1857])
Allow-Events: reg,dialog,message-summary,presence


<------------->
--- (14 headers 0 lines) ---
Sending to 10.0.1.96:8888 (NAT)
Sending to 10.0.1.96:8888 (NAT)

<--- Transmitting (NAT) to 10.0.1.96:8888 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.1.96:8888;branch=z9hG4bK-715DB7A8;received=10.0.1.96;rport=8888
From: <sip:Rental-Landline@10.0.1.115>;tag=764725143
To: <sip:Rental-Landline@10.0.1.115>;tag=as787ce642
Call-ID: 8ef27fd445a564017ddd00013e603351
CSeq: 1098 REGISTER
Server: Asterisk PBX certified/13.8-cert1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0101ed1d"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '8ef27fd445a564017ddd00013e603351' in 32000 ms (Method: REGISTER)

<--- SIP read from UDP:10.0.1.96:8888 --->
REGISTER sip:10.0.1.115 SIP/2.0
Authorization: Digest username="Rental-Landline",realm="asterisk",nonce="0101ed1d",response="4b0fd4595df6999671d7b4b93247b0d6",uri="sip:10.0.1.115",algorithm=MD5
Via: SIP/2.0/UDP 10.0.1.96:8888;branch=z9hG4bK-715DB7A9;rport
From: <sip:Rental-Landline@10.0.1.115>;tag=764725143
To: <sip:Rental-Landline@10.0.1.115>
Call-ID: 8ef27fd445a564017ddd00013e603351
CSeq: 1099 REGISTER
Contact: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>;expires=120
Accept: innovaphone/data
Content-Length: 0
Expires: 120
Max-Forwards: 70
User-Agent: (Ascom Myco 3 1.2.1/Ascom Experience 1.2.0 [13.1857])
Allow-Events: reg,dialog,message-summary,presence


<------------->
--- (14 headers 0 lines) ---
Sending to 10.0.1.96:8888 (NAT)
Reliably Transmitting (NAT) to 10.0.1.96:8888:
OPTIONS sip:Rental-Landline@10.0.1.96:8888;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK77bad01c;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@10.0.1.115:8888>;tag=as12779c39
To: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>
Contact: <sip:asterisk@10.0.1.115:8888>
Call-ID: 3588b2a8396fba840df09e1e45309966@10.0.1.115:8888
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX certified/13.8-cert1
Date: Wed, 05 Jul 2023 11:40:33 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


---

<--- Transmitting (NAT) to 10.0.1.96:8888 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.1.96:8888;branch=z9hG4bK-715DB7A9;received=10.0.1.96;rport=8888
From: <sip:Rental-Landline@10.0.1.115>;tag=764725143
To: <sip:Rental-Landline@10.0.1.115>;tag=as787ce642
Call-ID: 8ef27fd445a564017ddd00013e603351
CSeq: 1099 REGISTER
Server: Asterisk PBX certified/13.8-cert1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 120
Contact: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>;expires=120
Date: Wed, 05 Jul 2023 11:40:33 GMT
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '8ef27fd445a564017ddd00013e603351' in 32000 ms (Method: REGISTER)

<--- SIP read from UDP:10.0.1.96:8888 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK77bad01c;rport=8888;received=10.0.1.115
From: "asterisk" <sip:asterisk@10.0.1.115:8888>;tag=as12779c39
To: <sip:Rental-Landline@10.0.1.96:8888;transport=UDP>;tag=764725144
Call-ID: 3588b2a8396fba840df09e1e45309966@10.0.1.115:8888
CSeq: 102 OPTIONS
Accept: application/sdp,application/dtmf-relay
Allow: REGISTER,SUBSCRIBE,NOTIFY,INVITE,ACK,PRACK,OPTIONS,BYE,CANCEL,REFER,INFO,UPDATE,PUBLISH
Content-Length: 0
Server: (Ascom Myco 3 1.2.1/Ascom Experience 1.2.0 [13.1857])
Supported: 100rel,replaces,privacy,timer,from-change,histinfo,answermode,uui


<------------->
--- (11 headers 0 lines) ---
Really destroying SIP dialog '3588b2a8396fba840df09e1e45309966@10.0.1.115:8888' Method: OPTIONS
    -- Executing [443455280496@from-trunk2:9] Playback("SIP/trunk2-00000004", "goodbye") in new stack
    -- <SIP/trunk2-00000004> Playing 'goodbye.gsm' (language 'en')
    -- Executing [443455280496@from-trunk2:10] Hangup("SIP/trunk2-00000004", "") in new stack
  == Spawn extension (from-trunk2, 443455280496, 10) exited non-zero on 'SIP/trunk2-00000004'
Scheduling destruction of SIP dialog '562f44d379fa19fd1ce059a7577df3e7@208.100.60.34:5060' in 32000 ms (Method: ACK)
Reliably Transmitting (NAT) to 208.100.60.34:5060:
BYE sip:anonymous@208.100.60.34:5060 SIP/2.0
Via: SIP/2.0/UDP my-wan-ip:8888;branch=z9hG4bK40c93444;rport
Max-Forwards: 70
From: <sip:443455280496@10.0.1.115:8888>;tag=as785708ed
To: "anonymous" <sip:anonymous@208.100.60.34>;tag=as7992c37f
Call-ID: 562f44d379fa19fd1ce059a7577df3e7@208.100.60.34:5060
CSeq: 102 BYE
User-Agent: Asterisk PBX certified/13.8-cert1
X-Asterisk-HangupCause: Circuit/channel congestion
X-Asterisk-HangupCauseCode: 34
Content-Length: 0


---

<--- SIP read from UDP:208.100.60.34:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.1.115:8888;branch=z9hG4bK40c93444;received=10.0.1.115;rport=8888
From: <sip:443455280496@10.0.1.115:8888>;tag=as785708ed
To: "anonymous" <sip:anonymous@208.100.60.34>;tag=as7992c37f
Call-ID: 562f44d379fa19fd1ce059a7577df3e7@208.100.60.34:5060
CSeq: 102 BYE
Server: voip.ms
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------->
--- (10 headers 0 lines) ---
SIP Response message for INCOMING dialog BYE arrived
Really destroying SIP dialog '562f44d379fa19fd1ce059a7577df3e7@208.100.60.34:5060' Method: ACK

<--- SIP read from UDP:109.233.115.107:5060 --->
OPTIONS sip:s@my-wan-ip:8888 SIP/2.0
Via: SIP/2.0/UDP 109.233.115.107:5060;branch=z9hG4bKf6dd9b11
From: sip:keepalive@109.233.115.107;tag=ef642c33
To: sip:s@my-wan-ip:8888
Call-ID: 5bbf5c15-f6dd9b11-63f406@109.233.115.107
CSeq: 1 OPTIONS
Max-Forwards: 70
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
Sending to 109.233.115.107:5060 (NAT)
Looking for s in default (domain my-wan-ip)

<--- Transmitting (NAT) to 109.233.115.107:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 109.233.115.107:5060;branch=z9hG4bKf6dd9b11;received=109.233.115.107;rport=5060
From: sip:keepalive@109.233.115.107;tag=ef642c33
To: sip:s@my-wan-ip:8888;tag=as490a7105
Call-ID: 5bbf5c15-f6dd9b11-63f406@109.233.115.107
CSeq: 1 OPTIONS
Server: Asterisk PBX certified/13.8-cert1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Accept: application/sdp
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '5bbf5c15-f6dd9b11-63f406@109.233.115.107' in 32000 ms (Method: OPTIONS)
Really destroying SIP dialog '5bbf5c15-7b27c811-81f406@109.233.115.107' Method: OPTIONS

From the perspective of the SIP signaling you authenticated properly and then got a 503, so you’d likely need to reach out to voip.ms to understand why. Could be the formatting of the phone number, or maybe the use of anonymous for callerid name. All just guesses though.

As you are using a certified version, why are you asking here? Certified versions are only for people with paid support contracts. Also you are using an obsolete version of Asterisk, and current certified versions do not enable chan_sip - enabling it makes the version no longer certified.

Thanks for the suggestion, something obvious that I didn’t even check.

The number I was testing with was passing out anonymous as its caller id and this was unsupported as a called id to pass back to the provider as an outgoing call :see_no_evil:

All sorted now with an if statement in the dial plan to check for incoming calls with an anonymous caller id, before handling the call.

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