Upgrade 3CX to v18 and get it hosted free!

Asterisk cmd SubString

Author image

Note: This command is completely obsolete and has been removed

Synopsis:
Save substring digits in a given variable

Description:
SubString(variable=string_of_digits|count1|count2)

Assigns the substring of string_of_digits to a given variable. Parameter count1 may be positive or negative. If it’s positive then we skip the first count1 digits from the left. If it’s negative, we move count1 digits counting from the end of the string to the left.
Parameter count2 may be only positive and implies how many digits we’re taking from the point that count1 placed us.

Example:

exten => _NXXXXXX,1,SubString,test=2564286161|0|3
assigns the area code (3 first digits) to variable test.
exten => _NXXXXXX,1,SubString,test=2564286161|-7|7
assigns the last 7 digits to variable test.

Return codes

If there are no parameters it’ll return with -1.
If there wrong parameters it go on and return with 0

Note that SubString is deprecated. It has been replaced by a buit-in syntax for obtaining substrings of variables. Please use ${variable:count1:count2} instead, with count1 and count2 as described above.

See also


 

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.