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

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Apr 26 00:43:53 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:                     new
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-26 00:43 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

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

---------------------------------------------------------------------- 
 (0103781) tilghman (administrator) - 2009-04-26 00:43
 http://bugs.digium.com/view.php?id=14972#c103781 
---------------------------------------------------------------------- 
Try, instead, exten => s,n,Set(l_cnt=${FIELDQTY(ARG1,${ARG2})}).  Not sure
why this would have worked in 1.4, but the delimiter is never supposed to
be the NAME of a variable, only the value itself.  Only the field (first
argument) takes the name, as opposed to the value. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-04-26 00:43 tilghman       Note Added: 0103781                          
======================================================================




More information about the asterisk-bugs mailing list