[asterisk-users] Cut off last character of EXTEN

Jonas Kellens jonas.kellens at telenet.be
Tue Aug 20 05:25:06 CDT 2013


On 08/20/2013 10:40 AM, Gareth Blades wrote:
> On 20/08/13 09:29, Jonas Kellens wrote:
>> Hello,
>>
>> how can I cut off the last character of the EXTEN-variable with 
>> variating length ?
>>
>> So I have :
>>
>> 112233#
>> 123#
>> 123456789#
>>
>> I want to cut off the last character.
>>
>> ${EXTEN:-1} gives me #, but that is the character I want to cut off.
>
> Set(variable=${EXTEN:0:$[LEN(${EXTEN})-1]})

Hello,

this works !

Thanks.

Jonas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130820/70350d4e/attachment.htm>


More information about the asterisk-users mailing list