aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_osplookup.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-11 03:13:25 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-11 03:13:25 +0000
commit7acc893dad48c008eaced05bfbedb0d17735bc47 (patch)
tree628f68f20c4335fa880242de568f7cfcfd2856c2 /apps/app_osplookup.c
parent3d8745a038830e8689bfd3c9849a5f1c39e37ae8 (diff)
fix compiler warnings
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9468 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_osplookup.c')
-rw-r--r--apps/app_osplookup.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index e94a15ef5..e9b916c6d 100644
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -184,6 +184,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
int res=0;
struct localuser *u;
char *temp;
+ const char *val;
int cause;
struct ast_osp_result result;
int priority_jump = 0;
@@ -212,11 +213,11 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
}
cause = str2cause(args.cause);
- temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+ val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
result.handle = -1;
- if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
- temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
- if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
+ if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
+ val = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
+ if (ast_strlen_zero(val) || (sscanf(val, "%d", &result.numresults) != 1)) {
result.numresults = 0;
}
if ((res = ast_osp_next(&result, cause)) > 0) {
@@ -255,6 +256,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
int res=0;
struct localuser *u;
char *temp;
+ const char *val;
int cause;
time_t start=0, duration=0;
struct ast_osp_result result;
@@ -293,9 +295,9 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
cause = str2cause(args.status);
- temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+ val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
result.handle = -1;
- if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
+ if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
if (!ast_osp_terminate(result.handle, cause, start, duration)) {
pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "SUCCESS");