summaryrefslogtreecommitdiff
path: root/apps/app_readexten.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2012-02-13 17:27:06 +0000
committerTerry Wilson <twilson@digium.com>2012-02-13 17:27:06 +0000
commit34c55e8e7c87a92181fca3e0101dc456eef2475b (patch)
treead27fca98a7df582348e14b0aaa42f0065cdef99 /apps/app_readexten.c
parenta955a4770fcdd7874e1337e7df694bcd293e020e (diff)
Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_readexten.c')
-rw-r--r--apps/app_readexten.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/app_readexten.c b/apps/app_readexten.c
index dc2e482c3..5e6f3ed44 100644
--- a/apps/app_readexten.c
+++ b/apps/app_readexten.c
@@ -129,7 +129,7 @@ static int readexten_exec(struct ast_channel *chan, const char *data)
AST_APP_ARG(options);
AST_APP_ARG(timeout);
);
-
+
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "ReadExten requires at least one argument\n");
pbx_builtin_setvar_helper(chan, "READEXTENSTATUS", "ERROR");
@@ -145,14 +145,17 @@ static int readexten_exec(struct ast_channel *chan, const char *data)
return 0;
}
- if (ast_strlen_zero(arglist.filename))
+ if (ast_strlen_zero(arglist.filename)) {
arglist.filename = NULL;
+ }
- if (ast_strlen_zero(arglist.context))
- arglist.context = chan->context;
+ if (ast_strlen_zero(arglist.context)) {
+ arglist.context = ast_strdupa(ast_channel_context(chan));
+ }
- if (!ast_strlen_zero(arglist.options))
+ if (!ast_strlen_zero(arglist.options)) {
ast_app_parse_options(readexten_app_options, &flags, NULL, arglist.options);
+ }
if (!ast_strlen_zero(arglist.timeout)) {
timeout = atoi(arglist.timeout);