Fix call block hold music to play the hold music.
Allows defining hold_music in the dialplan for a custom music on hold.
This commit is contained in:
@@ -51,6 +51,7 @@
|
|||||||
context = session:getVariable("context");
|
context = session:getVariable("context");
|
||||||
call_block = session:getVariable("call_block");
|
call_block = session:getVariable("call_block");
|
||||||
extension_uuid = session:getVariable("extension_uuid");
|
extension_uuid = session:getVariable("extension_uuid");
|
||||||
|
hold_music = session:getVariable("hold_music");
|
||||||
end
|
end
|
||||||
|
|
||||||
--set default variables
|
--set default variables
|
||||||
@@ -172,9 +173,9 @@
|
|||||||
end
|
end
|
||||||
if (call_block_app ~= nil and call_block_app == 'hold') then
|
if (call_block_app ~= nil and call_block_app == 'hold') then
|
||||||
if (session:ready()) then
|
if (session:ready()) then
|
||||||
session:execute("respond", '600');
|
|
||||||
session:execute('set', 'call_block_uuid='..call_block_uuid);
|
session:execute('set', 'call_block_uuid='..call_block_uuid);
|
||||||
session:execute('set', 'call_block_app=hold');
|
session:execute('set', 'call_block_app=hold');
|
||||||
|
session:execute("playback", hold_music);
|
||||||
freeswitch.consoleLog("notice", "[call_block] caller id number " .. caller_id_number .. " action: Hold\n");
|
freeswitch.consoleLog("notice", "[call_block] caller id number " .. caller_id_number .. " action: Hold\n");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user