Hello list, how can I get the second character/cipher of an extension ? If I have : exten => 12345,n,NoOP() How can I get "2" ? If I have : exten => 7877777,n,NoOP() How can I get "8" ? Thanks ! Kind regards, Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110620/084a8c39/attachment.htm>
> -----Original Message----- > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of > Jonas Kellens > Sent: Monday, June 20, 2011 3:09 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [asterisk-users] Get second cipher in an extension > > Hello list, > > how can I get the second character/cipher of an extension ? > > If I have : exten => 12345,n,NoOP() > > How can I get "2" ? > > If I have : exten => 7877777,n,NoOP() > > How can I get "8" ?https://wiki.asterisk.org/wiki/display/AST/Selecting+Characters+from+Variables
> how can I get the second character/cipher of an extension ? > > If I have : exten => 12345,n,NoOP() > > How can I get "2" ?${EXTEN:1:1}
On Mon, Jun 20, 2011 at 2:09 PM, Jonas Kellens <jonas.kellens at telenet.be>wrote:> ** > Hello list, > > how can I get the second character/cipher of an extension ? > > <snip>I vaguely recall that to get a substring out of an extension variable, you would use it in the format ${EXTEN:offset:length}, so for your example it would be ${EXTEN:1:1} -- Thanks, --Warren Selby, dCAP http://www.SelbyTech.com <http://www.selbytech.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110620/ce304b1c/attachment-0001.htm>