Its part of FreePBX context its a macro they generate:
[macro-user-callerid]
exten => s,1,Set(TOUCH_MONITOR=${UNIQUEID})
exten => s,n,Set(AMPUSER=${IF($["${AMPUSER}" = “”]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,GotoIf($["${CUT(CHANNEL,@,2):5:5}"=“queue” | ${LEN(${AMPUSERCIDNAME})}]?report)
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = “”]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,GotoIf($["${AMPUSER}" = “none”]?limit)
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($["${AMPUSERCIDNAME:1:2}" = “”]?report)
exten => s,n,Set(AMPUSERCID=${IF($["${ARG2}" != “EXTERNAL” & “${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}” = “1”]?${DB_RESULT}:${AMPUSER})})
exten => s,n,Set(__DIAL_OPTIONS=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/dialopts)}" = “1”]?${DB_RESULT}:${DIAL_OPTIONS})})
exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSERCID}>)
exten => s,n,GotoIf($["${ARG1}"=“LIMIT” & ${LEN(${AMPUSER})} & ${DB_EXISTS(AMPUSER/${AMPUSER}/concurrency_limit)} & ${DB(AMPUSER/${AMPUSER}/concurrency_limit)}>0 & ${GROUP_COUNT(${AMPUSER}@concurrency_limit)}>=$
exten => s,n,ExecIf($["${ARG1}"=“LIMIT” & ${LEN(${AMPUSER})}]?Set(GROUP(concurrency_limit)=${AMPUSER}))
exten => s,n,ExecIf($["${DB(AMPUSER/${AMPUSER}/language)}" != “”]?Set(CHANNEL(language)=${DB(AMPUSER/${AMPUSER}/language)}))
exten => s,n(report),GotoIf($[ “${ARG1}” = “SKIPTTL” | “${ARG1}” = “LIMIT” ]?continue)
exten => s,n,ExecIf($["${CALLEE_ACCOUNCODE}" = “”]?Set(__CALLEE_ACCOUNCODE=${DB(AMPUSER/${IF($["${MACRO_CONTEXT}"=“macro-exten-vm”]?${ARG2}:${MACRO_EXTEN})}/accountcode)}))
exten => s,n(report2),Set(__TTL=${IF($[“foo${TTL}” = “foo”]?6:$[ ${TTL} - 1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER})
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n,Gosub(macro-user-callerid,lang-playback,1(hook_0))
exten => s,n,Macro(hangupcall,)
exten => s,n(limit),Answer
exten => s,n,Wait(1)
exten => s,n,Gosub(macro-user-callerid,lang-playback,1(hook_1))
exten => s,n,Macro(hangupcall,)
exten => s,n,Congestion(20)
exten => s,n(continue),Set(CALLERID(number)=${CALLERID(number):0:40})
exten => s,n,Set(CALLERID(name)=${CALLERID(name):0:40})
exten => s,n,GotoIf($["${CALLERID(name)}" = “”]?cnum)
exten => s,n,Set(CDR(cnam)=${CALLERID(name)})
exten => s,n(cnum),Set(CDR(cnum)=${CALLERID(num)})
exten => s,n,Set(CHANNEL(language)=${MASTER_CHANNEL(CHANNEL(language))})
However as soon as the queue rings the member it calls the macro and fails:
-- Executing [s@macro-user-callerid:1] Set("Local/2028@from-queue-0002c416;2", "TOUCH_MONITOR=1505382582.381471") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/2028@from-queue-0002c416;2", "AMPUSER=+27114528644") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/2028@from-queue-0002c416;2", "1?report") in new stack
-- Executing [s@macro-user-callerid:15] GotoIf("Local/2028@from-queue-0002c416;2", "0?continue") in new stack
-- Executing [s@macro-user-callerid:16] ExecIf("Local/2028@from-queue-0002c416;2", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
-- Executing [s@macro-user-callerid:17] Set("Local/2028@from-queue-0002c416;2", "__TTL=0") in new stack
-- Executing [s@macro-user-callerid:18] GotoIf("Local/2028@from-queue-0002c416;2", "0?continue") in new stack
-- Executing [s@macro-user-callerid:19] Wait("Local/2028@from-queue-0002c416;2", "21") in new stack
-- Executing [s@macro-user-callerid:20] Answer("Local/2028@from-queue-0002c416;2", "") in new stack
Other queues TTL does return with a value greater then 0 and the call gets processed.
Regards