[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    [Asterisk-Dev] parsing variables
From:       "Ed Devine" <ncfm () airmail ! net>
Date:       2004-04-29 22:41:27
Message-ID: 002d01c42e3b$4c2e08d0$050210ac () dragon
[Download RAW message or body]

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.


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I've been through all the documentation, forums and 
lists, but I still can't resolve a particular problem.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>For various reasons, I can't use either 
authenticate or Disa in my application (primarily as I deal with a 
great</FONT></DIV>
<DIV><FONT face=Arial size=2>deal of inbound traffic, i.e. automatic dialers, 
PBX's with ARS, antique LCR applications, etc...</FONT></DIV>
<DIV><FONT face=Arial size=2>that can't or won't send the '#' to terminate the 
field). I'm hoping to get a servicable Asterisk system up and 
running</FONT></DIV>
<DIV><FONT face=Arial size=2>without doing a great deal of 'C' 
coding.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I thought that I'd use the CIDNAME structure in 
Asterisk Db as a starting point (just to get the sucker up and 
running)!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>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</FONT></DIV>
<DIV><FONT face=Arial size=2>a dbget CIDNAME (or lookupcidname) based on digits 
entered by the caller, for example:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; exten =&gt; 
_XXXXXXX9XXXXXXXXXX,1,SetVar(AUTHCODE=${EXTEN:0:7})&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Asterisk moves the first 7 digits of the dialed 
digit string to the AUTHCODE variable.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>What I'd like to be able to do is do a lookup on 
CIDNAME, determine if the digits</FONT></DIV>
<DIV><FONT face=Arial size=2>in the variable AUTHCODE match, and if so route the 
call, and if there isn't a match, handle the</FONT></DIV>
<DIV><FONT face=Arial size=2>call in an alternate manner.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Sure I could complicate this, but I'm really not a 
"C" programmer. Besides, using CIDNAME allows </FONT></DIV>
<DIV><FONT face=Arial size=2>a simple method to add or delete users, and being 
able to retrieve</FONT></DIV>
<DIV><FONT face=Arial size=2>an existing Asterisk record helps me to understand 
the system a little better without going through</FONT></DIV>
<DIV><FONT face=Arial size=2>the aggravation and the learning curve of setting 
up AGI or an external database.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I've spent days on this with no success. It seems 
pretty straightforward (Basically, if Asterisk </FONT></DIV>
<DIV><FONT face=Arial size=2>see's XXXXXXX dialed by the caller that 
</FONT><FONT face=Arial size=2>matches an entry in ${CIDNAME} place the call, 
otherwise, don't). </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I've tried hundreds of variations, gotten close a 
time or two, but inevitably, I either get a parsing error,</FONT></DIV>
<DIV><FONT face=Arial size=2>or the program allows any 7 digits to pass, or 
simply errors out without branching.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I've asked several "Asterisk" users, but mostly 
they keep referring me to the same "voicemail" scripts,</FONT></DIV>
<DIV><FONT face=Arial size=2>and Macro's in the documentation, that I (just call 
me stupid) can't seem to grasp in their application</FONT></DIV>
<DIV><FONT face=Arial size=2>to my problem. If anyone has a better suggestion or 
recommendation as to how to accomplich the same end, </FONT></DIV>
<DIV><FONT face=Arial size=2>I'd appreciate your input.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic