mirror of
https://github.com/asterisk/asterisk.git
synced 2026-01-07 02:21:24 +00:00
Add atxfer fix (bug #3592)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
12
app.c
12
app.c
@@ -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 @@ int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect,
|
||||
} 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);
|
||||
|
||||
Reference in New Issue
Block a user