Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread A J Stiles
ject: [asterisk-users] Cut off last character of EXTEN > > > > 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. &

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Pat Collins
From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steven Howes Sent: Tuesday, August 20, 2013 7:38 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Cut off last character of EXTEN On 20 Aug

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Steven Howes
On 20 Aug 2013, at 12:25, Pat Collins wrote: > Here ya go: > > 112233# use ${EXTEN:0:6}) > 123# use ${EXTEN:0:3}) > 123456789# use ${EXTEN:0:9}) I think 'variable length' implied 'unknown length'... S-- _ -- Bandwidth and Col

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Pat Collins
From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jonas Kellens Sent: Tuesday, August 20, 2013 4:29 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Cut off last character of EXTEN Hello, how can

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread jg
Damn it! Try: "${EXTEN:0:-1}" jg -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello aste

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Jonas Kellens
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

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Łukasz Grzywański
Hi, try [testEx] exten => _X.,1,noop(${EXTEN}) same => n,noop(len: ${LEN(${EXTEN})}) same => n,noop(${EXTEN:0:${MATH(${LEN(${EXTEN})}-1)}}) exten => _X.,n,hangup On 20 August 2013 12:15, Jonas Kellens wrote: > On 08/20/2013 10:47 AM, jg wrote: > > How about "${EXTEN:-1:1}"? > > "The Definiti

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Jonas Kellens
On 08/20/2013 10:47 AM, jg wrote: How about "${EXTEN:-1:1}"? "The Definitive Guide" has a special paragraph with the title "*More Advanced Digit Manipulation".* jg Same result : # Jonas. -- _ -- Bandwidth and Colocation

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread jg
How about "${EXTEN:-1:1}"? "The Definitive Guide" has a special paragraph with the title "*More Advanced Digit Manipulation".* jg -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join

Re: [asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Gareth Blades
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=${

[asterisk-users] Cut off last character of EXTEN

2013-08-20 Thread Jonas Kellens
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. Kind regards, Jonas. -- ___