[Freeswitch-users] Problem with XML preprocessor variable

Anthony Minessale anthony.minessale at gmail.com
Tue May 19 08:39:53 PDT 2009


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 at netbox.cz <klejch%2Bfreeswitch at 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 at netbox.cz <kleo%2Bfreeswitch at netbox.cz>
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at 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 at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090519/fb01d041/attachment-0002.html 


More information about the FreeSWITCH-users mailing list