[asterisk-commits] rmudgett: branch rmudgett/bridge_phase r380140 - in /team/rmudgett/bridge_pha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 25 16:35:04 CST 2013


Author: rmudgett
Date: Fri Jan 25 16:34:57 2013
New Revision: 380140

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380140
Log:
Save off coding issue comments.

Modified:
    team/rmudgett/bridge_phase/apps/app_dial.c
    team/rmudgett/bridge_phase/apps/app_queue.c
    team/rmudgett/bridge_phase/bridges/bridge_builtin_features.c
    team/rmudgett/bridge_phase/bridges/bridge_multiplexed.c
    team/rmudgett/bridge_phase/include/asterisk/bridging.h
    team/rmudgett/bridge_phase/include/asterisk/bridging_features.h
    team/rmudgett/bridge_phase/main/bridging.c
    team/rmudgett/bridge_phase/main/channel.c
    team/rmudgett/bridge_phase/main/channel_internal_api.c
    team/rmudgett/bridge_phase/main/features.c

Modified: team/rmudgett/bridge_phase/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/apps/app_dial.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/apps/app_dial.c (original)
+++ team/rmudgett/bridge_phase/apps/app_dial.c Fri Jan 25 16:34:57 2013
@@ -3044,6 +3044,7 @@
 
 				ast_channel_setoption(chan, AST_OPTION_OPRMODE, &oprmode, sizeof(oprmode), 0);
 			}
+/* BUGBUG need to determine where peer is going to execute on bridge completion. */
 			res = ast_bridge_call(chan, peer, &config);
 		}
 

Modified: team/rmudgett/bridge_phase/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/apps/app_queue.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/apps/app_queue.c (original)
+++ team/rmudgett/bridge_phase/apps/app_queue.c Fri Jan 25 16:34:57 2013
@@ -5890,6 +5890,7 @@
 
 		time(&callstart);
 		transfer_ds = setup_transfer_datastore(qe, member, callstart, callcompletedinsl);
+/* BUGBUG need to determine where peer is going to execute on bridge completion. */
 		bridge = ast_bridge_call(qe->chan, peer, &bridge_config);
 
 		/* If the queue member did an attended transfer, then the TRANSFER already was logged in the queue_log

Modified: team/rmudgett/bridge_phase/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/bridges/bridge_builtin_features.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/bridges/bridge_builtin_features.c (original)
+++ team/rmudgett/bridge_phase/bridges/bridge_builtin_features.c Fri Jan 25 16:34:57 2013
@@ -72,6 +72,7 @@
 	}
 
 	/* Drop to dialtone so they can enter the extension they want to transfer to */
+/* BUGBUG the timeout needs to be configurable from features.conf. */
 	res = ast_app_dtget(chan, context, exten, exten_len, exten_len - 1, 3000);
 	if (res < 0) {
 		/* Hangup or error */
@@ -101,6 +102,11 @@
 	int cause;
 
 	/* Fill the variable with the extension and context we want to call */
+/* BUGBUG if local channel optimization is using masquerades then this needs /n so the destination keeps its DTMF features.
+ * Or use /n to keep the peer channel stable until after the atxfer completes and remove the /n from the channel.
+ *
+ * Local channel optimization currently is disabled because I don't set the chan->bridge pointers.
+ */
 	snprintf(destination, sizeof(destination), "%s@%s", exten, context);
 
 	/* Now we request that chan_local prepare to call the destination */
@@ -165,6 +171,7 @@
 	struct ast_bridge_features_blind_transfer *blind_transfer = hook_pvt;
 	const char *context;
 
+/* BUGBUG the peer needs to be put on hold for the transfer. */
 	ast_channel_lock(bridge_channel->chan);
 	context = ast_strdupa(get_transfer_context(bridge_channel->chan,
 		blind_transfer ? blind_transfer->context : NULL));
@@ -174,6 +181,10 @@
 	if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), context)) {
 		return 0;
 	}
+
+/* BUGBUG just need to ast_async_goto the peer so this bridge will go away and not accumulate local channels and bridges if the destination is to an application. */
+/* ast_async_goto actually is a blind transfer. */
+/* BUGBUG Use the bridge count to determine if can do DTMF transfer features.  If count is not 2 then don't allow it. */
 
 	/* Get a channel that is the destination we wish to call */
 	chan = dial_transfer(bridge_channel->chan, exten, context);
@@ -214,6 +225,7 @@
 	struct ast_bridge_features_attended_transfer *attended_transfer = hook_pvt;
 	const char *context;
 
+/* BUGBUG the peer needs to be put on hold for the transfer. */
 	ast_channel_lock(bridge_channel->chan);
 	context = ast_strdupa(get_transfer_context(bridge_channel->chan,
 		attended_transfer ? attended_transfer->context : NULL));
@@ -230,17 +242,21 @@
 		ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
 		return 0;
 	}
+
+/* BUGBUG we need to wait for Party C (peer) to answer before dumping into the transient B-C bridge. */
 
 	/* Create a bridge to use to talk to the person we are calling */
 	attended_bridge = ast_bridge_new(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE,
 		AST_BRIDGE_FLAG_DISSOLVE_HANGUP);
 	if (!attended_bridge) {
 		ast_hangup(peer);
+/* BUGBUG beeperr needs to be configurable from features.conf */
 		ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
 		return 0;
 	}
 
 	/* This is how this is going down, we are imparting the channel we called above into this bridge first */
+/* BUGBUG we should impart the peer as an independent and move it to the original bridge. */
 	if (ast_bridge_impart(attended_bridge, peer, NULL, NULL, 0)) {
 		ast_bridge_destroy(attended_bridge);
 		ast_hangup(peer);
@@ -252,6 +268,7 @@
 	ast_bridge_features_init(&caller_features);
 /* BUGBUG bridging API features does not support features.conf featuremap */
 /* BUGBUG bridging API features does not support the features.conf atxfer bounce between C & B channels */
+/* BUGBUG The atxfer feature hooks need to be passed a pointer to where to mark which hook happened.  Rather than relying on the bridge join return value. */
 	ast_bridge_features_enable(&caller_features, AST_BRIDGE_BUILTIN_HANGUP,
 		attended_transfer && !ast_strlen_zero(attended_transfer->complete)
 			? attended_transfer->complete : "*1",

Modified: team/rmudgett/bridge_phase/bridges/bridge_multiplexed.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/bridges/bridge_multiplexed.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/bridges/bridge_multiplexed.c (original)
+++ team/rmudgett/bridge_phase/bridges/bridge_multiplexed.c Fri Jan 25 16:34:57 2013
@@ -59,8 +59,10 @@
 	pthread_t thread;
 	/*! Pipe used to wake up the multiplexed thread */
 	int pipe[2];
+/* BUGBUG this is only large enough for the supported number of bridge channel pairs.  It is not large enough to handle transient channels being swapped. */
 	/*! Channels in this thread */
 	struct ast_channel *chans[MULTIPLEXED_MAX_CHANNELS];
+/* BUGBUG this should be changed to the number of 1-1 bridges muxed instead of the number of channels. */
 	/*! Number of channels in this thread */
 	unsigned int count;
 	/*! Bit used to indicate that the thread is waiting on channels */

Modified: team/rmudgett/bridge_phase/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/include/asterisk/bridging.h?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/include/asterisk/bridging.h (original)
+++ team/rmudgett/bridge_phase/include/asterisk/bridging.h Fri Jan 25 16:34:57 2013
@@ -93,6 +93,7 @@
 	AST_BRIDGE_CHANNEL_STATE_HANGUP,
 	/*! Bridged channel was ast_bridge_depart() from the bridge without being hung up */
 	AST_BRIDGE_CHANNEL_STATE_DEPART,
+/* BUGBUG the following states should be removed and replaced with bridge queued actions. */
 	/*! Bridged channel is executing a feature hook */
 	AST_BRIDGE_CHANNEL_STATE_FEATURE,
 	/*! Bridged channel is sending a DTMF stream out */

Modified: team/rmudgett/bridge_phase/include/asterisk/bridging_features.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/include/asterisk/bridging_features.h?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/include/asterisk/bridging_features.h (original)
+++ team/rmudgett/bridge_phase/include/asterisk/bridging_features.h Fri Jan 25 16:34:57 2013
@@ -61,6 +61,7 @@
 	 * parking slot to which it was parked.
 	 */
 	AST_BRIDGE_BUILTIN_PARKCALL,
+/* BUGBUG does Monitor and/or MixMonitor require a two party bridge?  MixMonitor is used by ConfBridge so maybe it doesn't. */
 	/*!
 	 * DTMF one-touch-record toggle using Monitor app.
 	 *
@@ -157,6 +158,7 @@
 	unsigned int usable:1;
 	/*! Bit to indicate whether the channel/bridge is muted or not */
 	unsigned int mute:1;
+/* BUGBUG why is dtmf_passthrough not a feature_flags bit? */
 	/*! Bit to indicate whether DTMF should be passed into the bridge tech or not.  */
 	unsigned int dtmf_passthrough:1;
 
@@ -166,6 +168,7 @@
  * \brief Structure that contains configuration information for the blind transfer built in feature
  */
 struct ast_bridge_features_blind_transfer {
+/* BUGBUG the context should be figured out based upon TRANSFER_CONTEXT channel variable of A/B or current context of A/B. More appropriate for when channel moved to other bridges. */
 	/*! Context to use for transfers */
 	char context[AST_MAX_CONTEXT];
 };
@@ -174,6 +177,7 @@
  * \brief Structure that contains configuration information for the attended transfer built in feature
  */
 struct ast_bridge_features_attended_transfer {
+/* BUGBUG the context should be figured out based upon TRANSFER_CONTEXT channel variable of A/B or current context of A/B. More appropriate for when channel moved to other bridges. */
 	/*! Context to use for transfers */
 	char context[AST_MAX_CONTEXT];
 	/*! DTMF string used to turn the transfer into a three way conference */

Modified: team/rmudgett/bridge_phase/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/bridging.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/main/bridging.c (original)
+++ team/rmudgett/bridge_phase/main/bridging.c Fri Jan 25 16:34:57 2013
@@ -129,6 +129,9 @@
 /*! \note This function assumes the bridge_channel is locked. */
 static void ast_bridge_change_state_nolock(struct ast_bridge_channel *bridge_channel, enum ast_bridge_channel_state new_state)
 {
+	ast_debug(1, "BUGBUG Setting bridge channel %p state from:%d to:%d\n",
+		bridge_channel, bridge_channel->state, new_state);
+
 	/* Change the state on the bridge channel */
 	bridge_channel->state = new_state;
 
@@ -313,6 +316,7 @@
 		return frame;
 	}
 
+/* BUGBUG the feature hook matching needs to be done here.  Any matching feature hook needs to be queued onto the bridge_channel.  Also the feature hook digit timeout needs to be handled. */
 	/* See if this DTMF matches the beginnings of any feature hooks, if so we switch to the feature state to either execute the feature or collect more DTMF */
 	AST_LIST_TRAVERSE(&features->hooks, hook, entry) {
 		if (hook->dtmf[0] == frame->subclass.integer) {
@@ -660,6 +664,7 @@
 	}
 
 	if (bridge->thread != AST_PTHREADT_NULL) {
+/* BUGBUG this needs to be moved to the last bridge_channel removal code if the bridge flag AST_BRIDGE_FLAG_DISSOLVE_EMPTY. */
 		bridge_stop(bridge);
 	}
 
@@ -983,6 +988,7 @@
 			break;
 		}
 
+/* BUGBUG need to record the duration of DTMF digits so when the string is played back, they are reproduced. */
 		/* Add the above DTMF into the DTMF string so we can do our matching */
 		dtmf[dtmf_len++] = res;
 
@@ -1345,6 +1351,9 @@
 
 	ao2_ref(bridge_channel, -1);
 
+/* BUGBUG need to run a PBX on this channel or hangup. */
+/* BUGBUG need to start the PBX at the appropriate location. */
+/* BUGBUG need to determine where to execute in the dialplan. */
 	switch (state) {
 	case AST_BRIDGE_CHANNEL_STATE_DEPART:
 		ast_log(LOG_ERROR, "Independently imparted channel was departed: %s\n",
@@ -1563,6 +1572,7 @@
 int ast_bridge_suspend(struct ast_bridge *bridge, struct ast_channel *chan)
 {
 	struct ast_bridge_channel *bridge_channel;
+/* BUGBUG the case of a disolved bridge while channel is suspended is not handled. */
 
 	ao2_lock(bridge);
 
@@ -1581,6 +1591,7 @@
 int ast_bridge_unsuspend(struct ast_bridge *bridge, struct ast_channel *chan)
 {
 	struct ast_bridge_channel *bridge_channel;
+/* BUGBUG the case of a disolved bridge while channel is suspended is not handled. */
 
 	ao2_lock(bridge);
 
@@ -1672,6 +1683,7 @@
 
 int ast_bridge_features_enable(struct ast_bridge_features *features, enum ast_bridge_builtin_feature feature, const char *dtmf, void *config)
 {
+/* BUGBUG a destructor for config is needed if it is going to be non-NULL */
 	if (ARRAY_LEN(builtin_features_handlers) <= feature
 		|| !builtin_features_handlers[feature]) {
 		return -1;

Modified: team/rmudgett/bridge_phase/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/channel.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/main/channel.c (original)
+++ team/rmudgett/bridge_phase/main/channel.c Fri Jan 25 16:34:57 2013
@@ -7853,6 +7853,7 @@
 	}
 }
 
+/* BUGBUG ast_channel_bridge() and anything that only it calls will be removed. */
 /*! \brief Bridge two channels together */
 enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1,
 					  struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc)

Modified: team/rmudgett/bridge_phase/main/channel_internal_api.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/channel_internal_api.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/main/channel_internal_api.c (original)
+++ team/rmudgett/bridge_phase/main/channel_internal_api.c Fri Jan 25 16:34:57 2013
@@ -1034,6 +1034,15 @@
 }
 
 /* Evil softhangup accessors */
+#if defined(WHY_HUNGUP)
+static void BUGBUG_softhangup_check(struct ast_channel *chan)
+{
+	if (chan->softhangup && !strcmp(chan->name, "DAHDI/3-1")) {
+		char *crash = NULL;
+		*crash = '\0';
+	}
+}
+#endif	/* defined(WHY_HUNGUP) */
 int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
 {
 	return chan->softhangup;
@@ -1041,10 +1050,16 @@
 void ast_channel_softhangup_internal_flag_set(struct ast_channel *chan, int value)
 {
 	chan->softhangup = value;
+#if defined(WHY_HUNGUP)
+	BUGBUG_softhangup_check(chan);
+#endif	/* defined(WHY_HUNGUP) */
 }
 void ast_channel_softhangup_internal_flag_add(struct ast_channel *chan, int value)
 {
 	chan->softhangup |= value;
+#if defined(WHY_HUNGUP)
+	BUGBUG_softhangup_check(chan);
+#endif	/* defined(WHY_HUNGUP) */
 }
 void ast_channel_softhangup_internal_flag_clear(struct ast_channel *chan, int value)
 {

Modified: team/rmudgett/bridge_phase/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/features.c?view=diff&rev=380140&r1=380139&r2=380140
==============================================================================
--- team/rmudgett/bridge_phase/main/features.c (original)
+++ team/rmudgett/bridge_phase/main/features.c Fri Jan 25 16:34:57 2013
@@ -8250,6 +8250,7 @@
 	 * continue in the dialplan.
 	 */
 	ast_set_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_HANGUP_DONT);
+/* BUGBUG need to determine where peer is going to execute on bridge completion. */
 	ast_bridge_call(chan, final_dest_chan, &bconfig);
 
 	/* The bridge has ended, set BRIDGERESULT to SUCCESS. */




More information about the asterisk-commits mailing list