mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Use digit/response timeouts
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
6
app.c
6
app.c
@@ -21,6 +21,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <asterisk/channel.h>
|
#include <asterisk/channel.h>
|
||||||
|
#include <asterisk/pbx.h>
|
||||||
#include <asterisk/file.h>
|
#include <asterisk/file.h>
|
||||||
#include <asterisk/app.h>
|
#include <asterisk/app.h>
|
||||||
#include <asterisk/dsp.h>
|
#include <asterisk/dsp.h>
|
||||||
@@ -40,8 +41,9 @@ int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, in
|
|||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
fto = 6000;
|
fto = c->pbx ? c->pbx->rtimeout * 1000 : 6000;
|
||||||
to = 2000;
|
to = c->pbx ? c->pbx->dtimeout * 1000 : 2000;
|
||||||
|
|
||||||
if (timeout > 0) fto = to = timeout;
|
if (timeout > 0) fto = to = timeout;
|
||||||
if (timeout < 0) fto = to = 1000000000;
|
if (timeout < 0) fto = to = 1000000000;
|
||||||
res = ast_readstring(c, s, maxlen, to, fto, "#");
|
res = ast_readstring(c, s, maxlen, to, fto, "#");
|
||||||
|
@@ -68,6 +68,13 @@ struct ast_switch {
|
|||||||
int (*matchmore)(struct ast_channel *chan, char *context, char *exten, int priority, char *callerid, char *data);
|
int (*matchmore)(struct ast_channel *chan, char *context, char *exten, int priority, char *callerid, char *data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ast_pbx {
|
||||||
|
int dtimeout; /* Timeout between digits (seconds) */
|
||||||
|
int rtimeout; /* Timeout for response
|
||||||
|
(seconds) */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//! Register an alternative switch
|
//! Register an alternative switch
|
||||||
/*!
|
/*!
|
||||||
* \param sw switch to register
|
* \param sw switch to register
|
||||||
|
5
pbx.c
5
pbx.c
@@ -50,11 +50,6 @@
|
|||||||
|
|
||||||
struct ast_context;
|
struct ast_context;
|
||||||
|
|
||||||
struct ast_pbx {
|
|
||||||
int dtimeout; /* Timeout between digits (seconds) */
|
|
||||||
int rtimeout; /* Timeout for response (seconds) */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* An extension */
|
/* An extension */
|
||||||
struct ast_exten {
|
struct ast_exten {
|
||||||
char exten[AST_MAX_EXTENSION];
|
char exten[AST_MAX_EXTENSION];
|
||||||
|
Reference in New Issue
Block a user