[Asterisk-cvs] asterisk pbx.c,1.109,1.110

markster at lists.digium.com markster at lists.digium.com
Tue Apr 6 00:14:05 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv23842

Modified Files:
	pbx.c 
Log Message:
Add "WaitExten" application


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- pbx.c	4 Apr 2004 21:30:24 -0000	1.109
+++ pbx.c	6 Apr 2004 04:14:19 -0000	1.110
@@ -156,6 +156,7 @@
 static int pbx_builtin_rtimeout(struct ast_channel *, void *);
 static int pbx_builtin_atimeout(struct ast_channel *, void *);
 static int pbx_builtin_wait(struct ast_channel *, void *);
+static int pbx_builtin_waitexten(struct ast_channel *, void *);
 static int pbx_builtin_setlanguage(struct ast_channel *, void *);
 static int pbx_builtin_resetcdr(struct ast_channel *, void *);
 static int pbx_builtin_setaccount(struct ast_channel *, void *);
@@ -340,6 +341,13 @@
 "Waits for some time", 
 "  Wait(seconds): Waits for a specified number of seconds, then returns 0.\n"
 "seconds can be passed with fractions of a second. (eg: 1.5 = 1.5 seconds)\n" },
+
+	{ "WaitExten", pbx_builtin_waitexten, 
+"Waits for some time", 
+"  Wait(seconds): Waits for the user to enter a new extension for the \n"
+"specified number of seconds, then returns 0.  Seconds can be passed with\n"
+"fractions of a second. (eg: 1.5 = 1.5 seconds)\n" },
+
 };
 
 /* Lock for the application list */
@@ -4305,6 +4313,17 @@
 	if (data && atof((char *)data)) {
 		ms = atof((char *)data) * 1000;
 		return ast_safe_sleep(chan, ms);
+	}
+	return 0;
+}
+
+static int pbx_builtin_waitexten(struct ast_channel *chan, void *data)
+{
+	int ms;
+	/* Wait for "n" seconds */
+	if (data && atof((char *)data)) {
+		ms = atof((char *)data) * 1000;
+		return ast_waitfordigit(chan, ms);
 	}
 	return 0;
 }




More information about the svn-commits mailing list