Вот еще пример "кривой" записи.
Пришел звонок с 9025153636 на 3952761244
Код: Выделить всё
-- Executing [3952761244@sip-in:1] Goto("SIP/irkutsk_761244-00000b33", "sip-in-3952761244,3952761244,1") in new stack
-- Goto (sip-in-3952761244,3952761244,1)
-- Executing [3952761244@sip-in-3952761244:1] Answer("SIP/irkutsk_761244-00000b33", "") in new stack
-- Executing [3952761244@sip-in-3952761244:2] Set("SIP/irkutsk_761244-00000b33", "bl=") in new stack
-- Executing [3952761244@sip-in-3952761244:3] GotoIf("SIP/irkutsk_761244-00000b33", "0?end") in new stack
-- Executing [3952761244@sip-in-3952761244:4] Set("SIP/irkutsk_761244-00000b33", "_path=3952761244/20151013") in new stack
-- Executing [3952761244@sip-in-3952761244:5] Set("SIP/irkutsk_761244-00000b33", "_fname=20151013163957-9025153636-3952761244") in new stack
-- Executing [3952761244@sip-in-3952761244:6] Set("SIP/irkutsk_761244-00000b33", "clid=") in new stack
-- Executing [3952761244@sip-in-3952761244:7] GotoIf("SIP/irkutsk_761244-00000b33", "1?noclid") in new stack
-- Goto (sip-in-3952761244,3952761244,9)
-- Executing [3952761244@sip-in-3952761244:9] Set("SIP/irkutsk_761244-00000b33", "_monopt=nice /usr/bin/lame -b 48 --resample 32 -q5 --silent "/usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.wav" "/usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.mp3" && rm -f "/usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.wav" && /bin/chmod 444 /usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.mp3") in new stack
-- Executing [3952761244@sip-in-3952761244:10] Set("SIP/irkutsk_761244-00000b33", "CDR(userfield)=in/3952761244/20151013/20151013163957-9025153636-3952761244") in new stack
-- Executing [3952761244@sip-in-3952761244:11] BackGround("SIP/irkutsk_761244-00000b33", "/usr/records/ivr/ivr_gygol") in new stack
-- <SIP/irkutsk_761244-00000b33> Playing '/usr/records/ivr/ivr.slin' (language 'ru')
== CDR updated on SIP/irkutsk_761244-00000b33
-- Executing [3@sip-in-3952761244:1] MixMonitor("SIP/irkutsk_761244-00000b33", "/usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.wav,b,nice /usr/bin/lame -b 48 --resample 32 -q5 --silent "/usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.wav" "/usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.mp3" && rm -f "/usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.wav" && /bin/chmod 444 /usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.mp3") in new stack
== Begin MixMonitor Recording SIP/irkutsk_761244-00000b33
-- Executing [3@sip-in-3952761244:2] Playback("SIP/irkutsk_761244-00000b33", "queue-callswaiting") in new stack
-- <SIP/irkutsk_761244-00000b33> Playing 'queue-callswaiting.gsm' (language 'ru')
-- Executing [3@sip-in-3952761244:3] GotoIfTime("SIP/irkutsk_761244-00000b33", "12:00-13:00,Mon-Fri,*,*?support-abk-context,s,1") in new stack
-- Executing [3@sip-in-3952761244:4] Queue("SIP/irkutsk_761244-00000b33", "602,t,,,180") in new stack
-- Started music on hold, class 'music', on SIP/irkutsk_761244-00000b33
== Using SIP RTP CoS mark 5
-- SIP/215-00000b34 connected line has changed. Saving it until answer for SIP/irkutsk_761244-00000b33
-- SIP/215-00000b34 is ringing
-- SIP/215-00000b34 connected line has changed. Saving it until answer for SIP/irkutsk_761244-00000b33
-- SIP/215-00000b34 answered SIP/irkutsk_761244-00000b33
-- Stopped music on hold on SIP/irkutsk_761244-00000b33
asterisk*CLI> core set verbose 0
Файл записи упал куда надо:
Код: Выделить всё
root@asterisk:/var/log/asterisk# ls -la /usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.mp3
-r--r--r-- 1 root root 3721896 окт. 13 16:55 /usr/records/in/3952761244/20151013/20151013163957-9025153636-3952761244.mp3
root@asterisk:/var/log/asterisk#
А вот в SQL опять "неправильно" - запись задублировалась
Ниже лог запроса на запись от Asterisk в БД
Код: Выделить всё
root@asterisk:/var/log/mysql# cat mysql.log |grep 9025153636
151013 16:42:07 15557 Query INSERT INTO cdr (`calldate`,`clid`,`src`,`dst`,`dcontext`,`channel`,`dstchannel`,`lastapp`,`lastdata`,`duration`,`billsec`,`disposition`,`amaflags`,`userfield`,`uniqueid`,`sequence`) VALUES ('2015-10-13 16:39:56','9025153636','9025153636','3','sip-in-3952761244','SIP/irkutsk_761244-00000b33','SIP/215-00000b34','Queue','602,t,,,180','131','131','ANSWERED','3','in/3952761244/20151013/20151013163957-9025153636-3952761244in/3952761244/20151013/20151013163957-9025153636-3952761244;in/3952761244/20151013/20151013163957-9025153636-3952761244','1444729196.3076','3970')