diff options
author | Joshua Colp <jcolp@digium.com> | 2007-06-27 20:26:53 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-06-27 20:26:53 +0000 |
commit | 809c1398d7059aebed309b5fb2bc8a65356173f0 (patch) | |
tree | 32ec06714c236b3e40b2a5e4676fdd4b3a6eac2c /main/channel.c | |
parent | 08fa65de5e969cd45bb831072966d9f44d3a3eca (diff) |
Merged revisions 72257 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r72257 | file | 2007-06-27 16:25:24 -0400 (Wed, 27 Jun 2007) | 10 lines
Merged revisions 72256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r72256 | file | 2007-06-27 16:23:24 -0400 (Wed, 27 Jun 2007) | 2 lines
I may possibly get shot for doing this... but... defer CDR processing until after the channel has been dealt with. This should eliminate all of the issues with channels going funky (SIP/PRI) when you are posting CDRs to a database that is either slow or unavailable and do not want to enable batching.
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index a9a380084..9d395dcb2 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1605,6 +1605,7 @@ static void free_translation(struct ast_channel *clone) int ast_hangup(struct ast_channel *chan) { int res = 0; + struct ast_cdr *cdr = NULL; /* Don't actually hang up a channel that will masquerade as someone else, or if someone is going to masquerade as us */ @@ -1652,7 +1653,7 @@ int ast_hangup(struct ast_channel *chan) chan->generator = NULL; if (chan->cdr) { /* End the CDR if it hasn't already */ ast_cdr_end(chan->cdr); - ast_cdr_detach(chan->cdr); /* Post and Free the CDR */ + cdr = chan->cdr; chan->cdr = NULL; } if (ast_test_flag(chan, AST_FLAG_BLOCKING)) { @@ -1681,6 +1682,10 @@ int ast_hangup(struct ast_channel *chan) ast_cause2str(chan->hangupcause) ); ast_channel_free(chan); + + if (cdr) + ast_cdr_detach(cdr); + return res; } |