On Mon, May 21, 2007 at 05:14:31PM +0100, Steve Hill wrote:
> On Mon, 21 May 2007, Mike Jagdis wrote:
>
> > Yeah, ENUMLOOKUP is just broken. It does a separate query for each call
> > so if there are multiple records with the same weight DNS will do the right
> > thing and change the order each time. You may see some twice, you may
> > not see some at all. If there are exactly two results and one path is
> > down you have a 50/50 chance of being completely shafted!
>
> Doh!
> I guess for OGI it makes sense to implement the DNS queries in the OGI
> application itself, but using the existing command seemed easy. :)
Ok, I've committed my set-the-results-in-variables patch (that being
something that I have to hand and understand).
Simply replace your option, "c" (for count) with, say, "result%d".
ENUMLOOKUP will still return the record count but your iterator
iterates over variables instead of calling ENUMLOOKUP again.
e.g.
Set(n=${ENUMLOOKUP(+${EXTEN},all,result%d,e164.org)})
Set(i=0)
While($[ ${i} < ${n} ])
Set(i=$[ ${i} + 1 ])
Set(path=${result{i}})
; try ${path}
EndWhile
N.B. That may not work - I'm paraphrasing a chunk of my dialplan
but what I actually have iterates over 3 e164 domains and can go
recursive if it sees a "tel" method in a reply. In fact, while
I was checking this patch worked in CW I spotted some bugs in
my dialplan enum handling :-)
Mike
--
Mike Jagdis Web: http://www.eris-associates.co.uk
Eris Associates Limited Tel: +44 7780 608 368
Reading, England Fax: +44 118 926 6974
_______________________________________________
Callweaver-users mailing list
[email protected]
http://lists.callweaver.org/mailman/listinfo/callweaver-users