[asterisk-users] can ENUMLOOKUP query multiple DNS servers without having to replicate the same code for each server?

rjcarvalho at reit.up.pt rjcarvalho at reit.up.pt
Fri Jun 15 09:06:16 CDT 2007


Hi all,

Does ENUMLOOKUP can query multiple DNS servers without having to  
replicate the same code in which the only thing replaced is the server?

If I use ENUMLOOKUP(${exten}), Asterisk will parse enum.conf file to  
find the list of DNS servers in order of preference to be queried,  
but, I pretend to use something like this:  
${ENUMLOOKUP(+${ARG1:2:},sip,c) which does not seam to care about the  
existence of enum.conf file! May I force Asterisk to care about the  
servers I wrote in enum.conf?

To let you understand better, I wish to use just a block of code that  
is able to query multiple DNS servers, instead of repeating like in  
the following example the same code for each DNS server I wish to  
lookup for:

; Start first with e164.arpa zone:
exten => _X.,1,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c)}|counter=0)
exten => _X.,2,GotoIf($["${counter}"<"${sipcount}"]?3:6)
exten => _X.,3,Set(counter=$[${counter}+1])
exten => _X.,4,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,${counter})})
exten => _X.,5,GotoIf($["${counter}"<"${sipcount}"]?3:6)
; ...then also try e164.org:
exten => _X.,6,Set(sipcount=${ENUMLOOKUP(+${EXTEN},sip,c)}|counter=0)
exten => _X.,7,GotoIf($["${counter}"<"${sipcount}"]?8:11)
exten => _X.,8,Set(counter=$[${counter}+1])
exten => _X.,9,Dial(SIP/${ENUMLOOKUP(+${EXTEN},sip,${counter})})
exten => _X.,10,GotoIf($["${counter}"<"${sipcount}"]?8:11)
; ...in case of no route by IP, then send out PRI:
exten => _X.,11,Dial(Zap/g1/${EXTEN})

Regards,
Ricardo.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070615/90e1f00d/attachment.htm 


More information about the asterisk-users mailing list