From: Russell Bryant Date: Mon, 21 Nov 2005 13:41:28 +0000 (+0000) Subject: issue #5789 X-Git-Tag: 1.4.0-beta1~3270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeac8bf137740e480ef0ba11050600a95a38e18a;p=thirdparty%2Fasterisk.git issue #5789 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7171 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/ChangeLog b/ChangeLog index 8916ffd40c..7675e7bea6 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-11-21 Russell Bryant + * 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 d4f2c5352e..2fe2d016ac 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);