Setting up Eurotech GSM Gateway as a SIP trunk & calls failing

[code]pbx*CLI> sip set debug peer 102
SIP Debugging Enabled for IP: 192.168.1.17

<— SIP read from UDP:192.168.1.17:51860 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-a642ae43f22c482c-1–d87543-;rport
Max-Forwards: 70
Contact: sip:[email protected]:51860
To: "09991112222"sip:[email protected]
From: "102"sip:[email protected];tag=00635314
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
User-Agent: eyeBeam release 1003s stamp 31159
Content-Length: 338

v=0
o=- 3 2 IN IP4 192.168.1.17
s=CounterPath eyeBeam 1.5
c=IN IP4 192.168.1.17
t=0 0
m=audio 45382 RTP/AVP 0 101
a=alt:1 2 : j8QWaziv PvukmJCn 5.197.199.246 45382
a=alt:2 1 : lvvtlj8e 6YOaHW/8 192.168.1.17 45382
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=sendrecv
a=x-rtp-session-id:9D423DC1CA0E4223A8DCA73227810F61
<------------->
— (12 headers 12 lines) —
Sending to 192.168.1.17:51860 (NAT)
Using INVITE request as basis request - 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
Found peer ‘102’ for ‘102’ from 192.168.1.17:51860

<— Reliably Transmitting (NAT) to 192.168.1.17:51860 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-a642ae43f22c482c-1–d87543-;received=192.168.1.17;rport=51860
From: "102"sip:[email protected];tag=00635314
To: "09991112222"sip:[email protected];tag=as016c8f49
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 1 INVITE
Server: FPBX-2.8.1(1.8.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="4f4a1b0e"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.’ in 6720 ms (Method: INVITE)

<— SIP read from UDP:192.168.1.17:51860 —>
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-a642ae43f22c482c-1–d87543-;rport
To: "09991112222"sip:[email protected];tag=as016c8f49
From: "102"sip:[email protected];tag=00635314
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 1 ACK
Content-Length: 0

<------------->
— (7 headers 0 lines) —

<— SIP read from UDP:192.168.1.17:51860 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-9e492f6ddf658714-1–d87543-;rport
Max-Forwards: 70
Contact: sip:[email protected]:51860
To: "09991112222"sip:[email protected]
From: “102"sip:[email protected];tag=00635314
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
User-Agent: eyeBeam release 1003s stamp 31159
Authorization: Digest username=“102”,realm=“asterisk”,nonce=“4f4a1b0e”,uri="sip:[email protected]”,response=“0d0b610b216bf62e1b6ec4bd2523a933”,algorithm=MD5
Content-Length: 338

v=0
o=- 3 2 IN IP4 192.168.1.17
s=CounterPath eyeBeam 1.5
c=IN IP4 192.168.1.17
t=0 0
m=audio 45382 RTP/AVP 0 101
a=alt:1 2 : j8QWaziv PvukmJCn 5.197.199.246 45382
a=alt:2 1 : lvvtlj8e 6YOaHW/8 192.168.1.17 45382
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=sendrecv
a=x-rtp-session-id:9D423DC1CA0E4223A8DCA73227810F61
<------------->
— (13 headers 12 lines) —
Sending to 192.168.1.17:51860 (NAT)
Using INVITE request as basis request - 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
Found peer ‘102’ for ‘102’ from 192.168.1.17:51860
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 101
Found audio description format telephone-event for ID 101
Capabilities: us - 0x4 (ulaw), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.17:45382
Looking for 09991112222 in from-internal (domain 192.168.1.252)
list_route: hop: sip:[email protected]:51860

<— Transmitting (NAT) to 192.168.1.17:51860 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-9e492f6ddf658714-1–d87543-;received=192.168.1.17;rport=51860
From: "102"sip:[email protected];tag=00635314
To: "09991112222"sip:[email protected]
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 2 INVITE
Server: FPBX-2.8.1(1.8.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:[email protected]:5060
Content-Length: 0

<------------>
– Executing [09991112222@from-internal:1] Macro(“SIP/102-0000003d”, “user-callerid,SKIPTTL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/102-0000003d”, “AMPUSER=102”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“SIP/102-0000003d”, “0?report”) in new stack
– Executing [s@macro-user-callerid:3] ExecIf(“SIP/102-0000003d”, “1?Set(REALCALLERIDNUM=102)”) in new stack
– Executing [s@macro-user-callerid:4] Set(“SIP/102-0000003d”, “AMPUSER=102”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/102-0000003d”, “AMPUSERCIDNAME=Mark”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/102-0000003d”, “0?report”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/102-0000003d”, “AMPUSERCID=102”) in new stack
– Executing [s@macro-user-callerid:8] Set(“SIP/102-0000003d”, “CALLERID(all)=“Mark” <102>”) in new stack
– Executing [s@macro-user-callerid:9] ExecIf(“SIP/102-0000003d”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:10] GotoIf(“SIP/102-0000003d”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] Set(“SIP/102-0000003d”, “CALLERID(number)=102”) in new stack
– Executing [s@macro-user-callerid:20] Set(“SIP/102-0000003d”, “CALLERID(name)=Mark”) in new stack
– Executing [s@macro-user-callerid:21] NoOp(“SIP/102-0000003d”, “Using CallerID “Mark” <102>”) in new stack
– Executing [09991112222@from-internal:2] NoOp(“SIP/102-0000003d”, “Calling Out Route: to_gsm”) in new stack
– Executing [09991112222@from-internal:3] Set(“SIP/102-0000003d”, “MOHCLASS=default”) in new stack
– Executing [09991112222@from-internal:4] Set(“SIP/102-0000003d”, “_NODEST=”) in new stack
– Executing [09991112222@from-internal:5] Macro(“SIP/102-0000003d”, “record-enable,102,OUT,”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“SIP/102-0000003d”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] ExecIf(“SIP/102-0000003d”, “0?MacroExit()”) in new stack
– Executing [s@macro-record-enable:5] GotoIf(“SIP/102-0000003d”, “0?Group:OUT”) in new stack
– Goto (macro-record-enable,s,15)
– Executing [s@macro-record-enable:15] GotoIf(“SIP/102-0000003d”, “0?IN”) in new stack
– Executing [s@macro-record-enable:16] ExecIf(“SIP/102-0000003d”, “1?MacroExit()”) in new stack
– Executing [09991112222@from-internal:6] Macro(“SIP/102-0000003d”, “dialout-trunk,2,09991112222,”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/102-0000003d”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/102-0000003d”, “0?sub-pincheck,s,1”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/102-0000003d”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/102-0000003d”, “DIAL_NUMBER=09991112222”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/102-0000003d”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/102-0000003d”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/102-0000003d”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/102-0000003d”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/102-0000003d”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/102-0000003d”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/102-0000003d”, “outbound-callerid,2”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/102-0000003d”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/102-0000003d”, “0?Set(REALCALLERIDNUM=102)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/102-0000003d”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/102-0000003d”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/102-0000003d”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/102-0000003d”, “TRUNKOUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/102-0000003d”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/102-0000003d”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/102-0000003d”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/102-0000003d”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/102-0000003d”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/102-0000003d”, “1?sub-flp-2,s,1”) in new stack
– Executing [s@sub-flp-2:1] ExecIf(“SIP/102-0000003d”, “0?Set(TARGET_FLP_2=272272272)”) in new stack
– Executing [s@sub-flp-2:2] GotoIf(“SIP/102-0000003d”, “0?match”) in new stack
– Executing [s@sub-flp-2:3] Return(“SIP/102-0000003d”, “”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/102-0000003d”, “OUTNUM=09991112222”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/102-0000003d”, “custom=SIP/gsm”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/102-0000003d”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
– Executing [s@macro-dialout-trunk:16] Macro(“SIP/102-0000003d”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/102-0000003d”, “”) in new stack
– Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/102-0000003d”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/102-0000003d”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:19] Dial(“SIP/102-0000003d”, “SIP/gsm/09991112222,300,”) in new stack
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:20] NoOp(“SIP/102-0000003d”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 20”) in new stack
– Executing [s@macro-dialout-trunk:21] Goto(“SIP/102-0000003d”, “s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/102-0000003d”, “RC=20”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/102-0000003d”, “20,1”) in new stack
– Goto (macro-dialout-trunk,20,1)
– Executing [20@macro-dialout-trunk:1] Goto(“SIP/102-0000003d”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] GotoIf(“SIP/102-0000003d”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [continue@macro-dialout-trunk:3] NoOp(“SIP/102-0000003d”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 20 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:4] Set(“SIP/102-0000003d”, “CALLERID(number)=102”) in new stack
– Executing [09991112222@from-internal:7] Macro(“SIP/102-0000003d”, “outisbusy,”) in new stack
– Executing [s@macro-outisbusy:1] Progress(“SIP/102-0000003d”, “”) in new stack
Audio is at 5060
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Transmitting (NAT) to 192.168.1.17:51860 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-9e492f6ddf658714-1–d87543-;received=192.168.1.17;rport=51860
From: "102"sip:[email protected];tag=00635314
To: "09991112222"sip:[email protected];tag=as2bffc6de
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 2 INVITE
Server: FPBX-2.8.1(1.8.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:[email protected]:5060
Content-Type: application/sdp
Content-Length: 234

v=0
o=root 87450460 87450460 IN IP4 192.168.1.252
s=Asterisk PBX 1.8.7.0
c=IN IP4 192.168.1.252
t=0 0
m=audio 14270 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

<------------>
– Executing [s@macro-outisbusy:2] GotoIf(“SIP/102-0000003d”, “0?emergency,1”) in new stack
– Executing [s@macro-outisbusy:3] GotoIf(“SIP/102-0000003d”, “0?intracompany,1”) in new stack
– Executing [s@macro-outisbusy:4] Playback(“SIP/102-0000003d”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
– <SIP/102-0000003d> Playing ‘all-circuits-busy-now.gsm’ (language ‘en’)
– <SIP/102-0000003d> Playing ‘pls-try-call-later.gsm’ (language ‘en’)
– Executing [s@macro-outisbusy:5] Congestion(“SIP/102-0000003d”, “20”) in new stack

<— Reliably Transmitting (NAT) to 192.168.1.17:51860 —>
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-9e492f6ddf658714-1–d87543-;received=192.168.1.17;rport=51860
From: "102"sip:[email protected];tag=00635314
To: "09991112222"sip:[email protected];tag=as2bffc6de
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 2 INVITE
Server: FPBX-2.8.1(1.8.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-Asterisk-HangupCause: Unknown
X-Asterisk-HangupCauseCode: 20
Content-Length: 0

<------------>
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/102-0000003d’ in macro ‘outisbusy’
== Spawn extension (from-internal, 09991112222, 7) exited non-zero on ‘SIP/102-0000003d’
– Executing [h@from-internal:1] Macro(“SIP/102-0000003d”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/102-0000003d”, “1?endmixmoncheck”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] NoOp(“SIP/102-0000003d”, “End of MIXMON check”) in new stack
– Executing [s@macro-hangupcall:10] GotoIf(“SIP/102-0000003d”, “1?nomeetmemon”) in new stack
– Goto (macro-hangupcall,s,15)
– Executing [s@macro-hangupcall:15] NoOp(“SIP/102-0000003d”, “MEETME_RECORDINGFILE=”) in new stack
– Executing [s@macro-hangupcall:16] GotoIf(“SIP/102-0000003d”, “1?noautomon”) in new stack
– Goto (macro-hangupcall,s,18)
– Executing [s@macro-hangupcall:18] NoOp(“SIP/102-0000003d”, “TOUCH_MONITOR_OUTPUT=”) in new stack
– Executing [s@macro-hangupcall:19] GotoIf(“SIP/102-0000003d”, “1?noautomon2”) in new stack
– Goto (macro-hangupcall,s,25)
– Executing [s@macro-hangupcall:25] NoOp(“SIP/102-0000003d”, “MONITOR_FILENAME=”) in new stack
– Executing [s@macro-hangupcall:26] GotoIf(“SIP/102-0000003d”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,29)
– Executing [s@macro-hangupcall:29] GotoIf(“SIP/102-0000003d”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,32)
– Executing [s@macro-hangupcall:32] GotoIf(“SIP/102-0000003d”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,34)
– Executing [s@macro-hangupcall:34] Hangup(“SIP/102-0000003d”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 34) exited non-zero on ‘SIP/102-0000003d’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/102-0000003d’

<— SIP read from UDP:192.168.1.17:51860 —>
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.17:51860;branch=z9hG4bK-d87543-9e492f6ddf658714-1–d87543-;rport
To: "09991112222"sip:[email protected];tag=as2bffc6de
From: "102"sip:[email protected];tag=00635314
Call-ID: 4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.
CSeq: 2 ACK
Content-Length: 0

<------------->
— (7 headers 0 lines) —
Really destroying SIP dialog ‘4f0b426b7e689d7fYjgyYTlhMTNmNDY1MWU5YWJjYmRlOTBjZDI0Y2UyY2I.’ Method: ACK

<— SIP read from UDP:192.168.1.17:51860 —>

<------------->
pbx*CLI> sip set debug off
SIP Debugging Disabled
[/code]

192.168.1.17 (PC/eyeBeam)
192.168.1.252(Asterisk)
192.168.1.15 (Eurotech) (But you won’t see it anywhere)

Why am I getting hangupcause=20? As you can see after dialpattern matching, the call gets sent to SIP/gsm, but it gets rejected. I don’t see packets going there either.

Some help would be great.
If paste formattin isn’t nice, please check out pastebin