RE: [Asterisk-Users] Stripping numbers at the end of a dial pattern => extension

2004-05-09 Thread Girish Gopinath
Hi,

Replying to my own mail. There is a mistake, The syntax is incorrect:

From: "Girish Gopinath" <[EMAIL PROTECTED]>
exten => 12345, 1, SetVar,MYDIGITS=${EXTEN:2,3} ; MYDIGITS = 2345.
Correct: exten => 1234, 1, SetVar,MYDIGITS=${EXTEN:2:3} ; MYDIGITS = 234.

My apologies...

Girish

_
Sports, sports and more sports! Keep up with all thatÂ’s happening! 
http://www.msn.co.in/sports/ Stay connected with MSN Sports!

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Stripping numbers at the end of a dial pattern => extension

2004-05-09 Thread Girish Gopinath
Hello,

From: "Hermann Wecke" <[EMAIL PROTECTED]>
Subject: [Asterisk-Users] Stripping numbers at the end of a dial pattern => 
extensions.conf
Date: 8 May 2004 22:03:57 +

Is it possible to strip some numbers from the *end* of a number?

I know that ${EXTEN:1} will remove 1 position from the beggining... but
how to remove N numbers from the end?
Use ${variable:pos:n}. This will give you 'n'  digits from the position 
'pos'.
exten => 12345, 1, SetVar,MYDIGITS=${EXTEN:2,3} ; MYDIGITS = 2345.
Also, there is Substring application available with Asterisk, but it is 
deprecated i think...

HTH, Girish

_
Post Classifieds on MSN classifieds. http://go.msnserver.com/IN/44045.asp 
Buy and Sell on MSN Classifieds.

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users