[Asterisk-cvs] asterisk app.c,1.47,1.48
markster at lists.digium.com
markster at lists.digium.com
Thu Feb 17 14:05:08 CST 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv27703
Modified Files:
app.c
Log Message:
Add atxfer fix (bug #3592)
Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- app.c 17 Feb 2005 14:57:36 -0000 1.47
+++ app.c 17 Feb 2005 20:04:10 -0000 1.48
@@ -37,11 +37,20 @@
#define MAX_OTHER_FORMATS 10
+/*
+This function presents a dialtone and reads an extension into 'collect'
+which must be a pointer to a **pre-initilized** array of char having a
+size of 'size' suitable for writing to. It will collect no more than the smaller
+of 'maxlen' or 'size' minus the original strlen() of collect digits.
+*/
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(maxlen > size)
+ maxlen = size;
+
if(!timeout && chan->pbx)
timeout = chan->pbx->dtimeout;
else if(!timeout)
@@ -53,8 +62,7 @@
} else
ast_log(LOG_NOTICE,"Huh....? no dial for indications?\n");
- memset(collect, 0, size);
- for (x=0; strlen(collect) < size; ) {
+ for (x = strlen(collect); strlen(collect) < maxlen; ) {
res = ast_waitfordigit(chan, timeout);
if (!ast_ignore_pattern(context, collect))
ast_playtones_stop(chan);
More information about the svn-commits
mailing list