К сожалению AMI использовать нельзя.
На практике с макросом в итоге получилось:
Код: Выделить всё
Called SIP/501
-- SIP/501-000000f3 is ringing
-- Nobody picked up in 5000 ms
-- Executing [78126400011@dostavka2:5] Wait("SIP/westcall-out-000000f2", "15") in new stack
-- Executing [78126400011@dostavka2:6] System("SIP/westcall-out-000000f2", "mv /var/dostavka/call301.txt /var/dostavka/old/call301.txt") in new stack
-- Executing [78126400011@dostavka2:7] Hangup("SIP/westcall-out-000000f2", "") in new stack
== Spawn extension (dostavka2, 78126400011, 7) exited non-zero on 'SIP/westcall-out-000000f2'
-- Executing [h@dostavka2:1] Macro("SIP/westcall-out-000000f2", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/westcall-out-000000f2", "1?endmixmoncheck") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] NoOp("SIP/westcall-out-000000f2", "End of MIXMON check") in new stack
-- Executing [s@macro-hangupcall:10] GotoIf("SIP/westcall-out-000000f2", "1?nomeetmemon") in new stack
-- Goto (macro-hangupcall,s,28)
-- Executing [s@macro-hangupcall:28] NoOp("SIP/westcall-out-000000f2", "End of MEETME check") in new stack
-- Executing [s@macro-hangupcall:29] GotoIf("SIP/westcall-out-000000f2", "1?noautomon") in new stack
-- Goto (macro-hangupcall,s,34)
-- Executing [s@macro-hangupcall:34] NoOp("SIP/westcall-out-000000f2", "TOUCH_MONITOR_OUTPUT=") in new stack
-- Executing [s@macro-hangupcall:35] GotoIf("SIP/westcall-out-000000f2", "1?noautomon2") in new stack
-- Goto (macro-hangupcall,s,41)
-- Executing [s@macro-hangupcall:41] NoOp("SIP/westcall-out-000000f2", "MONITOR_FILENAME=") in new stack
-- Executing [s@macro-hangupcall:42] GotoIf("SIP/westcall-out-000000f2", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,45)
-- Executing [s@macro-hangupcall:45] GotoIf("SIP/westcall-out-000000f2", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,48)
-- Executing [s@macro-hangupcall:48] GotoIf("SIP/westcall-out-000000f2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,50)
-- Executing [s@macro-hangupcall:50] AGI("SIP/westcall-out-000000f2", "hangup.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/hangup.agi
-- <SIP/westcall-out-000000f2>AGI Script hangup.agi completed, returning 0
-- Executing [s@macro-hangupcall:51] Hangup("SIP/westcall-out-000000f2", "") in new stack
Но все равно пока не то.
Файл создается сразу же после поступления звонка, а хотелось бы после ответа вн. абонента 501
И хотелось бы что бы в файле была запись о принимавшем звонок абоненте. Типа 78121234567-501