[asterisk-commits] mmichelson: branch mmichelson/forward-loop r87741 - /team/mmichelson/forward-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 30 18:09:42 CDT 2007


Author: mmichelson
Date: Tue Oct 30 18:09:42 2007
New Revision: 87741

URL: http://svn.digium.com/view/asterisk?view=rev&rev=87741
Log:
To prevent subsequent priorities from being attempted after a Dial that attempts
to only ring already dialed interfaces, we need to return -1.

(related to issue #11024, reported by ruffle)


Modified:
    team/mmichelson/forward-loop/apps/app_dial.c

Modified: team/mmichelson/forward-loop/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/forward-loop/apps/app_dial.c?view=diff&rev=87741&r1=87740&r2=87741
==============================================================================
--- team/mmichelson/forward-loop/apps/app_dial.c (original)
+++ team/mmichelson/forward-loop/apps/app_dial.c Tue Oct 30 18:09:42 2007
@@ -819,6 +819,7 @@
 	struct ast_flags opts = { 0, };
 	char *opt_args[OPT_ARG_ARRAY_SIZE];
 	struct ast_datastore *datastore;
+	int fulldial = 0, num_dialed = 0;
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
@@ -1085,6 +1086,7 @@
 		int dialed = 0;
 		struct ast_dialed_interface *di;
 		AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces;
+		num_dialed++;
 		if (!number) {
 			ast_log(LOG_WARNING, "Dial argument takes format (technology/[device:]number1)\n");
 			goto out;
@@ -1140,6 +1142,7 @@
 		} else {
 			AST_LIST_UNLOCK(dialed_interfaces);
 			ast_log(LOG_WARNING, "Skipping dialing interface '%s' again since it has already been dialed\n", di->interface);
+			fulldial++;
 			free(tmp);
 			continue;
 		}
@@ -1261,6 +1264,10 @@
 
 	if (!outgoing) {
 		strcpy(status, "CHANUNAVAIL");
+		if(fulldial == num_dialed) {
+			res = -1;
+			goto out;
+		}
 	} else {
 		/* Our status will at least be NOANSWER */
 		strcpy(status, "NOANSWER");




More information about the asterisk-commits mailing list