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
This commit is contained in:
Matthew Jordan
2013-08-08 02:58:01 +00:00
parent 200ed6a405
commit 8b75a68f13

View File

@@ -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 */