Summary:ASTERISK-15436: CDR and ForkCDR write wrong data on hangup in AGI execution
Reporter:Thomas Omerzu (t-o)Labels:
Date Opened:2010-01-15 07:23:25.000-0600Date Closed:2011-07-27 09:13:48
Versions:Frequency of
Environment:Attachments:( 0) agi2.agi
( 1) extensions.conf
( 2) extensions-2.conf
( 3) misdn.conf
( 4) misdn-2.conf
( 5) typescript.txt
( 6) typescript-2.txt
Description:If an AGI execution is stopped because the caller hung up, the written CDR will have partially wrong data, i.e. wrong context ("default" instead of the actual value), wrong caller id (leading "0" which was added by chan_misdn is missing), wrong extension (originally dialled value instead of version that was modified during dial plan execution).

Also CDRs written by ForkCDR during AGI execution will have the same wrong data as listed above.

On the other hand, if the AGI hangs up the channel itself, the resulting CDR will be correct.
Comments:By: Leif Madsen (lmadsen) 2010-01-15 13:16:58.000-0600

Can you provide some console output and an example of how to reproduce this? It seems pretty straight forward, but would be useful for a developer to have all the information to reproduce this easily once they get to it. Thanks!

By: John Todd (jtodd) 2010-01-15 14:17:19.000-0600

This sounds quite important, but we really do need the extra data as to how you produce it (I know the xplanation shows a lot, but we'd like to see your specific details) - holding until we get that.

By: Thomas Omerzu (t-o) 2010-01-15 16:29:34.000-0600

I tried to produce a set of config files as small as possible by removing as many directives as possible.
Find the results attached:
typescript.txt contains console output
misdn.conf, extensions.conf and the AGI in agi2.agi

- I was only able to produce this error in conjunction with calls arriving via chan_misdn. But here the error occurs always.

- The test in typescript.txt comprises two calls. In #1 the AGI hangs up and the Master.csv shows the (correct) context "von-ascotel". In #2 the caller hangs up while the AGI is still playing the "tt-weasels", and in this case the Master.csv shows the context "default". (See output of "tail" at the end of "typescript.txt").

- If you activate the (now commented) "FORKCDR" in the AGI, this will also produce the wrong context output.

- In my test scenario I currently do not have external phone lines available, thus I cannot demonstrate the problem whith the missing "0" at the beginning of the external phone numbers at the moment.

By: Thomas Omerzu (t-o) 2010-01-15 18:01:40.000-0600

I have now prepared a second test set, comprising of
misdn-2.conf, extensions-2.conf, typescript-2.txt
This example uses the same AGI as the first.

Here you can see that in the case of normal termination of the AGI the correct context (zv-ext), the correct caller id (02315600125) and the correctly cut version of the extension (2292) gets logged, while in test case 2, when the AGI is terminated by the user hanging up while "GET DATA" is running, wrong context (default), wrong caller id (2315600125), and unmodified extension (906292292) gets logged.

Please do also note that the AGI debug shows that the AGI environment has the correct data in both cases.

By: Russell Bryant (russell) 2011-07-27 09:13:42.614-0500

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

If this is still an issue, please open a new issue so it can be re-triaged appropriately. Thanks!