<extension name="public_proxy_iqtek_hello">
<condition regex="all" break="on-false">
<regex field="network_addr" expression="^82\.146\.53\.62$"/>
<regex field="destination_number" expression="^(\d+)$"/>
<action application="set" data="sip_h_X-IQANTIBOT-Source=${network_addr}"/>
<action application="set" data="bypass_media=false"/>
<action application="set" data="sip_cid_type=none"/>
<action application="set" data="group_confirm_file=lua /opt/iqtek/scripts/hello/botdetect_hello.lua"/>
<action application="set" data="group_confirm_key=exec"/>
<action application="bridge" data="{sip_contact_user=${caller_id_number},ignore_early_media=consume}sofia/external/sip:$1@82.146.53.62;fs_path=sip:62.109.18.143:7000"/>
</condition>
</extension>
session:execute("detect_audio","100 15 2000")
freeswitch.console_log("info", session:getVariable("detect_audio_timeout") .. "\n");
if session:getVariable("detect_audio_timeout") == "true" then
session:execute("playback","/opt/iqtek/scripts/hello/hello_women1");
session:execute("detect_audio","100 15 6000");
freeswitch.console_log("info", session:getVariable("detect_audio_timeout") .. "\n");
if session:getVariable("detect_audio_timeout") == "false" then
freeswitch.console_log("info", "DISCONNECT!!!\n");
session:hangup("USER_BUSY");
else
session:execute("detect_silence","100 15 500")
freeswitch.console_log("info", "Got reaction after initiation phrase\n");
end
else
session:execute("detect_silence","100 15 500")
freeswitch.console_log("info", "Got proper human greeting\n");
end
файл: hello_women1.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000
экспортируем аудиоданные файла со следующими данными:
заголовок: RAW (header-less)
кодирование: A-Law
Переименовываем файл hello_women1.raw
в hello_women1.PCMA
и отправляем на сервер Freeswitch