mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-02 02:18:31 +00:00
Filter out internal channels from dial message handling
Surrogate channels would pop up from time to time in dial message handling. This would cause a WARNING message to appear, indicating that the Surrogate channel had no CDR. This patch filters out those channels that have the internal implementation flag set, such that the WARNING message isn't displayed. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
62
main/cdr.c
62
main/cdr.c
@@ -1832,6 +1832,35 @@ static int finalized_state_process_party_a(struct cdr_object *cdr, struct ast_ch
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \internal
|
||||||
|
* \brief Filter channel snapshots by technology
|
||||||
|
*/
|
||||||
|
static int filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
|
||||||
|
{
|
||||||
|
return snapshot->tech_properties & AST_CHAN_TP_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \internal
|
||||||
|
* \brief Filter a channel cache update
|
||||||
|
*/
|
||||||
|
static int filter_channel_cache_message(struct ast_channel_snapshot *old_snapshot,
|
||||||
|
struct ast_channel_snapshot *new_snapshot)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
/* Drop cache updates from certain channel technologies */
|
||||||
|
if (old_snapshot) {
|
||||||
|
ret |= filter_channel_snapshot(old_snapshot);
|
||||||
|
}
|
||||||
|
if (new_snapshot) {
|
||||||
|
ret |= filter_channel_snapshot(new_snapshot);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* TOPIC ROUTER CALLBACKS */
|
/* TOPIC ROUTER CALLBACKS */
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -1870,6 +1899,10 @@ static void handle_dial_message(void *data, struct stasis_subscription *sub, str
|
|||||||
(unsigned int)stasis_message_timestamp(message)->tv_sec,
|
(unsigned int)stasis_message_timestamp(message)->tv_sec,
|
||||||
(unsigned int)stasis_message_timestamp(message)->tv_usec);
|
(unsigned int)stasis_message_timestamp(message)->tv_usec);
|
||||||
|
|
||||||
|
if (filter_channel_snapshot(peer) || (caller && filter_channel_snapshot(caller))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Figure out who is running this show */
|
/* Figure out who is running this show */
|
||||||
if (caller) {
|
if (caller) {
|
||||||
cdr = ao2_find(active_cdrs_by_channel, caller->uniqueid, OBJ_KEY);
|
cdr = ao2_find(active_cdrs_by_channel, caller->uniqueid, OBJ_KEY);
|
||||||
@@ -1959,35 +1992,6 @@ static int cdr_object_update_party_b(void *obj, void *arg, int flags)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
* \internal
|
|
||||||
* \brief Filter channel snapshots by technology
|
|
||||||
*/
|
|
||||||
static int filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
|
|
||||||
{
|
|
||||||
return snapshot->tech_properties & AST_CHAN_TP_INTERNAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \internal
|
|
||||||
* \brief Filter a channel cache update
|
|
||||||
*/
|
|
||||||
static int filter_channel_cache_message(struct ast_channel_snapshot *old_snapshot,
|
|
||||||
struct ast_channel_snapshot *new_snapshot)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
/* Drop cache updates from certain channel technologies */
|
|
||||||
if (old_snapshot) {
|
|
||||||
ret |= filter_channel_snapshot(old_snapshot);
|
|
||||||
}
|
|
||||||
if (new_snapshot) {
|
|
||||||
ret |= filter_channel_snapshot(new_snapshot);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! \brief Determine if we need to add a new CDR based on snapshots */
|
/*! \brief Determine if we need to add a new CDR based on snapshots */
|
||||||
static int check_new_cdr_needed(struct ast_channel_snapshot *old_snapshot,
|
static int check_new_cdr_needed(struct ast_channel_snapshot *old_snapshot,
|
||||||
struct ast_channel_snapshot *new_snapshot)
|
struct ast_channel_snapshot *new_snapshot)
|
||||||
|
Reference in New Issue
Block a user