Strange behavior in call forward

I have very strange behavior of the call forwarding to external numbers.
For the forward of a extension to a external number, I created a ring group with external number as only member.
I activate it with *98, type the number of the ring group and#
If activated, a internal call to this extension correctly forwards to the external number.
When an outside call is routed to this extension, the forward to the external number does not work.
I could not fully understand what it does, but it seems in the case of an external caller, the ringgroup loops back to the ring group, and so on.

Can somebody take a look at the trace and give me a hint.

Here is the trace:
[cut something]

-- Executing [4975315846012@from-pstn:6] ExecIf("PJSIP/SIPGate-00000747", "0 ?Set(CALLERID(name)=0041774157911)") in new stack
-- Executing [4975315846012@from-pstn:7] Set("PJSIP/SIPGate-00000747", "__MOHCLASS=") in new stack
-- Executing [4975315846012@from-pstn:8] Set("PJSIP/SIPGate-00000747", "__REVERSAL_REJECT=FALSE") in new stack
-- Executing [4975315846012@from-pstn:9] GotoIf("PJSIP/SIPGate-00000747", "1?post-reverse-charge") in new stack
-- Goto (from-pstn,4975315846012,11)
-- Executing [4975315846012@from-pstn:11] NoOp("PJSIP/SIPGate-00000747", "") in new stack
-- Executing [4975315846012@from-pstn:12] Set("PJSIP/SIPGate-00000747", "__CALLINGNAMEPRES_SV=allowed_not_screened") in new stack
-- Executing [4975315846012@from-pstn:13] Set("PJSIP/SIPGate-00000747", "__CALLINGNUMPRES_SV=allowed_not_screened") in new stack
-- Executing [4975315846012@from-pstn:14] Set("PJSIP/SIPGate-00000747", "CALLERID(name-pres)=allowed_not_screened") in new stack
-- Executing [4975315846012@from-pstn:15] Set("PJSIP/SIPGate-00000747", "CALLERID(num-pres)=allowed_not_screened") in new stack
-- Executing [4975315846012@from-pstn:16] NoOp("PJSIP/SIPGate-00000747", "CallerID Entry Point") in new stack
-- Executing [4975315846012@from-pstn:17] Goto("PJSIP/SIPGate-00000747", "from-did-direct,635,1") in new stack
-- Goto (from-did-direct,635,1)
-- Executing [635@from-did-direct:1] GotoIf("PJSIP/SIPGate-00000747", "1?ext-local,635,1:followme-check,635,1") in new stack
-- Goto (ext-local,635,1)
-- Executing [635@ext-local:1] Set("PJSIP/SIPGate-00000747", "__RINGTIMER=15") in new stack
-- Executing [635@ext-local:2] Macro("PJSIP/SIPGate-00000747", "exten-vm,635,635,0,0,0") in new stack
-- Executing [s@macro-exten-vm:1] Macro("PJSIP/SIPGate-00000747", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("PJSIP/SIPGate-00000747", "TOUCH_MONITOR=1487257994.3659") in new stack
-- Executing [s@macro-user-callerid:2] Set("PJSIP/SIPGate-00000747", "AMPUSER=0041774157911") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("PJSIP/SIPGate-00000747", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("PJSIP/SIPGate-00000747", "1?Set(REALCALLERIDNUM=0041774157911)") in new stack
-- Executing [s@macro-user-callerid:5] Set("PJSIP/SIPGate-00000747", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("PJSIP/SIPGate-00000747", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("PJSIP/SIPGate-00000747", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("PJSIP/SIPGate-00000747", "1?report") in new stack
-- Goto (macro-user-callerid,s,15)
-- Executing [s@macro-user-callerid:15] GotoIf("PJSIP/SIPGate-00000747", "0?continue") in new stack
-- Executing [s@macro-user-callerid:16] ExecIf("PJSIP/SIPGate-00000747", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
-- Executing [s@macro-user-callerid:17] Set("PJSIP/SIPGate-00000747", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:18] GotoIf("PJSIP/SIPGate-00000747", "1?continue") in new stack
-- Goto (macro-user-callerid,s,29)
-- Executing [s@macro-user-callerid:29] Set("PJSIP/SIPGate-00000747", "CALLERID(number)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:30] Set("PJSIP/SIPGate-00000747", "CALLERID(name)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:31] Set("PJSIP/SIPGate-00000747", "CDR(cnum)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:32] Set("PJSIP/SIPGate-00000747", "CDR(cnam)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:33] Set("PJSIP/SIPGate-00000747", "CHANNEL(language)=de") in new stack
-- Executing [s@macro-exten-vm:2] Set("PJSIP/SIPGate-00000747", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:3] Set("PJSIP/SIPGate-00000747", "__EXTTOCALL=635") in new stack
-- Executing [s@macro-exten-vm:4] Set("PJSIP/SIPGate-00000747", "__PICKUPMARK=635") in new stack
-- Executing [s@macro-exten-vm:5] Set("PJSIP/SIPGate-00000747", "RT=15") in new stack
[2017-02-16 16:13:14] WARNING[6166][C-000004b4]: chan_sip.c:22773 func_header_read: This function can only be used on SIP channels.
-- Executing [s@macro-exten-vm:6] ExecIf("PJSIP/SIPGate-00000747", "0?Macro(vm,635,DIRECTDIAL,)") in new stack
[2017-02-16 16:13:14] WARNING[6166][C-000004b4]: chan_sip.c:22773 func_header_read: This function can only be used on SIP channels.
[2017-02-16 16:13:14] WARNING[6166][C-000004b4]: chan_sip.c:22773 func_header_read: This function can only be used on SIP channels.
-- Executing [s@macro-exten-vm:7] ExecIf("PJSIP/SIPGate-00000747", "0?MacroExit()") in new stack
[2017-02-16 16:13:14] WARNING[6166][C-000004b4]: chan_sip.c:22773 func_header_read: This function can only be used on SIP channels.
-- Executing [s@macro-exten-vm:8] Gosub("PJSIP/SIPGate-00000747", "sub-record-check,s,1(exten,635,dontcare)") in new stack
-- Executing [s@sub-record-check:1] GotoIf("PJSIP/SIPGate-00000747", "13?initialized") in new stack
-- Goto (sub-record-check,s,10)
-- Executing [s@sub-record-check:10] NoOp("PJSIP/SIPGate-00000747", "Recordings initialized") in new stack
-- Executing [s@sub-record-check:11] ExecIf("PJSIP/SIPGate-00000747", "0?Set(ARG3=dontcare)") in new stack
-- Executing [s@sub-record-check:12] Set("PJSIP/SIPGate-00000747", "REC_POLICY_MODE_SAVE=") in new stack
-- Executing [s@sub-record-check:13] ExecIf("PJSIP/SIPGate-00000747", "0?Set(REC_STATUS=NO)") in new stack
-- Executing [s@sub-record-check:14] GotoIf("PJSIP/SIPGate-00000747", "5?checkaction") in new stack
-- Goto (sub-record-check,s,17)
-- Executing [s@sub-record-check:17] GotoIf("PJSIP/SIPGate-00000747", "1?sub-record-check,exten,1") in new stack
-- Goto (sub-record-check,exten,1)
-- Executing [exten@sub-record-check:1] NoOp("PJSIP/SIPGate-00000747", "Exten Recording Check between 0041774157911 and 635") in new stack
-- Executing [exten@sub-record-check:2] Set("PJSIP/SIPGate-00000747", "CALLTYPE=external") in new stack
-- Executing [exten@sub-record-check:3] ExecIf("PJSIP/SIPGate-00000747", "0?Set(CALLTYPE=)") in new stack
-- Executing [exten@sub-record-check:4] Set("PJSIP/SIPGate-00000747", "CALLEE=dontcare") in new stack
-- Executing [exten@sub-record-check:5] ExecIf("PJSIP/SIPGate-00000747", "0?Set(CALLEE=dontcare)") in new stack
-- Executing [exten@sub-record-check:6] GotoIf("PJSIP/SIPGate-00000747", "1?callee") in new stack
-- Goto (sub-record-check,exten,11)
-- Executing [exten@sub-record-check:11] Gosub("PJSIP/SIPGate-00000747", "recordcheck,1(dontcare,external,635)") in new stack
-- Executing [recordcheck@sub-record-check:1] NoOp("PJSIP/SIPGate-00000747", "Starting recording check against dontcare") in new stack
-- Executing [recordcheck@sub-record-check:2] Goto("PJSIP/SIPGate-00000747", "dontcare") in new stack
-- Goto (sub-record-check,recordcheck,3)
-- Executing [recordcheck@sub-record-check:3] Return("PJSIP/SIPGate-00000747", "") in new stack
-- Executing [exten@sub-record-check:12] Return("PJSIP/SIPGate-00000747", "") in new stack
-- Executing [s@macro-exten-vm:9] GotoIf("PJSIP/SIPGate-00000747", "1?macrodial") in new stack
-- Goto (macro-exten-vm,s,15)
-- Executing [s@macro-exten-vm:15] GosubIf("PJSIP/SIPGate-00000747", "0?clrheader,1()") in new stack
-- Executing [s@macro-exten-vm:16] Macro("PJSIP/SIPGate-00000747", "dial-one,15,Ttrc,635") in new stack
-- Executing [s@macro-dial-one:1] Set("PJSIP/SIPGate-00000747", "DEXTEN=635") in new stack
-- Executing [s@macro-dial-one:2] Set("PJSIP/SIPGate-00000747", "DIALSTATUS_CW=") in new stack
-- Executing [s@macro-dial-one:3] GosubIf("PJSIP/SIPGate-00000747", "0?screen,1()") in new stack
-- Executing [s@macro-dial-one:4] GosubIf("PJSIP/SIPGate-00000747", "1?cf,1()") in new stack
-- Executing [cf@macro-dial-one:1] Set("PJSIP/SIPGate-00000747", "CFAMPUSER=0041774157911") in new stack
-- Executing [cf@macro-dial-one:2] ExecIf("PJSIP/SIPGate-00000747", "0?Return()") in new stack
-- Executing [cf@macro-dial-one:3] ExecIf("PJSIP/SIPGate-00000747", "0?Set(ARG1=0)") in new stack
-- Executing [cf@macro-dial-one:4] Set("PJSIP/SIPGate-00000747", "DEXTEN=2615#") in new stack
-- Executing [cf@macro-dial-one:5] Set("PJSIP/SIPGate-00000747", "__DIVERSION_REASON=unconditional") in new stack
-- Executing [cf@macro-dial-one:6] ExecIf("PJSIP/SIPGate-00000747", "1?Return()") in new stack
-- Executing [s@macro-dial-one:5] GotoIf("PJSIP/SIPGate-00000747", "1?skip1") in new stack
-- Goto (macro-dial-one,s,8)
-- Executing [s@macro-dial-one:8] GotoIf("PJSIP/SIPGate-00000747", "0?nodial") in new stack
-- Executing [s@macro-dial-one:9] GotoIf("PJSIP/SIPGate-00000747", "1?continue") in new stack
-- Goto (macro-dial-one,s,25)
-- Executing [s@macro-dial-one:25] GotoIf("PJSIP/SIPGate-00000747", "0?nodial") in new stack
-- Executing [s@macro-dial-one:26] GosubIf("PJSIP/SIPGate-00000747", "0?dstring,1():dlocal,1()") in new stack
-- Executing [dlocal@macro-dial-one:1] Set("PJSIP/SIPGate-00000747", "DSTRING=Local/2615@from-internal/n") in new stack
-- Executing [dlocal@macro-dial-one:2] Set("PJSIP/SIPGate-00000747", "USEGOTO=0") in new stack
-- Executing [dlocal@macro-dial-one:3] Return("PJSIP/SIPGate-00000747", "") in new stack
-- Executing [s@macro-dial-one:27] GotoIf("PJSIP/SIPGate-00000747", "0?nodial") in new stack
-- Executing [s@macro-dial-one:28] GotoIf("PJSIP/SIPGate-00000747", "1?skiptrace") in new stack
-- Goto (macro-dial-one,s,30)
-- Executing [s@macro-dial-one:30] Set("PJSIP/SIPGate-00000747", "D_OPTIONS=Ttrc") in new stack
-- Executing [s@macro-dial-one:31] NoOp("PJSIP/SIPGate-00000747", "Blind Transfer: , Attended Transfer: , User: , Alert Info: ") in new stack
-- Executing [s@macro-dial-one:32] ExecIf("PJSIP/SIPGate-00000747", "0?Set(ALERT_INFO=)") in new stack
-- Executing [s@macro-dial-one:33] ExecIf("PJSIP/SIPGate-00000747", "0?Set(ALERT_INFO=)") in new stack
-- Executing [s@macro-dial-one:34] ExecIf("PJSIP/SIPGate-00000747", "0?Set(ALERT_INFO=)") in new stack
-- Executing [s@macro-dial-one:35] GosubIf("PJSIP/SIPGate-00000747", "0?func-set-sipheader,s,1(Alert-Info,)") in new stack
-- Executing [s@macro-dial-one:36] ExecIf("PJSIP/SIPGate-00000747", "0?Set(CHANNEL(musicclass)=)") in new stack
-- Executing [s@macro-dial-one:37] GosubIf("PJSIP/SIPGate-00000747", "0?qwait,1()") in new stack
-- Executing [s@macro-dial-one:38] Set("PJSIP/SIPGate-00000747", "__CWIGNORE=") in new stack
-- Executing [s@macro-dial-one:39] Set("PJSIP/SIPGate-00000747", "__KEEPCID=TRUE") in new stack
-- Executing [s@macro-dial-one:40] GotoIf("PJSIP/SIPGate-00000747", "0?usegoto,1") in new stack
-- Executing [s@macro-dial-one:41] GotoIf("PJSIP/SIPGate-00000747", "1?godial") in new stack
-- Goto (macro-dial-one,s,46)
-- Executing [s@macro-dial-one:46] Macro("PJSIP/SIPGate-00000747", "dialout-one-predial-hook,") in new stack
-- Executing [s@macro-dialout-one-predial-hook:1] MacroExit("PJSIP/SIPGate-00000747", "") in new stack
-- Executing [s@macro-dial-one:47] ExecIf("PJSIP/SIPGate-00000747", "1?Set(D_OPTIONS=trcI)") in new stack
-- Executing [s@macro-dial-one:48] Dial("PJSIP/SIPGate-00000747", "Local/2615@from-internal/n,15,trcIb(func-apply-sipheaders^s^1)") in new stack
-- Local/2615@from-internal-0000006b;1 Internal Gosub(func-apply-sipheaders,s,1) start
-- Executing [s@func-apply-sipheaders:1] NoOp("Local/2615@from-internal-0000006b;1", "Applying SIP Headers to channel") in new stack
-- Executing [s@func-apply-sipheaders:2] Set("Local/2615@from-internal-0000006b;1", "SIPHEADERKEYS=") in new stack
-- Executing [s@func-apply-sipheaders:3] While("Local/2615@from-internal-0000006b;1", "0") in new stack
-- Jumping to priority 7
-- Executing [s@func-apply-sipheaders:8] Return("Local/2615@from-internal-0000006b;1", "") in new stack
  == Spawn extension (from-internal, 635, 1) exited non-zero on 'Local/2615@from-internal-0000006b;1'
-- Local/2615@from-internal-0000006b;1 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
-- Called Local/2615@from-internal/n
-- Executing [2615@from-internal:1] GotoIf("Local/2615@from-internal-0000006b;2", "0?cid") in new stack
-- Executing [2615@from-internal:2] PlayTones("Local/2615@from-internal-0000006b;2", "ring") in new stack
-- Executing [2615@from-internal:3] Progress("Local/2615@from-internal-0000006b;2", "") in new stack
-- Local/2615@from-internal-0000006b;1 is making progress passing it to PJSIP/SIPGate-00000747
-- Executing [2615@from-internal:4] Macro("Local/2615@from-internal-0000006b;2", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/2615@from-internal-0000006b;2", "TOUCH_MONITOR=1487257994.3661") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/2615@from-internal-0000006b;2", "AMPUSER=0041774157911") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/2615@from-internal-0000006b;2", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("Local/2615@from-internal-0000006b;2", "1?Set(REALCALLERIDNUM=0041774157911)") in new stack
-- Executing [s@macro-user-callerid:5] Set("Local/2615@from-internal-0000006b;2", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("Local/2615@from-internal-0000006b;2", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("Local/2615@from-internal-0000006b;2", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("Local/2615@from-internal-0000006b;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,15)
-- Executing [s@macro-user-callerid:15] GotoIf("Local/2615@from-internal-0000006b;2", "0?continue") in new stack
-- Executing [s@macro-user-callerid:16] ExecIf("Local/2615@from-internal-0000006b;2", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
-- Executing [s@macro-user-callerid:17] Set("Local/2615@from-internal-0000006b;2", "__TTL=63") in new stack
-- Executing [s@macro-user-callerid:18] GotoIf("Local/2615@from-internal-0000006b;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,29)
-- Executing [s@macro-user-callerid:29] Set("Local/2615@from-internal-0000006b;2", "CALLERID(number)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:30] Set("Local/2615@from-internal-0000006b;2", "CALLERID(name)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:31] Set("Local/2615@from-internal-0000006b;2", "CDR(cnum)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:32] Set("Local/2615@from-internal-0000006b;2", "CDR(cnam)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:33] Set("Local/2615@from-internal-0000006b;2", "CHANNEL(language)=de") in new stack
-- Executing [2615@from-internal:5] Macro("Local/2615@from-internal-0000006b;2", "blkvm-setifempty,") in new stack
-- Executing [s@macro-blkvm-setifempty:1] GotoIf("Local/2615@from-internal-0000006b;2", "1?init") in new stack
-- Goto (macro-blkvm-setifempty,s,4)
-- Executing [s@macro-blkvm-setifempty:4] Set("Local/2615@from-internal-0000006b;2", "__BLKVM_CHANNEL=Local/2615@from-internal-0000006b;2") in new stack
-- Executing [s@macro-blkvm-setifempty:5] Set("Local/2615@from-internal-0000006b;2", "SHARED(BLKVM,Local/2615@from-internal-0000006b;2)=TRUE") in new stack
-- Executing [s@macro-blkvm-setifempty:6] Set("Local/2615@from-internal-0000006b;2", "GOSUB_RETVAL=TRUE") in new stack
-- Executing [s@macro-blkvm-setifempty:7] MacroExit("Local/2615@from-internal-0000006b;2", "") in new stack
-- Executing [2615@from-internal:6] GotoIf("Local/2615@from-internal-0000006b;2", "1?skipov") in new stack
-- Goto (from-internal,2615,9)
-- Executing [2615@from-internal:9] Set("Local/2615@from-internal-0000006b;2", "RRNODEST=") in new stack
-- Executing [2615@from-internal:10] Set("Local/2615@from-internal-0000006b;2", "__NODEST=2615") in new stack
-- Executing [2615@from-internal:11] GosubIf("Local/2615@from-internal-0000006b;2", "0?sub-rgsetcid,s,1()") in new stack
-- Executing [2615@from-internal:12] Gosub("Local/2615@from-internal-0000006b;2", "sub-record-check,s,1(rg,2615,dontcare)") in new stack
-- Executing [s@sub-record-check:1] GotoIf("Local/2615@from-internal-0000006b;2", "0?initialized") in new stack
-- Executing [s@sub-record-check:2] Set("Local/2615@from-internal-0000006b;2", "__REC_STATUS=INITIALIZED") in new stack
-- Executing [s@sub-record-check:3] Set("Local/2615@from-internal-0000006b;2", "NOW=1487257994") in new stack
-- Executing [s@sub-record-check:4] Set("Local/2615@from-internal-0000006b;2", "__DAY=16") in new stack
-- Executing [s@sub-record-check:5] Set("Local/2615@from-internal-0000006b;2", "__MONTH=02") in new stack
-- Executing [s@sub-record-check:6] Set("Local/2615@from-internal-0000006b;2", "__YEAR=2017") in new stack
-- Executing [s@sub-record-check:7] Set("Local/2615@from-internal-0000006b;2", "__TIMESTR=20170216-161314") in new stack
-- Executing [s@sub-record-check:8] Set("Local/2615@from-internal-0000006b;2", "__FROMEXTEN=0041774157911") in new stack
-- Executing [s@sub-record-check:9] Set("Local/2615@from-internal-0000006b;2", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:10] NoOp("Local/2615@from-internal-0000006b;2", "Recordings initialized") in new stack
-- Executing [s@sub-record-check:11] ExecIf("Local/2615@from-internal-0000006b;2", "0?Set(ARG3=dontcare)") in new stack
-- Executing [s@sub-record-check:12] Set("Local/2615@from-internal-0000006b;2", "REC_POLICY_MODE_SAVE=") in new stack
-- Executing [s@sub-record-check:13] ExecIf("Local/2615@from-internal-0000006b;2", "0?Set(REC_STATUS=NO)") in new stack
-- Executing [s@sub-record-check:14] GotoIf("Local/2615@from-internal-0000006b;2", "2?checkaction") in new stack
-- Goto (sub-record-check,s,17)
-- Executing [s@sub-record-check:17] GotoIf("Local/2615@from-internal-0000006b;2", "0?sub-record-check,rg,1") in new stack
-- Executing [s@sub-record-check:18] NoOp("Local/2615@from-internal-0000006b;2", "Generic rg Recording Check - 0041774157911 2615") in new stack
-- Executing [s@sub-record-check:19] Gosub("Local/2615@from-internal-0000006b;2", "recordcheck,1(dontcare,rg,2615)") in new stack
-- Executing [recordcheck@sub-record-check:1] NoOp("Local/2615@from-internal-0000006b;2", "Starting recording check against dontcare") in new stack
-- Executing [recordcheck@sub-record-check:2] Goto("Local/2615@from-internal-0000006b;2", "dontcare") in new stack
-- Goto (sub-record-check,recordcheck,3)
-- Executing [recordcheck@sub-record-check:3] Return("Local/2615@from-internal-0000006b;2", "") in new stack
-- Executing [s@sub-record-check:20] Return("Local/2615@from-internal-0000006b;2", "") in new stack
-- Executing [2615@from-internal:13] Set("Local/2615@from-internal-0000006b;2", "RingGroupMethod=hunt") in new stack
-- Executing [2615@from-internal:14] Macro("Local/2615@from-internal-0000006b;2", "dial,40,Ttrc,015123265632#") in new stack
-- Executing [s@macro-dial:1] NoOp("Local/2615@from-internal-0000006b;2", "Blind Transfer: , Attended Transfer: , User: , Alert Info: ") in new stack
-- Executing [s@macro-dial:2] ExecIf("Local/2615@from-internal-0000006b;2", "0?Set(ALERT_INFO=)") in new stack
-- Executing [s@macro-dial:3] ExecIf("Local/2615@from-internal-0000006b;2", "0?Set(ALERT_INFO=)") in new stack
-- Executing [s@macro-dial:4] ExecIf("Local/2615@from-internal-0000006b;2", "0?Set(ALERT_INFO=)") in new stack
-- Executing [s@macro-dial:5] ExecIf("Local/2615@from-internal-0000006b;2", "0?Set(CHANNEL(musicclass)=)") in new stack
-- Executing [s@macro-dial:6] AGI("Local/2615@from-internal-0000006b;2", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
 dialparties.agi: Starting New Dialparties.agi
 dialparties.agi: Caller ID name is '0041774157911' number is '0041774157911'
   > dialparties.agi: USE_CONFIRMATION:  'FALSE'
   > dialparties.agi: RINGGROUP_INDEX:   ''
 dialparties.agi: Methodology of ring is  'hunt'
-- dialparties.agi: Added extension 015123265632# to extension map
-- dialparties.agi: Extension 015123265632# cf is disabled
   > dialparties.agi: extnum 015123265632# has:  cw: 0; hascfb: 0 [] hascfu: 0 []
   > dialparties.agi: Built External dialstring component for 015123265632: Local/015123265632@from-internal/n
-- dialparties.agi: Filtered ARG3: 015123265632
   > dialparties.agi: NODEST: 2615 adding M(auto-blkvm) to dialopts: TtrcM(auto-blkvm)
   > dialparties.agi: NODEST: 2615 blkvm enabled macro already in dialopts: TtrcM(auto-blkvm)
-- <Local/2615@from-internal-0000006b;2>AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:22] NoOp("Local/2615@from-internal-0000006b;2", "Returned from dialparties with hunt groups to dial") in new stack
-- Executing [s@macro-dial:23] Set("Local/2615@from-internal-0000006b;2", "HuntLoop=0") in new stack
-- Executing [s@macro-dial:24] ExecIf("Local/2615@from-internal-0000006b;2", "0?Set(HuntMembers=0)") in new stack
-- Executing [s@macro-dial:25] GotoIf("Local/2615@from-internal-0000006b;2", "1?a30") in new stack
-- Goto (macro-dial,s,28)
-- Executing [s@macro-dial:28] Set("Local/2615@from-internal-0000006b;2", "HuntMember=HuntMember0") in new stack
-- Executing [s@macro-dial:29] GotoIf("Local/2615@from-internal-0000006b;2", "1?a32:a35") in new stack
-- Goto (macro-dial,s,30)
-- Executing [s@macro-dial:30] Set("Local/2615@from-internal-0000006b;2", "CT_EXTEN=015123265632") in new stack
-- Executing [s@macro-dial:31] Set("Local/2615@from-internal-0000006b;2", "DB(CALLTRACE/015123265632)=0041774157911") in new stack
-- Executing [s@macro-dial:32] Goto("Local/2615@from-internal-0000006b;2", "s,huntstart") in new stack
-- Goto (macro-dial,s,40)
-- Executing [s@macro-dial:40] NoOp("Local/2615@from-internal-0000006b;2", "Hunt Dial Start") in new stack
-- Executing [s@macro-dial:41] Macro("Local/2615@from-internal-0000006b;2", "dial-hunt-predial-hook,") in new stack
-- Executing [s@macro-dial-hunt-predial-hook:1] MacroExit("Local/2615@from-internal-0000006b;2", "") in new stack
-- Executing [s@macro-dial:42] Dial("Local/2615@from-internal-0000006b;2", "Local/015123265632@from-internal/n,40,trcM(auto-blkvm)b(func-apply-sipheaders^s^1),") in new stack
-- Local/015123265632@from-internal-0000006c;1 Internal Gosub(func-apply-sipheaders,s,1) start
-- Executing [s@func-apply-sipheaders:1] NoOp("Local/015123265632@from-internal-0000006c;1", "Applying SIP Headers to channel") in new stack
-- Executing [s@func-apply-sipheaders:2] Set("Local/015123265632@from-internal-0000006c;1", "SIPHEADERKEYS=") in new stack
-- Executing [s@func-apply-sipheaders:3] While("Local/015123265632@from-internal-0000006c;1", "0") in new stack
-- Jumping to priority 7
-- Executing [s@func-apply-sipheaders:8] Return("Local/015123265632@from-internal-0000006c;1", "") in new stack
  == Spawn extension (from-internal, 2615, 1) exited non-zero on 'Local/015123265632@from-internal-0000006c;1'
-- Local/015123265632@from-internal-0000006c;1 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
-- Called Local/015123265632@from-internal/n
-- Local/2615@from-internal-0000006b;1 is ringing
-- Executing [015123265632@from-internal:1] Macro("Local/015123265632@from-internal-0000006c;2", "user-callerid,LIMIT,EXTERNAL,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/015123265632@from-internal-0000006c;2", "TOUCH_MONITOR=1487257995.3663") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/015123265632@from-internal-0000006c;2", "AMPUSER=0041774157911") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/015123265632@from-internal-0000006c;2", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("Local/015123265632@from-internal-0000006c;2", "1?Set(REALCALLERIDNUM=0041774157911)") in new stack
-- Executing [s@macro-user-callerid:5] Set("Local/015123265632@from-internal-0000006c;2", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("Local/015123265632@from-internal-0000006c;2", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("Local/015123265632@from-internal-0000006c;2", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("Local/015123265632@from-internal-0000006c;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,15)
-- Executing [s@macro-user-callerid:15] GotoIf("Local/015123265632@from-internal-0000006c;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,29)
-- Executing [s@macro-user-callerid:29] Set("Local/015123265632@from-internal-0000006c;2", "CALLERID(number)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:30] Set("Local/015123265632@from-internal-0000006c;2", "CALLERID(name)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:31] Set("Local/015123265632@from-internal-0000006c;2", "CDR(cnum)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:32] Set("Local/015123265632@from-internal-0000006c;2", "CDR(cnam)=0041774157911") in new stack
-- Executing [s@macro-user-callerid:33] Set("Local/015123265632@from-internal-0000006c;2", "CHANNEL(language)=de") in new stack
-- Executing [015123265632@from-internal:2] NoCDR("Local/015123265632@from-internal-0000006c;2", "") in new stack
-- Executing [015123265632@from-internal:3] Progress("Local/015123265632@from-internal-0000006c;2", "") in new stack
-- Local/015123265632@from-internal-0000006c;1 is making progress passing it to Local/2615@from-internal-0000006b;2
-- Executing [015123265632@from-internal:4] Wait("Local/015123265632@from-internal-0000006c;2", "1") in new stack
-- Executing [015123265632@from-internal:5] Playback("Local/015123265632@from-internal-0000006c;2", "silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer") in new stack
-- <Local/015123265632@from-internal-0000006c;2> Playing 'silence/1.ulaw' (language 'de')
-- <Local/015123265632@from-internal-0000006c;2> Playing 'cannot-complete-as-dialed.ulaw' (language 'de')
-- <Local/015123265632@from-internal-0000006c;2> Playing 'check-number-dial-again.ulaw' (language 'de')
  == Spawn extension (macro-dial-one, s, 48) exited non-zero on 'PJSIP/SIPGate-00000747' in macro 'dial-one'
  == Spawn extension (macro-exten-vm, s, 16) exited non-zero on 'PJSIP/SIPGate-00000747' in macro 'exten-vm'
  == Spawn extension (ext-local, 635, 2) exited non-zero on 'PJSIP/SIPGate-00000747'
-- Executing [h@ext-local:1] Macro("PJSIP/SIPGate-00000747", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("PJSIP/SIPGate-00000747", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("PJSIP/SIPGate-00000747", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("PJSIP/SIPGate-00000747", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/SIPGate-00000747' in macro 'hangupcall'
-- Executing [h@from-internal:1] Macro("Local/015123265632@from-internal-0000006c;2", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("Local/015123265632@from-internal-0000006c;2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("Local/015123265632@from-internal-0000006c;2", "0?Set(CDR(recordingfile)=)") in new stack
  == Spawn extension (ext-local, h, 1) exited non-zero on 'PJSIP/SIPGate-00000747'
-- Executing [s@macro-hangupcall:4] Hangup("Local/015123265632@from-internal-0000006c;2", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'Local/015123265632@from-internal-0000006c;2' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'Local/015123265632@from-internal-0000006c;2'
  == Spawn extension (macro-dial, s, 42) exited non-zero on 'Local/2615@from-internal-0000006b;2' in macro 'dial'
  == Spawn extension (from-internal, 2615, 14) exited non-zero on 'Local/2615@from-internal-0000006b;2'
-- Executing [h@from-internal:1] Macro("Local/2615@from-internal-0000006b;2", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("Local/2615@from-internal-0000006b;2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)

You saw this part, right? It appears to me that this is why your call is failing.

First: Update. NO forward of any external call, also not via Follow-Me’s work

Second: This is only via calls from outside. If an internal number calls the internal extension, the call forward and followme works as expected.

Sounds like you provider is. Blocking the call due to an unrecognised calling clid change your outgoing trunk not to send any foreign clid’s

Hallo

I’ll try to analyse the sen’t and received sip protocol. But I have set “Block foreign CIDs” in the trunk and added the
following line in the custom trunk context for this trunk:

same => n,ExecIf($[${LEN(${CALLERID(rdnis)})} != 0]?Set(CALLERID(all)=${CALLERID(rdnis)}))
same => n,Set(PJSIP_HEADER(add,P-Preferred-Identity)=sip:${CONNECTEDLINE(num)}@sipconnect.sipgate.de)

to additionally explicit suppress such a behavior