[Home]

Summary:ASTERISK-15690: [patch] patch for LISTFILTER to properly handle delimiter
Reporter:Mitch Sharp (bluecrow76)Labels:
Date Opened:2010-02-24 15:34:15.000-0600Date Closed:2010-03-11 10:12:12.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Functions/func_strings
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk-1.6.2.4-func_strings.diff
Description:LISTFILTER is removing the requested string from a variable properly, but is leaving extra delimiters behind in the return string.

I have tested the patched code with single and multiple character delimiters and it appears to be working properly now.  I have tested it on 1.6.2.1 and 1.6.2.4.

****** ADDITIONAL INFORMATION ******

Below is just one example.  Notice the extra & in the output.

The code:
Set(TESTING=ab&cd&ef)
NoOp(${LISTFILTER(TESTING,&,cd)})

Resulted in the following:
NoOp("IAX2/bignetworks-02-12836", "ab&&ef")



Below is some testing after patching:
NoOp("SIP/101-00000090", "-= Testing LISTFILTER =-")
Answer("SIP/101-00000090", "")

Set("SIP/101-00000090", "TESTING=ab&cd&ef&gh&ij")
NoOp("SIP/101-00000090", "Remove ab: cd&ef&gh&ij")
NoOp("SIP/101-00000090", "Remove cd: ab&ef&gh&ij")
NoOp("SIP/101-00000090", "Remove ef: ab&cd&gh&ij")
NoOp("SIP/101-00000090", "Remove gh: ab&cd&ef&ij")
NoOp("SIP/101-00000090", "Remove ij: ab&cd&ef&gh")

Set("SIP/101-00000090", "TESTING=123aa456aa123")
NoOp("SIP/101-00000090", "Remove 123: 456")
NoOp("SIP/101-00000090", "Remove 456: 123aa123")

Set("SIP/101-00000090", "TESTING=123a456a123")
NoOp("SIP/101-00000090", "Remove 123: 456")
NoOp("SIP/101-00000090", "Remove 456: 123a123")
Hangup("SIP/101-00000090", "")
Comments:By: Digium Subversion (svnbot) 2010-03-10 14:30:35.000-0600

Repository: asterisk
Revision: 251677

U   trunk/funcs/func_strings.c
U   trunk/tests/test_substitution.c

------------------------------------------------------------------------
r251677 | tilghman | 2010-03-10 14:30:35 -0600 (Wed, 10 Mar 2010) | 5 lines

It's amazing what writing a test will find.

(issue ASTERISK-15690)
Reported by: bluecrow76

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=251677

By: Digium Subversion (svnbot) 2010-03-10 14:48:34.000-0600

Repository: asterisk
Revision: 251678

U   branches/1.6.2/funcs/func_strings.c

------------------------------------------------------------------------
r251678 | tilghman | 2010-03-10 14:48:34 -0600 (Wed, 10 Mar 2010) | 7 lines

LISTFILTER was doubling delimiters on output.

(closes issue ASTERISK-15690)
Reported by: bluecrow76
Patches:
      asterisk-1.6.2.4-func_strings.diff uploaded by bluecrow76 (license 270)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=251678

By: Digium Subversion (svnbot) 2010-03-10 14:54:04.000-0600

Repository: asterisk
Revision: 251682

U   trunk/funcs/func_strings.c

------------------------------------------------------------------------
r251682 | tilghman | 2010-03-10 14:54:04 -0600 (Wed, 10 Mar 2010) | 7 lines

Hmmm, apparently needed to be fixed in trunk, too.

(closes issue ASTERISK-15690)
Reported by: bluecrow76
Patches:
      asterisk-1.6.2.4-func_strings.diff uploaded by bluecrow76 (license 270)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=251682