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