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
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
P.S. Write here if this patch help you or if you'll find bugs =)