Задать вопрос
@Janus74

Как в очереди отслеживать не отвеченные звонки?

Всем привет!
Необходимо уведомлять о неотвеченных вызовах в чат telegramm, для этого в extensions_override_freepbx.conf
я написал:
[ext-queues]
exten => h,1,Noop(${CDR(disposition))
;exten => h,n,ExecIf($["${CDR(disposition)}" = "NO ANSWER"] | $["${CDR(disposition)}" = "BUSY"])?AGI(tg-noanswer.php, ${CALLERID(num)}, ${STRFTIME(${EPOCH},,%Y.%m.%d-%H:%M:%S)})
exten => h,n,Macro(hangupcall,)

Во время тестирования все было норм, но в эскплуатации выяснилось, что ${CDR(disposition) может быть NO ANSWER да же, если кто-то ответил на звонок.
лог:
-- Executing [s@macro-auto-blkvm:1] ExecIf("PJSIP/101-0000004d", "1?Set(CDR(recordingfile)=in-89XXXXXXXX-+79NNNNNNNN-20240911-135327-1726044807.315.wav)") in new stack
    -- Executing [s@macro-auto-blkvm:2] Set("PJSIP/101-0000004d", "__MACRO_RESULT=") in new stack
    -- Executing [s@macro-auto-blkvm:3] Set("PJSIP/101-0000004d", "CFIGNORE=") in new stack
    -- Executing [s@macro-auto-blkvm:4] Set("PJSIP/101-0000004d", "MASTER_CHANNEL(CFIGNORE)=") in new stack
    -- Executing [s@macro-auto-blkvm:5] Set("PJSIP/101-0000004d", "FORWARD_CONTEXT=from-internal") in new stack
    -- Executing [s@macro-auto-blkvm:6] Set("PJSIP/101-0000004d", "MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal") in new stack
    -- Executing [s@macro-auto-blkvm:7] Macro("PJSIP/101-0000004d", "blkvm-clr,") in new stack
    -- Executing [s@macro-blkvm-clr:1] Set("PJSIP/101-0000004d", "SHARED(BLKVM,SIP/tg200_out-00000044)=") in new stack
    -- Executing [s@macro-blkvm-clr:2] Set("PJSIP/101-0000004d", "GOSUB_RETVAL=") in new stack
    -- Executing [s@macro-blkvm-clr:3] MacroExit("PJSIP/101-0000004d", "") in new stack
       > 0x23f57e0 -- Strict RTP learning complete - Locking on source address 172.17.1.4:11840
    -- Executing [s@macro-auto-blkvm:8] ExecIf("PJSIP/101-0000004d", "0?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=101/sip:101@172.17.1.6:5060)") in new stack
    -- Executing [s@macro-auto-blkvm:9] ExecIf("PJSIP/101-0000004d", "0?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=)") in new stack
    -- Local/101@from-queue-00000056;1 answered SIP/tg200_out-00000044
    -- Stopped music on hold on SIP/tg200_out-00000044
  == Spawn extension (macro-dial-one, s, 54) exited non-zero on 'Local/400@from-queue-00000055;2' in macro 'dial-one'
  == Spawn extension (from-queue-exten-internal, 400, 8) exited non-zero on 'Local/400@from-queue-00000055;2'
    -- Executing [h@from-queue-exten-internal:1] Macro("Local/400@from-queue-00000055;2", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("Local/400@from-queue-00000055;2", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("Local/400@from-queue-00000055;2", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] NoOp("Local/400@from-queue-00000055;2", "SIP/400-00000045 montior file= ") in new stack
    -- Executing [s@macro-hangupcall:5] GotoIf("Local/400@from-queue-00000055;2", "1?skipagi") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [s@macro-hangupcall:7] Hangup("Local/400@from-queue-00000055;2", "") in new stack
  == Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'Local/400@from-queue-00000055;2' in macro 'hangupcall'
  == Spawn extension (from-queue-exten-internal, h, 1) exited non-zero on 'Local/400@from-queue-00000055;2'
    -- Channel Local/101@from-queue-00000056;1 joined 'simple_bridge' basic-bridge <0463f6d2-ef87-4666-806e-162221eb91b2>
    -- Channel SIP/tg200_out-00000044 joined 'simple_bridge' basic-bridge <0463f6d2-ef87-4666-806e-162221eb91b2>
    -- Channel PJSIP/101-0000004d joined 'simple_bridge' basic-bridge <8bf01d18-901d-4612-94aa-55ff86971fdf>
    -- Channel Local/101@from-queue-00000056;2 joined 'simple_bridge' basic-bridge <8bf01d18-901d-4612-94aa-55ff86971fdf>
       > 0x7f70840d9620 -- Strict RTP switching to RTP target address 172.17.1.6:5018 as source
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
       > 0x7f70840d9620 -- Strict RTP learning complete - Locking on source address 172.17.1.6:5018
    -- Channel SIP/tg200_out-00000044 left 'simple_bridge' basic-bridge <0463f6d2-ef87-4666-806e-162221eb91b2>
  == Spawn extension (ext-queues, 1021, 52) exited non-zero on 'SIP/tg200_out-00000044'
[2024-09-11 13:53:41] WARNING[17387][C-00000047]: pbx_variables.c:719 pbx_substitute_variables_helper_full: Error in extension logic (missing '}')
    -- Channel Local/101@from-queue-00000056;1 left 'simple_bridge' basic-bridge <0463f6d2-ef87-4666-806e-162221eb91b2>
    -- Channel Local/101@from-queue-00000056;2 left 'simple_bridge' basic-bridge <8bf01d18-901d-4612-94aa-55ff86971fdf>
  == Spawn extension (macro-dial-one, s, 54) exited non-zero on 'Local/101@from-queue-00000056;2' in macro 'dial-one'
  == Spawn extension (from-queue-exten-internal, 101, 8) exited non-zero on 'Local/101@from-queue-00000056;2'
    -- Executing [h@from-queue-exten-internal:1] Macro("Local/101@from-queue-00000056;2", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("Local/101@from-queue-00000056;2", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Channel PJSIP/101-0000004d left 'simple_bridge' basic-bridge <8bf01d18-901d-4612-94aa-55ff86971fdf>
    -- Executing [h@ext-queues:1] NoOp("SIP/tg200_out-00000044", "NO ANSWER") in new stack
    -- Executing [h@ext-queues:2] Macro("SIP/tg200_out-00000044", "hangupcall,") in new stack

Запись в CDR
66e15f7daf257467687306.png


Вопрос, как при таких обстоятельствах отслеживать в очереди не отвеченные вызовы?
  • Вопрос задан
  • 201 просмотр
Подписаться 2 Простой Комментировать
Решения вопроса 1
@dronmaxman
VoIP Administrator
может быть NO ANSWER да же, если кто-то ответил на звонок.

Логично, допустим в очереди 3 агента, один ответил на звонок а остальные естественно нет, а проверку ты делаеш в hangup, а для 3х агентов будет 3 хенгапа)

Надо делать через handler. Надо переписать начало звонка и перед вызовом queue вставить handler такого вида.

;; Это надо вставить перед вызовом очереди 
same => n,Set(CHANNEL(hangup_handler_push)=hdlr-queue-miss-call,s,1(${CALLERID(num)})

[hdlr-queue-miss-call]
exten => s,1,Noop(---==== Handler queue miss call ===---)
same => n,Set(CLIENT_NUMBER=${ARG1})
same => n,GotoIf($[${ABANDONED}]?:end_call)
same => n,AGI(tg-noanswer.php, ${CLIENT_NUMBER}, ${STRFTIME(${EPOCH},,%Y.%m.%d--H:%M:%S)})
same => n(end_call),Hangup()
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы