Hi I think i found a bug on XML preprocessor in way of working with preprocessor varibles. I have problem with concatenation of preprocessor variables in XML config. Preprocessor is incorectly concatenatin two preprocessor variables, and building wrong config xml. Best to explain on example: in vars.xml: <X-PRE-PROCESS cmd="set" data="bug_test_1=xpreprocessbug1" /> <X-PRE-PROCESS cmd="set" data="bug_test_2=xpreprocessbug2" /> <X-PRE-PROCESS cmd="set" data="bug_test_3=xpreprocessbug3" /> <X-PRE-PROCESS cmd="set" data="bug_test_4=xpreprocessbug4" /> <X-PRE-PROCESS cmd="set" data="bug_test_sum1=$${bug_test_1}$${bug_test_2}$${bug_test_3}$${bug_test_4}" /> <X-PRE-PROCESS cmd="set" data="bug_test_sum2=$${bug_test_1}^$${bug_test_2}^$${bug_test_3}^$${bug_test_4}" /> then in dialplan: <extension name="x_preprocess_bug1" continue="false" > <condition field="destination_number" expression="$${bug_test_sum1}" > <action application="info" /> </condition> </extension> <extension name="x_preprocess_bug2" continue="false" > <condition field="destination_number" expression="$${bug_test_sum2}" > <action application="info" /> </condition> </extension> but in freeswitch.xml.fsxml: <extension name="x_preprocess_bug1" continue="false" > <condition field="destination_number" expression="xpreprocessbug1$%{bug_test_2}xpreprocessbug3$%{bug_test_4}" > <action application="info" /> </condition> </extension> <extension name="x_preprocess_bug2" continue="false" > <condition field="destination_number" expression="xpreprocessbug1^xpreprocessbug2^xpreprocessbug3^xpreprocessbug4" > <action application="info" /> </condition> </extension> The odd variables are wrong translated by preprocessor . The odd variable used as $${var} is translated corect to his content, but the even variable used as $${var} is mangled and in freeswitch.xml.fsxml is to seen %${var} form of prefious $${var}. This problem only ocur, if tvo variables are direcly concatenated w/o any char between them. config : <X-PRE-PROCESS cmd="set" data="bug_test_sum1=$${bug_test_1}$${bug_test_2}$${bug_test_3}$${bug_test_4}" /> is translated to string: "xpreprocessbug1$%{bug_test_2}xpreprocessbug3$%{bug_test_4}" , to see in extension name="x_preprocess_bug1". If there is a char between concatenated variables (in my test a ^ char), everything is OK, to see in extension name="x_preprocess_bug2". It's this known problem or I'm wrong understanding preprocessor usage ?? Thanks Kleo -- kleo+freeswitch@netbox.cz
yes it was a bug, it has been fixed in r13385 please report future bugs to http://jira.freeswitch.org not the mailing list. On Tue, May 19, 2009 at 9:12 AM, Vladimir Klejch < klejch+freeswitch@netbox.cz <klejch%2Bfreeswitch@netbox.cz>> wrote:
Hi
I think i found a bug on XML preprocessor in way of working with preprocessor varibles.
I have problem with concatenation of preprocessor variables in XML config.
Preprocessor is incorectly concatenatin two preprocessor variables, and building wrong config xml.
Best to explain on example:
in vars.xml:
<X-PRE-PROCESS cmd="set" data="bug_test_1=xpreprocessbug1" /> <X-PRE-PROCESS cmd="set" data="bug_test_2=xpreprocessbug2" /> <X-PRE-PROCESS cmd="set" data="bug_test_3=xpreprocessbug3" /> <X-PRE-PROCESS cmd="set" data="bug_test_4=xpreprocessbug4" />
<X-PRE-PROCESS cmd="set" data="bug_test_sum1=$${bug_test_1}$${bug_test_2}$${bug_test_3}$${bug_test_4}" /> <X-PRE-PROCESS cmd="set" data="bug_test_sum2=$${bug_test_1}^$${bug_test_2}^$${bug_test_3}^$${bug_test_4}" />
then in dialplan:
<extension name="x_preprocess_bug1" continue="false" > <condition field="destination_number" expression="$${bug_test_sum1}" > <action application="info" /> </condition> </extension>
<extension name="x_preprocess_bug2" continue="false" > <condition field="destination_number" expression="$${bug_test_sum2}" > <action application="info" /> </condition> </extension>
but in freeswitch.xml.fsxml:
<extension name="x_preprocess_bug1" continue="false" > <condition field="destination_number" expression="xpreprocessbug1$%{bug_test_2}xpreprocessbug3$%{bug_test_4}" > <action application="info" /> </condition> </extension>
<extension name="x_preprocess_bug2" continue="false" > <condition field="destination_number" expression="xpreprocessbug1^xpreprocessbug2^xpreprocessbug3^xpreprocessbug4"
<action application="info" /> </condition> </extension>
The odd variables are wrong translated by preprocessor . The odd variable used as $${var} is translated corect to his content, but the even variable used as $${var} is mangled and in freeswitch.xml.fsxml is to seen %${var} form of prefious $${var}. This problem only ocur, if tvo variables are direcly concatenated w/o any char between them.
config :
<X-PRE-PROCESS cmd="set" data="bug_test_sum1=$${bug_test_1}$${bug_test_2}$${bug_test_3}$${bug_test_4}" />
is translated to string:
"xpreprocessbug1$%{bug_test_2}xpreprocessbug3$%{bug_test_4}" , to see in extension name="x_preprocess_bug1".
If there is a char between concatenated variables (in my test a ^ char), everything is OK, to see in extension name="x_preprocess_bug2".
It's this known problem or I'm wrong understanding preprocessor usage ??
Thanks Kleo
-- kleo+freeswitch@netbox.cz <kleo%2Bfreeswitch@netbox.cz>
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
participants (2)
-
Anthony Minessale
-
Vladimir Klejch