asterisk


Asterisk GotoIf comparison variable exists in Array


Currently I'm using the following condition:
exten => 1237,n,GotoIf($[ $[ "${text}" = "yes" ] | $[ "${text}" = "ok" ]
| $[ "${text}" = "perfect" ] ]?interest:retry)
Is it a better way to define this syntax, I would like to compare the value of text against an array of strings, but I cant find a way to do it. Example:
exten => 1237,n,GotoIf($[ $[ "${text}" in ARRAY("yes","ok","perfect") ] ]?interest:retry)
I'm not aware of in operator in Asterisk, but you can use regex match instead:
GotoIf($[ "${text}" =~ "^(yes|no|perfect)$"]?interest:retry)
FIELDNUM Is almost what you need
exten = 1237,n,Set(STRARRAY='yes-ok-perfect')
exten = 1237,n,GotoIF($[ ${FIELDNUM(STRARRAY,-,${text})} > 0 ]?interest:retry)

Related Links

Linphone server developer manual
command dahdi show channels not working on asterisk CLI
sip device registration bypassing in freeswitch
Path Translation issue in Asterisk PBX DialPlan
Asterisk change callerid after consultation call
Make a call center with Asterisk and Integrate it with JSF [closed]
Asterisk: list originated calls (preferably by destination)
nothing recorded in asterisk on PRI channel [closed]
RTP audio stream works only in one direction in a SIP call
Asterisk, blacklist a number by country code or area code
unable to send SIGHUP to AGI Process
How to config instance messaging for asterisk 12
How to do auto callback in asterisk and then pstn call?
how to minimize or disable codec transcoding from freeswitch to asterisk?
Simple Asterisk PJSIP config for two softphones with messaging and presence
looking for a way to determine if the phone number i'm calling is a cell phone or not

Categories

HOME
actionscript-3
max
autohotkey
javafx
url
google-cloud-pubsub
itunesconnect
cors
intellisense
window.open
android-ndk
liquibase
mifare
crash
terminal
css-selectors
glympse
checkpoint
clip-path
samsung-gear-s2
dcos
solidity
aggregate
tag-cloud
dompdf
facebook-marketing-api
smooth-scrolling
autologin
spring-webflow
jq
gomobile
ithit-webdav-server
ppp
poisson
waterfall
my.cnf
symlink
large-files
launchd
emr
edirectory
wordpress-rest-api
jsonapi-resources
bootcamp
pyenv
border-layout
yelp
jibx
mediastream
definition
irr
php-mongodb
bootstrap-carousel
reqif
yank
enet
node-java
android-vectordrawable
aot
opticalflow
petapoco
recursive-query
dbi
patching
system-integration
archiva
radar-chart
nonblocking
matlab-engine
updating
adempiere
om
bootstrap-tabs
properties-file
tokudb
litedb
vspackage
stderr
jeet-grid
autopep8
qxorm
fiware-health
frisby.js
nsurlrequest
mixradio
nomachine
friendly-id
aspnet-compiler
jython-2.5
latex-suite
database-restore
idoc
big-endian
reflexil
mismatch
funambol
virtual-destructor
mediastreamsource
subdirectories
dgml
calendarextender
scala-designer
bootstrap-protocol
moores-law

Resources

Encrypt Message