
来自官网,侵权删!!!
mod_callcenter
About
mod_callcenter is an inbound call queuing application that can be used for call center needs.
The callcenter dialplan application provides call center functionality by distributing calls to agents using various scenarios and rules. A score-based system is used to distribute inbound calls. A caller's score increases by 1 for every second he waits. You can add a base score to help move a caller to the front of a queue or just remove the wait time from that queue. The callcenter application also has a tiered system for creating different agent 'priorities' as needed.
A simpler alternative means of handling incoming call queues is with mod_fifo, a first-in, first-out (FIFO) queuing system.
Click to expand Table of Contents
Configuration
Settings
odbc-dsn
The callcenter will use the supplied ODBC database instead of the default behavior, which is to use the internal SQLite database.
dbname
This is to specify a different name or path and name of the SQLite database. Useful to put into a ram disk for better performance.
Agent options
type
We currently support 2 types, 'callback' and 'uuid-standby'. callback will try to reach the agent via the contact fields value. uuid-standby will try to bridge the call directly using the agent uuid.
contact
A simple dial string can be put in here, like: user/1000@default. If using verto: ${verto_contact(1000@default)}
status
Define the current status of an agent. Check the Agents Status table for more information.
max-no-answer
If the agent fails to answer calls this number of times, his status is changed to On Break automatically.
wrap-up-time
The amount of time to wait before putting the agent back in the available queue to receive another call, to allow her to complete notes or other tasks.
reject-delay-time
If the agent presses the reject button on her phone, wait this defined time amount.
busy-delay-time
If the agent is on Do Not Disturb, wait this defined time before trying him again.
no-answer-delay-time
If the agent does not answer the call, wait this defined time before trying him again.
reserve-agents
If defined to true, agent state is changed to Reserved if the old state is Receiving, the call will only be sent to him if the state get's changed.
This is useful if you're manipulating agent state external to mod_callcenter. false by default.
truncate-agents-on-load
If defined to true, we'll delete all the agents when the module is loaded. false by default.
truncate-tiers-on-load
If defined to true, we'll delete all the tiers when the module is loaded. false by default.
Queue options
strategy
The strategy defines how calls are distributed in a queue. A table of different strategies can be found below.
moh-sound
The system will playback whatever you specify to incoming callers. You can use any type of input here that is supported by the FreeSWITCH playback system:
- A direct path to a .wav file will play in a loop indefinitely.
- The local stream, e.g. (local_stream://moh) or use $${hold_music} as defined in the default configuration.
- The FreeSWITCH phrase system, e.g., (phrase:my-special-phrase
). (I use this to play multiple prompts after each other.)
record-template
time-base-score
tier-rules-apply
tier-rule-wait-second
tier-rule-wait-multiply-level
tier-rule-no-agent-no-wait
discard-abandoned-after
abandoned-resume-allowed
max-wait-time
max-wait-time-with-no-agent
max-wait-time-with-no-agent-time-reached
ring-progressively-delay
leg_timeout callcenter的分机组里边想让分机a多振玲一会再转去b分机
callcenter.conf.xml example
<configuration name="callcenter.conf" description="CallCenter">
<!--<param name="odbc-dsn" value="dsn:user:pass"/>-->
<!--<param name="dbname" value="/dev/shm/callcenter.db"/>-->
<param name="strategy" value="agent-with-least-talk-time"/>
<param name="moh-sound" value="$${hold_music}"/>
<param name="time-base-score" value="queue"/>
<param name="tier-rules-apply" value="false"/>
<param name="tier-rule-wait-second" value="300"/>
<param name="tier-rule-wait-multiply-level" value="true"/>
<param name="tier-rule-no-agent-no-wait" value="false"/>
<param name="discard-abandoned-after" value="14400"/>
<param name="max-wait-time" value="0"/>
<param name="max-wait-time-with-no-agent" value="120"/>
<queue name="support@default">
<param name="strategy" value="longest-idle-agent"/>
<param name="moh-sound" value="$${hold_music}"/>
<param name="time-base-score" value="system"/>
<param name="tier-rules-apply" value="false"/>
<param name="tier-rule-wait-second" value="300"/>
<param name="tier-rule-wait-multiply-level" value="true"/>
<param name="tier-rule-no-agent-no-wait" value="false"/>
<param name="discard-abandoned-after" value="60"/>
<param name="abandoned-resume-allowed" value="false"/>
<param name="max-wait-time" value="0"/>
<param name="max-wait-time-with-no-agent" value="120"/>
<!-- WARNING: Configuration of XML Agents will be updated into the DB upon restart. -->
<!-- WARNING: Agents and Tiers XML config shouldn't be used in a multi FS shared DB setup. -->
<!-- If you would like to set the Caller ID name, for whatever reason notice below. -->
<!-- agent 1000 will be in both the sales and support queues -->
<tier agent="1000@default" queue="sales@default" level="1" position="1"/>
<tier agent="1000@default" queue="support@default" level="1" position="1"/>
<!-- agent 1001 will only be in the support queue -->
<tier agent="1001@default" queue="support@default" level="1" position="1"/>
Put a caller into a queue
<action application="callcenter" data="support@default"/>
Time of Day / Voicemail timeout Example
<condition field="destination_number" expression="^3000$" break="on-false"/>
<condition wday="2-6" time-of-day="09:00-17:00" break="on-true">
<!-- limit 3 calls to this destination number per 1 second, otherwise give congestion message -->
<!-- play a message before entering the queue. -->
<action application="playback" data="$${sounds_dir}/greeting.wav"/>
<!-- hangup after successful bridge to agent -->
<action application="set" data="hangup_after_bridge=true"/>
<action application="callcenter" data="queue@default"/>
<!-- if no agent was reached and using max-wait-time - send to general voicemail -->
<action application="playback" data="$${sounds_dir}/queue_voicemail.wav"/>
<action application="answer"/>
<action application="set" data="skip_greeting=true"/>
<action application="set" data="skip_instructions=true"/>
<action application="voicemail" data="default voicemail 2001"/>
<action application="hangup"/>
<!-- outside business hours - play message and send to general voicemail -->
<action application="playback" data="$${sounds_dir}/tod_voicemail.wav"/>
<action application="answer"/>
<action application="set" data="skip_greeting=true"/>
<action application="set" data="skip_instructions=true"/>
<action application="voicemail" data="default voicemail 2001"/>
<action application="hangup"/>
Queues can only be configured in the XML configuration. They are only loaded once.
Distribution Strategy
| Rings the agent who has been idle the longest taking into account tier level. | |
| Rings the agent in order position starting from 1 for every member. | |
Time base score
Agents
Agent Status and States follow:
| State will be set to 'Idle' once the call ends (not automatically set to 'Waiting'). | |
Type
Callback
Available
Available (On Demand)
uuid-standby
This is used when agents call into the system and wait to receive a calls.
Sample Dialplan to use this function
<condition field="destination_number" expression="^(4099)$">
<action application="sleep" data="300"/> <!-- Small delay for safety needs -->
<action application="set" data="cc_warning_tone=tone_stream://%(200,0,500,600,700)"/>
<action application="answer" />
<action application="playback" data="$${hold_music}"/>
Rejecting Calls
Rejecting a call does not act as a 'no-answer'.
Do not disturb
Example Dialplan
Agent Login/Logout Example
<extension name="agent_login">
<condition field="destination_number" expression="^agent-login$">
<action application="answer" data=""/>
<action application="sleep" data="500"/>
<action application="playback" data="ivr/ivr-you_are_now_logged_in.wav"/>
<action application="hangup" data=""/>
<extension name="agent_logoff">
<condition field="destination_number" expression="^agent-logoff$">
<action application="answer" data=""/>
<action application="sleep" data="500"/>
<action application="playback" data="ivr/ivr-you_are_now_logged_out.wav"/>
<action application="hangup" data=""/>
Zero-out for voicemail
<action application="bind_digit_action" data="inqueue,0,exec:transfer,1000 XML default,aleg,self"/>
<action application="digit_action_set_realm" data="inqueue"/>
<action application="set" data="bridge_pre_execute_aleg_app=clear_digit_action"/>
<action application="set" data="bridge_pre_execute_aleg_data=all"/>
<action application="callcenter" data="example> />
API Commands
callcenter_config
agent
Add a new agent into the system
callcenter_config agent add [agent name] [type(Callback)]
callcenter_config agent del [agent name]
callcenter_config agent list [agent_name]
Get uuid of the agent who is bridged to a member
callcenter_config agent get uuid [agent_name]
tier
callcenter_config tier add [queue name] [agent name] [[level]] [[position]]
callcenter_config tier set [key(state|level|position)] [queue name] [agent name] [value]
callcenter_config tier set state support@default 21009@default on break
callcenter_config tier del [queue name] [agent name]
queue
Load a queue off the in memory xml config file
callcenter_config queue load [queue_name]
callcenter_config queue unload [queue_name]
callcenter_config queue reload [queue_name]
callcenter_config queue list agents [queue_name] [status] [state]
List callers present in the queue.
callcenter_config queue list members [queue_name]
List tiers associated to a specific queue.
callcenter_config queue list tiers [queue_name]
Return the total number of queues.
callcenter_config queue count agents [queue_name] [status]
callcenter_config queue count agents support@default Available
callcenter_config queue count members [queue_name]
callcenter_config queue count members support@default
Return the number of tiers associated to the specified queue.
callcenter_config queue count tiers [queue_name]
JSON API Commands
JSON API was added in FS-8799 - Jira project doesn't exist or you don't have permission to view it. and currently it support the following commands:
json {"command": "callcenter_config", "format": "pretty", "data": {"arguments":"agent list"}}
Listing queues
json {"command": "callcenter_config", "format": "pretty", "data": {"arguments":"queue list"}}
Listing agents for a queue
Listing members(callers) for a queue
Listing tiers for a queue
Listing members
json {"command": "callcenter_config","data": {"arguments":"member list"}}
Listing tiers
json {"command": "callcenter_config","data": {"arguments":"tier list"}}
Variables
cc_export_vars
Export variables to the b-leg(s) of call center (the agents)
<action application="set" data="hold_music=local_stream://example_moh"/>
<action application="set" data="origination_caller_id_name=Call Center"/>
<action application="set" data="origination_caller_id_number=9000"/>
<action application="callcenter" data="9000@callcenter"/>
cc_moh_override
Overrides the queue's default Music On Hold.
<action application="set" data="cc_moh_override=/var/sounds/custom_moh.wav"/>
<action application="set" data="cc_moh_override=/var/sounds/custom_moh.mp3"/>
<action application="set" data="cc_moh_override=tone_stream://%(2000,4000,440,480)"/>
cc_base_score
cc_exit_keys
Caller can exit the queue by pressing this key.
cc_outbound_cid_name_prefix
Adds prefix to the Caller ID Name of the caller.
cc_outbound_announce
Playback specific audio, or an array of audios, to the agent prior to bridging the member.
cc_bridge_failed_outbound_announce
<action application="callcenter" data="support@default"/>
cc_warning_tone
cc_record_filename
cc_side
Contains the leg side of the call. Can be either member or agent. (read-only)
cc_member_uuid
Contains the unique callcenter member uuid (Different from the member session uuid) (read-only)
cc_member_session_uuid
Contains the member session uuid. (Different from the member_uuid) (read-only)
cc_agent
Contains the agent who accepted the call from the queue. (read-only)
cc_queue_answered_epoch
Contains the epoch time that the agent answered the call. (read only)
cc_queue_terminated_epoch
Contains the epoch time that the bridge with the agent was terminated. (read-only)
cc_queue_joined_epoch
Contains the epoch time that the caller joined the queue and started waiting. (read-only)
cc_queue_canceled_epoch
Contains the epoch time when a caller leaves the queue and aborts the call. (read-only)
cc_agent_bridged
Events
Actions
Here are a few example events generated by mod_callcenter.
agent-status-change
When an agent's Status changes, this event is generated with the agent's new Status.
Event-Subclass: callcenter::info
CC-Action: agent-status-change
agent-state-change
Every time an agent's State changes, this event is generated.
Event-Subclass: callcenter::info
agent-offering
Every time a caller is presented to an agent (before he answers), this event is generated.
Event-Subclass: callcenter::info
CC-Member-UUID: 453324f8-3424-4322-4242362fd23d
CC-Member-Session-UUID: 600165a4-f748-11df-afdd-b386769690cd
CC-Member-CID-Name: CHOUINARD MO
CC-Member-CID-Number: 4385551212
bridge-agent-start
Event-Subclass: callcenter::info
CC-Agent-UUID: 7acfecd3-ab50-470b-8875-d37aba0429ba
CC-Member-UUID: 453324f8-3424-4322-4242362fd23d
CC-Member-Session-UUID: c6360976-231c-43c6-bda7-7ac4c7d1c125
CC-Member-CID-Name: Their Name
CC-Member-CID-Number: 555-555-5555
bridge-agent-end
Event-Subclass: callcenter::info
CC-Agent-UUID: 7acfecd3-ab50-470b-8875-d37aba0429ba
CC-Bridge-Terminated-Time: 10500
CC-Member-UUID: 453324f8-3424-4322-4242362fd23d
CC-Member-Session-UUID: c6360976-231c-43c6-bda7-7ac4c7d1c125
CC-Member-CID-Name: Their Name
CC-Member-CID-Number: 555-555-5555
bridge-agent-fail
Event-Subclass: callcenter::info
CC-Hangup-Cause: CHECK FS HANGUP CAUSE
CC-Member-UUID: 453324f8-3424-4322-4242362fd23d
CC-Member-Session-UUID: c6360976-231c-43c6-bda7-7ac4c7d1c125
CC-Member-CID-Name: Their Name
CC-Member-CID-Number: 555-555-5555
members-count
Event-Subclass: callcenter::info
member-queue-start
Joining the queue triggers this event, allowing you to track when callers enter the queue.
Event-Subclass: callcenter::info
CC-Member-UUID: 453324f8-3424-4322-4242362fd23d
CC-Member-Session-UUID: b77c49c2-a732-11df-9438-e7d9456f8886
CC-Member-CID-Name: CHOUINARD MO
CC-Member-CID-Number: 4385551212
member-queue-end
'Terminated' means the call ended after talking to an agent. Here is an example:
Event-Subclass: callcenter::info
CC-Hangup-Cause: CHECK FS HANGUP CAUSE
CC-Member-UUID: 453324f8-3424-4322-4242362fd23d
CC-Member-Session-UUID: b77c49c2-a732-11df-9438-e7d9456f8886
CC-Member-CID-Name: CHOUINARD MO
CC-Member-CID-Number: 4385551212
Event-Subclass: callcenter::info
CC-Member-UUID: 453324f8-3424-4322-4242362fd23d
CC-Member-Session-UUID: e260ffd0-a731-11df-9341-e7d9456f8886
CC-Member-CID-Name: Marc O Robinson
CC-Member-CID-Number: 5145551212
Sample Scripts
Python
This a very simple script that you can use to monitor all callcenter events.
con = ESL.ESLconnection("127.0.0.1", "8021", "ClueCon")
print("ERROR: connection failed!")
name = e.getHeader("Event-Name")
subclass = e.getHeader("Event-Subclass")
if subclass == 'callcenter::info':
print('->>' + name + '|' + subclass + '\n')
Lua
Lua Script to announce members position
This is the script to place in $PREFIX/scripts:
-- callcenter-announce-position.lua
-- Announce queue position to a member in a given mod_callcenter queue.
-- Arguments are, in order: caller uuid, queue_name, interval (in milliseconds).
if caller_uuid == nil or queue_name == nil or mseconds == nil then
-- Pause between announcements
members = api:executeString("callcenter_config queue list members "..queue_name)
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
-- 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")
-- If member was not found in queue, or it's status is Aborted - terminate script
Name this script for example callcenter-announce-position.lua. This script accepts three arguments:
If uuid is found, play the position. Using uuid_broadcast we can pause moh sound and play the audio file after which moh sound will continue to play. uuid_broadcast has a forth parameter which indicate to what leg we want to play the position. Position must hear only member which initiated the call, and therefore is considered as aleg.
We have to call this script before entering callcenter module. For example in the dialplan:
<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 -->
<!-- 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"/>
<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"/>
See Also
- mod_dptools: callcenter
- mod_fifo
- GitHub - gonicus/fsqueuemon: Web status monitor for FreeSWITCH's mod_callcenter queues and agents - Web status monitor for mod_callcenter queues and agents
本文介绍了mod_callcenter,它是用于呼叫中心的入站呼叫排队应用。阐述了其配置,包括设置、代理选项、队列选项等,还提及了API命令、变量、事件等内容,同时给出示例脚本,如Python和Lua脚本,以及相关注意事项。

1177

被折叠的 条评论
为什么被折叠?



