In an Asterisk $[]
expression, undefined variables do not return an implicit empty string or zero. They expand as "nothing" prior to evaluation of the expression, so after the variable is expanded (to nothing), it isn't visible to the expression parser. This causes the error already noted by Pablo Alsina:
GotoIf("IAX2/AtlantaTeliax-10086", "?CLOSED,1")
There are two ways to avoid this:
- Always give your variables reasonable defaults before you use them (as Pablo suggested).
- In any
$[]
expression, enclose your variables and literals with double-quotes. This will cause an undefined variable to be handled as an empty string, which can still be used for comparison purposes.
Personally, I try to do both. For example:
exten => START,n,Set(FORCE_CLOSED=FALSE)
exten => START,n,GotoIf($["${FORCE_CLOSED}"="TRUE"]?CLOSED,1)
Note the double-quotes around ${FORCE_CLOSED}
and the comparison value. Even if the variable is undefined, the expression will have ""
(an empty string) to compare against "TRUE"
.
Really, you can use any character you like, because it will just be tacked onto the variable expansion. It just gives you a literal value that is guaranteed to be there in case the variable is undefined. I like quotes because it makes the code resemble other programming languages. You could just as easily use something like $[x${FORCE_CLOSED}=xTRUE]
, which is commonly seen in Bourne shell scripting. The end result is the same.
there are AMI interface, which allow to listen to EVENTS.
so u can create listener and remember state.
also u can use
meetme list concise conf_no
but sorry, i not remmember if it shwo muted state.
Best Answer
Try running
core show application MeetMe
-- if it says the application is not found, then checkmodules.conf
.If
autoload=yes
is not specified, then you need aload => app_meetme.so
directive.It would also be helpful to have your asterisk version as well as the snippet of your extension logic that is failing.