[Asterisk-cvs] asterisk app.c,1.39,1.40 sounds.txt,1.43,1.44
markster at lists.digium.com
markster at lists.digium.com
Wed Jan 5 13:51:50 CST 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv19699
Modified Files:
app.c sounds.txt
Log Message:
Merge Tony's attended # transfer with changes (bug #3241)
Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- app.c 4 Jan 2005 20:54:36 -0000 1.39
+++ app.c 5 Jan 2005 19:56:47 -0000 1.40
@@ -30,11 +30,56 @@
#include <asterisk/options.h>
#include <asterisk/utils.h>
#include <asterisk/lock.h>
+#include <asterisk/indications.h>
#include "asterisk.h"
#include "astconf.h"
#define MAX_OTHER_FORMATS 10
+
+int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout)
+{
+ struct tone_zone_sound *ts;
+ int res=0, x=0;
+
+ if(!timeout && chan->pbx)
+ timeout = chan->pbx->dtimeout;
+ else if(!timeout)
+ timeout = 5;
+
+ ts = ast_get_indication_tone(chan->zone,"dial");
+ if (ts && ts->data[0]) {
+ res = ast_playtones_start(chan, 0, ts->data, 0);
+ } else
+ ast_log(LOG_NOTICE,"Huh....? no dial for indications?\n");
+
+ memset(collect, 0, size);
+ for (x=0; strlen(collect) < size; ) {
+ res = ast_waitfordigit(chan, timeout);
+ if (!ast_ignore_pattern(context, collect))
+ ast_playtones_stop(chan);
+ if (res < 1)
+ break;
+ collect[x++] = res;
+ if (!ast_matchmore_extension(chan, context, collect, 1, chan->cid.cid_num)) {
+ if (collect[x-1] == '#') {
+ /* Not a valid extension, ending in #, assume the # was to finish dialing */
+ collect[x-1] = '\0';
+ }
+ break;
+ }
+ }
+ if (res >= 0) {
+ if (ast_exists_extension(chan, context, collect, 1, chan->cid.cid_num))
+ res = 1;
+ else
+ res = 0;
+ }
+ return res;
+}
+
+
+
/* set timeout to 0 for "standard" timeouts. Set timeout to -1 for
"ludicrous time" (essentially never times out) */
int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout)
Index: sounds.txt
===================================================================
RCS file: /usr/cvsroot/asterisk/sounds.txt,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- sounds.txt 3 Jan 2005 02:01:58 -0000 1.43
+++ sounds.txt 5 Jan 2005 19:56:47 -0000 1.44
@@ -24,6 +24,8 @@
%beep.gsm%(this is a simple beep tone)
+%beeperr.gsm%(this is an error beep tone)
+
%conf-getconfno.gsm%Please enter your conference number followed by the pound key.
%conf-getchannel.gsm%Please enter your channel number followed by the pound key.
More information about the svn-commits
mailing list