<!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>Admittedly this is probably pretty stupid of me,
but there are just some things I can't understand by reading documentation. Any
suggestions or recommendations about how to handle my problem are greatly
appreciated. I'm trying to achieve the same functionality as my Nortel PBX,
without rewriting much 'C' code.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In my dialplan I'd like to compare two variables as
a means of getting around some of the troubles I've experienced in
authenticating users, or with using Disa (primarily the requirement that a '#'
be sent to terminate the authorization field). One variable (AUTHCODE
shown below) is a series of digits entered by the caller once asterisk
has answered and returned dialtone. I want to compare this variable to a
variable already stored in ${CIDNAME} and, depending on the results
of the comparison (i.e. if it's a match proceed, if not or if no value or '0' is
found, branch to another context or simply to jump to an extension in the
present context, or hangup</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Everytime I've tried (using gotoif as an example) I
get a parsing error; or the program allows everything through.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Think of the process as being like Disa, except you
don't send the '#'</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've been noodling around with code that is pretty
much as follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>[main2]</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten =>
_XXXXXXX9XXXXXXXXXX,1,SetVar(AUTHCODE=${EXTEN:0:7})</FONT></DIV>
<DIV><FONT face=Arial size=2>'Calls coming in to '*' from outside are
answered and sent here. The Caller recieves
PlayInterruptibleTones(dial)</FONT></DIV>
<DIV><FONT face=Arial size=2>'and begins entering digits. The first seven are
moved to the AUTHCODE variable for comparison.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten => _XXXXXXX9XXXXXXXXXX,2,dbget(${CIDNAME}
${AUTHCODE})</FONT></DIV>
<DIV><FONT face=Arial size=2>'I do a dbget to retrieve the CIDNAME if one exists
that matches AUTHCODE</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten =>
_XXXXXXX9XXXXXXXXXX,3,SetCIDName(${CIDNAME})</FONT></DIV>
<DIV><FONT face=Arial size=2>'I do this just so I don't have to screw around
with the ast_expr.y: error or implementing </FONT></DIV>
<DIV><FONT face=Arial size=2>'the 'foo trick' to test for an empty value when
using GoToif.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten => _XXXXXXX9XXXXXXXXXX,4,Gotoif(${CIDNAME}
= 228XXXX)?|1:5</FONT></DIV>
<DIV><FONT face=Arial size=2>'This is just one of the seemingly hundreds of
options I've tried just to see if</FONT></DIV>
<DIV><FONT face=Arial size=2>'I could get the Gotoif to pass the call if it met
the requirements, or fail if it didn't</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten =>
_XXXXXXX9XXXXXXXXXX,5,dial(zap/g3/${EXTEN:7:18})</FONT></DIV>
<DIV><FONT face=Arial size=2>'This is where I send the actual called number
digits to the channel</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten =>
_XXXXXXX9XXXXXXXXXX,6,hangup</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten => s,1,answer</FONT></DIV>
<DIV><FONT face=Arial size=2>exten =>
s,2,Playinterruptibletones(dial)</FONT></DIV>
<DIV><FONT face=Arial size=2>exten => i,1,Congestion</FONT></DIV>
<DIV><FONT face=Arial size=2>exten => i,2,Hangup</FONT></DIV>
<DIV><FONT face=Arial size=2>exten => t,1,Congestion</FONT></DIV>
<DIV><FONT face=Arial size=2>exten => t,2,Hangup</FONT></DIV></BODY></HTML>