diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-03-18 15:28:45 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-03-18 15:28:45 +0000 |
commit | 77db94a25a39754f7d79b46e3067bc28376a2865 (patch) | |
tree | fe305b0ce901c0c4987fba92a2ff0a58b08c0f00 /main/cdr.c | |
parent | 216b04e6f40f72fe682e1ed3cf8c38ec3c9514a8 (diff) |
cdr: Add asserts for when we don't know about a CDR for a channel
In the CDR core, every channel should either be filtered out (due to being an
'internal' channel used as an implementation detail, such as playing media
back into a bridge) or it should get a CDR. Even if that CDR ends up being
discarded, we still give the channel a CDR in case we end up needing it. If we
hit a situation where a channel does not have a CDR, we should blow up in
-dev-mode. Asserts are appropriate for that.
This patch adds those asserts, as they would have quickly caught the error
fixed by r410814.
........
Merged revisions 410861 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cdr.c')
-rw-r--r-- | main/cdr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/cdr.c b/main/cdr.c index e1060a517..467969097 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -1936,6 +1936,7 @@ static void handle_dial_message(void *data, struct stasis_subscription *sub, str if (!cdr) { ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", caller ? caller->name : peer->name); + ast_assert(0); return; } @@ -2087,6 +2088,7 @@ static void handle_channel_cache_message(void *data, struct stasis_subscription } if (!cdr) { ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", name); + ast_assert(0); } else { ao2_lock(cdr); if (new_snapshot) { @@ -2212,6 +2214,7 @@ static void handle_bridge_leave_message(void *data, struct stasis_subscription * if (!cdr) { ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", channel->name); + ast_assert(0); return; } @@ -2509,6 +2512,7 @@ static void handle_bridge_enter_message(void *data, struct stasis_subscription * if (!cdr) { ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", channel->name); + ast_assert(0); return; } @@ -2559,6 +2563,7 @@ static void handle_parked_call_message(void *data, struct stasis_subscription *s cdr = ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_KEY); if (!cdr) { ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", channel->name); + ast_assert(0); return; } |