[svn-commits] kmoore: trunk r392241 - in /trunk: include/asterisk/cel.h main/cel.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 19 07:55:37 CDT 2013


Author: kmoore
Date: Wed Jun 19 07:55:34 2013
New Revision: 392241

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392241
Log:
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/

Modified:
    trunk/include/asterisk/cel.h
    trunk/main/cel.c

Modified: trunk/include/asterisk/cel.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/cel.h?view=diff&rev=392241&r1=392240&r2=392241
==============================================================================
--- trunk/include/asterisk/cel.h (original)
+++ trunk/include/asterisk/cel.h Wed Jun 19 07:55:34 2013
@@ -148,31 +148,6 @@
  */
 enum ast_cel_event_type ast_cel_str_to_event_type(const char *name);
 
-/*! 
- * \brief Check and potentially retire a Linked ID
- *
- * \param chan channel that is being destroyed or its linkedid is changing
- *
- * \since 1.8
- *
- * If at least one CEL backend is looking for CEL_LINKEDID_END
- * events, this function will check if the given channel is the last
- * active channel with that linkedid, and if it is, emit a
- * CEL_LINKEDID_END event.
- *
- * \return nothing
- */
-void ast_cel_check_retire_linkedid(struct ast_channel *chan);
-
-/*!
- * \brief Inform CEL that a new linkedid is being used
- * \since 11
- *
- * \retval -1 error
- * \retval 0 success
- */
-int ast_cel_linkedid_ref(const char *linkedid);
-
 /*!
  * \brief Create a fake channel from data in a CEL event
  *

Modified: trunk/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cel.c?view=diff&rev=392241&r1=392240&r2=392241
==============================================================================
--- trunk/main/cel.c (original)
+++ trunk/main/cel.c Wed Jun 19 07:55:34 2013
@@ -634,6 +634,7 @@
 	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 @@
 	/* 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 @@
 	return tchan;
 }
 
-int ast_cel_linkedid_ref(const char *linkedid)
+static int cel_linkedid_ref(const char *linkedid)
 {
 	char *lid;
 
@@ -909,7 +910,7 @@
 	/* 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 @@
 		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);
 	}
 }




More information about the svn-commits mailing list