[asterisk-users] parse error in GosubIf

Philipp Kempgen philipp.kempgen at amooma.de
Wed Oct 17 15:36:26 CDT 2007


Michael Iedema wrote:

> Greetings everyone,
> 
> today I spent the last part of my day trying to find a parse error
> inside this snip:
> http://pastebin.ca/740081
> 
> If there's anyone who can shed some light on why my GosubIf condition
> is throwing a parse error, I'd greatly appreciate your insight. This
> was really frustrating and is probably a stupid mistake.

---cut---
exten => h,1,Set(MISSEDCAUSE=hungup)
exten => h,n,GosubIf($[${SENDNOTIFICATIONS} = 1]?notify,1)
exten => h,n,Hangup()
---cut---

---cut---
Oct 17 20:08:13 -- Executing [h at macro-vm:1] Set("Zap/4-1", "MISSEDCAUSE=hungup") in new stack
Oct 17 20:08:13 ast_expr2.fl:398 in ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected '=', expecting $end; Input: = 1 ^
Oct 17 20:08:13 ast_expr2.fl:402 in ast_yyerror: If you have questions, please refer to doc/channelvariables.txt in the asterisk source.
Oct 17 20:08:13 -- Executing [h at macro-vm:2] GosubIf("Zap/4-1", "?notify|1") in new stack
---cut---

Just a wild guess:
${SENDNOTIFICATIONS} might be empty so what it tries to execute is
GosubIf($[ = 1]?notify,1)
(and then complains about the unexpected "=")

Try
GosubIf($["${SENDNOTIFICATIONS}" = "1"]?notify,1)


Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
    Let's use IT to solve problems and not to create new ones.
          Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998



More information about the asterisk-users mailing list