aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-21 13:40:34 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-21 13:40:34 +0000
commitbe9fab546a81788f48941f7ddc2273465ea206cf (patch)
tree29b27de7b0395c04c17e76c075d974438f604bc4
parent0af4f03271ce1f9c4214766b7331670e97022a0f (diff)
issue #5789
git-svn-id: http://svn.digium.com/svn/asterisk/branches/v1-2@7170 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xChangeLog2
-rwxr-xr-xapps/app_osplookup.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ce75bc3ec..d563e5bcb 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2005-11-21 Russell Bryant <russell@digium.com>
+ * apps/app_osplookup.c: Properly populate the number of results. (issue #5789)
+
* Makefile: Don't hard-code that poll functionality needs to be provided on Darwin.
* apps/Makefile: Fix incorrect portion of the patch to fix 'make install' on Solaris.
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index d4f2c5352..2fe2d016a 100755
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -217,6 +217,10 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
temp = 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)) {
+ result.numresults = 0;
+ }
if ((res = ast_osp_next(&result, cause)) > 0) {
char tmp[80];
snprintf(tmp, sizeof(tmp), "%d", result.handle);