[asterisk-bugs] [Asterisk 0017115]: When providing a delemeter character, placing it betwenn apostrophy signs does not work. CUT retruns the shole string in this ca

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Mar 30 09:59:21 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17115 
====================================================================== 
Reported By:                roland65
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   17115
Category:                   Functions/func_cut
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.6.2.6 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-30 07:04 CDT
Last Modified:              2010-03-30 09:59 CDT
====================================================================== 
Summary:                    When providing a delemeter character, placing it
betwenn apostrophy signs does not work. CUT retruns the shole string in this ca
Description: 
The following example fails:
exten => 123,1,Set(foo=1 2 3 4 5)
exten => 123,n,Set(foo=${CUT(foo,' ',2)})

which means that instead of returning the second space separated field,
CUT returns the whole string.

A work-around is to replace the ' apostrophy sign by double quotes like:

exten => 123,1,Set(foo=1 2 3 4 5)
exten => 123,n,Set(foo=${CUT(foo," ",2)})

This correctly returns 2.

====================================================================== 

---------------------------------------------------------------------- 
 (0120002) tilghman (administrator) - 2010-03-30 09:59
 https://issues.asterisk.org/view.php?id=17115#c120002 
---------------------------------------------------------------------- 
Nowhere is it documented that placing the delimiter between apostrophe
signs will do what you want.  In fact, the suggested method in the
documentation is to use the backslash character to specify the character in
hexadecimal or octal. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-03-30 09:59 tilghman       Note Added: 0120002                          
======================================================================




More information about the asterisk-bugs mailing list