[Asterisk-Users] CALLERIDNAME and GotoIf -- Quoting Question

Steve Murphy murf at e-tools.com
Wed Mar 24 08:50:29 MST 2004


For those experts in the expressions that can be used in
extensions.conf,  I pose the following question:

In my extensions.conf, I have the following...

exten => s,3,Zapateller,nocallerid
exten => s,4,PrivacyManager
exten => s,5,GotoIf($[${CALLERIDNUM} : "7776665555" &  ${CALLERIDNAME} :
"Privacy Manager"]?telemarket|s|1:s|6)

(Pardon the mailer-enforced insertion of newlines in the middle of the
s,5 statement)

The intention here is that if some bozo calling with no callerid enters
"7776665555" (read this as: MY number), which to me is really offensive,
as they are basically trying to blow off this prompt, then I want to 
send them to the telemarketing script.

BUT....

I consistently get a parse error:

ast_yyerror: ast_yyerror(): syntax error: parse error

(BTW-- this is really not very informative error message!)

So, I slipped a little debug into the ast_expr.y file, and I see that
ast_expr is being called with the string arg:

ast_expr.y:309 ast_expr: ast_expr(): ast_expr passed: 7776668888 :
"7776665555" & MURPHY STEVE    : "Privacy Manager"

The way this is set up, it will do what is right in those situations
where no dual match is found... but it will not do what is right when
the conditions ARE matched!

Now, On the wiki, http://www.voip-info.org/wiki-Asterisk+cmd+GotoIf --
under the "Please Note" it says:

This also means that the value of your argument must not contain any
spaces as otherwise gotoif() will not behave as expected! 

So, I assume that the "MURPHY STEVE   " part is being interpreted as two
tokens, and is therefore generating the parse error.

So, in that vein, I ask:

Is there any quoting function available? How do I pull a rabbit out of
the hat here, and do what I want to do?

murf


-- 
Steve Murphy <murf at e-tools.com>
Electronic Tools Company
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20040324/1cf7a8e4/attachment.pgp


More information about the asterisk-users mailing list