这是运行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代码的功能。它可以通过Lua xml Parser实现,但我不知道怎么做?
<permission>
<name>900Dialing</name>
<label>900Dialing</label>
<defaultValue>false</defaultValue>
<type>CALL</type>
<builtIn>true</builtIn>
</permission>
Centos已经有XPAT xml Parser,但我不知道如何使用它?
答案 0 :(得分:0)
您可以使用与使用Lua相同的方式从mod_perl
运行Perl脚本。它的开销有点大,但你拥有Perl的所有好东西。最灵活的方法是使用Event Socket库并控制来自外部应用程序的调用。在这种情况下,您可以选择更广泛的编程语言。