]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
issue #5789
authorRussell Bryant <russell@russellbryant.com>
Mon, 21 Nov 2005 13:41:28 +0000 (13:41 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 21 Nov 2005 13:41:28 +0000 (13:41 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7171 65c4cc65-6c06-0410-ace0-fbb531ad65f3

ChangeLog
apps/app_osplookup.c

index 8916ffd40cbb86307bffb04e6f5d27ab69d2ec17..7675e7bea6efde2fc8a4487c06c75b5374281cd7 100755 (executable)
--- 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.
 
index d4f2c5352e66c1a81aefec9fb5a3cccb0f5cdeee..2fe2d016ac02dc64f05b43d9d29dca58c55b53cc 100755 (executable)
@@ -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);