summaryrefslogtreecommitdiff
path: root/main/cel.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-06-19 12:55:34 +0000
committerKinsey Moore <kmoore@digium.com>2013-06-19 12:55:34 +0000
commit954166ed2486e5a44367ee1bd4e29b7bc8c8cf13 (patch)
tree924f23d9a78c5bab0e357c72c74be291a98a4240 /main/cel.c
parent68103abba38b3ccd362dd1e9018b4045b9b7cb57 (diff)
Pull CEL linkedid manipulation into cel.c
This finishes moving all CEL linkedid tracking entirely within cel.c since that is now possible with channel snapshots. This also removes another CEL linkedid manipulation function from cel.h that has already been internalized and is neither called nor available to link against. Review: https://reviewboard.asterisk.org/r/2632/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cel.c')
-rw-r--r--main/cel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/main/cel.c b/main/cel.c
index 8110b116e..b3802c7ee 100644
--- a/main/cel.c
+++ b/main/cel.c
@@ -634,6 +634,7 @@ static int cel_track_app(const char *const_app)
return 1;
}
+static int cel_linkedid_ref(const char *linkedid);
static int report_event_snapshot(struct ast_channel_snapshot *snapshot,
enum ast_cel_event_type event_type, const char *userdefevname,
const char *extra, const char *peer2_name)
@@ -663,7 +664,7 @@ static int report_event_snapshot(struct ast_channel_snapshot *snapshot,
/* Record the linkedid of new channels if we are tracking LINKEDID_END even if we aren't
* reporting on CHANNEL_START so we can track when to send LINKEDID_END */
if (ast_cel_track_event(AST_CEL_LINKEDID_END) && event_type == AST_CEL_CHANNEL_START && linkedid) {
- if (ast_cel_linkedid_ref(linkedid)) {
+ if (cel_linkedid_ref(linkedid)) {
return -1;
}
}
@@ -868,7 +869,7 @@ struct ast_channel *ast_cel_fabricate_channel_from_event(const struct ast_event
return tchan;
}
-int ast_cel_linkedid_ref(const char *linkedid)
+static int cel_linkedid_ref(const char *linkedid)
{
char *lid;
@@ -909,7 +910,7 @@ int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event
/* Record the linkedid of new channels if we are tracking LINKEDID_END even if we aren't
* reporting on CHANNEL_START so we can track when to send LINKEDID_END */
if (ast_cel_track_event(AST_CEL_LINKEDID_END) && event_type == AST_CEL_CHANNEL_START && linkedid) {
- if (ast_cel_linkedid_ref(linkedid)) {
+ if (cel_linkedid_ref(linkedid)) {
return -1;
}
}
@@ -1114,7 +1115,11 @@ static void cel_channel_linkedid_change(
return;
}
+ ast_assert(!ast_strlen_zero(new_snapshot->linkedid));
+ ast_assert(!ast_strlen_zero(old_snapshot->linkedid));
+
if (strcmp(old_snapshot->linkedid, new_snapshot->linkedid)) {
+ cel_linkedid_ref(new_snapshot->linkedid);
check_retire_linkedid(old_snapshot);
}
}