My CDR doesn’t work correctly in the following case:
When I get an incoming call both phones ring (SIP 1001 and SIP 1002). When phone 1002 answers the call, everything is fine with the CDR (dcontext = ANSWERED). But when phone 1001 answers the phone, the CDR dcontext is set with “NO ANSWER” and the CDR callanswer is set “0000-00-00 00:00:00”.
If I change the SIPs
it is just the opposite way. How can I solve this problem? The CDR dcontext should be correctly set as “ANSWERED” - irrespective of which phone answers the call.
12 and above has a CDR specification[1] which documents the resulting CDRs which occur as a result of common scenarios. In this case you’ll end up with two CDR entries. One for the answered leg, one for the unanswered leg. This is expected.
Thank you so far! I use the Asterisk-package on a Synology Diskstation. This package does not provide an ODBC-connector and it is not possible to install an ODBC-Addon. But I could manage the following workaround to write the CDR into my MariaDB-Database (formerly MySQL):
So I realized now, that the CDR-variables (f.e. CDR(disposition)) provide successively the data. Example: a phonecall is coming in --> both phones (SIP 1001 and [color=#FF0000]SIP 1002[/color]) ring --> I pick up phone [color=#FF0000]SIP 1002[/color] --> in a first step CDR(disposition) = NO ANSWER and in the second step CDR(disposition) = [color=#FF0000]ANSWERED[/color] --> when I hang up, my MySQL-command writes the last set CDR(disposition) ("[color=#FF0000]ANSWERED[/color]") into the database.
How (or where in my dialplan) can I “grab” the CDR(disposition) when it is set the first time (in my example “NO ANSWER”)?