[Asterisk-Dev] parsing variables

Ed Devine ncfm at airmail.net
Thu Apr 29 15:41:27 MST 2004


I've been through all the documentation, forums and lists, but I still can't resolve a particular problem.

For various reasons, I can't use either authenticate or Disa in my application (primarily as I deal with a great
deal of inbound traffic, i.e. automatic dialers, PBX's with ARS, antique LCR applications, etc...
that can't or won't send the '#' to terminate the field). I'm hoping to get a servicable Asterisk system up and running
without doing a great deal of 'C' coding.

I thought that I'd use the CIDNAME structure in Asterisk Db as a starting point (just to get the sucker up and running)!

I'll not bore you with the dozens of dialplans I've tried, suffice to say what I'd like to be able to do is
a dbget CIDNAME (or lookupcidname) based on digits entered by the caller, for example:

    exten => _XXXXXXX9XXXXXXXXXX,1,SetVar(AUTHCODE=${EXTEN:0:7})        

Asterisk moves the first 7 digits of the dialed digit string to the AUTHCODE variable.

What I'd like to be able to do is do a lookup on CIDNAME, determine if the digits
in the variable AUTHCODE match, and if so route the call, and if there isn't a match, handle the
call in an alternate manner.

Sure I could complicate this, but I'm really not a "C" programmer. Besides, using CIDNAME allows 
a simple method to add or delete users, and being able to retrieve
an existing Asterisk record helps me to understand the system a little better without going through
the aggravation and the learning curve of setting up AGI or an external database.

I've spent days on this with no success. It seems pretty straightforward (Basically, if Asterisk 
see's XXXXXXX dialed by the caller that matches an entry in ${CIDNAME} place the call, otherwise, don't). 

I've tried hundreds of variations, gotten close a time or two, but inevitably, I either get a parsing error,
or the program allows any 7 digits to pass, or simply errors out without branching.

I've asked several "Asterisk" users, but mostly they keep referring me to the same "voicemail" scripts,
and Macro's in the documentation, that I (just call me stupid) can't seem to grasp in their application
to my problem. If anyone has a better suggestion or recommendation as to how to accomplich the same end, 
I'd appreciate your input.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20040429/1b167a25/attachment.htm


More information about the asterisk-dev mailing list