[Freeswitch-users] Lua XML parser

Avi Marcus avi at avimarcus.net
Mon Sep 12 10:37:05 MSD 2011


I tried a whole bunch from http://lua-users.org/wiki/LuaXml in order to
query mod_lcr and then custom-use the results but I wasn't able to get
"keyed" results, only numbered ones. I'm also interested in this..

-Avi


On Mon, Sep 12, 2011 at 9:26 AM, Glen Ganderton <
Glen.Ganderton at premier.com.au> wrote:

> Hey Guys,****
>
> ** **
>
> I’m currently trying to create a basic IVR with voice recognition (just a
> simple YES or NO response). I have successfully configured the freeswitch
> MRCP client to connect to my nuance MRCP server and I successfully get a
> responses from the server. Now what I need to do is process the response in
> my freeswitch lua script. The nuance box returns the following:****
>
> ** **
>
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> ****
>
> Completion-Cause: 000 success****
>
> Content-Type: application/nlsml+xml****
>
> Content-Length: 178****
>
> ** **
>
> <?xml version='1.0'?><result><interpretation
> grammar="session:nuance5-mrcp2" confidence="0.99"><input
> mode="speech">yes</input><instance>true</instance></interpretation></result>
> ****
>
> ** **
>
> Now what I want to be able to do is parse the XML in my lua script so that
> I can simply have the XML stored in some variables:****
>
> ** **
>
> Eg.****
>
> ** **
>
> Confidence = 0.99****
>
> Input = yes****
>
> Instance =  true****
>
> ….etc.****
>
> ** **
>
> I am just starting to learn lua and am unable to do this myself. I have
> seen a few scripts online to parse XML for lua but none seem to work
> correctly (maybe they are meant for different format..not sure).****
>
> ** **
>
> If anybody could point me in the right direction or write some sample code
> for what I need to do that would be a great help.****
>
> ** **
>
> Thanks in advance.****
>
> ** **
>
> -Glen****
>
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110912/f72b0f7d/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list