Чат  ::   FAQ  ::   Поиск  ::   Регистрация  ::   Вход

Передача номера агента из очереди

Проблемы и их решения Asterisk как такового

Модератор: april22

Передача номера агента из очереди

Сообщение Kroteg » 15 май 2020, 11:48

Подскажите, товарищи, уже который день бьюсь с проблемой: необходимо после окончания вызова передать в экстен h контекста ext-queues номер отвечавшего агента
Всё поправлял через extensions_override_freepbx.conf
Был поправлен диалплан:
Код: выделить все
[ext-queues]
exten => h,1,NoOP(Agent: ${AAGENT}, Queue: ${QUEUENUM} Uniqueid: ${UNIQUEID})
    same => n,Set(QAGENT=${DB(qam/agent/${UNIQUEID})})
    same => n,NoOP(${UNIQUEID} and ${QAGENT})
    same => n,Set(DB_RESULT=${DB_DELETE(qam/agent/${UNIQUEID})})
    same => n,NoOP(Agent: ${DB_RESULT})
    same => n,Macro(hangupcall,)

Пытался добавлять в from-queue глобальную переменную
Код: выделить все
[from-queue]
exten => _.,1,NoOP(${QAGENT} and ${EXTEN}, ${UNIQUEID})
    same => n,Set(__QAGENT=${EXTEN})
    same => n,Goto(${NODEST},1)       

Но она не сохранялась, потом в исправил macro-auto-blkvm который вызывается после ответа агента:
Код: выделить все
[macro-auto-blkvm]
exten => s,7,Set(__AAGENT=${DIALEDPEERNUMBER})
exten => s,8,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=${DIALEDPEERNUMBER}))
exten => s,9,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=${DB(AMPUSER/${DIALEDPEERNUMBER}/cidname)}))

Но в выводе всё равно не отображается эта глобальная переменная
Концовка вызова правда взята из другого вызова, но по выводу понятно
в итоге в в macro-dial-one завершается канал который Local, а в ext-queues уже изначальный, т.е. внешний входящий
[Показать] Спойлер: лог вызова
-- Executing [s@time-rule-budni_buguruslan:4] Goto("SIP/203000-0000734f", "ext-queues,506,1") in new stack
-- Goto (ext-queues,506,1)
-- Executing [506@ext-queues:1] Macro("SIP/203000-0000734f", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/203000-0000734f", "TOUCH_MONITOR=1589520051.77092") in new stack
-- Executing [s@macro-user-callerid:2] Set("SIP/203000-0000734f", "AMPUSER=89328888888") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("SIP/203000-0000734f", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("SIP/203000-0000734f", "1?Set(REALCALLERIDNUM=89328888888)") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/203000-0000734f", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/203000-0000734f", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/203000-0000734f", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("SIP/203000-0000734f", "1?report") in new stack
-- Goto (macro-user-callerid,s,14)
-- Executing [s@macro-user-callerid:14] GotoIf("SIP/203000-0000734f", "0?continue") in new stack
-- Executing [s@macro-user-callerid:15] Set("SIP/203000-0000734f", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("SIP/203000-0000734f", "1?continue") in new stack
-- Goto (macro-user-callerid,s,27)
-- Executing [s@macro-user-callerid:27] Set("SIP/203000-0000734f", "CALLERID(number)=89328888888") in new stack
-- Executing [s@macro-user-callerid:28] Set("SIP/203000-0000734f", "CALLERID(name)=89328888888") in new stack
-- Executing [s@macro-user-callerid:29] Set("SIP/203000-0000734f", "CDR(cnum)=89328888888") in new stack
-- Executing [s@macro-user-callerid:30] Set("SIP/203000-0000734f", "CDR(cnam)=89328888888") in new stack
-- Executing [s@macro-user-callerid:31] Set("SIP/203000-0000734f", "CHANNEL(language)=en") in new stack
-- Executing [506@ext-queues:2] Answer("SIP/203000-0000734f", "") in new stack
-- Executing [506@ext-queues:3] Macro("SIP/203000-0000734f", "blkvm-set,reset") in new stack
-- Executing [s@macro-blkvm-set:1] ExecIf("SIP/203000-0000734f", "1?Set(__BLKVM_CHANNEL=SIP/203000-0000734f)") in new stack
-- Executing [s@macro-blkvm-set:2] Set("SIP/203000-0000734f", "SHARED(BLKVM,SIP/203000-0000734f)=TRUE") in new stack
-- Executing [s@macro-blkvm-set:3] Set("SIP/203000-0000734f", "GOSUB_RETVAL=TRUE") in new stack
-- Executing [s@macro-blkvm-set:4] MacroExit("SIP/203000-0000734f", "") in new stack
-- Executing [506@ext-queues:4] ExecIf("SIP/203000-0000734f", "1?Set(_DIAL_OPTIONS=TtrM(auto-blkvm))") in new stack
-- Executing [506@ext-queues:5] Set("SIP/203000-0000734f", "__NODEST=506") in new stack
-- Executing [506@ext-queues:6] Set("SIP/203000-0000734f", "QCIDPP=") in new stack
-- Executing [506@ext-queues:7] Set("SIP/203000-0000734f", "VQ_CIDPP=") in new stack
-- Executing [506@ext-queues:8] ExecIf("SIP/203000-0000734f", "0?Macro(prepend-cid,)") in new stack
-- Executing [506@ext-queues:9] Set("SIP/203000-0000734f", "QAINFO=") in new stack
-- Executing [506@ext-queues:10] Set("SIP/203000-0000734f", "VQ_AINFO=") in new stack
-- Executing [506@ext-queues:11] ExecIf("SIP/203000-0000734f", "0?Set(__ALERT_INFO=)") in new stack
-- Executing [506@ext-queues:12] Set("SIP/203000-0000734f", "QJOINMSG=custom/gazprom_4") in new stack
-- Executing [506@ext-queues:13] Set("SIP/203000-0000734f", "VQ_JOINMSG=") in new stack
-- Executing [506@ext-queues:14] Set("SIP/203000-0000734f", "QMOH=") in new stack
-- Executing [506@ext-queues:15] Set("SIP/203000-0000734f", "VQ_MOH=") in new stack
-- Executing [506@ext-queues:16] ExecIf("SIP/203000-0000734f", "0?Set(__MOHCLASS=)") in new stack
-- Executing [506@ext-queues:17] ExecIf("SIP/203000-0000734f", "1?Set(CHANNEL(musicclass)=default)") in new stack
-- Executing [506@ext-queues:18] Set("SIP/203000-0000734f", "QCANCELMISSED=C") in new stack
-- Executing [506@ext-queues:19] Set("SIP/203000-0000734f", "QRINGOPTS=r") in new stack
-- Executing [506@ext-queues:20] Set("SIP/203000-0000734f", "QRETRY=") in new stack
-- Executing [506@ext-queues:21] Set("SIP/203000-0000734f", "VQ_RETRY=") in new stack
-- Executing [506@ext-queues:22] Set("SIP/203000-0000734f", "QOPTIONS=tCr") in new stack
-- Executing [506@ext-queues:23] Set("SIP/203000-0000734f", "VQ_OPTIONS=") in new stack
-- Executing [506@ext-queues:24] Set("SIP/203000-0000734f", "QGOSUB=") in new stack
-- Executing [506@ext-queues:25] Set("SIP/203000-0000734f", "VQ_GOSUB=") in new stack
-- Executing [506@ext-queues:26] Set("SIP/203000-0000734f", "QAGI=") in new stack
-- Executing [506@ext-queues:27] Set("SIP/203000-0000734f", "VQ_AGI=") in new stack
-- Executing [506@ext-queues:28] Set("SIP/203000-0000734f", "QRULE=") in new stack
-- Executing [506@ext-queues:29] Set("SIP/203000-0000734f", "VQ_RULE=") in new stack
-- Executing [506@ext-queues:30] Set("SIP/203000-0000734f", "QPOSITION=") in new stack
-- Executing [506@ext-queues:31] Set("SIP/203000-0000734f", "VQ_POSITION=") in new stack
-- Executing [506@ext-queues:32] Set("SIP/203000-0000734f", "__MIXMON_FORMAT=wav") in new stack
-- Executing [506@ext-queues:33] Gosub("SIP/203000-0000734f", "sub-record-check,s,1(q,506,always)") in new stack
-- Executing [s@sub-record-check:1] Set("SIP/203000-0000734f", "REC_POLICY_MODE_SAVE=") in new stack
-- Executing [s@sub-record-check:2] GotoIf("SIP/203000-0000734f", "1?check") in new stack
-- Goto (sub-record-check,s,7)
-- Executing [s@sub-record-check:7] Set("SIP/203000-0000734f", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:8] GotoIf("SIP/203000-0000734f", "1?next") in new stack
-- Goto (sub-record-check,s,11)
-- Executing [s@sub-record-check:11] ExecIf("SIP/203000-0000734f", "0?Return()") in new stack
-- Executing [s@sub-record-check:12] ExecIf("SIP/203000-0000734f", "1?Set(__REC_POLICY_MODE=always)") in new stack
-- Executing [s@sub-record-check:13] GotoIf("SIP/203000-0000734f", "0?q,1") in new stack
-- Executing [s@sub-record-check:14] Set("SIP/203000-0000734f", "__REC_STATUS=INITIALIZED") in new stack
-- Executing [s@sub-record-check:15] Set("SIP/203000-0000734f", "NOW=1589520090") in new stack
-- Executing [s@sub-record-check:16] Set("SIP/203000-0000734f", "__DAY=15") in new stack
-- Executing [s@sub-record-check:17] Set("SIP/203000-0000734f", "__MONTH=05") in new stack
-- Executing [s@sub-record-check:18] Set("SIP/203000-0000734f", "__YEAR=2020") in new stack
-- Executing [s@sub-record-check:19] Set("SIP/203000-0000734f", "__TIMESTR=20200515-102130") in new stack
-- Executing [s@sub-record-check:20] Set("SIP/203000-0000734f", "__FROMEXTEN=89328888888") in new stack
-- Executing [s@sub-record-check:21] Set("SIP/203000-0000734f", "__CALLFILENAME=q-506-89328888888-20200515-102130-1589520051.77092") in new stack
-- Executing [s@sub-record-check:22] Goto("SIP/203000-0000734f", "q,1") in new stack
-- Goto (sub-record-check,q,1)
-- Executing [q@sub-record-check:1] GosubIf("SIP/203000-0000734f", "1?recq,1(q,506,89328888888)") in new stack
-- Executing [recq@sub-record-check:1] Set("SIP/203000-0000734f", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack
-- Executing [recq@sub-record-check:2] Set("SIP/203000-0000734f", "MONITOR_FILENAME=2020/05/15/q-506-89328888888-20200515-102130-1589520051.77092") in new stack
-- Executing [recq@sub-record-check:3] MixMonitor("SIP/203000-0000734f", "2020/05/15/q-506-89328888888-20200515-102130-1589520051.77092.wav,,") in new stack
-- Executing [recq@sub-record-check:4] Set("SIP/203000-0000734f", "__REC_STATUS=RECORDING") in new stack
== Begin MixMonitor Recording SIP/203000-0000734f
-- Executing [recq@sub-record-check:5] Set("SIP/203000-0000734f", "CDR(recordingfile)=q-506-89328888888-20200515-102130-1589520051.77092.wav") in new stack
-- Executing [recq@sub-record-check:6] Return("SIP/203000-0000734f", "") in new stack
-- Executing [q@sub-record-check:2] Return("SIP/203000-0000734f", "") in new stack
-- Executing [506@ext-queues:34] ExecIf("SIP/203000-0000734f", "1?Playback(custom/gazprom_4, )") in new stack
-- <SIP/203000-0000734f> Playing 'custom/gazprom_4.slin' (language 'en')
-- Executing [506@ext-queues:35] QueueLog("SIP/203000-0000734f", "506,1589520051.77092,NONE,DID,66010") in new stack
-- Executing [506@ext-queues:36] Set("SIP/203000-0000734f", "QAANNOUNCE=") in new stack
-- Executing [506@ext-queues:37] Set("SIP/203000-0000734f", "VQ_AANNOUNCE=") in new stack
-- Executing [506@ext-queues:38] Set("SIP/203000-0000734f", "QMAXWAIT=60") in new stack
-- Executing [506@ext-queues:39] Set("SIP/203000-0000734f", "VQ_MAXWAIT=") in new stack
-- Executing [506@ext-queues:40] Set("SIP/203000-0000734f", "QUEUENUM=506") in new stack
-- Executing [506@ext-queues:41] Set("SIP/203000-0000734f", "QUEUEJOINTIME=1589520094") in new stack
-- Executing [506@ext-queues:42] Queue("SIP/203000-0000734f", "506,tCr,,,60,,,,,") in new stack
-- Executing [2206@from-queue:1] Set("Local/2206@from-queue-00005cf7;2", "QAGENT=2206") in new stack
-- Executing [2206@from-queue:2] Goto("Local/2206@from-queue-00005cf7;2", "506,1") in new stack
-- Goto (from-queue,506,1)
-- Executing [2211@from-queue:1] Set("Local/2211@from-queue-00005cf8;2", "QAGENT=2211") in new stack
-- Executing [506@from-queue:1] Goto("Local/2206@from-queue-00005cf7;2", "from-internal,2206,1") in new stack
-- Executing [2211@from-queue:2] Goto("Local/2211@from-queue-00005cf8;2", "506,1") in new stack
-- Goto (from-internal,2206,1)
-- Goto (from-queue,506,1)
-- Executing [506@from-queue:1] Goto("Local/2211@from-queue-00005cf8;2", "from-internal,2211,1") in new stack
-- Goto (from-internal,2211,1)
-- Executing [2206@from-internal:1] Set("Local/2206@from-queue-00005cf7;2", "__RINGTIMER=25") in new stack
-- Executing [2211@from-internal:1] Set("Local/2211@from-queue-00005cf8;2", "__RINGTIMER=25") in new stack
-- Executing [2206@from-internal:2] Macro("Local/2206@from-queue-00005cf7;2", "exten-vm,novm,2206,0,0,0") in new stack
-- Executing [2211@from-internal:2] Macro("Local/2211@from-queue-00005cf8;2", "exten-vm,novm,2211,0,0,0") in new stack
-- Executing [s@macro-exten-vm:1] Macro("Local/2206@from-queue-00005cf7;2", "user-callerid,") in new stack
-- Executing [s@macro-exten-vm:1] Macro("Local/2211@from-queue-00005cf8;2", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/2206@from-queue-00005cf7;2", "TOUCH_MONITOR=1589520094.77153") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/2211@from-queue-00005cf8;2", "TOUCH_MONITOR=1589520094.77155") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/2206@from-queue-00005cf7;2", "AMPUSER=89328888888") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/2211@from-queue-00005cf8;2", "AMPUSER=89328888888") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/2206@from-queue-00005cf7;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,14)
-- Executing [s@macro-user-callerid:14] GotoIf("Local/2206@from-queue-00005cf7;2", "0?continue") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/2211@from-queue-00005cf8;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,14)
-- Executing [s@macro-user-callerid:15] Set("Local/2206@from-queue-00005cf7;2", "__TTL=63") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("Local/2211@from-queue-00005cf8;2", "0?continue") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("Local/2206@from-queue-00005cf7;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,27)
-- Executing [s@macro-user-callerid:15] Set("Local/2211@from-queue-00005cf8;2", "__TTL=63") in new stack
-- Executing [s@macro-user-callerid:27] Set("Local/2206@from-queue-00005cf7;2", "CALLERID(number)=89328888888") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("Local/2211@from-queue-00005cf8;2", "1?continue") in new stack
-- Executing [s@macro-user-callerid:28] Set("Local/2206@from-queue-00005cf7;2", "CALLERID(name)=89328888888") in new stack
-- Goto (macro-user-callerid,s,27)
-- Executing [s@macro-user-callerid:27] Set("Local/2211@from-queue-00005cf8;2", "CALLERID(number)=89328888888") in new stack
-- Executing [s@macro-user-callerid:29] Set("Local/2206@from-queue-00005cf7;2", "CDR(cnum)=89328888888") in new stack
-- Executing [s@macro-user-callerid:28] Set("Local/2211@from-queue-00005cf8;2", "CALLERID(name)=89328888888") in new stack
-- Executing [s@macro-user-callerid:30] Set("Local/2206@from-queue-00005cf7;2", "CDR(cnam)=89328888888") in new stack
-- Executing [s@macro-user-callerid:29] Set("Local/2211@from-queue-00005cf8;2", "CDR(cnum)=89328888888") in new stack
-- Executing [s@macro-user-callerid:31] Set("Local/2206@from-queue-00005cf7;2", "CHANNEL(language)=en") in new stack
-- Executing [s@macro-user-callerid:30] Set("Local/2211@from-queue-00005cf8;2", "CDR(cnam)=89328888888") in new stack
-- Executing [s@macro-user-callerid:31] Set("Local/2211@from-queue-00005cf8;2", "CHANNEL(language)=en") in new stack
-- Executing [s@macro-exten-vm:2] Set("Local/2206@from-queue-00005cf7;2", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:3] Set("Local/2206@from-queue-00005cf7;2", "__EXTTOCALL=2206") in new stack
-- Executing [s@macro-exten-vm:2] Set("Local/2211@from-queue-00005cf8;2", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:4] Set("Local/2206@from-queue-00005cf7;2", "__PICKUPMARK=2206") in new stack
-- Executing [s@macro-exten-vm:3] Set("Local/2211@from-queue-00005cf8;2", "__EXTTOCALL=2211") in new stack
-- Executing [s@macro-exten-vm:4] Set("Local/2211@from-queue-00005cf8;2", "__PICKUPMARK=2211") in new stack
-- Executing [s@macro-exten-vm:5] Set("Local/2206@from-queue-00005cf7;2", "RT=") in new stack
-- Executing [s@macro-exten-vm:6] Gosub("Local/2206@from-queue-00005cf7;2", "sub-record-check,s,1(exten,2206,)") in new stack
-- Executing [s@macro-exten-vm:5] Set("Local/2211@from-queue-00005cf8;2", "RT=") in new stack
-- Executing [s@macro-exten-vm:6] Gosub("Local/2211@from-queue-00005cf8;2", "sub-record-check,s,1(exten,2211,)") in new stack
-- Executing [s@sub-record-check:1] Set("Local/2206@from-queue-00005cf7;2", "REC_POLICY_MODE_SAVE=always") in new stack
-- Executing [s@sub-record-check:2] GotoIf("Local/2206@from-queue-00005cf7;2", "1?check") in new stack
-- Goto (sub-record-check,s,7)
-- Executing [s@sub-record-check:1] Set("Local/2211@from-queue-00005cf8;2", "REC_POLICY_MODE_SAVE=always") in new stack
-- Executing [s@sub-record-check:7] Set("Local/2206@from-queue-00005cf7;2", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:2] GotoIf("Local/2211@from-queue-00005cf8;2", "1?check") in new stack
-- Goto (sub-record-check,s,7)
-- Executing [s@sub-record-check:8] GotoIf("Local/2206@from-queue-00005cf7;2", "0?next") in new stack
-- Executing [s@sub-record-check:9] Set("Local/2206@from-queue-00005cf7;2", "CDR(recordingfile)=q-506-89328888888-20200515-102130-1589520051.77092.wav") in new stack
-- Executing [s@sub-record-check:7] Set("Local/2211@from-queue-00005cf8;2", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:10] Return("Local/2206@from-queue-00005cf7;2", "") in new stack
-- Executing [s@macro-exten-vm:7] Macro("Local/2206@from-queue-00005cf7;2", "dial-one,,TtrM(auto-blkvm),2206") in new stack
-- Executing [s@sub-record-check:8] GotoIf("Local/2211@from-queue-00005cf8;2", "0?next") in new stack
-- Executing [s@sub-record-check:9] Set("Local/2211@from-queue-00005cf8;2", "CDR(recordingfile)=q-506-89328888888-20200515-102130-1589520051.77092.wav") in new stack
-- Executing [s@sub-record-check:10] Return("Local/2211@from-queue-00005cf8;2", "") in new stack
-- Executing [s@macro-dial-one:1] Set("Local/2206@from-queue-00005cf7;2", "DEXTEN=2206") in new stack
-- Executing [s@macro-exten-vm:7] Macro("Local/2211@from-queue-00005cf8;2", "dial-one,,TtrM(auto-blkvm),2211") in new stack
-- Executing [s@macro-dial-one:2] Set("Local/2206@from-queue-00005cf7;2", "DIALSTATUS_CW=") in new stack
-- Executing [s@macro-dial-one:1] Set("Local/2211@from-queue-00005cf8;2", "DEXTEN=2211") in new stack
-- Executing [s@macro-dial-one:3] GosubIf("Local/2206@from-queue-00005cf7;2", "0?screen,1()") in new stack
-- Executing [s@macro-dial-one:2] Set("Local/2211@from-queue-00005cf8;2", "DIALSTATUS_CW=") in new stack
-- Executing [s@macro-dial-one:3] GosubIf("Local/2211@from-queue-00005cf8;2", "0?screen,1()") in new stack
-- Executing [s@macro-dial-one:4] GosubIf("Local/2206@from-queue-00005cf7;2", "0?cf,1()") in new stack
-- Executing [s@macro-dial-one:4] GosubIf("Local/2211@from-queue-00005cf8;2", "0?cf,1()") in new stack
-- Executing [s@macro-dial-one:5] GotoIf("Local/2206@from-queue-00005cf7;2", "1?skip1") in new stack
-- Goto (macro-dial-one,s,8)
-- Executing [s@macro-dial-one:8] GotoIf("Local/2206@from-queue-00005cf7;2", "0?nodial") in new stack
-- Executing [s@macro-dial-one:5] GotoIf("Local/2211@from-queue-00005cf8;2", "1?skip1") in new stack
-- Goto (macro-dial-one,s,8)
-- Executing [s@macro-dial-one:9] GotoIf("Local/2206@from-queue-00005cf7;2", "0?continue") in new stack
-- Executing [s@macro-dial-one:8] GotoIf("Local/2211@from-queue-00005cf8;2", "0?nodial") in new stack
-- Executing [s@macro-dial-one:9] GotoIf("Local/2211@from-queue-00005cf8;2", "0?continue") in new stack
-- Executing [s@macro-dial-one:10] Set("Local/2206@from-queue-00005cf7;2", "EXTHASCW=ENABLED") in new stack
-- Executing [s@macro-dial-one:10] Set("Local/2211@from-queue-00005cf8;2", "EXTHASCW=ENABLED") in new stack
-- Executing [s@macro-dial-one:11] GotoIf("Local/2206@from-queue-00005cf7;2", "0?next1:cwinusebusy") in new stack
-- Goto (macro-dial-one,s,23)
-- Executing [s@macro-dial-one:23] GotoIf("Local/2206@from-queue-00005cf7;2", "1?next3:continue") in new stack
-- Goto (macro-dial-one,s,24)
-- Executing [s@macro-dial-one:11] GotoIf("Local/2211@from-queue-00005cf8;2", "0?next1:cwinusebusy") in new stack
-- Goto (macro-dial-one,s,23)
-- Executing [s@macro-dial-one:23] GotoIf("Local/2211@from-queue-00005cf8;2", "1?next3:continue") in new stack
-- Executing [s@macro-dial-one:24] ExecIf("Local/2206@from-queue-00005cf7;2", "0?Set(DIALSTATUS_CW=BUSY)") in new stack
-- Goto (macro-dial-one,s,24)
-- Executing [s@macro-dial-one:25] GotoIf("Local/2206@from-queue-00005cf7;2", "0?nodial") in new stack
-- Executing [s@macro-dial-one:24] ExecIf("Local/2211@from-queue-00005cf8;2", "1?Set(DIALSTATUS_CW=BUSY)") in new stack
-- Executing [s@macro-dial-one:26] GosubIf("Local/2206@from-queue-00005cf7;2", "1?dstring,1():dlocal,1()") in new stack
-- Executing [dstring@macro-dial-one:1] Set("Local/2206@from-queue-00005cf7;2", "DSTRING=") in new stack
-- Executing [s@macro-dial-one:25] GotoIf("Local/2211@from-queue-00005cf8;2", "0?nodial") in new stack
-- Executing [s@macro-dial-one:26] GosubIf("Local/2211@from-queue-00005cf8;2", "1?dstring,1():dlocal,1()") in new stack
-- Executing [dstring@macro-dial-one:2] Set("Local/2206@from-queue-00005cf7;2", "DEVICES=2206") in new stack
-- Executing [dstring@macro-dial-one:3] ExecIf("Local/2206@from-queue-00005cf7;2", "0?Return()") in new stack
-- Executing [dstring@macro-dial-one:1] Set("Local/2211@from-queue-00005cf8;2", "DSTRING=") in new stack
-- Executing [dstring@macro-dial-one:4] ExecIf("Local/2206@from-queue-00005cf7;2", "0?Set(DEVICES=206)") in new stack
-- Executing [dstring@macro-dial-one:2] Set("Local/2211@from-queue-00005cf8;2", "DEVICES=2211") in new stack
-- Executing [dstring@macro-dial-one:5] Set("Local/2206@from-queue-00005cf7;2", "LOOPCNT=1") in new stack
-- Executing [dstring@macro-dial-one:3] ExecIf("Local/2211@from-queue-00005cf8;2", "0?Return()") in new stack
-- Executing [dstring@macro-dial-one:6] Set("Local/2206@from-queue-00005cf7;2", "ITER=1") in new stack
-- Executing [dstring@macro-dial-one:4] ExecIf("Local/2211@from-queue-00005cf8;2", "0?Set(DEVICES=211)") in new stack
-- Executing [dstring@macro-dial-one:7] Set("Local/2206@from-queue-00005cf7;2", "THISDIAL=SIP/2206") in new stack
-- Executing [dstring@macro-dial-one:5] Set("Local/2211@from-queue-00005cf8;2", "LOOPCNT=1") in new stack
-- Executing [dstring@macro-dial-one:6] Set("Local/2211@from-queue-00005cf8;2", "ITER=1") in new stack
-- Executing [dstring@macro-dial-one:8] GosubIf("Local/2206@from-queue-00005cf7;2", "1?zap2dahdi,1()") in new stack
-- Executing [zap2dahdi@macro-dial-one:1] ExecIf("Local/2206@from-queue-00005cf7;2", "0?Return()") in new stack
-- Executing [dstring@macro-dial-one:7] Set("Local/2211@from-queue-00005cf8;2", "THISDIAL=SIP/2211") in new stack
-- Executing [zap2dahdi@macro-dial-one:2] Set("Local/2206@from-queue-00005cf7;2", "NEWDIAL=") in new stack
-- Executing [dstring@macro-dial-one:8] GosubIf("Local/2211@from-queue-00005cf8;2", "1?zap2dahdi,1()") in new stack
-- Executing [zap2dahdi@macro-dial-one:3] Set("Local/2206@from-queue-00005cf7;2", "LOOPCNT2=1") in new stack
-- Executing [zap2dahdi@macro-dial-one:4] Set("Local/2206@from-queue-00005cf7;2", "ITER2=1") in new stack
-- Executing [zap2dahdi@macro-dial-one:1] ExecIf("Local/2211@from-queue-00005cf8;2", "0?Return()") in new stack
-- Executing [zap2dahdi@macro-dial-one:2] Set("Local/2211@from-queue-00005cf8;2", "NEWDIAL=") in new stack
-- Executing [zap2dahdi@macro-dial-one:5] Set("Local/2206@from-queue-00005cf7;2", "THISPART2=SIP/2206") in new stack
-- Executing [zap2dahdi@macro-dial-one:6] ExecIf("Local/2206@from-queue-00005cf7;2", "0?Set(THISPART2=DAHDI/2206)") in new stack
-- Executing [zap2dahdi@macro-dial-one:3] Set("Local/2211@from-queue-00005cf8;2", "LOOPCNT2=1") in new stack
-- Executing [zap2dahdi@macro-dial-one:7] Set("Local/2206@from-queue-00005cf7;2", "NEWDIAL=SIP/2206&") in new stack
-- Executing [zap2dahdi@macro-dial-one:4] Set("Local/2211@from-queue-00005cf8;2", "ITER2=1") in new stack
-- Executing [zap2dahdi@macro-dial-one:8] Set("Local/2206@from-queue-00005cf7;2", "ITER2=2") in new stack
-- Executing [zap2dahdi@macro-dial-one:5] Set("Local/2211@from-queue-00005cf8;2", "THISPART2=SIP/2211") in new stack
-- Executing [zap2dahdi@macro-dial-one:9] GotoIf("Local/2206@from-queue-00005cf7;2", "0?begin2") in new stack
-- Executing [zap2dahdi@macro-dial-one:6] ExecIf("Local/2211@from-queue-00005cf8;2", "0?Set(THISPART2=DAHDI/2211)") in new stack
-- Executing [zap2dahdi@macro-dial-one:10] Set("Local/2206@from-queue-00005cf7;2", "THISDIAL=SIP/2206") in new stack
-- Executing [zap2dahdi@macro-dial-one:7] Set("Local/2211@from-queue-00005cf8;2", "NEWDIAL=SIP/2211&") in new stack
-- Executing [zap2dahdi@macro-dial-one:11] Return("Local/2206@from-queue-00005cf7;2", "") in new stack
-- Executing [zap2dahdi@macro-dial-one:8] Set("Local/2211@from-queue-00005cf8;2", "ITER2=2") in new stack
-- Executing [dstring@macro-dial-one:9] Set("Local/2206@from-queue-00005cf7;2", "DSTRING=SIP/2206&") in new stack
-- Executing [zap2dahdi@macro-dial-one:9] GotoIf("Local/2211@from-queue-00005cf8;2", "0?begin2") in new stack
-- Executing [dstring@macro-dial-one:10] Set("Local/2206@from-queue-00005cf7;2", "ITER=2") in new stack
-- Executing [zap2dahdi@macro-dial-one:10] Set("Local/2211@from-queue-00005cf8;2", "THISDIAL=SIP/2211") in new stack
-- Executing [dstring@macro-dial-one:11] GotoIf("Local/2206@from-queue-00005cf7;2", "0?begin") in new stack
-- Executing [zap2dahdi@macro-dial-one:11] Return("Local/2211@from-queue-00005cf8;2", "") in new stack
-- Executing [dstring@macro-dial-one:12] Set("Local/2206@from-queue-00005cf7;2", "DSTRING=SIP/2206") in new stack
-- Executing [dstring@macro-dial-one:9] Set("Local/2211@from-queue-00005cf8;2", "DSTRING=SIP/2211&") in new stack
-- Executing [dstring@macro-dial-one:13] Return("Local/2206@from-queue-00005cf7;2", "") in new stack
-- Executing [s@macro-dial-one:27] GotoIf("Local/2206@from-queue-00005cf7;2", "0?nodial") in new stack
-- Executing [dstring@macro-dial-one:10] Set("Local/2211@from-queue-00005cf8;2", "ITER=2") in new stack
-- Executing [s@macro-dial-one:28] GotoIf("Local/2206@from-queue-00005cf7;2", "0?skiptrace") in new stack
-- Executing [dstring@macro-dial-one:11] GotoIf("Local/2211@from-queue-00005cf8;2", "0?begin") in new stack
-- Executing [dstring@macro-dial-one:12] Set("Local/2211@from-queue-00005cf8;2", "DSTRING=SIP/2211") in new stack
-- Executing [s@macro-dial-one:29] GosubIf("Local/2206@from-queue-00005cf7;2", "1?ctset,1():ctclear,1()") in new stack
-- Executing [dstring@macro-dial-one:13] Return("Local/2211@from-queue-00005cf8;2", "") in new stack
-- Executing [s@macro-dial-one:27] GotoIf("Local/2211@from-queue-00005cf8;2", "0?nodial") in new stack
-- Executing [ctset@macro-dial-one:1] Set("Local/2206@from-queue-00005cf7;2", "DB(CALLTRACE/2206)=89328888888") in new stack
-- Executing [s@macro-dial-one:28] GotoIf("Local/2211@from-queue-00005cf8;2", "0?skiptrace") in new stack
-- Executing [s@macro-dial-one:29] GosubIf("Local/2211@from-queue-00005cf8;2", "1?ctset,1():ctclear,1()") in new stack
-- Executing [ctset@macro-dial-one:2] Return("Local/2206@from-queue-00005cf7;2", "") in new stack
-- Executing [ctset@macro-dial-one:1] Set("Local/2211@from-queue-00005cf8;2", "DB(CALLTRACE/2211)=89328888888") in new stack
-- Executing [s@macro-dial-one:30] Set("Local/2206@from-queue-00005cf7;2", "D_OPTIONS=TtrM(auto-blkvm)") in new stack
-- Executing [ctset@macro-dial-one:2] Return("Local/2211@from-queue-00005cf8;2", "") in new stack
-- Executing [s@macro-dial-one:31] ExecIf("Local/2206@from-queue-00005cf7;2", "0?SIPAddHeader(Alert-Info: )") in new stack
-- Executing [s@macro-dial-one:32] ExecIf("Local/2206@from-queue-00005cf7;2", "0?SIPAddHeader()") in new stack
-- Executing [s@macro-dial-one:30] Set("Local/2211@from-queue-00005cf8;2", "D_OPTIONS=TtrM(auto-blkvm)") in new stack
-- Executing [s@macro-dial-one:33] ExecIf("Local/2206@from-queue-00005cf7;2", "1?Set(CHANNEL(musicclass)=default)") in new stack
-- Executing [s@macro-dial-one:31] ExecIf("Local/2211@from-queue-00005cf8;2", "0?SIPAddHeader(Alert-Info: )") in new stack
-- Executing [s@macro-dial-one:34] GosubIf("Local/2206@from-queue-00005cf7;2", "0?qwait,1()") in new stack
-- Executing [s@macro-dial-one:35] Set("Local/2206@from-queue-00005cf7;2", "__CWIGNORE=") in new stack
-- Executing [s@macro-dial-one:32] ExecIf("Local/2211@from-queue-00005cf8;2", "0?SIPAddHeader()") in new stack
-- Executing [s@macro-dial-one:36] Set("Local/2206@from-queue-00005cf7;2", "__KEEPCID=TRUE") in new stack
-- Executing [s@macro-dial-one:33] ExecIf("Local/2211@from-queue-00005cf8;2", "1?Set(CHANNEL(musicclass)=default)") in new stack
-- Executing [s@macro-dial-one:37] GotoIf("Local/2206@from-queue-00005cf7;2", "0?usegoto,1") in new stack
-- Executing [s@macro-dial-one:34] GosubIf("Local/2211@from-queue-00005cf8;2", "0?qwait,1()") in new stack
-- Executing [s@macro-dial-one:38] GotoIf("Local/2206@from-queue-00005cf7;2", "1?godial") in new stack
-- Executing [s@macro-dial-one:35] Set("Local/2211@from-queue-00005cf8;2", "__CWIGNORE=") in new stack
-- Goto (macro-dial-one,s,43)
-- Executing [s@macro-dial-one:36] Set("Local/2211@from-queue-00005cf8;2", "__KEEPCID=TRUE") in new stack
-- Executing [s@macro-dial-one:43] Dial("Local/2206@from-queue-00005cf7;2", "SIP/2206,,TtrM(auto-blkvm)") in new stack
-- Executing [s@macro-dial-one:37] GotoIf("Local/2211@from-queue-00005cf8;2", "0?usegoto,1") in new stack
-- Executing [s@macro-dial-one:38] GotoIf("Local/2211@from-queue-00005cf8;2", "1?godial") in new stack
-- Goto (macro-dial-one,s,43)
-- Executing [s@macro-dial-one:43] Dial("Local/2211@from-queue-00005cf8;2", "SIP/2211,,TtrM(auto-blkvm)") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/2206
-- Local/2206@from-queue-00005cf7;1 is ringing
-- Local/2206@from-queue-00005cf7;1 connected line has changed. Saving it until answer for SIP/203000-0000734f
-- Local/2206@from-queue-00005cf7;1 connected line has changed. Saving it until answer for SIP/203000-0000734f
-- Called SIP/2211
-- Local/2211@from-queue-00005cf8;1 is ringing
-- Local/2211@from-queue-00005cf8;1 connected line has changed. Saving it until answer for SIP/203000-0000734f
-- Local/2211@from-queue-00005cf8;1 connected line has changed. Saving it until answer for SIP/203000-0000734f
-- SIP/2211-0000736a is ringing
-- Local/2211@from-queue-00005cf8;1 is ringing
-- SIP/2206-00007369 is ringing
-- Local/2206@from-queue-00005cf7;1 is ringing
-- Local/2206@from-queue-00005cf7;1 connected line has changed. Saving it until answer for SIP/203000-0000734f
-- SIP/2206-00007369 answered Local/2206@from-queue-00005cf7;2
-- Executing [s@macro-auto-blkvm:1] Set("SIP/2206-00007369", "__MACRO_RESULT=") in new stack
-- Executing [s@macro-auto-blkvm:2] Set("SIP/2206-00007369", "CFIGNORE=") in new stack
-- Executing [s@macro-auto-blkvm:3] Set("SIP/2206-00007369", "MASTER_CHANNEL(CFIGNORE)=") in new stack
-- Executing [s@macro-auto-blkvm:4] Set("SIP/2206-00007369", "FORWARD_CONTEXT=from-internal") in new stack
-- Executing [s@macro-auto-blkvm:5] Set("SIP/2206-00007369", "MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal") in new stack
-- Executing [s@macro-auto-blkvm:6] Macro("SIP/2206-00007369", "blkvm-clr,") in new stack
-- Executing [s@macro-blkvm-clr:1] Set("SIP/2206-
00007369", "SHARED(BLKVM,SIP/203000-0000734f)=") in new stack
-- Executing [s@macro-blkvm-clr:2] Set("SIP/2206-00007369", "GOSUB_RETVAL=") in new stack
-- Executing [s@macro-blkvm-clr:3] MacroExit("SIP/2206-00007369", "") in new stack
-- Executing [s@macro-auto-blkvm:7] Set("SIP/2206-00007369", "__AAGENT=2206") in new stack
-- Executing [s@macro-auto-blkvm:8] ExecIf("SIP/2206-00007369", "0?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=2206)") in new stack
-- Executing [s@macro-auto-blkvm:9] ExecIf("SIP/2206-00007369", "0?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=2206)") in new stack
-- Local/2206@from-queue-00005cf7;1 answered SIP/203000-0000734f
== Spawn extension (macro-dial-one, s, 43) exited non-zero on 'Local/2211@from-queue-00005cf8;2' in macro 'dial-one'
== Spawn extension (macro-exten-vm, s, 7) exited non-zero on 'Local/2211@from-queue-00005cf8;2' in macro 'exten-vm'
== Spawn extension (from-internal, 2211, 2) exited non-zero on 'Local/2211@from-queue-00005cf8;2'
-- Executing [h@from-internal:1] Hangup("Local/2211@from-queue-00005cf8;2", "") in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'Local/2211@from-queue-00005cf8;2'

Концовка правда из другого вызова, но диалплан - тот же:
-- Executing [h@ext-queues:1] NoOp("SIP/203000-00007317", "Agent: , Queue: 504 Uniqueid: 1589520002.76950") in new stack
-- Executing [h@ext-queues:2] Set("SIP/203000-00007317", "QAGENT=") in new stack
-- Executing [h@ext-queues:3] NoOp("SIP/203000-00007317", "1589520002.76950 and ") in new stack
-- Executing [h@ext-queues:4] Set("SIP/203000-00007317", "DB_RESULT=") in new stack
-- Executing [h@ext-queues:5] NoOp("SIP/203000-00007317", "Agent: ") in new stack
-- Executing [h@ext-queues:6] Macro("SIP/203000-00007317", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/203000-00007317", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("SIP/203000-00007317", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("SIP/203000-00007317", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/203000-00007317' in macro 'hangupcall'
== Spawn extension (ext-queues, h, 6) exited non-zero on 'SIP/203000-00007317'
== Spawn extension (ext-queues, 504, 43) exited non-zero on 'SIP/203000-00007317'
== MixMonitor close filestream (mixed)

Пробовал и в astdb по ключу uniqueid добавлять пира
Код: выделить все
[macro-auto-blkvm]
exten => s,7,Set(DB(qam/agent/${UNIQUEID})=${DIALEDPEERNUMBER})
exten => s,8,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=${DIALEDPEERNUMBER}))
exten => s,9,ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && "${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=${DB(AMPUSER/${DIALEDPEERNUMBER}/cidname)}))

Код: выделить все
    same => n,Set(QAGENT=${DB(qam/agent/${UNIQUEID})})
    same => n,NoOP(${UNIQUEID} and ${QAGENT})

в базу пишется, но как видно по окончанию - не извлекается
Аватар пользователя
Kroteg
 
Сообщений: 159
Зарегистрирован: 11 янв 2018, 14:51

Re: Передача номера агента из очереди

Сообщение ded » 15 май 2020, 18:51

Ты поздно ставишь присвоение -
[macro-auto-blkvm]
exten => s,7,Set(__AAGENT=${DIALEDPEERNUMBER})

Посмотри свой лог - на 6-м шаге уходит на другой макрос blkvm-clr, поэтому я бы посоветовал
[macro-auto-blkvm](+)
exten => s,4,Set(__AAGENT=${DIALEDPEERNUMBER})
ded
 
Сообщений: 14447
Зарегистрирован: 26 авг 2010, 19:00


Вернуться в Конфигурация и настройка Asterisk

Кто сейчас на форуме

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 14

© 2008 — 2020 Asterisk.ru
Digium, Asterisk and AsteriskNOW are registered trademarks of Digium, Inc.
Design and development by PostMet-Netzwerk GmbH