Upgrade 3CX to v18 and get it hosted free!

Asterisk func exists

Author image

Synopsis:

Existence Test: Returns 1 if exists, 0 otherwise

Description:

EXISTS(<data>)

This checks the existance of a string. Consider the following:
Var1=test
Var2=

EXISTS(${Var1}) = 1
EXISTS(${Var2}) = 0

If you’re dynamically creating variables and need to check for their existance this function comes in really handy.

Notes

  • *CLI> show function EXISTS

 

Return value

0 or 1

Example

exten => s,1,GotoIf($[${EXISTS(${Var})}]?2:4)
exten => s,2,NoOp(Variable Var (${Var}) exists!)
exten => s,3,Goto(5)
exten => s,4,NoOp(Variable Var does NOT exist!)
exten => s,5,Hangup

See also

1830 views strong.


Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.