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

Asterisk вызвать свой скрипт после завершение вызова?

Пытаюсь при работе транка сделать tcpdump
extensions_custom.conf
[from-internal-custom]
exten => _X.,1,AGI(tcpdump_ata_fxo.sh,start,${UNIQUEID})

tcpdump включается

А как завершить то?

В логах при завершение вызова искал триггеры и пытался вызвать
AGI(tcpdump_ata_fxo.sh,stop,${UNIQUEID})


ЛОГИ (где идёт разговор и нажата кнопка отбой)
spoiler
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] bridge_channel.c: Channel PJSIP/9274-0000009c left 'simple_bridge' basic-bridge <3f1c6808-b8db-413c-8a0e-3bad39e54b00>
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] app_macro.c: Spawn extension (macro-dialout-trunk, s, 38) exited non-zero on 'PJSIP/9274-0000009c' in macro 'dialout-trunk'
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Spawn extension (from-internal, ВОТ_ТУТ_ВНЕШНИЙ_НОМЕР_ЧЕРЕЗ_ТРАНК, 12) exited non-zero on 'PJSIP/9274-0000009c'
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [h@from-internal:1] Macro("PJSIP/9274-0000009c", "hangupcall") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@macro-hangupcall:1] Set("PJSIP/9274-0000009c", "__MCVMSTATUS=") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@macro-hangupcall:2] Gosub("PJSIP/9274-0000009c", "app-missedcall-hangup,s,1()") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:1] NoOp("PJSIP/9274-0000009c", "Dialed: s") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:2] NoOp("PJSIP/9274-0000009c", "Caller: ") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:3] GotoIf("PJSIP/9274-0000009c", "0?exit") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:4] Set("PJSIP/9274-0000009c", "EXTENNUM=s") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:5] Set("PJSIP/9274-0000009c", "FEXTENNUM=s") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:6] GotoIf("PJSIP/9274-0000009c", "0?exit") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:7] AGI("PJSIP/9274-0000009c", "agi://127.0.0.1/missedcallnotify.php,s,,s,0,,PJSIP...,,,") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] bridge_channel.c: Channel PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d left 'simple_bridge' basic-bridge <3f1c6808-b8db-413c-8a0e-3bad39e54b00>
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] app_stack.c: PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d Internal Gosub(app-missedcall-hangup,100.64.1.3,1) start
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:1] NoOp("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "Dialed: 100.64.1.3") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:2] NoOp("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "Caller: ") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:3] GotoIf("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "0?exit") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:4] Set("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "EXTENNUM=100.64.1.3") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:5] Set("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "FEXTENNUM=100.64.1.3") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:6] GotoIf("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "0?exit") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:7] AGI("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "agi://127.0.0.1/missedcallnotify.php,100.64.1.3,,1...,,,,") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] res_agi.c: AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@app-missedcall-hangup:8] Return("PJSIP/9274-0000009c", "") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@macro-hangupcall:3] GotoIf("PJSIP/9274-0000009c", "1?theend") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx_builtins.c: Goto (macro-hangupcall,s,5)
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@macro-hangupcall:5] ExecIf("PJSIP/9274-0000009c", "0?Set(CDR(recordingfile)=)") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@macro-hangupcall:6] Hangup("PJSIP/9274-0000009c", "") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] app_macro.c: Spawn extension (macro-hangupcall, s, 6) exited non-zero on 'PJSIP/9274-0000009c' in macro 'hangupcall'
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/9274-0000009c'
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] app_stack.c: PJSIP/9274-0000009c Internal Gosub(crm-hangup,s,1) start
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:1] NoOp("PJSIP/9274-0000009c", "Sending Hangup to CRM") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:2] NoOp("PJSIP/9274-0000009c", "HANGUP CAUSE: 16") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:3] ExecIf("PJSIP/9274-0000009c", "0?Set(__CRM_VOICEMAIL=)") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:4] NoOp("PJSIP/9274-0000009c", "MASTER CHANNEL: 1733260478.156 = 1733260478.156") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:5] GotoIf("PJSIP/9274-0000009c", "0?return") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:6] Set("PJSIP/9274-0000009c", "__CRM_HANGUP=1") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:7] AGI("PJSIP/9274-0000009c", "agi://127.0.0.1/sangomacrm.agi") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] res_agi.c: AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] pbx.c: Executing [100.64.1.3@app-missedcall-hangup:8] Return("PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d", "") in new stack
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] app_stack.c: Spawn extension (from-fxo, , 1) exited non-zero on 'PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d'
[2024-12-03 23:14:51] VERBOSE[4703][C-0000004f] app_stack.c: PJSIP/100.64.1.3-GrandStream-HT813-FXO-0000009d Internal Gosub(app-missedcall-hangup,100.64.1.3,1) complete GOSUB_RETVAL=
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] res_agi.c: AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] pbx.c: Executing [s@crm-hangup:8] Return("PJSIP/9274-0000009c", "") in new stack
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] app_stack.c: Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/9274-0000009c'
[2024-12-03 23:14:51] VERBOSE[4689][C-0000004f] app_stack.c: PJSIP/9274-0000009c Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=


P.S. HT813 плохо работает и при работе VoIP хочу записать аналоговую линию (при работе) имеются искажении передачи связи, открыл тикет grandstream просят логи скинуть и пакеты, но проблема плавающая, syslog сервер настроил осталось мне настроить tcpdump захватить только звонки транков
  • Вопрос задан
  • 79 просмотров
Подписаться 2 Простой 2 комментария
Пригласить эксперта
Ответы на вопрос 1
Rsa97
@Rsa97
Для правильного вопроса надо знать половину ответа
А зачем так усложнять себе жизнь? У tcpdump есть фильтр, в нём можно настроить адрес и порт, которые будут записываться. Просто запустите его в отдельном терминале через screen и получите дамп всего обмена с вашим шлюзом.
А может вам вообще лучше подойдёт sngrep.
Ну или смотрите в сторону опций F и g у Dial.
Ответ написан
Комментировать
Ваш ответ на вопрос

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

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