Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我正在使用Lua编写一个IVR,并希望在两者之间运行xml脚本_Xml_Lua_Freeswitch_Ivr - Fatal编程技术网

我正在使用Lua编写一个IVR,并希望在两者之间运行xml脚本

我正在使用Lua编写一个IVR,并希望在两者之间运行xml脚本,xml,lua,freeswitch,ivr,Xml,Lua,Freeswitch,Ivr,这是运行IVR的Lua代码 i = 0 j = 0 while (session:ready() == true) do session:setAutoHangup(false); repeat digits = session:playAndGetDigits(1, 3, 3, 3000, "#", "/var/sipxdata/mediaserver/data/ivrscript/sampleIvrS1test/prompts/Corporate.wav", "shout:

这是运行IVR的Lua代码

i = 0
j = 0

while (session:ready() == true) do 


session:setAutoHangup(false);




repeat

digits = session:playAndGetDigits(1, 3, 3, 3000, "#", "/var/sipxdata/mediaserver/data/ivrscript/sampleIvrS1test/prompts/Corporate.wav", "shout://translate.google.com/translate_tts?tl=en&q=This+option+is+not+valid", "\\d+"); 



  if ( digits == "1")  then

    repeat 


   digits = session:playAndGetDigits(1, 3, 3, 3000, "#", "/var/sipxdata/mediaserver/data/ivrscript/sampleIvrS1test/prompts/coral_converted.wav","shout://translate.google.com/translate_tts?tl=en&q=This+option+is+not+valid", "\\d+");



  if (digits == "1")  then
    language = "de"
    session:execute("set","transfer_ringback=$${us-ring}");
    session:execute("bridge","sofia/clixxo.co.in/208@10.161.17.112");
    session:hangup();
    destroy(0);



  elseif (digits == "2")  then

    language = "de"
    session:execute("set","transfer_ringback=$${us-ring}");
    session:execute("bridge","sofia/clixxo.co.in/101@10.161.17.112");
    session:hangup();
    destroy(0);




else
    language = "de"
    session:execute("set","transfer_ringback=$${us-ring}");
    session:execute("bridge","sofia/clixxo.co.in/200@10.161.17.112");
    session:hangup();
    destroy(0);



end




until j == 2
end
until i == 5




end
如果用户按下数字3,我想运行以下xml代码的功能。它可以通过LuaXML解析器实现,但我不知道如何实现

<permission>
<name>900Dialing</name>
<label>900Dialing</label>
<defaultValue>false</defaultValue>
<type>CALL</type>
<builtIn>true</builtIn>
</permission>

900拨号
900拨号
假的
呼叫
真的

Centos已经有了XPAT xml解析器,但我不知道如何使用它?

您可以从
mod_Perl
运行Perl脚本,方法与使用Lua相同。它的开销要大一点,但是Perl的所有优点都在这里。另外,最灵活的方法是使用事件套接字库并控制来自外部应用程序的调用。在这种情况下,您有更广泛的编程语言选择。

请正确缩进您的代码。我只能使用Lua,因为我使用的代码位于Freeswitch服务器中,该服务器支持xml或Lua进行IVR确认。