When taking a substring and a negative length is provided, instead of just

ignoring it, allow this to mean that we want that many characters off of
the end of the string so that ${EXTEN:0:$[${LEN(${EXTEN}) - 1]} can become
${EXTEN:0:-1}.  (issue #7586, Corydon)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-08-14 02:14:14 +00:00
parent 781f9dbcaf
commit 2f2cce01d2
2 changed files with 20 additions and 12 deletions

View File

@@ -139,8 +139,12 @@ previous example).
;Save the numbers 555 to the 'number' variable
exten => _9X.,1,Set(number=${EXTEN:-7:3})
If a negative length value is entered, it is ignored and Asterisk will match
to the end of the string.
If a negative length value is entered, Asterisk will remove that many characters
from the end of the string.
;Set pin to everything but the trailing #.
exten => _XXXX#,1,Set(pin=${EXTEN:0:-1})
___________________________
EXPRESSIONS:
---------------------------