Asterisk 13.4 cdr 引擎每次调用创建 2 条记录

Asterisk 13.4 cdr engine is creating 2 records per call

这真的开始让人讨厌了。

我从 2007 年开始使用 Asterisk 1.4 来操作一个完美的 PBX,它为每次呼叫创建一个单一的 CDR,就像任何其他版本的 Asterisk 一样。

昨天我觉得升级就可以了,得到了 Asterisk 13.4。

这该死的东西是为每个呼叫创建 2 个 CDR...一个代表拨号尝试..另一个包括已连接的呼叫和初始拨号

我不知道在哪里配置 CDR 引擎才能正常运行...也就是说,每次呼叫记录一个 CDR...不是 2!!

有什么想法吗?

PS:(不,我没有更改我的代码,不,我没有配置任何异常的特定行cdr.conf

这是 CDR 引擎的调试输出:

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

这是 new CDR engine 从 Asterisk 版本 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.

在升级任何软件之前,阅读所有升级文档是个好主意 – 在这种情况下,您有 7 或 8 年的价值!

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

在cdr.conf中请添加

unanswered=no

我为 asterisk 13 创建了补丁 =) 简而言之,cdr 的算法保持不变,消除了各种错误。如果话单记录是最晚的,那我们就写。而最后一条记录正是我们所需要的。在版本 13.4 和 13.6 上测试。

安装: 修补星号源代码和 build/rebuild 星号。

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

下载:http://miho.org.ua/download/asterisk/asterisk13_cdr_patch.zip

P.S。如果这个补丁对你有帮助或者你会发现错误,请写在这里=)

我遇到了类似的问题。

星号certified/13.8-cert4

一次调用产生两条记录。一个正确的记录,第二个记录除了 'start'、'end'、'answered' 字段为空之外具有相同的值。

重复记录的原因 - cdr_odbc.so 模块。

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

我在 modules.conf 关掉他 'noload => cdr_odbc.so'

重启服务器,一切正常。