From 6cb38ac23a539bca16c989b195fdeca08779abb5 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Sat, 6 Nov 2004 21:33:01 +0000 Subject: Add features (incomplete, highly experimental), fix DundiLookup app, debug improvements (bug #2800) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4167 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx/pbx_dundi.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'pbx') diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 0c8b86555..7aa4efb2c 100755 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -3824,10 +3824,14 @@ int dundi_query_eid(struct dundi_entity_info *dei, const char *dcontext, dundi_e static int dundi_lookup_exec(struct ast_channel *chan, void *data) { char *tmp; - char *context; + char *context = NULL; char *opts; - int res = -1; + int res = 0; + int results = 0; + int x; + int bypass = 0; struct localuser *u; + struct dundi_result dr[MAX_RESULTS]; if (!data || !strlen(data)) { ast_log(LOG_WARNING, "DUNDiLookup requires an argument (number)\n"); @@ -3853,6 +3857,20 @@ static int dundi_lookup_exec(struct ast_channel *chan, void *data) opts = ""; } + results = dundi_lookup(dr, MAX_RESULTS, NULL, context, tmp, bypass); + if (results > 0) { + sort_results(dr, results); + for (x=0;xcontext, chan->exten, chan->priority + 101, chan->cid.cid_num)) + chan->priority += 100; + } LOCAL_USER_REMOVE(u); return res; } -- cgit v1.2.3