summaryrefslogtreecommitdiff
path: root/main/cdr.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-08-08 02:58:01 +0000
committerMatthew Jordan <mjordan@digium.com>2013-08-08 02:58:01 +0000
commit8b75a68f13ac545ab48054c3cd80c456010ec947 (patch)
tree27ed8f80c7183b649710fe556c378ffdcaf5e94e /main/cdr.c
parent200ed6a405405497ba1e498c52fd27f5b84b43f7 (diff)
Handle Surrogate channels in Dial message processing
Depending on when a Surrogate channel replaces an existing channel, it is possible to get a Dial message for the Surrogate channel. When this occurs, no CDR will exist for the channel as Surrogate channels are ignored. Safely handle the case when a CDR doesn't exist for a Dial message. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 276f15bc4..15f98ef1e 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1818,6 +1818,11 @@ static void handle_dial_message(void *data, struct stasis_subscription *sub, str
cdr = ao2_find(active_cdrs_by_channel, peer->name, OBJ_KEY);
}
+ if (!cdr) {
+ ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", caller ? caller->name : peer->name);
+ return;
+ }
+
ao2_lock(cdr);
for (it_cdr = cdr; it_cdr; it_cdr = it_cdr->next) {
if (ast_strlen_zero(dial_status)) {
@@ -1896,7 +1901,7 @@ static int cdr_object_update_party_b(void *obj, void *arg, int flags)
/*! \internal \brief Filter channel snapshots by technology */
static int filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
{
- return snapshot->tech_properties & (AST_CHAN_TP_ANNOUNCER | AST_CHAN_TP_RECORDER);
+ return snapshot->tech_properties & AST_CHAN_TP_INTERNAL;
}
/*! \internal \brief Filter a channel cache update */