Cdr + mixmonitor + transfers

I’m trying to find working solution for blind and attended transfer with mixmonitor. I have tried transfer by DTMF (features) and SIP (on phone). In each variant CDR (in postgresql) contains different ids than mixmonitor is executed with or there is no record in CDR for part of call…

In every variant extention 404 calls 400, which transfers to 401. I’m using ${CDR(uniqueid)}-${CDR(sequence)} for uniq mixmonitor filename.

My extension.conf:

[size=50] exten=>_4XX,1,NoOp(Wewnetrzne: ${EXTEN}, uniqueid-sequence: ${CDR(uniqueid)}-${CDR(sequence)}) same=>n,MixMonitor(${CDR(uniqueid)}-${CDR(sequence)}.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}) same=>n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes) same=>n,Dial(SIP/${EXTEN},,tT) same=>n,Hangup [/size]

1. blindxfer by DTMF
log:

[size=50] [Apr 30 16:03:01] VERBOSE[18811][C-00000001] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:03:01] VERBOSE[19156][C-00000001] pbx.c: -- Executing [400@test:1] NoOp("SIP/404-00000003", "Wewnetrzne: 400, uniqueid-sequence: 1367330581.3-5") in new stack [Apr 30 16:03:01] VERBOSE[19156][C-00000001] pbx.c: -- Executing [400@test:2] MixMonitor("SIP/404-00000003", "1367330581.3-5.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:03:01] VERBOSE[19157][C-00000001] app_mixmonitor.c: == Begin MixMonitor Recording SIP/404-00000003 [Apr 30 16:03:01] VERBOSE[19156][C-00000001] pbx.c: -- Executing [400@test:3] Set("SIP/404-00000003", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:03:01] VERBOSE[19156][C-00000001] pbx.c: -- Executing [400@test:4] Dial("SIP/404-00000003", "SIP/400,,tT") in new stack [Apr 30 16:03:01] VERBOSE[19156][C-00000001] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:03:01] VERBOSE[19156][C-00000001] app_dial.c: -- Called SIP/400 [Apr 30 16:03:01] VERBOSE[19156][C-00000001] app_dial.c: -- SIP/400-00000004 is ringing [Apr 30 16:03:04] VERBOSE[19156][C-00000001] app_dial.c: -- SIP/400-00000004 answered SIP/404-00000003 [Apr 30 16:03:07] DTMF[19156][C-00000001] channel.c: DTMF end '6' received on SIP/400-00000004, duration 100 ms [Apr 30 16:03:07] DTMF[19156][C-00000001] channel.c: DTMF end passthrough '6' on SIP/400-00000004 [Apr 30 16:03:07] DTMF[19156][C-00000001] channel.c: DTMF end '6' received on SIP/400-00000004, duration 100 ms [Apr 30 16:03:07] DTMF[19156][C-00000001] channel.c: DTMF end passthrough '6' on SIP/400-00000004 [Apr 30 16:03:07] DTMF[19156][C-00000001] channel.c: DTMF end '6' received on SIP/400-00000004, duration 100 ms [Apr 30 16:03:07] DTMF[19156][C-00000001] channel.c: DTMF end passthrough '6' on SIP/400-00000004 [Apr 30 16:03:07] VERBOSE[19156][C-00000001] res_musiconhold.c: -- Started music on hold, class 'default', on SIP/404-00000003 [Apr 30 16:03:07] VERBOSE[19156][C-00000001] file.c: -- <SIP/400-00000004> Playing 'pbx-transfer.alaw' (language 'en') [Apr 30 16:03:08] DTMF[19156][C-00000001] channel.c: DTMF end '4' received on SIP/400-00000004, duration 100 ms [Apr 30 16:03:08] DTMF[19156][C-00000001] channel.c: DTMF end passthrough '4' on SIP/400-00000004 [Apr 30 16:03:09] DTMF[19156][C-00000001] channel.c: DTMF end '0' received on SIP/400-00000004, duration 100 ms [Apr 30 16:03:09] DTMF[19156][C-00000001] channel.c: DTMF end passthrough '0' on SIP/400-00000004 [Apr 30 16:03:09] DTMF[19156][C-00000001] channel.c: DTMF end '1' received on SIP/400-00000004, duration 100 ms [Apr 30 16:03:09] DTMF[19156][C-00000001] channel.c: DTMF end passthrough '1' on SIP/400-00000004 [Apr 30 16:03:10] DTMF[19156][C-00000001] channel.c: DTMF end '#' received on SIP/400-00000004, duration 100 ms [Apr 30 16:03:10] DTMF[19156][C-00000001] channel.c: DTMF end passthrough '#' on SIP/400-00000004 [Apr 30 16:03:10] VERBOSE[19156][C-00000001] features.c: -- Blind transferring SIP/404-00000003 to '401' (context test) priority 1 [Apr 30 16:03:10] VERBOSE[19156][C-00000001] res_musiconhold.c: -- Stopped music on hold on SIP/404-00000003 [Apr 30 16:03:10] VERBOSE[19156][C-00000001] pbx.c: -- Executing [401@test:1] NoOp("SIP/404-00000003", "Wewnetrzne: 401, uniqueid-sequence: 1367330581.4-6") in new stack [Apr 30 16:03:10] VERBOSE[19156][C-00000001] pbx.c: -- Executing [401@test:2] MixMonitor("SIP/404-00000003", "1367330581.4-6.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:03:10] VERBOSE[19156][C-00000001] pbx.c: -- Executing [401@test:3] Set("SIP/404-00000003", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:03:10] VERBOSE[19156][C-00000001] pbx.c: -- Executing [401@test:4] Dial("SIP/404-00000003", "SIP/401,,tT") in new stack [Apr 30 16:03:10] VERBOSE[19158][C-00000001] app_mixmonitor.c: == Begin MixMonitor Recording SIP/404-00000003 [Apr 30 16:03:10] VERBOSE[19156][C-00000001] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:03:10] VERBOSE[19156][C-00000001] app_dial.c: -- Called SIP/401 [Apr 30 16:03:10] VERBOSE[19156][C-00000001] app_dial.c: -- SIP/401-00000005 is ringing [Apr 30 16:03:12] VERBOSE[19156][C-00000001] app_dial.c: -- SIP/401-00000005 answered SIP/404-00000003 [Apr 30 16:03:14] VERBOSE[19156][C-00000001] pbx.c: -- Executing [h@test:1] NoOp("SIP/404-00000003", "Koniec polaczenia") in new stack [Apr 30 16:03:14] VERBOSE[19156][C-00000001] pbx.c: == Spawn extension (test, 401, 4) exited non-zero on 'SIP/404-00000003' [Apr 30 16:03:14] VERBOSE[19157][C-00000001] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:03:14] VERBOSE[19157][C-00000001] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367330581.3-5] [Apr 30 16:03:14] VERBOSE[19158][C-00000001] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:03:14] VERBOSE[19158][C-00000001] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367330581.4-6] [Apr 30 16:03:14] VERBOSE[19158][C-00000001] app_mixmonitor.c: == End MixMonitor Recording SIP/404-00000003 [Apr 30 16:03:14] VERBOSE[19157][C-00000001] app_mixmonitor.c: == End MixMonitor Recording SIP/404-00000003 [/size]

cdr:

[size=50] id | calldate | clid | src | dst | dcontext | channel | dstchannel | uniqueid | linkedid | sequence -----+---------------------+------+-----+-----+----------+------------------+------------------+--------------+--------------+---------- 666 | 2013-04-30 16:03:01 | 404 | 404 | 400 | test | SIP/404-00000003 | SIP/400-00000004 | 1367330581.3 | 1367330581.3 | 7 667 | 2013-04-30 16:03:01 | 404 | 404 | 401 | test | SIP/400-00000004 | SIP/401-00000005 | 1367330581.4 | 1367330581.3 | 6 (2 rows) [/size]

files:

[size=50] /var/spool/asterisk/monitor/2013/04/30/1367330581.3-5.ogg (before tr. + after tr.) /var/spool/asterisk/monitor/2013/04/30/1367330581.4-6.ogg (after tr.) [/size]

Sequence is different in cdr and in log (files).

2. blindxfer by SIP
log:

[size=50] [Apr 30 16:41:08] VERBOSE[18811][C-00000002] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:41:08] VERBOSE[19413][C-00000002] pbx.c: -- Executing [400@test:1] NoOp("SIP/404-00000006", "Wewnetrzne: 400, uniqueid-sequence: 1367332868.6-10") in new stack [Apr 30 16:41:08] VERBOSE[19413][C-00000002] pbx.c: -- Executing [400@test:2] MixMonitor("SIP/404-00000006", "1367332868.6-10.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:41:08] VERBOSE[19414][C-00000002] app_mixmonitor.c: == Begin MixMonitor Recording SIP/404-00000006 [Apr 30 16:41:08] VERBOSE[19413][C-00000002] pbx.c: -- Executing [400@test:3] Set("SIP/404-00000006", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:41:08] VERBOSE[19413][C-00000002] pbx.c: -- Executing [400@test:4] Dial("SIP/404-00000006", "SIP/400,,tT") in new stack [Apr 30 16:41:08] VERBOSE[19413][C-00000002] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:41:08] VERBOSE[19413][C-00000002] app_dial.c: -- Called SIP/400 [Apr 30 16:41:08] VERBOSE[19413][C-00000002] app_dial.c: -- SIP/400-00000007 is ringing [Apr 30 16:41:10] VERBOSE[19413][C-00000002] app_dial.c: -- SIP/400-00000007 answered SIP/404-00000006 [Apr 30 16:41:18] VERBOSE[19413][C-00000002] res_musiconhold.c: -- Started music on hold, class 'default', on SIP/404-00000006 [Apr 30 16:41:27] VERBOSE[19413][C-00000002] res_musiconhold.c: -- Stopped music on hold on SIP/404-00000006 [Apr 30 16:41:27] VERBOSE[19413][C-00000002] pbx.c: == Spawn extension (test, 401, 1) exited non-zero on 'SIP/404-00000006' [Apr 30 16:41:27] VERBOSE[19413][C-00000002] pbx.c: -- Executing [401@test:1] NoOp("SIP/404-00000006", "Wewnetrzne: 401, uniqueid-sequence: 1367332868.6-12") in new stack [Apr 30 16:41:27] VERBOSE[19413][C-00000002] pbx.c: -- Executing [401@test:2] MixMonitor("SIP/404-00000006", "1367332868.6-12.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:41:27] VERBOSE[19413][C-00000002] pbx.c: -- Executing [401@test:3] Set("SIP/404-00000006", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:41:27] VERBOSE[19415][C-00000002] app_mixmonitor.c: == Begin MixMonitor Recording SIP/404-00000006 [Apr 30 16:41:27] VERBOSE[19413][C-00000002] pbx.c: -- Executing [401@test:4] Dial("SIP/404-00000006", "SIP/401,,tT") in new stack [Apr 30 16:41:27] VERBOSE[19413][C-00000002] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:41:27] VERBOSE[19413][C-00000002] app_dial.c: -- Called SIP/401 [Apr 30 16:41:27] VERBOSE[19413][C-00000002] app_dial.c: -- SIP/401-00000008 is ringing [Apr 30 16:41:28] VERBOSE[19413][C-00000002] app_dial.c: -- SIP/401-00000008 answered SIP/404-00000006 [Apr 30 16:41:32] VERBOSE[19413][C-00000002] pbx.c: -- Executing [h@test:1] NoOp("SIP/404-00000006", "Koniec polaczenia") in new stack [Apr 30 16:41:32] VERBOSE[19413][C-00000002] pbx.c: == Spawn extension (test, 401, 4) exited non-zero on 'SIP/404-00000006' [Apr 30 16:41:32] VERBOSE[19415][C-00000002] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:41:32] VERBOSE[19415][C-00000002] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367332868.6-12] [Apr 30 16:41:32] VERBOSE[19414][C-00000002] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:41:32] VERBOSE[19414][C-00000002] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367332868.6-10] [Apr 30 16:41:32] VERBOSE[19415][C-00000002] app_mixmonitor.c: == End MixMonitor Recording SIP/404-00000006 [Apr 30 16:41:32] VERBOSE[19414][C-00000002] app_mixmonitor.c: == End MixMonitor Recording SIP/404-00000006 [/size]

cdr:

[size=50] id | calldate | clid | src | dst | dcontext | channel | dstchannel | uniqueid | linkedid | sequence -----+---------------------+------+-----+-----+----------+------------------+------------------+--------------+--------------+---------- 668 | 2013-04-30 16:41:08 | 404 | 404 | 401 | test | SIP/404-00000006 | SIP/401-00000008 | 1367332868.6 | 1367332868.6 | 12 (1 row) [/size]

files:

[size=50] /var/spool/asterisk/monitor/2013/04/30/1367332868.6-10.ogg (before tr. + moh + after tr.) /var/spool/asterisk/monitor/2013/04/30/1367332868.6-12.ogg (after tr.) [/size]

There is no cdr for 404->400 call.

3. atxfer by DTMF
log:

[size=50] [Apr 30 16:44:05] VERBOSE[18811][C-00000004] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:44:05] VERBOSE[19541][C-00000004] pbx.c: -- Executing [400@test:1] NoOp("SIP/404-0000000c", "Wewnetrzne: 400, uniqueid-sequence: 1367333045.14-23") in new stack [Apr 30 16:44:05] VERBOSE[19541][C-00000004] pbx.c: -- Executing [400@test:2] MixMonitor("SIP/404-0000000c", "1367333045.14-23.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:44:05] VERBOSE[19541][C-00000004] pbx.c: -- Executing [400@test:3] Set("SIP/404-0000000c", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:44:05] VERBOSE[19542][C-00000004] app_mixmonitor.c: == Begin MixMonitor Recording SIP/404-0000000c [Apr 30 16:44:05] VERBOSE[19541][C-00000004] pbx.c: -- Executing [400@test:4] Dial("SIP/404-0000000c", "SIP/400,,tT") in new stack [Apr 30 16:44:05] VERBOSE[19541][C-00000004] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:44:05] VERBOSE[19541][C-00000004] app_dial.c: -- Called SIP/400 [Apr 30 16:44:05] VERBOSE[19541][C-00000004] app_dial.c: -- SIP/400-0000000d is ringing [Apr 30 16:44:07] VERBOSE[19541][C-00000004] app_dial.c: -- SIP/400-0000000d answered SIP/404-0000000c [Apr 30 16:44:09] DTMF[19541][C-00000004] channel.c: DTMF end '6' received on SIP/400-0000000d, duration 100 ms [Apr 30 16:44:09] DTMF[19541][C-00000004] channel.c: DTMF end passthrough '6' on SIP/400-0000000d [Apr 30 16:44:09] DTMF[19541][C-00000004] channel.c: DTMF end '6' received on SIP/400-0000000d, duration 100 ms [Apr 30 16:44:09] DTMF[19541][C-00000004] channel.c: DTMF end passthrough '6' on SIP/400-0000000d [Apr 30 16:44:10] DTMF[19541][C-00000004] channel.c: DTMF end '7' received on SIP/400-0000000d, duration 100 ms [Apr 30 16:44:10] DTMF[19541][C-00000004] channel.c: DTMF end passthrough '7' on SIP/400-0000000d [Apr 30 16:44:10] VERBOSE[19541][C-00000004] res_musiconhold.c: -- Started music on hold, class 'default', on SIP/404-0000000c [Apr 30 16:44:10] VERBOSE[19541][C-00000004] file.c: -- <SIP/400-0000000d> Playing 'pbx-transfer.alaw' (language 'en') [Apr 30 16:44:11] DTMF[19541][C-00000004] channel.c: DTMF end '4' received on SIP/400-0000000d, duration 100 ms [Apr 30 16:44:11] DTMF[19541][C-00000004] channel.c: DTMF end passthrough '4' on SIP/400-0000000d [Apr 30 16:44:11] DTMF[19541][C-00000004] channel.c: DTMF end '0' received on SIP/400-0000000d, duration 100 ms [Apr 30 16:44:11] DTMF[19541][C-00000004] channel.c: DTMF end passthrough '0' on SIP/400-0000000d [Apr 30 16:44:12] DTMF[19541][C-00000004] channel.c: DTMF end '1' received on SIP/400-0000000d, duration 100 ms [Apr 30 16:44:12] DTMF[19541][C-00000004] channel.c: DTMF end passthrough '1' on SIP/400-0000000d [Apr 30 16:44:13] DTMF[19541][C-00000004] channel.c: DTMF end '#' received on SIP/400-0000000d, duration 100 ms [Apr 30 16:44:13] DTMF[19541][C-00000004] channel.c: DTMF end passthrough '#' on SIP/400-0000000d [Apr 30 16:44:13] VERBOSE[19543][C-00000004] pbx.c: -- Executing [401@test:1] NoOp("Local/401@test-00000001;2", "Wewnetrzne: 401, uniqueid-sequence: 1367333053.17-27") in new stack [Apr 30 16:44:13] VERBOSE[19543][C-00000004] pbx.c: -- Executing [401@test:2] MixMonitor("Local/401@test-00000001;2", "1367333053.17-27.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:44:13] VERBOSE[19543][C-00000004] pbx.c: -- Executing [401@test:3] Set("Local/401@test-00000001;2", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:44:13] VERBOSE[19543][C-00000004] pbx.c: -- Executing [401@test:4] Dial("Local/401@test-00000001;2", "SIP/401,,tT") in new stack [Apr 30 16:44:13] VERBOSE[19544][C-00000004] app_mixmonitor.c: == Begin MixMonitor Recording Local/401@test-00000001;2 [Apr 30 16:44:13] VERBOSE[19543][C-00000004] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:44:13] VERBOSE[19543][C-00000004] app_dial.c: -- Called SIP/401 [Apr 30 16:44:13] VERBOSE[19543][C-00000004] app_dial.c: -- SIP/401-0000000e is ringing [Apr 30 16:44:13] VERBOSE[19541][C-00000004] features.c: -- Local/401@test-00000001;1 is ringing [Apr 30 16:44:14] VERBOSE[19543][C-00000004] app_dial.c: -- SIP/401-0000000e answered Local/401@test-00000001;2 [Apr 30 16:44:18] VERBOSE[19541][C-00000004] res_musiconhold.c: -- Stopped music on hold on SIP/404-0000000c [Apr 30 16:44:19] VERBOSE[19541][C-00000004] file.c: -- <Local/401@test-00000001;1> Playing 'beep.alaw' (language 'en') [Apr 30 16:44:19] VERBOSE[19541][C-00000004] pbx.c: -- Executing [h@test:1] NoOp("Transfered/SIP/404-0000000c<ZOMBIE>", "Koniec polaczenia") in new stack [Apr 30 16:44:19] VERBOSE[19541][C-00000004] pbx.c: == Spawn extension (test, 400, 4) exited non-zero on 'Transfered/SIP/404-0000000c<ZOMBIE>' [Apr 30 16:44:23] VERBOSE[19543][C-00000004] pbx.c: -- Executing [h@test:1] NoOp("Local/401@test-00000001;2", "Koniec polaczenia") in new stack [Apr 30 16:44:23] VERBOSE[19543][C-00000004] pbx.c: == Spawn extension (test, 401, 4) exited non-zero on 'Local/401@test-00000001;2' [Apr 30 16:44:23] VERBOSE[19544][C-00000004] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:44:23] VERBOSE[19544][C-00000004] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367333053.17-27] [Apr 30 16:44:23] VERBOSE[19545][C-00000004] pbx.c: -- Executing [h@test:1] NoOp("SIP/404-0000000c", "Koniec polaczenia") in new stack [Apr 30 16:44:23] VERBOSE[19542][C-00000004] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:44:23] VERBOSE[19542][C-00000004] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367333045.14-23] [Apr 30 16:44:23] VERBOSE[19542][C-00000004] app_mixmonitor.c: == End MixMonitor Recording SIP/404-0000000c [Apr 30 16:44:23] VERBOSE[19544][C-00000004] app_mixmonitor.c: == End MixMonitor Recording Local/401@test-00000001;2 [/size]

cdr:

[size=50] id | calldate | clid | src | dst | dcontext | channel | dstchannel | uniqueid | linkedid | sequence -----+---------------------+------+-----+-----+----------+------------------------------+------------------+---------------+---------------+---------- 671 | 2013-04-30 16:44:05 | 404 | 404 | 400 | test | SIP/404-0000000c | SIP/400-0000000d | 1367333045.14 | 1367333045.14 | 23 672 | 2013-04-30 16:44:13 | 400 | 400 | 401 | test | Local/401@test-00000001;2 | SIP/401-0000000e | 1367333053.17 | 1367333045.14 | 27 673 | 2013-04-30 16:44:05 | 404 | 404 | 400 | test | SIP/404-0000000c | SIP/400-0000000d | 1367333045.14 | 1367333045.14 | 25 (3 rows) [/size]

files:

[size=50] /var/spool/asterisk/monitor/2013/04/30/1367333045.14-23.ogg (before tr. + after tr.) /var/spool/asterisk/monitor/2013/04/30/1367333053.17-27.ogg (while tr. + after tr.) [/size]

There are two cdrs for 404->400 but there is no one for 404->401.

4. atxfer by SIP
log:

[size=50] [Apr 30 16:45:23] VERBOSE[18811][C-00000005] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:45:23] VERBOSE[19603][C-00000005] pbx.c: -- Executing [400@test:1] NoOp("SIP/404-0000000f", "Wewnetrzne: 400, uniqueid-sequence: 1367333123.20-33") in new stack [Apr 30 16:45:23] VERBOSE[19603][C-00000005] pbx.c: -- Executing [400@test:2] MixMonitor("SIP/404-0000000f", "1367333123.20-33.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:45:23] VERBOSE[19603][C-00000005] pbx.c: -- Executing [400@test:3] Set("SIP/404-0000000f", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:45:23] VERBOSE[19603][C-00000005] pbx.c: -- Executing [400@test:4] Dial("SIP/404-0000000f", "SIP/400,,tT") in new stack [Apr 30 16:45:23] VERBOSE[19604][C-00000005] app_mixmonitor.c: == Begin MixMonitor Recording SIP/404-0000000f [Apr 30 16:45:23] VERBOSE[19603][C-00000005] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:45:23] VERBOSE[19603][C-00000005] app_dial.c: -- Called SIP/400 [Apr 30 16:45:23] VERBOSE[19603][C-00000005] app_dial.c: -- SIP/400-00000010 is ringing [Apr 30 16:45:25] VERBOSE[19603][C-00000005] app_dial.c: -- SIP/400-00000010 answered SIP/404-0000000f [Apr 30 16:45:27] VERBOSE[19603][C-00000005] res_musiconhold.c: -- Started music on hold, class 'default', on SIP/404-0000000f [Apr 30 16:45:31] VERBOSE[18811][C-00000006] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:45:31] VERBOSE[19605][C-00000006] pbx.c: -- Executing [401@test:1] NoOp("SIP/400-00000011", "Wewnetrzne: 401, uniqueid-sequence: 1367333131.22-36") in new stack [Apr 30 16:45:31] VERBOSE[19605][C-00000006] pbx.c: -- Executing [401@test:2] MixMonitor("SIP/400-00000011", "1367333131.22-36.wav,ab,/usr/local/sbin/konwersja_nagrania.sh ^{CDR(uniqueid)}-^{CDR(sequence)}") in new stack [Apr 30 16:45:31] VERBOSE[19605][C-00000006] pbx.c: -- Executing [401@test:3] Set("SIP/400-00000011", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack [Apr 30 16:45:31] VERBOSE[19606][C-00000006] app_mixmonitor.c: == Begin MixMonitor Recording SIP/400-00000011 [Apr 30 16:45:31] VERBOSE[19605][C-00000006] pbx.c: -- Executing [401@test:4] Dial("SIP/400-00000011", "SIP/401,,tT") in new stack [Apr 30 16:45:31] VERBOSE[19605][C-00000006] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 30 16:45:31] VERBOSE[19605][C-00000006] app_dial.c: -- Called SIP/401 [Apr 30 16:45:31] VERBOSE[19605][C-00000006] app_dial.c: -- SIP/401-00000012 is ringing [Apr 30 16:45:33] VERBOSE[19605][C-00000006] app_dial.c: -- SIP/401-00000012 answered SIP/400-00000011 [Apr 30 16:45:37] VERBOSE[18811][C-00000005] res_musiconhold.c: -- Stopped music on hold on SIP/404-0000000f [Apr 30 16:45:37] VERBOSE[19603][C-00000005] pbx.c: -- Executing [h@test:1] NoOp("SIP/400-00000011<ZOMBIE>", "Koniec polaczenia") in new stack [Apr 30 16:45:37] NOTICE[18811][C-00000005] chan_sip.c: Got OK on REFER Notify message [Apr 30 16:45:37] VERBOSE[19603][C-00000005] pbx.c: == Spawn extension (test, 400, 4) exited non-zero on 'SIP/400-00000011<ZOMBIE>' [Apr 30 16:45:42] VERBOSE[19605][C-00000006] pbx.c: -- Executing [h@test:1] NoOp("SIP/404-0000000f", "Koniec polaczenia") in new stack [Apr 30 16:45:42] VERBOSE[19605][C-00000006] pbx.c: == Spawn extension (test, 401, 4) exited non-zero on 'SIP/404-0000000f' [Apr 30 16:45:42] VERBOSE[19606][C-00000006] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:45:42] VERBOSE[19606][C-00000006] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367333131.22-36] [Apr 30 16:45:42] VERBOSE[19604][C-00000005] app_mixmonitor.c: == MixMonitor close filestream (mixed) [Apr 30 16:45:42] VERBOSE[19604][C-00000005] app_mixmonitor.c: == Executing [/usr/local/sbin/konwersja_nagrania.sh 1367333123.20-33] [Apr 30 16:45:42] VERBOSE[19606][C-00000006] app_mixmonitor.c: == End MixMonitor Recording SIP/400-00000011 [Apr 30 16:45:42] VERBOSE[19604][C-00000005] app_mixmonitor.c: == End MixMonitor Recording SIP/404-0000000f [/size]

cdr:

[size=50] id | calldate | clid | src | dst | dcontext | channel | dstchannel | uniqueid | linkedid | sequence -----+---------------------+------+-----+-----+----------+------------------+------------------+---------------+---------------+---------- 674 | 2013-04-30 16:45:23 | 404 | 404 | 400 | test | SIP/404-0000000f | SIP/400-00000010 | 1367333123.20 | 1367333123.20 | 33 675 | 2013-04-30 16:45:31 | 400 | 400 | 401 | test | SIP/400-00000011 | SIP/401-00000012 | 1367333131.22 | 1367333131.22 | 36 (2 rows) [/size]

files:

[size=50] /var/spool/asterisk/monitor/2013/04/30/1367333123.20-33.ogg (before tr. + moh + after tr.) /var/spool/asterisk/monitor/2013/04/30/1367333131.22-36.ogg (while tr. + after tr.) [/size]

There is no cdr for 404->401. Linkedid are different for stages.

What should I do to get matching cdr and files from mixmonitor? Are there some mistakes in dialplan? Which transfer type (DTMF or SIP) is better to achieve this?

You should be using Call Event Logging. CDRs are known to have difficulties with all but the most basic of calls, and attempts to remedy kept breaking other things.