Girish Gopinath
2004-May-09 09:39 UTC
[Asterisk-Users] Stripping numbers at the end of a dial pattern => extension
Hello,>From: "Hermann Wecke" <hermann@wecke.com> >Subject: [Asterisk-Users] Stripping numbers at the end of a dial pattern => >extensions.conf >Date: 8 May 2004 22:03:57 +0000 > >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.
Girish Gopinath
2004-May-09 10:05 UTC
[Asterisk-Users] Stripping numbers at the end of a dial pattern => extension
Hi, Replying to my own mail. There is a mistake, The syntax is incorrect:>From: "Girish Gopinath" <gopinath_girish@hotmail.com> >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!