To get all avmd events you can subscribe to all FS events and filter them by "Call-command":
What I need is to start intro sound file playback on call answer and detect
beep sound from callee side
What I tried is:
1. start avmd
2. bridge call
3. on answer start intro sound message playback using bgapi
BUT when background playback starts avmd seems to be paused and continues
after playback is completed.
gateway dialplan is:
<extension name="mytelco">
<condition field="destination_number" expression="^987(\d+)$">
<action application="set"
data="effective_caller_id_number=46xxxxxxxx"/>
<action application="set"
data="record_link=${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>
<action application="record_session"
data="/var/www/html/freeswitch/recordings/${record_link}"/>
<action application="lua"
data="/etc/freeswitch/scripts/beep_detection-from-call-v0.1.2.lua $1
${record_link}"/>
<action application="hangup"/>
</condition>
</extension>
file beep_detection-from-call-v0.1.2.lua
#!/usr/local/bin/lua
DNID = argv[1]
if session:ready() then
session:sleep(1000)
session:execute("avmd_start",
"inbound_channel=1,outbound_channel=0,sample_n_continuous_streak=10,sample_n_to_skip=0,debug=1,report_status=1")
session:execute("bridge", "{execute_on_answer=lua
/etc/freeswitch/scripts/on_answer-v0.3.lua " .. uuid ..
"}sofia/gateway/mytelco/" .. DNID)
session:execute("avmd_stop","")
end --if
file on_answer-v0.3.lua
#!/usr/bin/lua
uuid_original = argv[1]
api = freeswitch.API()
reply = api:executeString("bgapi uuid_broadcast " .. uuid_original .. "
/usr/share/asterisk/sounds/en/dennis-ivan.gsm both")
freeswitch.consoleLog("INFO","==============================================")
freeswitch.consoleLog("INFO","API reply is:" .. reply)
freeswitch.consoleLog("INFO","==============================================")
--
Sent from: http://freeswitch-users.2379917.n2.nabble.com/
_________________________________________________________________________
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
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
https://freeswitch.com