简体   繁体   中英

Asterisk 13.4 cdr engine is creating 2 records per call

This is really starting to get annoying.

I´m using Asterisk 1.4 since 2007 to operate a flawless PBX, and it creates a SINGLE CDR per call, like any other version of asterisk would.

Yesterday I figured an upgrade would be ok and got Asterisk 13.4.

This damn thing is creating 2 CDRs per call... one representing the dial attempt .. and another including both the connected call and the initial dial

I don't know where to configure the CDR engine to behave normally... that is, to record A SINGLE CDR per call.. NOT 2!!

Any ideas?

PS: (No, I did not change my code, no I did not config any specific lines out of the ordinary cdr.conf )

Here is the debug output of the CDR engine:

0x7f51f40009a8 - Created CDR for channel SIP/900100-00000002
0x7f51f40009a8 - Transitioning CDR for SIP/900100-00000002 from state NONE to Single
0x7f51f4002bc8 - Created CDR for channel SIP/vox-00000003
0x7f51f4002bc8 - Transitioning CDR for SIP/vox-00000003 from state NONE to Single

Dial Begin message for SIP/900100-00000002, SIP/vox-00000003: 1448665204.00639317

0x7f51f40009a8 - Processing Dial Begin message for channel SIP/900100-00000002, peer SIP/vox-00000003
0x7f51f40009a8 - Updated Party A SIP/900100-00000002 snapshot
0x7f51f40009a8 - Updated Party B SIP/vox-00000003 snapshot
0x7f51f40009a8 - Transitioning CDR for SIP/900100-00000002 from state Single to Dial
0x7f51f4002bc8 - Processing Bridge Leave for SIP/vox-00000003
0x7f51f4002bc8 - Transitioning CDR for SIP/vox-00000003 from state Bridged to Finalized
0x7f51f40009a8 - Transitioning CDR for SIP/900100-00000002 from state Bridged to Finalized
0x7f51f4002bc8 - Beginning finalize/dispatch for SIP/vox-00000003
0x7f51f4002bc8 - Dispatching CDR for Party A SIP/vox-00000003, Party B <none>

Bridge Leave message for SIP/900100-00000002: 1448665215.00246400

0x7f51f4003da8 - Created CDR for channel SIP/900100-00000002
0x7f51f4003da8 - Transitioning CDR for SIP/900100-00000002 from state NONE to Single
0x7f51f4003da8 - Set answered time to 1448665215.248071
0x7f51f4003da8 - Transitioning CDR for SIP/900100-00000002 from state Single to Finalized
0x7f51f40009a8 - Beginning finalize/dispatch for SIP/900100-00000002
0x7f51f40009a8 - Dispatching CDR for Party A SIP/900100-00000002, Party B SIP/vox-00000003

This is a result of a new CDR engine starting in Asterisk version 12.

Depending on how channels are dialed and bridged, multiple CDRs will be created for a given call. Post-processing of these records will be required to determine the overall statistics of the call.

Before upgrading any software, it's a good idea to read all the upgrade documentation – in this case you've got 7 or 8 years' worth!

https://wiki.asterisk.org/wiki/display/AST/New+in+1.8

https://wiki.asterisk.org/wiki/display/AST/New+in+10

https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+11

https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+12

https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+13

I created the patch for asterisk 13 =) In short, the algorithm of the cdr remained the same, which eliminates various errors. If CDR record is the most latter, then we write it. And the last record is exactly what we need. Tested on version 13.4 and 13.6.

Install: Patch asterisk source code and build/rebuild asterisk.

patch asterisk-13.6.0/main/cdr.c ./asterisk13_cdr.patch

Download: http://miho.org.ua/download/asterisk/asterisk13_cdr_patch.zip

PS Write here if this patch help you or if you'll find bugs =)

在cdr.conf中添加

unanswered=no

I had similar problem.

Asterisk certified/13.8-cert4

One call produced two record. One correct record, second record had the same values except 'start','end','answered' fields, which was empty.

The reason of duplicates record - cdr_odbc.so module.

asterisk -rx "module show like odbc"
Module Description Use Count Status Support Level
cdr_adaptive_odbc.so Adaptive ODBC CDR backend 0 Running core
cdr_odbc.so ODBC CDR Backend 0 Running extended
cel_odbc.so ODBC CEL backend 0 Running core
func_odbc.so ODBC lookups 0 Running core
res_config_odbc.so Realtime ODBC configuration 0 Running core
res_odbc.so ODBC resource 0 Running core
res_odbc_transaction.so ODBC transaction resource 0 Running core
7 modules loaded

I turn him off in modules.conf 'noload => cdr_odbc.so'

Restart server and things is fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM