Cann't call outside, everything else works

Hello, I’m new in ASterisk and FreePBX and wanteted to have a Server for our company. I succesfully set up a working Server, where I can call out- & inside of my office with some benefits like conference and listening, whispering. Its awsome whats possible.

After I installed a Zabbix-Agent and reconfigured my FreePBX firewall (currently disabled), I wasn’t able to call outside and I cann’t figure out why. It would be really nice if someone could help me out.

Here are some informations about my Server:

XXXXXXXXXX is my Sipgate.de ID
YYYYYYYYYY is my Sipgate.de Secret

Users:

freepbx*CLI> sip show users
Username                   Secret           Accountcode      Def.Context      ACL  Forcerport
1000                       1000                         from-internal    Yes  No        
1001                       1001                         from-internal    Yes  No        
1003                       1003                         from-internal    Yes  No  

Peers:

freepbx*CLI> sip show peers
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description                      
1000                      (Unspecified)                            D  No         No          A  0        UNKNOWN                                      
1001/1001                 192.168.1.32                             D  No         No          A  5060     OK (26 ms)                                   
1003/1003                 192.168.1.31                             D  No         No          A  5060     OK (41 ms)                                   
sipgate.de/XXXXXXXXXX     217.10.79.9                                 No         No             5060     OK (29 ms)  

Registry:

freepbx*CLI> sip show registry
Host                                    dnsmgr Username       Refresh State                Reg.Time                 
sipgate.de:5060                         N      XXXXXXXXXX         105 Registered           Thu, 26 Oct 2017 16:03:10
1 SIP registrations.

sip_additional.conf:

[1000]
deny=0.0.0.0/0.0.0.0
secret=1000
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
defaultuser=
trustrpid=yes
sendrpid=pai
type=friend
session-timers=accept
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
force_avp=no
icesupport=no
rtcp_mux=no
encryption=no
namedcallgroup=
namedpickupgroup=
dial=SIP/1000
permit=0.0.0.0/0.0.0.0
callerid=Admin <1000>
callcounter=yes
faxdetect=no
cc_monitor_policy=generic

[1001]
deny=0.0.0.0/0.0.0.0
secret=1001
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
defaultuser=
trustrpid=yes
sendrpid=pai
type=friend
session-timers=accept
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
force_avp=no
icesupport=no
rtcp_mux=no
encryption=no
namedcallgroup=
namedpickupgroup=
dial=SIP/1001
permit=0.0.0.0/0.0.0.0
callerid=Asterisk 1 <1001>
callcounter=yes
faxdetect=no
cc_monitor_policy=generic

[1003]
deny=0.0.0.0/0.0.0.0
secret=1003
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
defaultuser=
trustrpid=yes
sendrpid=pai
type=friend
session-timers=accept
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
force_avp=no
icesupport=no
rtcp_mux=no
encryption=no
namedcallgroup=
namedpickupgroup=
dial=SIP/1003
permit=0.0.0.0/0.0.0.0
callerid=Asterisk 3 <1003>
callcounter=yes
faxdetect=no
cc_monitor_policy=generic

[sipgate.de]
disallow=all
username=XXXXXXXXXX
type=peer
secret=YYYYYYYYYYYY
qualify=yes
nat=no
insecure=port,invite
host=sipgate.de
outboundproxy=sipgate.de
port=5060
fromuser=XXXXXXXXXX
fromdomain=sipgate.de
dtmfmode=rfc2833
context=from-trunk
canreinvite=no
registertimeout=600
allow=gsm
allow=ulaw
allow=alaw

Outbound Routes in FreePBX GUI:

Route CID = 10002
Route Name = external
Trunk Sequence for Matched Routes = Sipgate
With Pattern = X.

My Incomming Registry String:

[SIP-ID]:[SIP-SECRET]@[SIP-HOST]/[SIP-ID]

Log of a outside call in ‘-rvvvvvvv’ mode:

<--- SIP read from UDP:192.168.1.32:5060 --->
INVITE sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.1.32:5060;branch=z9hG4bK6a54304fce0e6d60d3ba5cb53dd749bb;rport
From: "Asterisk 1" <sip:[email protected]>;tag=1579942557
To: <sip:[email protected];user=phone>
Call-ID: 1430505037@192_168_1_32
CSeq: 2 INVITE
Contact: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: S850A GO/42.243.00.000.000
Supported: replaces
Allow-Events: message-summary, refer, ua-profile, talk, check-sync
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY, REFER, UPDATE
Content-Type: application/sdp
Content-Length: 381

v=0
o=1001 5016 15 IN IP4 192.168.1.32
s=Mapping
c=IN IP4 192.168.1.32
t=0 0
m=audio 5016 RTP/AVP 9 8 0 96 97 2 18 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:96 G726-32/8000
a=rtpmap:97 AAL2-G726-32/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
<------------->
--- (14 headers 17 lines) ---
Sending to 192.168.1.32:5060 (no NAT)
Sending to 192.168.1.32:5060 (no NAT)
Using INVITE request as basis request - 1430505037@192_168_1_32
Found peer '1001' for '1001' from 192.168.1.32:5060

<--- Reliably Transmitting (no NAT) to 192.168.1.32:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.32:5060;branch=z9hG4bK6a54304fce0e6d60d3ba5cb53dd749bb;received=192.168.1.32;rport=5060
From: "Asterisk 1" <sip:[email protected]>;tag=1579942557
To: <sip:[email protected];user=phone>;tag=as39a6862f
Call-ID: 1430505037@192_168_1_32
CSeq: 2 INVITE
Server: FPBX-14.0.1.20(13.17.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="4edef15d"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '1430505037@192_168_1_32' in 6400 ms (Method: INVITE)

<--- SIP read from UDP:192.168.1.32:5060 --->
ACK sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.1.32:5060;branch=z9hG4bK6a54304fce0e6d60d3ba5cb53dd749bb;rport
From: "Asterisk 1" <sip:[email protected]>;tag=1579942557
To: <sip:[email protected];user=phone>;tag=as39a6862f
Call-ID: 1430505037@192_168_1_32
CSeq: 2 ACK
Contact: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: S850A GO/42.243.00.000.000
Content-Length: 0

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

<--- SIP read from UDP:192.168.1.32:5060 --->
INVITE sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.1.32:5060;branch=z9hG4bKc5aa4eca59453b3492bd34365545350d;rport
From: "Asterisk 1" <sip:[email protected]>;tag=1579942557
To: <sip:[email protected];user=phone>
Call-ID: 1430505037@192_168_1_32
CSeq: 3 INVITE
Contact: <sip:[email protected]:5060>
Authorization: Digest username="1001", realm="asterisk", algorithm=MD5, uri="sip:[email protected];user=phone", nonce="4edef15d", response="dd27d34df9c4236fa91031b5efdfe303"
Max-Forwards: 70
User-Agent: S850A GO/42.243.00.000.000
Supported: replaces
Allow-Events: message-summary, refer, ua-profile, talk, check-sync
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY, REFER, UPDATE
Content-Type: application/sdp
Content-Length: 381

v=0
o=1001 5016 15 IN IP4 192.168.1.32
s=Mapping
c=IN IP4 192.168.1.32
t=0 0
m=audio 5016 RTP/AVP 9 8 0 96 97 2 18 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:96 G726-32/8000
a=rtpmap:97 AAL2-G726-32/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
<------------->
--- (15 headers 17 lines) ---
Sending to 192.168.1.32:5060 (no NAT)
Using INVITE request as basis request - 1430505037@192_168_1_32
Found peer '1001' for '1001' from 192.168.1.32:5060
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
Found RTP audio format 9
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 96
Found RTP audio format 97
Found RTP audio format 2
Found RTP audio format 18
Found RTP audio format 101
Found audio description format G722 for ID 9
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format G726-32 for ID 96
Found audio description format AAL2-G726-32 for ID 97
Found audio description format G726-32 for ID 2
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|g726|g722), peer - audio=(ulaw|g726|alaw|g722|g729|g726aal2)/video=(nothing)/text=(nothing), combined - (ulaw|alaw|g726|g722)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
       > 0x7fe00002bdd0 -- Strict RTP learning after remote address set to: 192.168.1.32:5016
Peer audio RTP is at port 192.168.1.32:5016
Looking for 01520ZZZZZZZ in from-internal (domain 192.168.1.29)
sip_route_dump: route/path hop: <sip:[email protected]:5060>

<--- Transmitting (no NAT) to 192.168.1.32:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.32:5060;branch=z9hG4bKc5aa4eca59453b3492bd34365545350d;received=192.168.1.32;rport=5060
From: "Asterisk 1" <sip:[email protected]>;tag=1579942557
To: <sip:[email protected];user=phone>
Call-ID: 1430505037@192_168_1_32
CSeq: 3 INVITE
Server: FPBX-14.0.1.20(13.17.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:[email protected]:5060>
Content-Length: 0


<------------>
    -- Executing [01520ZZZZZZZ@from-internal:1] Macro("SIP/1001-00000085", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/1001-00000085", "TOUCH_MONITOR=1509030681.133") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/1001-00000085", "AMPUSER=1001") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/1001-00000085", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/1001-00000085", "1?Set(REALCALLERIDNUM=1001)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/1001-00000085", "AMPUSER=1001") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/1001-00000085", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/1001-00000085", "AMPUSERCIDNAME=Asterisk 1") in new stack
    -- Executing [s@macro-user-callerid:8] ExecIf("SIP/1001-00000085", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:9] GotoIf("SIP/1001-00000085", "0?report") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/1001-00000085", "AMPUSERCID=1001") in new stack
    -- Executing [s@macro-user-callerid:11] Set("SIP/1001-00000085", "__DIAL_OPTIONS=") in new stack
    -- Executing [s@macro-user-callerid:12] Set("SIP/1001-00000085", "CALLERID(all)="Asterisk 1" <1001>") in new stack
    -- Executing [s@macro-user-callerid:13] GotoIf("SIP/1001-00000085", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:14] ExecIf("SIP/1001-00000085", "1?Set(GROUP(concurrency_limit)=1001)") in new stack
    -- Executing [s@macro-user-callerid:15] ExecIf("SIP/1001-00000085", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:16] NoOp("SIP/1001-00000085", "Macro Depth is 1") in new stack
    -- Executing [s@macro-user-callerid:17] GotoIf("SIP/1001-00000085", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,19)
    -- Executing [s@macro-user-callerid:19] GotoIf("SIP/1001-00000085", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,37)
    -- Executing [s@macro-user-callerid:37] Set("SIP/1001-00000085", "CALLERID(number)=1001") in new stack
    -- Executing [s@macro-user-callerid:38] Set("SIP/1001-00000085", "CALLERID(name)=Asterisk 1") in new stack
    -- Executing [s@macro-user-callerid:39] GotoIf("SIP/1001-00000085", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:40] Set("SIP/1001-00000085", "CDR(cnam)=Asterisk 1") in new stack
    -- Executing [s@macro-user-callerid:41] Set("SIP/1001-00000085", "CDR(cnum)=1001") in new stack
    -- Executing [s@macro-user-callerid:42] Set("SIP/1001-00000085", "CHANNEL(language)=en_GB") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:2] Gosub("SIP/1001-00000085", "sub-record-check,s,1(out,01520ZZZZZZZ,no)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("SIP/1001-00000085", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("SIP/1001-00000085", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("SIP/1001-00000085", "NOW=1509030681") in new stack
    -- Executing [s@sub-record-check:4] Set("SIP/1001-00000085", "__DAY=26") in new stack
    -- Executing [s@sub-record-check:5] Set("SIP/1001-00000085", "__MONTH=10") in new stack
    -- Executing [s@sub-record-check:6] Set("SIP/1001-00000085", "__YEAR=2017") in new stack
    -- Executing [s@sub-record-check:7] Set("SIP/1001-00000085", "__TIMESTR=20171026-151121") in new stack
    -- Executing [s@sub-record-check:8] Set("SIP/1001-00000085", "__FROMEXTEN=1001") in new stack
    -- Executing [s@sub-record-check:9] Set("SIP/1001-00000085", "__MON_FMT=ogg") in new stack
    -- Executing [s@sub-record-check:10] NoOp("SIP/1001-00000085", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("SIP/1001-00000085", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("SIP/1001-00000085", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("SIP/1001-00000085", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("SIP/1001-00000085", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("SIP/1001-00000085", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("SIP/1001-00000085", "Outbound Recording Check from 1001 to 01520ZZZZZZZ") in new stack
    -- Executing [out@sub-record-check:2] Set("SIP/1001-00000085", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("SIP/1001-00000085", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("SIP/1001-00000085", "recordcheck,1(no,out,01520ZZZZZZZ)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/1001-00000085", "Starting recording check against no") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("SIP/1001-00000085", "no") in new stack
    -- Goto (sub-record-check,recordcheck,12)
    -- Executing [recordcheck@sub-record-check:12] Set("SIP/1001-00000085", "__REC_POLICY_MODE=NO") in new stack
    -- Executing [recordcheck@sub-record-check:13] Return("SIP/1001-00000085", "") in new stack
    -- Executing [out@sub-record-check:8] Return("SIP/1001-00000085", "") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:3] ExecIf("SIP/1001-00000085", "0 ?Set(CDR(accountcode)=)") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:4] Set("SIP/1001-00000085", "ROUTE_CIDSAVE="Asterisk 1" <1001>") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:5] Set("SIP/1001-00000085", "MOHCLASS=default") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:6] ExecIf("SIP/1001-00000085", "0?Set(TRUNKCIDOVERRIDE=10002)") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:7] Set("SIP/1001-00000085", "_NODEST=") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:8] Macro("SIP/1001-00000085", "dialout-trunk,1,01520ZZZZZZZ,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/1001-00000085", "DIAL_TRUNK=1") in new stack
    -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/1001-00000085", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:3] ExecIf("SIP/1001-00000085", "0?Set(CALLERID(num)=1001)") in new stack
    -- Executing [s@macro-dialout-trunk:4] GotoIf("SIP/1001-00000085", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:5] Set("SIP/1001-00000085", "DIAL_NUMBER=01520ZZZZZZZ") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/1001-00000085", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [s@macro-dialout-trunk:7] Set("SIP/1001-00000085", "OUTBOUND_GROUP=OUT_1") in new stack
    -- Executing [s@macro-dialout-trunk:8] Set("SIP/1001-00000085", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/1001-00000085", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,11)
    -- Executing [s@macro-dialout-trunk:11] GotoIf("SIP/1001-00000085", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:12] Macro("SIP/1001-00000085", "outbound-callerid,1") in new stack
    -- Executing [s@macro-outbound-callerid:1] NoOp("SIP/1001-00000085", "1001") in new stack
    -- Executing [s@macro-outbound-callerid:2] NoOp("SIP/1001-00000085", "") in new stack
    -- Executing [s@macro-outbound-callerid:3] NoOp("SIP/1001-00000085", "") in new stack
    -- Executing [s@macro-outbound-callerid:4] ExecIf("SIP/1001-00000085", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:5] ExecIf("SIP/1001-00000085", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:6] ExecIf("SIP/1001-00000085", "0?Set(REALCALLERIDNUM=1001)") in new stack
    -- Executing [s@macro-outbound-callerid:7] GotoIf("SIP/1001-00000085", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,11)
    -- Executing [s@macro-outbound-callerid:11] Set("SIP/1001-00000085", "USEROUTCID=1001") in new stack
    -- Executing [s@macro-outbound-callerid:12] Set("SIP/1001-00000085", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:13] Set("SIP/1001-00000085", "TRUNKOUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:14] GotoIf("SIP/1001-00000085", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,19)
    -- Executing [s@macro-outbound-callerid:19] ExecIf("SIP/1001-00000085", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:20] ExecIf("SIP/1001-00000085", "1?Set(CALLERID(all)=1001)") in new stack
    -- Executing [s@macro-outbound-callerid:21] ExecIf("SIP/1001-00000085", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:22] ExecIf("SIP/1001-00000085", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:23] ExecIf("SIP/1001-00000085", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:24] Set("SIP/1001-00000085", "CDR(outbound_cnum)=1001") in new stack
    -- Executing [s@macro-outbound-callerid:25] Set("SIP/1001-00000085", "CDR(outbound_cnam)=") in new stack
    -- Executing [s@macro-dialout-trunk:13] GosubIf("SIP/1001-00000085", "0?sub-flp-1,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:14] Set("SIP/1001-00000085", "OUTNUM=01520ZZZZZZZ") in new stack
    -- Executing [s@macro-dialout-trunk:15] Set("SIP/1001-00000085", "custom=") in new stack
    -- Executing [s@macro-dialout-trunk:16] ExecIf("SIP/1001-00000085", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))") in new stack
    -- Executing [s@macro-dialout-trunk:17] ExecIf("SIP/1001-00000085", "0?Set(DIAL_TRUNK_OPTIONS=M(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:18] Macro("SIP/1001-00000085", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/1001-00000085", "") in new stack
    -- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/1001-00000085", "0?skipcrm") in new stack
    -- Executing [s@macro-dialout-trunk:20] Set("SIP/1001-00000085", "__CRM_DIRECTION=OUTBOUND") in new stack
    -- Executing [s@macro-dialout-trunk:21] Set("SIP/1001-00000085", "__CRM_DESTINATION=01520ZZZZZZZ") in new stack
    -- Executing [s@macro-dialout-trunk:22] Set("SIP/1001-00000085", "__CRM_SOURCE=1001") in new stack
    -- Executing [s@macro-dialout-trunk:23] AGI("SIP/1001-00000085", "sangomacrm.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
    -- <SIP/1001-00000085>AGI Script sangomacrm.agi completed, returning 0
    -- Executing [s@macro-dialout-trunk:24] Set("SIP/1001-00000085", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
    -- Executing [s@macro-dialout-trunk:25] NoOp("SIP/1001-00000085", "CRM Finished") in new stack
    -- Executing [s@macro-dialout-trunk:26] GotoIf("SIP/1001-00000085", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:27] ExecIf("SIP/1001-00000085", "1?Set(CONNECTEDLINE(num,i)=01520ZZZZZZZ)") in new stack
    -- Executing [s@macro-dialout-trunk:28] ExecIf("SIP/1001-00000085", "1?Set(CONNECTEDLINE(name,i)=CID:1001)") in new stack
    -- Executing [s@macro-dialout-trunk:29] ExecIf("SIP/1001-00000085", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)1001)") in new stack
    -- Executing [s@macro-dialout-trunk:30] GotoIf("SIP/1001-00000085", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:31] Dial("SIP/1001-00000085", "/01520ZZZZZZZ,,") in new stack
[2017-10-26 15:11:21] WARNING[7759][C-0000003f]: channel.c:6262 ast_request: No channel type registered for ''
[2017-10-26 15:11:21] WARNING[7759][C-0000003f]: app_dial.c:2525 dial_exec_full: Unable to create channel of type '' (cause 66 - Channel not implemented)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [s@macro-dialout-trunk:32] NoOp("SIP/1001-00000085", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 66") in new stack
    -- Executing [s@macro-dialout-trunk:33] GotoIf("SIP/1001-00000085", "0?continue,1:s-CHANUNAVAIL,1") in new stack
    -- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
    -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set("SIP/1001-00000085", "RC=66") in new stack
    -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto("SIP/1001-00000085", "66,1") in new stack
    -- Goto (macro-dialout-trunk,66,1)
    -- Executing [66@macro-dialout-trunk:1] Goto("SIP/1001-00000085", "continue,1") in new stack
    -- Goto (macro-dialout-trunk,continue,1)
    -- Executing [continue@macro-dialout-trunk:1] NoOp("SIP/1001-00000085", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 66 - failing through to other trunks") in new stack
    -- Executing [continue@macro-dialout-trunk:2] ExecIf("SIP/1001-00000085", "1?Set(CALLERID(number)=1001)") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:9] Set("SIP/1001-00000085", "CALLERID(all)="Asterisk 1" <1001>") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:10] Set("SIP/1001-00000085", "_KEEPCID=TRUE") in new stack
    -- Executing [01520ZZZZZZZ@from-internal:11] Goto("SIP/1001-00000085", "ext-trunk,1,1") in new stack
    -- Goto (ext-trunk,1,1)
    -- Executing [1@ext-trunk:1] Set("SIP/1001-00000085", "TDIAL_STRING=SIP/sipgate.de") in new stack
    -- Executing [1@ext-trunk:2] Set("SIP/1001-00000085", "DIAL_TRUNK=1") in new stack
    -- Executing [1@ext-trunk:3] Goto("SIP/1001-00000085", "ext-trunk,tdial,1") in new stack
    -- Goto (ext-trunk,tdial,1)
    -- Executing [tdial@ext-trunk:1] Set("SIP/1001-00000085", "OUTBOUND_GROUP=OUT_1") in new stack
    -- Executing [tdial@ext-trunk:2] GotoIf("SIP/1001-00000085", "1?nomax") in new stack
    -- Goto (ext-trunk,tdial,4)
    -- Executing [tdial@ext-trunk:4] ExecIf("SIP/1001-00000085", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [tdial@ext-trunk:5] ExecIf("SIP/1001-00000085", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [tdial@ext-trunk:6] Set("SIP/1001-00000085", "DIAL_NUMBER=") in new stack
    -- Executing [tdial@ext-trunk:7] GosubIf("SIP/1001-00000085", "0?sub-flp-1,s,1()") in new stack
    -- Executing [tdial@ext-trunk:8] Set("SIP/1001-00000085", "OUTNUM=") in new stack
    -- Executing [tdial@ext-trunk:9] Set("SIP/1001-00000085", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [tdial@ext-trunk:10] Dial("SIP/1001-00000085", "SIP/sipgate.de/,,") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
Audio is at 17330
Adding codec ulaw to SDP
Adding codec gsm to SDP
Adding codec alaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 217.10.79.9:5060:
INVITE sip:sipgate.de:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK30379ab0
Max-Forwards: 70
From: "Asterisk 1" <sip:[email protected]>;tag=as288e4e96
To: <sip:sipgate.de:5060>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: FPBX-14.0.1.20(13.17.2)
Date: Thu, 26 Oct 2017 15:11:21 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 297

v=0
o=root 1684954234 1684954234 IN IP4 192.168.1.1
s=Asterisk PBX 13.17.2
c=IN IP4 192.168.1.1
t=0 0
m=audio 17330 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---
    -- Called SIP/sipgate.de/

<--- SIP read from UDP:217.10.79.9:5060 --->
SIP/2.0 404 Not found (no match)
Via: SIP/2.0/UDP 192.168.1.1:5060;rport=61714;received=91.58.239.60;branch=z9hG4bK30379ab0
From: "Asterisk 1" <sip:[email protected]>;tag=as288e4e96
To: <sip:sipgate.de:5060>;tag=86e53dd608d1c001e0b8060625977563.cad7
Call-ID: [email protected]
CSeq: 102 INVITE
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
Transmitting (no NAT) to 217.10.79.9:5060:
ACK sip:sipgate.de:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK30379ab0
Max-Forwards: 70
From: "Asterisk 1" <sip:[email protected]>;tag=as288e4e96
To: <sip:sipgate.de:5060>;tag=86e53dd608d1c001e0b8060625977563.cad7
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]
CSeq: 102 ACK
User-Agent: FPBX-14.0.1.20(13.17.2)
Content-Length: 0


---
Scheduling destruction of SIP dialog '[email protected]' in 6400 ms (Method: INVITE)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [tdial@ext-trunk:11] Set("SIP/1001-00000085", "CALLERID(number)=1001") in new stack
    -- Executing [tdial@ext-trunk:12] Set("SIP/1001-00000085", "CALLERID(name)=Asterisk 1") in new stack
    -- Executing [tdial@ext-trunk:13] Hangup("SIP/1001-00000085", "") in new stack
  == Spawn extension (ext-trunk, tdial, 13) exited non-zero on 'SIP/1001-00000085'
    -- SIP/1001-00000085 Internal Gosub(crm-hangup,s,1) start
    -- Executing [s@crm-hangup:1] NoOp("SIP/1001-00000085", "Sending Hangup to CRM") in new stack
    -- Executing [s@crm-hangup:2] NoOp("SIP/1001-00000085", "HANGUP CAUSE: 1") in new stack
    -- Executing [s@crm-hangup:3] ExecIf("SIP/1001-00000085", "0?Set(__CRM_VOICEMAIL=)") in new stack
    -- Executing [s@crm-hangup:4] NoOp("SIP/1001-00000085", "MASTER CHANNEL: 1509030681.133 = 1509030681.133") in new stack
    -- Executing [s@crm-hangup:5] GotoIf("SIP/1001-00000085", "0?return") in new stack
    -- Executing [s@crm-hangup:6] Set("SIP/1001-00000085", "__CRM_HANGUP=1") in new stack
    -- Executing [s@crm-hangup:7] AGI("SIP/1001-00000085", "sangomacrm.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
    -- <SIP/1001-00000085>AGI Script sangomacrm.agi completed, returning 0
    -- Executing [s@crm-hangup:8] Return("SIP/1001-00000085", "") in new stack
  == Spawn extension (ext-trunk, tdial, 13) exited non-zero on 'SIP/1001-00000085'
    -- SIP/1001-00000085 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
Scheduling destruction of SIP dialog '1430505037@192_168_1_32' in 6400 ms (Method: INVITE)

<--- Reliably Transmitting (no NAT) to 192.168.1.32:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.32:5060;branch=z9hG4bKc5aa4eca59453b3492bd34365545350d;received=192.168.1.32;rport=5060
From: "Asterisk 1" <sip:[email protected]>;tag=1579942557
To: <sip:[email protected];user=phone>;tag=as461f27e6
Call-ID: 1430505037@192_168_1_32
CSeq: 3 INVITE
Server: FPBX-14.0.1.20(13.17.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>

<--- SIP read from UDP:192.168.1.32:5060 --->
ACK sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.1.32:5060;branch=z9hG4bKc5aa4eca59453b3492bd34365545350d;rport
From: "Asterisk 1" <sip:[email protected]>;tag=1579942557
To: <sip:[email protected];user=phone>;tag=as461f27e6
Call-ID: 1430505037@192_168_1_32
CSeq: 3 ACK
Contact: <sip:[email protected]:5060>
Authorization: Digest username="1001", realm="asterisk", algorithm=MD5, uri="sip:[email protected];user=phone", nonce="4edef15d", response="dd27d34df9c4236fa91031b5efdfe303"
Max-Forwards: 70
User-Agent: S850A GO/42.243.00.000.000
Content-Length: 0

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

Your dial string is messed up:

    -- Executing [s@macro-dialout-trunk:31] Dial("SIP/1001-00000085", "/01520ZZZZZZZ,,") in new stack

It should be attempting to dial SIP/sipgate.de/01520ZZZZZZZ but for some reason it’s not. I don’t see an obvious cause based on what you provided, perhaps rename the trunk not to include a . character.

Thank you for your answer, Igaetz. I removed the dot from the trunk. But nothing changed.

But I already noticed the dial string, I just didn’t know how to make it look right or whats look false. because I’m relatively new to these things.

What else can I share it with you to make things better?

I am also rather unsure if my custom outbound route will be used. Is there any way to check that out?

It’s especially funny that everything had worked, one morning it didn’t work anymore: S

Can I create a custom rule that only overwrites existing rules for this extension? So that I define the dial procedure by hand?