[asterisk-bugs] [Asterisk 0014972]: FIELDQTY not function correctly with escape characters from variables.

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Apr 27 09:25:35 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14972 
====================================================================== 
Reported By:                zktech
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14972
Category:                   Functions/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.0.7 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-04-25 09:30 CDT
Last Modified:              2009-04-27 09:25 CDT
====================================================================== 
Summary:                    FIELDQTY not function correctly with escape
characters from variables.
Description: 
I am using the FIELDQTY to dynamically parse headers and other strings.
When I pass in the delimeter in a variable it does not work correctly if
the variable has a escape character in it..

Example 1: ARG1 = header;data;data ARG2=\;
exten => s,n,Set(l_cnt=${FIELDQTY(ARG1,ARG2)})

This should and did in version 1.4 return 3 to l_cnt
In 1.6 it returns 1 to l_cnt

Example 2: ARG1 = header;data;data
exten => s,n,Set(l_cnt=${FIELDQTY(ARG1,\;)})

This returns 3 to l_cnt as expected. This is very broken as I can not now
send values with escape charcters to this function.

Does this bug also effect any other functions that use to allow escape
characters coming in variables?

Any help is apperciated.
Thanks
Bryant

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

---------------------------------------------------------------------- 
 (0103801) zktech (reporter) - 2009-04-27 09:25
 http://bugs.digium.com/view.php?id=14972#c103801 
---------------------------------------------------------------------- 
Thank you for the directions. It does appear that you are correct that the
second argument must be in the curl braces. This was not the case in 1.4
based on our current code base. I am updating our code base to this format.
I have found this to be very confusing. Is this the case as well for the
CUT function. I was using the same format there in 1.4 where I was just
using the var names and not the curl braces.

Thank you Very much
Bryant 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-04-27 09:25 zktech         Note Added: 0103801                          
======================================================================




More information about the asterisk-bugs mailing list