[svn-commits] russell: branch russell/issue_5841 r61279 - /team/russell/issue_5841/res/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Apr 10 13:10:38 MST 2007


Author: russell
Date: Tue Apr 10 15:10:37 2007
New Revision: 61279

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61279
Log:
Allow partial channel names to match and let the calling channel continue in
the PBX even if the callee hung up in the bridge

Modified:
    team/russell/issue_5841/res/res_features.c

Modified: team/russell/issue_5841/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_5841/res/res_features.c?view=diff&rev=61279&r1=61278&r2=61279
==============================================================================
--- team/russell/issue_5841/res/res_features.c (original)
+++ team/russell/issue_5841/res/res_features.c Tue Apr 10 15:10:37 2007
@@ -2030,8 +2030,8 @@
 
 	/* make sure valid channels were specified */
 	if (!ast_strlen_zero(channela) && !ast_strlen_zero(channelb)) {
-		chana = ast_get_channel_by_name_locked(channela);
-		chanb = ast_get_channel_by_name_locked(channelb);
+		chana = ast_get_channel_by_name_prefix_locked(channela, strlen(channela));
+		chanb = ast_get_channel_by_name_prefix_locked(channelb, strlen(channelb));
 		if (chana)
 			ast_mutex_unlock(&chana->lock);
 		if (chanb)
@@ -2557,7 +2557,6 @@
 {
 	struct ast_module_user *u;
 	struct ast_channel *current_dest_chan, *final_dest_chan;
-	int bridge_res;
 	char *tmp_data  = NULL;
 	struct ast_flags opts = { 0, };
 	struct ast_bridge_config bconfig = { { 0, }, };
@@ -2596,8 +2595,10 @@
 	}
 
 	/* make sure we have a valid end point */
-	if (!(current_dest_chan = ast_get_channel_by_name_locked(args.dest_chan))) {
-		ast_log(LOG_WARNING, "Bridge failed because channel %s does not exists or we cannot get its lock\n", args.dest_chan);
+	if (!(current_dest_chan = ast_get_channel_by_name_prefix_locked(args.dest_chan, 
+		strlen(args.dest_chan)))) {
+		ast_log(LOG_WARNING, "Bridge failed because channel %s does not exists or we "
+			"cannot get its lock\n", args.dest_chan);
 		manager_event(EVENT_FLAG_CALL, "BridgeExec",
 					"Response: Failed\r\n"
 					"Reason: Cannot grab end point\r\n"
@@ -2655,7 +2656,7 @@
 	}
 	
 	/* do the bridge */
-	bridge_res = ast_bridge_call(chan, final_dest_chan, &bconfig);
+	ast_bridge_call(chan, final_dest_chan, &bconfig);
 
 	/* the bridge has ended, set BRIDGERESULT to SUCCESS. If the other channel has not been hung up, return it to the PBX */
 	pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "SUCCESS");
@@ -2671,7 +2672,6 @@
 			ast_hangup(final_dest_chan);
 		} else if (option_debug)
 			ast_log(LOG_DEBUG, "SUCCESS continuing PBX on chan %s\n", final_dest_chan->name);
-
 	} else {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "hangup chan %s since the other endpoint has hung up\n", final_dest_chan->name);
@@ -2680,7 +2680,7 @@
 
 	ast_module_user_remove(u);
 
-	return bridge_res;
+	return 0;
 }
 
 static int reload(void)



More information about the svn-commits mailing list