[Asterisk-Users] Re: New CUT()

Tony Mountifield tony at softins.clara.co.uk
Fri Sep 9 06:56:17 MST 2005


In article <200509091317.j89DGtY3019393 at commserver.noach.com>,
John Hill <jhill at noach.com> wrote:
> I store my speed dial numbers in the astdb key speeddial with the number and
> then name separated by a -.
> 
> This dial plan works fine:
> [speed-dial]
> exten => _*0XX,1,Set(temp=${DB(speeddial/${EXTEN:2})})
> exten => _*0XX,2,Cut(number=temp,,1)
> exten => _*0XX,3,Goto(house-phones,${number},1)
> 
> The log informs me that cut is replaced with CUT.
> 
> I rewrote the dial plan using CUT (as best I can figure out) The plan below
> returns the entire string number-name and fails?
> 
> [speed-dial]
> exten => _*0XX,1,Set(temp=${DB(speeddial/${EXTEN:2})})
> exten => _*0XX,2,CUT(temp,,1)
> exten => _*0XX,3,Goto(house-phones,${temp},1)
> 
> What am I missing.

The new CUT is a function, and should be used within a Set command.
Something approximating (please check the detail):

exten => _*0XX,1,Set(temp=${DB(speeddial/${EXTEN:2})})
exten => _*0XX,2,Set(number=CUT(temp,,1))
exten => _*0XX,3,Goto(house-phones,${number},1)

Your second example is calling the same Cut command as the first.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list