[asterisk-commits] file: branch file/bridging r84125 - in /team/file/bridging: include/asterisk/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 29 12:04:50 CDT 2007


Author: file
Date: Sat Sep 29 12:04:49 2007
New Revision: 84125

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84125
Log:
Put in more skeleton work for features.

Modified:
    team/file/bridging/include/asterisk/bridging.h
    team/file/bridging/main/bridging.c

Modified: team/file/bridging/include/asterisk/bridging.h
URL: http://svn.digium.com/view/asterisk/team/file/bridging/include/asterisk/bridging.h?view=diff&rev=84125&r1=84124&r2=84125
==============================================================================
--- team/file/bridging/include/asterisk/bridging.h (original)
+++ team/file/bridging/include/asterisk/bridging.h Sat Sep 29 12:04:49 2007
@@ -94,8 +94,18 @@
 	AST_RWLIST_ENTRY(ast_bridge_technology) list;                                                                                          /*! Linked list information */
 };
 
+
+typedef int (*ast_bridge_features_hook_callback)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel);
+
+struct ast_bridge_features_hook {
+	char *dtmf;
+	ast_bridge_features_hook_callback callback;
+	AST_LIST_ENTRY(ast_bridge_features_hook) list;
+};
+
 struct ast_bridge_features {
 	enum ast_bridge_builtin_feature builtin_features[AST_BRIDGE_BUILTIN_END]; /*! Enabled built in features */
+	AST_LIST_HEAD_NOLOCK(, ast_bridge_features_hook) hooks;
 };
 
 struct ast_bridge_channel {
@@ -208,7 +218,7 @@
  * \param dtmf DTMF string to be activated upon
  * \return Returns 0 on success, -1 on failure
  */
-int ast_bridge_features_hook(struct ast_bridge_features *features, const char *dtmf);
+int ast_bridge_features_hook(struct ast_bridge_features *features, const char *dtmf, ast_bridge_features_hook_callback callback);
 
 /*! \brief Enable a built in feature on a bridge features structure
  * \param features Bridge features structure
@@ -216,6 +226,12 @@
  * \return Returns 0 on success, -1 on failure
  */
 int ast_bridge_features_enable(struct ast_bridge_features *features, enum ast_bridge_builtin_feature feature);
+
+/*! \brief Destroy the contents of a bridge features structure
+ * \param features Bridge features structure
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_bridge_features_destroy(struct ast_bridge_features *features);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=84125&r1=84124&r2=84125
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Sat Sep 29 12:04:49 2007
@@ -710,6 +710,7 @@
 	
 	/* Signal it's thread using a few different ways... */
 	pthread_kill(bridge_channel->thread, SIGURG);
+
 	return ast_cond_signal(&bridge_channel->cond);
 }
 
@@ -752,6 +753,23 @@
 	return -1;
 }
 
+/*! \brief Attach a custom hook to a bridge features structure
+ * \param features Bridge features structure
+ * \param dtmf DTMF string to be activated upon
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_bridge_features_hook(struct ast_bridge_features *features, const char *dtmf, ast_bridge_features_hook_callback callback)
+{
+	struct ast_bridge_features_hook *hook = NULL;
+
+	if (!(hook = ast_calloc(1, sizeof(*hook))))
+		return -1;
+
+	hook->callback = callback;
+
+	return 0;
+}
+
 /*! \brief Enable a built in feature on a bridge features structure
  * \param features Bridge features structure
  * \param feature Feature to enable
@@ -767,3 +785,12 @@
 
 	return 0;
 }
+
+/*! \brief Destroy the contents of a bridge features structure
+ * \param features Bridge features structure
+ * \return Returns 0 on success, -1 on failure
+ */
+int ast_bridge_features_destroy(struct ast_bridge_features *features)
+{
+	return -1;
+}




More information about the asterisk-commits mailing list