[asterisk-commits] rmudgett: trunk r392435 - in /trunk: bridges/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 21 12:48:16 CDT 2013


Author: rmudgett
Date: Fri Jun 21 12:48:14 2013
New Revision: 392435

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392435
Log:
Change several bridge functions to return error status.

The bridge frame queue functions need to return an error status if the
frame failed to be queued because of an error condition.  The main calls
that needed to return the status are:
ast_bridge_channel_queue_action_data() and
ast_bridge_channel_write_action_data().  The other return changes are
ripple effects.

Modified:
    trunk/bridges/bridge_softmix.c
    trunk/include/asterisk/bridging.h
    trunk/include/asterisk/bridging_technology.h
    trunk/main/bridging.c
    trunk/main/features.c

Modified: trunk/bridges/bridge_softmix.c
URL: http://svnview.digium.com/svn/asterisk/trunk/bridges/bridge_softmix.c?view=diff&rev=392435&r1=392434&r2=392435
==============================================================================
--- trunk/bridges/bridge_softmix.c (original)
+++ trunk/bridges/bridge_softmix.c Fri Jun 21 12:48:14 2013
@@ -378,11 +378,12 @@
  *
  * \param bridge_channel Which channel source is changing.
  *
- * \return Nothing
- */
-static void softmix_src_change(struct ast_bridge_channel *bridge_channel)
-{
-	ast_bridge_channel_queue_control_data(bridge_channel, AST_CONTROL_SRCCHANGE, NULL, 0);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+static int softmix_src_change(struct ast_bridge_channel *bridge_channel)
+{
+	return ast_bridge_channel_queue_control_data(bridge_channel, AST_CONTROL_SRCCHANGE, NULL, 0);
 }
 
 /*! \brief Function called when a channel is joined into the bridge */

Modified: trunk/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/bridging.h?view=diff&rev=392435&r1=392434&r2=392435
==============================================================================
--- trunk/include/asterisk/bridging.h (original)
+++ trunk/include/asterisk/bridging.h Fri Jun 21 12:48:14 2013
@@ -1088,9 +1088,10 @@
  * \param data Frame payload data to pass.
  * \param datalen Frame payload data length to pass.
  *
- * \return Nothing
- */
-typedef void (*ast_bridge_channel_post_action_data)(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+typedef int (*ast_bridge_channel_post_action_data)(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen);
 
 /*!
  * \brief Queue an action frame onto the bridge channel with data.
@@ -1101,9 +1102,10 @@
  * \param data Frame payload data to pass.
  * \param datalen Frame payload data length to pass.
  *
- * \return Nothing
- */
-void ast_bridge_channel_queue_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_queue_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen);
 
 /*!
  * \brief Write an action frame into the bridge with data.
@@ -1114,9 +1116,10 @@
  * \param data Frame payload data to pass.
  * \param datalen Frame payload data length to pass.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen);
 
 /*!
  * \brief Queue a control frame onto the bridge channel with data.
@@ -1127,9 +1130,10 @@
  * \param data Frame payload data to pass.
  * \param datalen Frame payload data length to pass.
  *
- * \return Nothing
- */
-void ast_bridge_channel_queue_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_queue_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen);
 
 /*!
  * \brief Write a control frame into the bridge with data.
@@ -1140,9 +1144,10 @@
  * \param data Frame payload data to pass.
  * \param datalen Frame payload data length to pass.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen);
 
 /*!
  * \brief Write a hold frame into the bridge.
@@ -1151,9 +1156,10 @@
  * \param bridge_channel Which channel is putting the hold into the bridge.
  * \param moh_class The suggested music class for the other end to use.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_hold(struct ast_bridge_channel *bridge_channel, const char *moh_class);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_hold(struct ast_bridge_channel *bridge_channel, const char *moh_class);
 
 /*!
  * \brief Write an unhold frame into the bridge.
@@ -1161,9 +1167,10 @@
  *
  * \param bridge_channel Which channel is putting the hold into the bridge.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_unhold(struct ast_bridge_channel *bridge_channel);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_unhold(struct ast_bridge_channel *bridge_channel);
 
 /*!
  * \brief Run an application on the bridge channel.
@@ -1195,9 +1202,10 @@
  *
  * \note This is intended to be called by bridge hooks.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class);
 
 /*!
  * \brief Queue a bridge action run application frame onto the bridge channel.
@@ -1212,9 +1220,10 @@
  *
  * \note This is intended to be called by bridge hooks.
  *
- * \return Nothing
- */
-void ast_bridge_channel_queue_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_queue_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class);
 
 /*!
  * \brief Custom interpretation of the playfile name.
@@ -1256,9 +1265,10 @@
  *
  * \note This is intended to be called by bridge hooks.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class);
 
 /*!
  * \brief Queue a bridge action play file frame onto the bridge channel.
@@ -1273,9 +1283,10 @@
  *
  * \note This is intended to be called by bridge hooks.
  *
- * \return Nothing
- */
-void ast_bridge_channel_queue_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_queue_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class);
 
 /*!
  * \brief Custom callback run on a bridge channel.
@@ -1303,9 +1314,10 @@
  *
  * \note This is intended to be called by bridge hooks.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size);
 
 /*!
  * \brief Queue a bridge action custom callback frame onto the bridge channel.
@@ -1320,9 +1332,10 @@
  *
  * \note This is intended to be called by bridge hooks.
  *
- * \return Nothing
- */
-void ast_bridge_channel_queue_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size);
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_queue_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size);
 
 /*!
  * \brief Have a bridge channel park a channel in the bridge
@@ -1335,9 +1348,10 @@
  *
  * \note This is intended to be called by bridge hooks.
  *
- * \return Nothing
- */
-void ast_bridge_channel_write_park(struct ast_bridge_channel *bridge_channel, const char *parkee_uuid,
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_channel_write_park(struct ast_bridge_channel *bridge_channel, const char *parkee_uuid,
 	const char *parker_uuid, const char *app_data);
 
 /*!

Modified: trunk/include/asterisk/bridging_technology.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/bridging_technology.h?view=diff&rev=392435&r1=392434&r2=392435
==============================================================================
--- trunk/include/asterisk/bridging_technology.h (original)
+++ trunk/include/asterisk/bridging_technology.h Fri Jun 21 12:48:14 2013
@@ -196,8 +196,11 @@
  * \param bridge_channel The bridge channel that has either started or stopped talking.
  * \param started_talking set to 1 when this indicates the channel has started talking set to 0
  * when this indicates the channel has stopped talking.
- */
-void ast_bridge_notify_talking(struct ast_bridge_channel *bridge_channel, int started_talking);
+ *
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_bridge_notify_talking(struct ast_bridge_channel *bridge_channel, int started_talking);
 
 /*!
  * \brief Suspend a bridge technology from consideration

Modified: trunk/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/bridging.c?view=diff&rev=392435&r1=392434&r2=392435
==============================================================================
--- trunk/main/bridging.c (original)
+++ trunk/main/bridging.c Fri Jun 21 12:48:14 2013
@@ -397,7 +397,7 @@
 	return 0;
 }
 
-void ast_bridge_channel_queue_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen)
+int ast_bridge_channel_queue_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen)
 {
 	struct ast_frame frame = {
 		.frametype = AST_FRAME_BRIDGE_ACTION,
@@ -406,10 +406,10 @@
 		.data.ptr = (void *) data,
 	};
 
-	ast_bridge_channel_queue_frame(bridge_channel, &frame);
-}
-
-void ast_bridge_channel_queue_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen)
+	return ast_bridge_channel_queue_frame(bridge_channel, &frame);
+}
+
+int ast_bridge_channel_queue_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen)
 {
 	struct ast_frame frame = {
 		.frametype = AST_FRAME_CONTROL,
@@ -418,7 +418,7 @@
 		.data.ptr = (void *) data,
 	};
 
-	ast_bridge_channel_queue_frame(bridge_channel, &frame);
+	return ast_bridge_channel_queue_frame(bridge_channel, &frame);
 }
 
 void ast_bridge_channel_restore_formats(struct ast_bridge_channel *bridge_channel)
@@ -749,7 +749,7 @@
 	return ready;
 }
 
-void ast_bridge_notify_talking(struct ast_bridge_channel *bridge_channel, int started_talking)
+int ast_bridge_notify_talking(struct ast_bridge_channel *bridge_channel, int started_talking)
 {
 	struct ast_frame action = {
 		.frametype = AST_FRAME_BRIDGE_ACTION,
@@ -757,10 +757,10 @@
 			? AST_BRIDGE_ACTION_TALKING_START : AST_BRIDGE_ACTION_TALKING_STOP,
 	};
 
-	ast_bridge_channel_queue_frame(bridge_channel, &action);
-}
-
-static void bridge_channel_write_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
+	return ast_bridge_channel_queue_frame(bridge_channel, &action);
+}
+
+static int bridge_channel_write_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
 {
 	ast_bridge_channel_lock_bridge(bridge_channel);
 /*
@@ -771,9 +771,15 @@
  */
 	bridge_channel->bridge->technology->write(bridge_channel->bridge, bridge_channel, frame);
 	ast_bridge_unlock(bridge_channel->bridge);
-}
-
-void ast_bridge_channel_write_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen)
+
+	/*
+	 * Claim successful write to bridge.  If deferred frame
+	 * support is added, claim successfully deferred.
+	 */
+	return 0;
+}
+
+int ast_bridge_channel_write_action_data(struct ast_bridge_channel *bridge_channel, enum ast_bridge_action_type action, const void *data, size_t datalen)
 {
 	struct ast_frame frame = {
 		.frametype = AST_FRAME_BRIDGE_ACTION,
@@ -782,10 +788,10 @@
 		.data.ptr = (void *) data,
 	};
 
-	bridge_channel_write_frame(bridge_channel, &frame);
-}
-
-void ast_bridge_channel_write_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen)
+	return bridge_channel_write_frame(bridge_channel, &frame);
+}
+
+int ast_bridge_channel_write_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen)
 {
 	struct ast_frame frame = {
 		.frametype = AST_FRAME_CONTROL,
@@ -794,10 +800,10 @@
 		.data.ptr = (void *) data,
 	};
 
-	bridge_channel_write_frame(bridge_channel, &frame);
-}
-
-void ast_bridge_channel_write_hold(struct ast_bridge_channel *bridge_channel, const char *moh_class)
+	return bridge_channel_write_frame(bridge_channel, &frame);
+}
+
+int ast_bridge_channel_write_hold(struct ast_bridge_channel *bridge_channel, const char *moh_class)
 {
 	RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
 	size_t datalen;
@@ -813,14 +819,14 @@
 	}
 
 	ast_channel_publish_blob(bridge_channel->chan, ast_channel_hold_type(), blob);
-	ast_bridge_channel_write_control_data(bridge_channel, AST_CONTROL_HOLD, moh_class,
-		datalen);
-}
-
-void ast_bridge_channel_write_unhold(struct ast_bridge_channel *bridge_channel)
+	return ast_bridge_channel_write_control_data(bridge_channel, AST_CONTROL_HOLD,
+		moh_class, datalen);
+}
+
+int ast_bridge_channel_write_unhold(struct ast_bridge_channel *bridge_channel)
 {
 	ast_channel_publish_blob(bridge_channel->chan, ast_channel_unhold_type(), NULL);
-	ast_bridge_channel_write_control_data(bridge_channel, AST_CONTROL_UNHOLD, NULL, 0);
+	return ast_bridge_channel_write_control_data(bridge_channel, AST_CONTROL_UNHOLD, NULL, 0);
 }
 
 static int run_app_helper(struct ast_channel *chan, const char *app_name, const char *app_args)
@@ -884,7 +890,7 @@
 		data->moh_offset ? &data->app_name[data->moh_offset] : NULL);
 }
 
-static void payload_helper_app(ast_bridge_channel_post_action_data post_it,
+static int payload_helper_app(ast_bridge_channel_post_action_data post_it,
 	struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
 {
 	struct bridge_run_app *app_data;
@@ -905,18 +911,18 @@
 		strcpy(&app_data->app_name[app_data->moh_offset], moh_class);/* Safe */
 	}
 
-	post_it(bridge_channel, AST_BRIDGE_ACTION_RUN_APP, app_data, len_data);
-}
-
-void ast_bridge_channel_write_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
-{
-	payload_helper_app(ast_bridge_channel_write_action_data,
+	return post_it(bridge_channel, AST_BRIDGE_ACTION_RUN_APP, app_data, len_data);
+}
+
+int ast_bridge_channel_write_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
+{
+	return payload_helper_app(ast_bridge_channel_write_action_data,
 		bridge_channel, app_name, app_args, moh_class);
 }
 
-void ast_bridge_channel_queue_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
-{
-	payload_helper_app(ast_bridge_channel_queue_action_data,
+int ast_bridge_channel_queue_app(struct ast_bridge_channel *bridge_channel, const char *app_name, const char *app_args, const char *moh_class)
+{
+	return payload_helper_app(ast_bridge_channel_queue_action_data,
 		bridge_channel, app_name, app_args, moh_class);
 }
 
@@ -971,7 +977,7 @@
 		payload->moh_offset ? &payload->playfile[payload->moh_offset] : NULL);
 }
 
-static void payload_helper_playfile(ast_bridge_channel_post_action_data post_it,
+static int payload_helper_playfile(ast_bridge_channel_post_action_data post_it,
 	struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
 {
 	struct bridge_playfile *payload;
@@ -988,18 +994,18 @@
 		strcpy(&payload->playfile[payload->moh_offset], moh_class);/* Safe */
 	}
 
-	post_it(bridge_channel, AST_BRIDGE_ACTION_PLAY_FILE, payload, len_payload);
-}
-
-void ast_bridge_channel_write_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
-{
-	payload_helper_playfile(ast_bridge_channel_write_action_data,
+	return post_it(bridge_channel, AST_BRIDGE_ACTION_PLAY_FILE, payload, len_payload);
+}
+
+int ast_bridge_channel_write_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
+{
+	return payload_helper_playfile(ast_bridge_channel_write_action_data,
 		bridge_channel, custom_play, playfile, moh_class);
 }
 
-void ast_bridge_channel_queue_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
-{
-	payload_helper_playfile(ast_bridge_channel_queue_action_data,
+int ast_bridge_channel_queue_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
+{
+	return payload_helper_playfile(ast_bridge_channel_queue_action_data,
 		bridge_channel, custom_play, playfile, moh_class);
 }
 
@@ -1029,7 +1035,7 @@
 	data->callback(bridge_channel, data->payload_exists ? data->payload : NULL, data->payload_size);
 }
 
-static void payload_helper_cb(ast_bridge_channel_post_action_data post_it,
+static int payload_helper_cb(ast_bridge_channel_post_action_data post_it,
 	struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
 {
 	struct bridge_custom_callback *cb_data;
@@ -1038,7 +1044,7 @@
 	/* Sanity check. */
 	if (!callback) {
 		ast_assert(0);
-		return;
+		return -1;
 	}
 
 	/* Fill in custom callback frame data. */
@@ -1050,18 +1056,18 @@
 		memcpy(cb_data->payload, payload, payload_size);/* Safe */
 	}
 
-	post_it(bridge_channel, AST_BRIDGE_ACTION_CALLBACK, cb_data, len_data);
-}
-
-void ast_bridge_channel_write_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
-{
-	payload_helper_cb(ast_bridge_channel_write_action_data,
+	return post_it(bridge_channel, AST_BRIDGE_ACTION_CALLBACK, cb_data, len_data);
+}
+
+int ast_bridge_channel_write_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
+{
+	return payload_helper_cb(ast_bridge_channel_write_action_data,
 		bridge_channel, callback, payload, payload_size);
 }
 
-void ast_bridge_channel_queue_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
-{
-	payload_helper_cb(ast_bridge_channel_queue_action_data,
+int ast_bridge_channel_queue_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
+{
+	return payload_helper_cb(ast_bridge_channel_queue_action_data,
 		bridge_channel, callback, payload, payload_size);
 }
 
@@ -1079,7 +1085,7 @@
 		payload->app_data_offset ? &payload->parkee_uuid[payload->app_data_offset] : NULL);
 }
 
-static void payload_helper_park(ast_bridge_channel_post_action_data post_it,
+static int payload_helper_park(ast_bridge_channel_post_action_data post_it,
 	struct ast_bridge_channel *bridge_channel,
 	const char *parkee_uuid,
 	const char *parker_uuid,
@@ -1100,12 +1106,12 @@
 		strcpy(&payload->parkee_uuid[payload->app_data_offset], app_data);
 	}
 
-	post_it(bridge_channel, AST_BRIDGE_ACTION_PARK, payload, len_payload);
-}
-
-void ast_bridge_channel_write_park(struct ast_bridge_channel *bridge_channel, const char *parkee_uuid, const char *parker_uuid, const char *app_data)
-{
-	payload_helper_park(ast_bridge_channel_write_action_data,
+	return post_it(bridge_channel, AST_BRIDGE_ACTION_PARK, payload, len_payload);
+}
+
+int ast_bridge_channel_write_park(struct ast_bridge_channel *bridge_channel, const char *parkee_uuid, const char *parker_uuid, const char *app_data)
+{
+	return payload_helper_park(ast_bridge_channel_write_action_data,
 		bridge_channel, parkee_uuid, parker_uuid, app_data);
 }
 
@@ -2349,9 +2355,9 @@
 	ast_heap_unlock(bridge_channel->features->interval_hooks);
 }
 
-static void bridge_channel_write_dtmf_stream(struct ast_bridge_channel *bridge_channel, const char *dtmf)
-{
-	ast_bridge_channel_write_action_data(bridge_channel,
+static int bridge_channel_write_dtmf_stream(struct ast_bridge_channel *bridge_channel, const char *dtmf)
+{
+	return ast_bridge_channel_write_action_data(bridge_channel,
 		AST_BRIDGE_ACTION_DTMF_STREAM, dtmf, strlen(dtmf) + 1);
 }
 
@@ -5833,8 +5839,9 @@
  * \param exten The destination extension for the transferee
  * \param context The destination context for the transferee
  * \param hook Frame hook to attach to transferee
- * \retval 0 Successfully queued the action
- * \retval non-zero Failed to queue the action
+ *
+ * \retval 0 on success.
+ * \retval -1 on error.
  */
 static int bridge_channel_queue_blind_transfer(struct ast_channel *transferee,
 		const char *exten, const char *context,
@@ -5858,11 +5865,8 @@
 	ast_copy_string(blind_data.exten, exten, sizeof(blind_data.exten));
 	ast_copy_string(blind_data.context, context, sizeof(blind_data.context));
 
-/* BUGBUG Why doesn't this function return success/failure? */
-	ast_bridge_channel_queue_action_data(transferee_bridge_channel,
-			AST_BRIDGE_ACTION_BLIND_TRANSFER, &blind_data, sizeof(blind_data));
-
-	return 0;
+	return ast_bridge_channel_queue_action_data(transferee_bridge_channel,
+		AST_BRIDGE_ACTION_BLIND_TRANSFER, &blind_data, sizeof(blind_data));
 }
 
 static int bridge_channel_queue_attended_transfer(struct ast_channel *transferee,
@@ -5882,11 +5886,9 @@
 	ast_copy_string(unbridged_chan_name, ast_channel_name(unbridged_chan),
 		sizeof(unbridged_chan_name));
 
-	ast_bridge_channel_queue_action_data(transferee_bridge_channel,
+	return ast_bridge_channel_queue_action_data(transferee_bridge_channel,
 		AST_BRIDGE_ACTION_ATTENDED_TRANSFER, unbridged_chan_name,
 		sizeof(unbridged_chan_name));
-
-	return 0;
 }
 
 enum try_parking_result {

Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=392435&r1=392434&r2=392435
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Fri Jun 21 12:48:14 2013
@@ -3308,10 +3308,11 @@
 		run_data->moh_offset ? &run_data->app_name[run_data->moh_offset] : NULL);
 }
 
-static void dynamic_dtmf_hook_run_callback(struct ast_bridge_channel *bridge_channel,
+static int dynamic_dtmf_hook_run_callback(struct ast_bridge_channel *bridge_channel,
 	ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size)
 {
 	callback(bridge_channel, payload, payload_size);
+	return 0;
 }
 
 struct dynamic_dtmf_hook_data {
@@ -3342,7 +3343,7 @@
 static int dynamic_dtmf_hook_trip(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *hook_pvt)
 {
 	struct dynamic_dtmf_hook_data *pvt = hook_pvt;
-	void (*run_it)(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size);
+	int (*run_it)(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size);
 	struct dynamic_dtmf_hook_run *run_data;
 	const char *activated_name;
 	size_t len_name;




More information about the asterisk-commits mailing list