简体   繁体   中英

Gotoif how to set it to allow a 3 or 4 digit response to meet the condition

Was wondering if anyone can help me currently I only accept 3 cvv numbers and I need to chage this to 4 but I can't find any where online how to put a range in this statement.

exten => s,n,GotoIf($[${LEN(${vrCC_CCV})}=3]?wait:cc_ccvinv)

Visa/Mastercard are fine with 3 didits but American Express requires the four digits on front of the card.

Any assistance would be greatful.

Like any other language asterisk support AND/OR in expressions.

https://www.voip-info.org/asterisk-cmd-gotoif/

Example 2


; Are the first three digits of the returned value of ${ENUM} are
;  either SIP or IAX?  If not,  we ignore and pass to normal
;  dialing path at priority 4.
;
exten => _011X.,2,GotoIf($[$["${ENUM:0:3}" = "SIP"] | $["${ENUM:0:3}" = "IAX"]]?3:4)

More info about expressions in dialplan

https://www.voip-info.org/asterisk-expressions/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM