Всем привет.
Требуется помощь в настройки extention.conf в asterisk.
Asterisk делает звонок через usb модем 3G. Звонок выполняется через callfile. Всё работает корректно, но требуется, чтобы при любом статусе ответа на звонок прописывался CDR(zakaz_id)=${zakaz_id},а пока получается, что прописывается только если человек ответит на звонок.
[dongle-outgoing-call]
;диалплан для исходящих вызовов
exten => _+7XXXXXXXX.,1,Answer()
same => n,DIAL(Dongle/dongle0/${EXTEN},,trg)
same = n,Set(CDR(zakaz_id)=${zakaz_id})
same = n,Playback(status1,skip)
same = n,Wait(1)
same => n,NoOP(Dialstatus: ${DIALSTATUS}) ;проверяем статус
same => n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?busy)
same => n,GotoIf($["${DIALSTATUS}"="BUSY"]?busy)
same => n,GotoIf($["${DIALSTATUS}"="CONGESTION"]?busy)
same => n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?noanswer)
;same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?answer)
same => n(busy),(CDR(zakaz_id)=${zakaz_id})
;same => n(answer),(CDR(zakaz_id)=${zakaz_id})
same => n(noanswer),(CDR(zakaz_id)=${zakaz_id})
same => n,Hangup()
Лог если был ответ (CDR(zakaz_id)=${zakaz_id} успешно записывается и в базу попадает)
-- Attempting call on Dongle/dongle0/+79269991313 for +79269991313@dongle-outgoing-call:1 (Retry 1)
-- Called dongle0/+79269991313
-- Dongle/dongle0-0100000005 is making progress
-- Dongle/dongle0-0100000005 answered
-- Executing [+79269991313@dongle-outgoing-call:1] Answer("Dongle/dongle0-0100000005", "") in new stack
-- Executing [+79269991313@dongle-outgoing-call:2] Dial("Dongle/dongle0-0100000005", "Dongle/dongle0/+79269991313,,trg") in new stack
[Jun 6 19:33:21] WARNING[17290][C-00000004]: channel.c:194 channel_request: [dongle0] Request to call on device which can not make call at this moment
[Jun 6 19:33:21] WARNING[17290][C-00000004]: app_dial.c:2525 dial_exec_full: Unable to create channel of type 'Dongle' (cause 44 - Requested channel not available)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [+79269991313@dongle-outgoing-call:3] Set("Dongle/dongle0-0100000005", "CDR(zakaz_id)=86482") in new stack
-- Executing [+79269991313@dongle-outgoing-call:4] Playback("Dongle/dongle0-0100000005", "status1,skip") in new stack
-- <Dongle/dongle0-0100000005> Playing 'status1.slin' (language 'ru')
-- Executing [+79269991313@dongle-outgoing-call:5] Wait("Dongle/dongle0-0100000005", "1") in new stack
-- Executing [+79269991313@dongle-outgoing-call:6] NoOp("Dongle/dongle0-0100000005", "Dialstatus: CHANUNAVAIL") in new stack
-- Executing [+79269991313@dongle-outgoing-call:7] GotoIf("Dongle/dongle0-0100000005", "1?busy") in new stack
-- Goto (dongle-outgoing-call,+79269991313,12)
[Jun 6 19:33:25] WARNING[17290][C-00000004]: pbx.c:2864 pbx_extension_helper: No application '' for extension (dongle-outgoing-call, +79269991313, 12)
== Spawn extension (dongle-outgoing-call, +79269991313, 12) exited non-zero on 'Dongle/dongle0-0100000005'
[Jun 6 19:33:25] NOTICE[17290][C-00000004]: pbx_spool.c:460 attempt_thread: Call completed to Dongle/dongle0/+79269991313
[Jun 6 19:33:25] WARNING[1172]: cdr_odbc.c:160 execute_cb: cdr_odbc: Error in ExecDirect: -1, query is: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES ({ts '2022-06-06 19:33:21'},?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )
[Jun 6 19:33:25] ERROR[1172]: cdr_odbc.c:189 odbc_log: CDR direct execute failed
Лог если не ответили (CDR(zakaz_id)=${zakaz_id} не работает. В базе поле пустое)
Attempting call on Dongle/dongle0/+79269991313 for +79269991313@dongle-outgoing-call:1 (Retry 1)
-- Called dongle0/+79269991313
-- Dongle/dongle0-0100000006 is making progress
[Jun 6 19:36:37] NOTICE[19941]: pbx_spool.c:447 attempt_thread: Call failed to go through, reason (3) Remote end Ringing
[Jun 6 19:36:37] NOTICE[19941]: pbx_spool.c:450 attempt_thread: Queued call to Dongle/dongle0/+79269991313 expired without completion after 0 attempts
[Jun 6 19:36:38] WARNING[1172]: cdr_odbc.c:160 execute_cb: cdr_odbc: Error in ExecDirect: -1, query is: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES ({ts '2022-06-06 19:36:11'},?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )
[Jun 6 19:36:38] ERROR[1172]: cdr_odbc.c:189 odbc_log: CDR direct execute failed