Пока не пропала информация - анонс позиции звонящего в очереди mod_callcenter
http://wiki.freeswitch.org/wiki/Mod_callcenter#Lua_Script_to_announce_members_positionLua Script to announce members positionThis is the script to place in $PREFIX/scripts:
Код:
-- Initialization of variables
api = freeswitch.API()
-- First argument is caller uuid.
caller_uuid = argv[1]
if caller_uuid==nil then return end
-- Second argument is callcenter name.
queue_name = argv[2]
if queue_name==nil then return end
-- Third argument is repeating interval in miliseconds.
mseconds = argv[3]
if mseconds==nil then return end
while (true) do
freeswitch.msleep(mseconds) -- Pause before announcing position
members = api:executeString("callcenter_config queue list members "..queue_name)
pos=1 -- Variable to count position
exists=false -- Variable to allow script termination when member leaves queue
for line in members:gmatch("[^\r\n]+") do
if (string.find(line,"Trying")~=nil or string.find(line,"Waiting")~=nil) then
-- Members have a position when their state is Waiting or Trying
if string.find(line,caller_uuid,1,true)~=nil then
exists=true -- Member still in queue so script must continue
api:executeString("uuid_broadcast "..caller_uuid.." ivr/ivr-you_are_number.wav aleg")
api:executeString("uuid_broadcast "..caller_uuid.." digits/"..pos..".wav aleg")
end
pos=pos+1
end
end
if exists==false then return end -- If member was not found in queue, or it's status is Aborted - terminate script
end
Пример плана набора
Код:
<extension name="callcenter-example">
<condition field="destination_number" expression="^callcenter$" break="on-false">
<!-- limit 3 calls to this destination number per 1 second, otherwise give congestion message -->
<action application="limit" data="hash inbound ${destination_number} 3/1 !NORMAL_CIRCUIT_CONGESTION"/>
</condition>
<condition>
<!-- play a message before entering the queue. -->
<action application="playback" data="ivr/ivr-welcome.wav"/>
<action application="playback" data="ivr/ivr-one_moment_please.wav"/>
<!-- hangup after successful bridge to agent -->
<action application="set" data="hangup_after_bridge=true"/>
<!-- queue caller -->
<action application="set" data="result=${luarun(callcenter-announce-position.lua ${uuid} example@default 10000)}"/>
<action application="callcenter" data="example@default"/>
<!-- if no agent was reached and using max-wait-time - send to general voicemail -->
<action application="playback" data="ivr/ivr-please_state_your_name_and_reason_for_calling2.wav"/>
<action application="answer"/>
<action application="set" data="skip_greeting=true"/>
<action application="set" data="skip_instructions=true"/>
<action application="voicemail" data="default ${domain_name} callcenter"/>
<action application="hangup"/>
</condition>
</extension>