Thanks guys. It was the If vs if that was causing the problem. This is probably due to my good coding practice of other languages in the past :-)
> -----Original Message----- > From: [email protected] [mailto:asterisk-users- > [email protected]] On Behalf Of Watkins, Bradley > Sent: Thursday, 5 March 2009 9:12 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] AEL2: If-then-else not permitted in Switch- > Case > > > I just want to confirm but it seems that if-then-else is not permitted > > in case structure. > > It was not really documented but it seems to be the case. > > > > Can anyone confirm? > > No, if-then-else works fine inside a case statement. See inline > comments. > > > > switch(${DIALSTATUS}) > > { > > case NOANSWER: > > { > This brace, and its closing-brace mate, are superfluous though not > harmful. > > > // if-then-else not permitted > > If (${ael-var} = 1) > Your primary problem is probably right here, the if needs to be all > lower-case ( If != if ). > > > { > > Playback(beep); > > return; > > } > > } > Again, unnecessary. > > > case BUSY: > > { > > return; > > } > > default: > > { > > Hangup(); > > }; > > } > > > > > > > > _______________________________________________ > > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > > > asterisk-users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
