[Home]

Summary:ASTERISK-05516: removing characters from string problem
Reporter:St├ęphane HENRY (stef)Labels:
Date Opened:2005-11-08 20:01:38.000-0600Date Closed:2008-01-15 15:55:07.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:There is a problem in the definition :
${variable_name[:offset[:length]]}
when length is an other variable.

In the above example, test3 returns a bad value :

exten => 4,1,Answer
exten => 4,n,Set(test1=9171130783674.373619991930033170364695);
exten => 4,n,Set(test2=${test1:1:2})
exten => 4,n,Set(test3=${test1:3:${test2}})

test3 should be 1130783674.373619, not 0783674.373619



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

CLI output
   -- Executing Answer("SIP/110-ba70", "") in new stack
   -- Executing Set("SIP/110-ba70", "test1=9171130783674.373619991930033170364695") in new stack
   -- Executing Set("SIP/110-ba70", "test2=17") in new stack
   -- Executing Set("SIP/110-ba70", "test3=0783674.373619") in new stack


I have a server with an old version of pbx.c without this problem (pbx.c/1.198/Fri Jan 21 07:06:24 2005)
Comments:By: Kevin P. Fleming (kpfleming) 2005-11-08 21:00:56.000-0600

Fixed in CVS HEAD.

By: Digium Subversion (svnbot) 2008-01-15 15:55:07.000-0600

Repository: asterisk
Revision: 7039

U   trunk/ChangeLog
U   trunk/pbx.c

------------------------------------------------------------------------
r7039 | kpfleming | 2008-01-15 15:55:06 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5516

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

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