[Freeswitch-users] avmd stops when bgapi uuid_broadcast starts

ivan381eu i.vujisic at gmail.com
Sun Oct 6 09:01:49 UTC 2019


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/



More information about the FreeSWITCH-users mailing list