Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Problem with XML preprocessor variable


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
klejch+freeswitch at n...
Guest





PostPosted: Tue May 19, 2009 9:38 am    Post subject: [Freeswitch-users] Problem with XML preprocessor variable Reply with quote

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


_______________________________________________
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
Back to top
anthony.minessale at g...
Guest





PostPosted: Tue May 19, 2009 11:01 am    Post subject: [Freeswitch-users] Problem with XML preprocessor variable Reply with quote

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 ([email]klejch%2Bfreeswitch@netbox.cz[/email])> wrote:
Quote:

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 ([email]kleo%2Bfreeswitch@netbox.cz[/email])


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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 ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services