Anton
Коллеги привет!
Возможно ли после команды
<action application="bridge" data="user/bob@domain" />
ловить причину hangup.
Если USER_BUSY проиграть файл user_busy.wav
Если SERVICE_UNAVAILABLE (пользователь недоступен) проиграть user_not_available.wav
и т.д.
Если механизм позволяющий это реализовать в диалплане?
Example: Playback custom error message
<action application="set" data="hangup_on_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="bridge" data="..."/>
<action application="lua" data="playerror.lua"/>
That'll run the lua script after the bridge, but only if the bridge fails.
In the lua script:
cause = session:getVariable("originate_disposition")
if (cause == "USER_BUSY") then
session:streamFile("ivr/ivr-user_busy.wav");
elseif (cause == "UNALLOCATED_NUMBER") then
session:streamFile("ivr/ivr-unallocated_number.wav");
elseif (cause == "NO_USER_RESPONSE" or cause=="NO_ANSWER") then
session:streamFile("ivr/ivr-no_user_response.wav");
else
session:streamFile("ivr/ivr-please_check_number_try_again.wav");
end