I have queue 1104 with CID prefix set to Parts- that fails to queue 1112 whis has CID prefix set to ${RGPREFIX} that then fails to queue 1116 which rings back to reception.
Here is the call trace
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:2] Answer("Local/1104@from-trunk-62d6,2", "") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:3] Set("Local/1104@from-trunk-62d6,2", "__BLKVM_OVERRIDE=BLKVM/1104/Local/1104@from-trunk-62d6,2") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:4] Set("Local/1104@from-trunk-62d6,2", "__BLKVM_BASE=1104") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:5] Set("Local/1104@from-trunk-62d6,2", "DB(BLKVM/1104/Local/1104@from-trunk-62d6,2)=TRUE") in new stack
[May 12 08:33:28] VERBOSE[28009] logger.c: -- Local/1104@from-trunk-62d6,1 answered IAX2/evreading-3501
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:6] ExecIf("Local/1104@from-trunk-62d6,2", "1|Set|_DIAL_OPTIONS=TtrwWM(auto-blkvm)") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:7] Set("Local/1104@from-trunk-62d6,2", "__NODEST=1104") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:8] GotoIf("Local/1104@from-trunk-62d6,2", "1?REPCID") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Goto (ext-queues,1104,13)
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:13] NoOp("Local/1104@from-trunk-62d6,2", "CALLERID(name) is 001189428440") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:14] Set("Local/1104@from-trunk-62d6,2", "_RGPREFIX=Parts-") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:15] Set("Local/1104@from-trunk-62d6,2", "CALLERID(name)=Parts-001189428440") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:16] Set("Local/1104@from-trunk-62d6,2", "MONITOR_FILENAME=/var/spool/asterisk/monitor/q1104-20090512-083328-1242113608.131773") in new stack
[May 12 08:33:28] VERBOSE[28010] logger.c: -- Executing [1104@ext-queues:17] Queue("Local/1104@from-trunk-62d6,2", "1104|tr|||20") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:1] GotoIf("Local/1145@from-internal-8384,2", "0?ext-local|1145|1") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:2] Macro("Local/1145@from-internal-8384,2", "user-callerid|") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [s@macro-user-callerid:1] Set("Local/1145@from-internal-8384,2", "AMPUSER=001189428440") in new stack
[May 12 08:33:28] DEBUG[28011] app_macro.c: Executed application: Set
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [s@macro-user-callerid:2] GotoIf("Local/1145@from-internal-8384,2", "1?report") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Goto (macro-user-callerid,s,11)
[May 12 08:33:28] DEBUG[28011] app_macro.c: Executed application: GotoIf
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [s@macro-user-callerid:11] GotoIf("Local/1145@from-internal-8384,2", "0?continue") in new stack
[May 12 08:33:28] DEBUG[28011] app_macro.c: Executed application: GotoIf
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [s@macro-user-callerid:12] Set("Local/1145@from-internal-8384,2", "__TTL=63") in new stack
[May 12 08:33:28] DEBUG[28011] app_macro.c: Executed application: Set
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [s@macro-user-callerid:13] GotoIf("Local/1145@from-internal-8384,2", "1?continue") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Goto (macro-user-callerid,s,20)
[May 12 08:33:28] DEBUG[28011] app_macro.c: Executed application: GotoIf
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [s@macro-user-callerid:20] NoOp("Local/1145@from-internal-8384,2", "Using CallerID "Parts-001189428440" <001189428440>") in new stack
[May 12 08:33:28] DEBUG[28011] app_macro.c: Executed application: Noop
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:3] GotoIf("Local/1145@from-internal-8384,2", "0?skipdb") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:4] GotoIf("Local/1145@from-internal-8384,2", "1?skipov") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Goto (from-internal,1145,9)
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:9] Set("Local/1145@from-internal-8384,2", "RRNODEST=1104") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:10] Set("Local/1145@from-internal-8384,2", "__NODEST=1145") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:11] Set("Local/1145@from-internal-8384,2", "RecordMethod=Group") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [1145@from-internal:12] Macro("Local/1145@from-internal-8384,2", "record-enable|1145|Group") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Executing [s@macro-record-enable:1] GotoIf("Local/1145@from-internal-8384,2", "1?check") in new stack
[May 12 08:33:28] VERBOSE[28011] logger.c: -- Goto (macro-record-enable,s,4)
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:2] Answer("Local/1144@from-internal-1ea1,2", "") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:3] Set("Local/1144@from-internal-1ea1,2", "__BLKVM_OVERRIDE=BLKVM/1112/Local/1144@from-internal-1ea1,2") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:4] Set("Local/1144@from-internal-1ea1,2", "__BLKVM_BASE=1112") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:5] Set("Local/1144@from-internal-1ea1,2", "DB(BLKVM/1112/Local/1144@from-internal-1ea1,2)=TRUE") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:6] ExecIf("Local/1144@from-internal-1ea1,2", "0|Set|_DIAL_OPTIONS=TtrwWM(auto-blkvm)M(auto-blkvm)") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:7] Set("Local/1144@from-internal-1ea1,2", "__NODEST=1112") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:8] GotoIf("Local/1144@from-internal-1ea1,2", "0?REPCID") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:9] GotoIf("Local/1144@from-internal-1ea1,2", "0?REPCID") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:10] NoOp("Local/1144@from-internal-1ea1,2", "Current RGPREFIX is Parts-....stripping from Caller ID") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:11] Set("Local/1144@from-internal-1ea1,2", "CALLERID(name)=001189428440") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:12] Set("Local/1144@from-internal-1ea1,2", "_RGPREFIX=") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:13] NoOp("Local/1144@from-internal-1ea1,2", "CALLERID(name) is 001189428440") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:14] Set("Local/1144@from-internal-1ea1,2", "_RGPREFIX=") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:15] Set("Local/1144@from-internal-1ea1,2", "CALLERID(name)=001189428440") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:16] Set("Local/1144@from-internal-1ea1,2", "MONITOR_FILENAME=/var/spool/asterisk/monitor/q1112-20090512-083427-1242113608.131777") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Executing [1112@ext-queues:17] Queue("Local/1144@from-internal-1ea1,2", "1112|t|||20") in new stack
[May 12 08:34:27] VERBOSE[28012] logger.c: -- Started music on hold, class 'default', on Local/1144@from-internal-1ea1,2
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:1] GotoIf("Local/1145@from-internal-7c8b,2", "0?ext-local|1145|1") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:2] Macro("Local/1145@from-internal-7c8b,2", "user-callerid|") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [s@macro-user-callerid:1] Set("Local/1145@from-internal-7c8b,2", "AMPUSER=001189428440") in new stack
[May 12 08:34:27] DEBUG[28074] app_macro.c: Executed application: Set
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [s@macro-user-callerid:2] GotoIf("Local/1145@from-internal-7c8b,2", "1?report") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Goto (macro-user-callerid,s,11)
[May 12 08:34:27] DEBUG[28074] app_macro.c: Executed application: GotoIf
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [s@macro-user-callerid:11] GotoIf("Local/1145@from-internal-7c8b,2", "0?continue") in new stack
[May 12 08:34:27] DEBUG[28074] app_macro.c: Executed application: GotoIf
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [s@macro-user-callerid:12] Set("Local/1145@from-internal-7c8b,2", "__TTL=60") in new stack
[May 12 08:34:27] DEBUG[28074] app_macro.c: Executed application: Set
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [s@macro-user-callerid:13] GotoIf("Local/1145@from-internal-7c8b,2", "1?continue") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Goto (macro-user-callerid,s,20)
[May 12 08:34:27] DEBUG[28074] app_macro.c: Executed application: GotoIf
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [s@macro-user-callerid:20] NoOp("Local/1145@from-internal-7c8b,2", "Using CallerID "001189428440" <001189428440>") in new stack
[May 12 08:34:27] DEBUG[28074] app_macro.c: Executed application: Noop
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:3] GotoIf("Local/1145@from-internal-7c8b,2", "0?skipdb") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:4] GotoIf("Local/1145@from-internal-7c8b,2", "1?skipov") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Goto (from-internal,1145,9)
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:9] Set("Local/1145@from-internal-7c8b,2", "RRNODEST=1112") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:10] Set("Local/1145@from-internal-7c8b,2", "__NODEST=1145") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:11] Set("Local/1145@from-internal-7c8b,2", "RecordMethod=Group") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [1145@from-internal:12] Macro("Local/1145@from-internal-7c8b,2", "record-enable|1145|Group") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Executing [s@macro-record-enable:1] GotoIf("Local/1145@from-internal-7c8b,2", "1?check") in new stack
[May 12 08:34:27] VERBOSE[28074] logger.c: -- Goto (macro-record-enable,s,4)
[May 12 08:34:27] DEBUG[28074] app_macro.c: Executed application: GotoIf
extract from extensions_additional
exten => 1116,1,Macro(user-callerid,)
exten => 1116,n,Answer
exten => 1116,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 1116,n,Set(__BLKVM_BASE=${EXTEN})
exten => 1116,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 1116,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"],Set,_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm))
exten => 1116,n,Set(__NODEST=${EXTEN})
exten => 1116,n,GotoIf($["foo${RGPREFIX}" = "foo"]?REPCID)
exten => 1116,n,GotoIf($["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]?REPCID)
exten => 1116,n,Noop(Current RGPREFIX is ${RGPREFIX}....stripping from Caller ID)
exten => 1116,n,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}})
exten => 1116,n,Set(_RGPREFIX=)
exten => 1116,n(REPCID),Noop(CALLERID(name) is ${CALLERID(name)})
exten => 1116,n,Set(_RGPREFIX=${RGPREFIX})
exten => 1116,n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})
exten => 1116,n,Set(__ALERT_INFO=info=<Bellcore-dr2>)
exten => 1116,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
exten => 1116,n,Queue(1116,t,,,20)
exten => 1116,n,dbDel(${BLKVM_OVERRIDE})
exten => 1116,n,Set(__NODEST=)
exten => 1116,n,Goto(ext-queues,1115,1)
exten => 1116*,1,Macro(agent-add,1116,)
exten => 1116**,1,Macro(agent-del,1116,1116)