[Home]

Summary:ASTERISK-06087: [patch] array function in func_string don't work
Reporter:Peng Yong (ppyy)Labels:
Date Opened:2006-01-15 06:29:26.000-0600Date Closed:2006-01-16 12:58:41.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Functions/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) patch.array
Description:exten => 3001,1,Set(ARRAY(var1,var2)=1,2)
exten => 3001,n,Noop(${var1})
exten => 3001,n,Noop(${var2})

the result:
   -- Executing Set("SIP/8086-dd44", "ARRAY(var1|var2)=1|2") in new stack
   -- Executing NoOp("SIP/8086-dd44", "1") in new stack
   -- Executing NoOp("SIP/8086-dd44", "") in new stack

the reason is that only first parameter '1' is past to ARRAY in function pbx_builtin_setvar.

i check the code and find no way to patch array without modifying the syntax of array function.

the syntax is now:

set(ARRAY(var1[,var2[...][,varN]]),(val1[,val2[...][,valN]]))
Comments:By: Tilghman Lesher (tilghman) 2006-01-15 10:58:18.000-0600

1) You're recoding strchr and strrchr unnecessarily in this patch.

2) At any rate, we're going to solve this a different way:  by allowing arguments to be quoted in ast_app_separate_args().