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. Regards, -Michael
On Wednesday 17 October 2007 22:57:41 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.Try removing spaces around Regards, Atis -- Atis Lezdins VoIP Developer, IQ Labs Inc. atis at iq-labs.net Skype: atis.lezdins Cell Phone: +371 28806004 Work phone: +1 800 7502835
Michael Iedema wrote:> Greetings everyone, > > today I spent the last part of my day trying to find a parse error >You have: GosubIf($[${SENDNOTIFICATIONS} = 1]?notify,1) Mine uses Double Quotes as such: GosubIf($["${SENDNOTIFICATIONS}" = "1"]?notify,1) Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Am Mittwoch, den 17.10.2007, 21:57 +0200 schrieb Michael Iedema:> 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.Try changing the relevant line exten => h,n,GosubIf($[${SENDNOTIFICATIONS} = 1]?notify,1) to exten => h,n,GosubIf($["${SENDNOTIFICATIONS}" = "1"]?notify,1) BR Anselm
At 12:57 PM 10/17/2007, you wrote:>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.exten => h,n,GosubIf($["${SENDNOTIFICATIONS}" = "1"]?notify,1) Should fix it. If SENDNOTIFICATIONS is empty, you'll get that error. Ira
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
On Wednesday 17 October 2007 14:57:41 Michael Iedema wrote:> exten => h,1,Set(MISSEDCAUSE=hungup) > exten => h,n,GosubIf($[${SENDNOTIFICATIONS} = 1]?notify,1) > exten => h,n,Hangup() > > exten => notify,1,Macro(email-${MISSEDCAUSE}) > exten => notify,n,Return()exten => h,1,Set(MISSEDCAUSE=hungup) exten => h,n,GosubIf($["${SENDNOTIFICATIONS}" = "1"]?notify) exten => h,n,Hangup() exten => h,n(notify),Macro(email-${MISSEDCAUSE}) exten => h,n,Return() Don't leave the h extension; it's special. :-) Also, I note that in your pastebin, you had a space before the word "exten", and " exten" != "exten" as far as the parser is concerned. -- Tilghman