[asterisk-commits] file: branch file/bridging r79082 - /team/file/bridging/apps/app_bridgetest.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 10 13:55:40 CDT 2007


Author: file
Date: Fri Aug 10 13:55:39 2007
New Revision: 79082

URL: http://svn.digium.com/view/asterisk?view=rev&rev=79082
Log:
Return BridgeTest application to a working/sane state. Simple dial channel, bridge, end.

Modified:
    team/file/bridging/apps/app_bridgetest.c

Modified: team/file/bridging/apps/app_bridgetest.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/apps/app_bridgetest.c?view=diff&rev=79082&r1=79081&r2=79082
==============================================================================
--- team/file/bridging/apps/app_bridgetest.c (original)
+++ team/file/bridging/apps/app_bridgetest.c Fri Aug 10 13:55:39 2007
@@ -52,7 +52,6 @@
 
 static int bridge_test_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
 	struct ast_dial *dial = NULL;
 	struct ast_bridge *bridge = NULL;
 	char *tech = NULL, *resource = NULL;
@@ -62,24 +61,19 @@
 		return -1;
 	}
 
-	u = ast_module_user_add(chan);
-
 	/* Create local duplicate for manipulation */
 	tech = ast_strdupa(data);
 
 	/* Split up technology and resource */
 	if (!(resource = strchr(tech, '/'))) {
 		ast_log(LOG_WARNING, "%s requires an argument (Tech/Resource)\n", app);
-		ast_module_user_remove(u);
 		return -1;
 	}
 	*resource++ = '\0';
 
 	/* Okay... create a new dialing structure */
-	if (!(dial = ast_dial_create())) {
-		ast_module_user_remove(u);
+	if (!(dial = ast_dial_create()))
 		return -1;
-	}
 
 	ast_dial_append(dial, tech, resource);
 
@@ -87,7 +81,6 @@
 	if (ast_dial_run(dial, chan, 0) != AST_DIAL_RESULT_ANSWERED || !ast_dial_answered(dial)) {
 		ast_log(LOG_WARNING, "Failed to call %s\n", (char*)data);
 		ast_dial_destroy(dial);
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -95,25 +88,15 @@
 	if (!(bridge = ast_bridge_new(AST_BRIDGE_CAPABILITY_1TO1MIX, AST_BRIDGE_FLAG_DISSOLVE))) {
 		ast_log(LOG_WARNING, "Failed to create bridge ;(\n");
 		ast_dial_destroy(dial);
-		ast_module_user_remove(u);
 		return -1;
 	}
 
 	/* Put the dialed channel into the bridge via async */
 	ast_bridge_impart(bridge, ast_dial_answered(dial));
 
-	sleep(1);
-
-	ast_bridge_depart(bridge, ast_dial_answered(dial));
-
-	ast_hangup(ast_dial_answered(dial));
+	ast_bridge_join(bridge, chan);
 	
 	ast_bridge_destroy(bridge);
-
-	/* Put our channel into the bridge via blocking */
-//	ast_bridge_join(bridge, chan);
-
-	ast_module_user_remove(u);
 
 	return 0;
 }




More information about the asterisk-commits mailing list