[svn-commits] mmichelson: branch group/CCSS r235566 - in /team/group/CCSS: include/asterisk...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Dec 18 13:01:02 CST 2009


Author: mmichelson
Date: Fri Dec 18 13:01:00 2009
New Revision: 235566

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235566
Log:
Move ast_cc_callback to a more sensible location.


Modified:
    team/group/CCSS/include/asterisk/ccss.h
    team/group/CCSS/include/asterisk/channel.h
    team/group/CCSS/main/ccss.c
    team/group/CCSS/main/channel.c

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=235566&r1=235565&r2=235566
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Fri Dec 18 13:01:00 2009
@@ -1200,6 +1200,21 @@
 
 /*!
  * \since 1.6.4
+ * \brief Run a callback for potential matching destinations.
+ *
+ * See the explanation in ast_channel_tech::cc_callback for more
+ * details.
+ *
+ * \param tech Channel technology to use
+ * \param dest Channel/group/peer or whatever the specific technology uses
+ * \param callback Function to call when a target is reached
+ * \retval Always 0, I guess.
+ */
+int ast_cc_callback(struct ast_channel *inbound, const char * const tech, const char * const dest, 
+		void (*callback)(struct ast_channel *inbound, struct ast_cc_config_params *cc_params, const char * const interace_name));
+
+/*!
+ * \since 1.6.4
  * \brief Initialize CCSS
  *
  * XXX This needs to be updated as more functionality is added.

Modified: team/group/CCSS/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/include/asterisk/channel.h?view=diff&rev=235566&r1=235565&r2=235566
==============================================================================
--- team/group/CCSS/include/asterisk/channel.h (original)
+++ team/group/CCSS/include/asterisk/channel.h Fri Dec 18 13:01:00 2009
@@ -2829,21 +2829,6 @@
  */
 int ast_channel_get_device_name(struct ast_channel *chan, char *device_name, size_t name_buffer_length);
 
-/*!
- * \since 1.6.4
- * \brief Run a callback for potential matching destinations.
- *
- * See the explanation in ast_channel_tech::cc_callback for more
- * details.
- *
- * \param tech Channel technology to use
- * \param dest Channel/group/peer or whatever the specific technology uses
- * \param callback Function to call when a target is reached
- * \retval Always 0, I guess.
- */
-int ast_cc_callback(struct ast_channel *inbound, const char * const tech, const char * const dest, 
-		void (*callback)(struct ast_channel *inbound, struct ast_cc_config_params *cc_params, const char * const interace_name));
-
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=235566&r1=235565&r2=235566
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Dec 18 13:01:00 2009
@@ -3290,6 +3290,18 @@
 	ast_handle_cc_control_frame(inbound, NULL, &payload);
 }
 
+int ast_cc_callback(struct ast_channel *inbound, const char * const tech, const char * const dest,
+		void (*callback)(struct ast_channel *inbound, struct ast_cc_config_params *cc_params, const char * const interface_name))
+{
+	const struct ast_channel_tech *chantech = ast_get_channel_tech(tech);
+
+	if (chantech && chantech->cc_callback) {
+		chantech->cc_callback(inbound, dest, callback);
+	}
+
+	return 0;
+}
+
 static char *ccreq_app = "CallCompletionRequest";
 
 static int ccreq_exec(struct ast_channel *chan, const char *data)

Modified: team/group/CCSS/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/channel.c?view=diff&rev=235566&r1=235565&r2=235566
==============================================================================
--- team/group/CCSS/main/channel.c (original)
+++ team/group/CCSS/main/channel.c Fri Dec 18 13:01:00 2009
@@ -7513,21 +7513,6 @@
 	return 0;
 }
 
-int ast_cc_callback(struct ast_channel *inbound, const char * const tech, const char * const dest,
-		void (*callback)(struct ast_channel *inbound, struct ast_cc_config_params *cc_params, const char * const interface_name))
-{
-	struct chanlist *cl;
-
-	AST_RWLIST_RDLOCK(&backends);
-	AST_RWLIST_TRAVERSE(&backends, cl, list) {
-		if (!strcasecmp(cl->tech->type, tech) && cl->tech->cc_callback) {
-			cl->tech->cc_callback(inbound, dest, callback);
-		}
-	}
-	AST_RWLIST_UNLOCK(&backends);
-	return 0;
-}
-
 /* DO NOT PUT ADDITIONAL FUNCTIONS BELOW THIS BOUNDARY
  *
  * ONLY FUNCTIONS FOR PROVIDING BACKWARDS ABI COMPATIBILITY BELONG HERE




More information about the svn-commits mailing list