Campaigns
Behavior
Agent Based Calls
The campaign manager send a list of contacts with a scheduled call time to the scheduler.
The scheduler sends these contacts to the Customer Channel Manager(CCM) at the scheduled time.
The CCM passes these contacts to the voice connector(VC).
The VC sends these to the dialer.
The dialer stores them in the a database.
The dialer periodically reads this database and processes the contacts based on the campaign type.
For Agent-Based calls, the dialer sends an agent request to the VC.
The voice connector sends a request for a voice agent with the call details to the CCM.
The CCM obtains the details of an available Voice agent and send them to the VC.
The VC passes these details to the dialer.
The dialer sends a command to EFSwitch with the customer and agent information.
EFSwitch calls the customer.
Upon answer, the call is bridged to the EF CX Agent.
When the call ends the call result is sent to dialer via EFSwitch.
The call result is stored in the database and sent to the VC.
The VC sends this result to the CCM as a Delivery Notification.
IVR Based Calls
The campaign manager send a list of contacts with a scheduled call time to the scheduler.
The scheduler sends these contacts to the Customer Channel Manager(CCM) at the scheduled time.
The CCM passes these contacts to the voice connector(VC).
The VC sends these to the dialer.
The dialer stores them in the a database.
The dialer periodically reads this database and processes the contacts based on the campaign type.
The dialer sends a command to EFSwitch with the customer and IVR information.
EFSwitch calls the customer.
Upon answer, the call is bridged to the EFSwitch IVR.
When the call ends the call result is sent to dialer via EFSwitch.
The call result is stored in the database and sent to the VC.
The VC sends this result to the CCM as a Delivery Notification.
Technical Solution
Contact Structure
The parameters for a campaign contact are set in the campaign manager sent to the scheduler.
These parameters are described in the following sections, along with other relevant information that the dialer stores in a database based on the state of the contact.
Mandatory
Field | Description | Type | Provided By |
---|---|---|---|
id | Unique UUID identifier used to identify this contact and call | VARCHAR(40) | Campaign Manager |
customer_number | The number to be dialed | VARCHAR(20) | Campaign Manager |
campaign_type | IVR or AGENT | VARCHAR(20) | Campaign Manager |
gateway_id | The UUID of the EFSwitch gateway to be used to dial customer number | VARCHAR(40) | Campaign Manager |
status | pending, agent_pending, dialed, ended, stopped or failed | VARCHAR(20) | Dialer |
call_result | The result of a call e.g. Normal clearing, User busy etc | VARCHAR(40) | Dialer |
received_time | The time at which the contact was received by the dialer | DateTime | Dialer |
dial_time | The time at which the contact was sent by the dialer to EFSwitch to be dialed | DateTime | Dialer |
campaign_contact_id | The id of the contact received in CCM message payload | VARCHAR(40) | Campaign Manager |
campaign_id | The campaign id received in CCM message | VARCHAR(40) | Campaign Manager |
start_time | The contact cannot be dialed before this time | DateTime | Campaign Manager |
end_time | The contact cannot be dialed after this time | DateTime | Campaign Manager |
priority | The contact between 1-10 | Integer | Campaign Manager |
IVR campaign
Can be provided in an IVR campaign. If not provided, the default value configured in the dialer is used.
Field | Description | Type | Provided By |
---|---|---|---|
ivr | The ivr to be selected, THE IVR number, if contact is IVR based | VARCHAR(20) | Campaign Manager |
Agent campaign
Mandatory for agent campaigns.
Field | Description | Type | Provided By |
---|---|---|---|
dialing_mode | PREDICTIVE, PREVIEW or PROGRESSIVE | VARCHAR(20) | Campaign Manager |
routing_mode | AGENT or QUEUE, only for contacts with campaign_type = AGENT | VARCHAR(20) | Campaign Manager |
resource_id | Queue or AgentId based on routing_mode | VARCHAR(40) | Campaign Manager |
queue_name | The name of queue if routing_mode = QUEUE, optional if routing_mode = AGENT or if routing_mode = QUEUE and resource_id is set | VARCHAR(20) | Campaign Manager |
Dialing Flow
The dialer will periodically query the database and take note of all the campaigns and the number of their contacts present.
It will also take note of the current free call slots.
It will then follow one of two cases:
Slots > Campaigns
At least one contact picked from each campaign.
Preference given to campaign with least contacts.
Dialing order for each campaign is FIFO, if multiple contacts from same campaign are picked.
Overall dialing order is campaign with lowest contacts first.
Slots <= Campaigns
First for each campaign contacts are ordered by received_time ascending(from oldest added, to newest added)
For each campaign the oldest added contact is put into a list
This list is sorted by received_time ascending(from oldest added, to newest added)
From this list we pick the first X number of contacts where X = free slots
These contacts are then sequentially processed based on the campaign type.
The dialing speed is also throttled based on the configured value in the environment variables.
IVR Campaigns
For IVR based campaigns, the IVR number is taken from the contact entry if set.
If the IVR number is not provided in the contact entry then the default IVR specified in the dialer configuration is used.
The dialer checks via EFSwitch ESL if the gateway provided is valid.
If it is valid, then the following command is sent to EFSwitch to initiate the call:
JSoriginate {session_in_hangup_hook=true,domain_name=EFSWITCH-IP,record_session=true,origination_caller_id_name=IVR-NUMBER,origination_caller_id_number=IVR-NUMBER,call_direction=outbound,origination_uuid=call_uuid}sofia/gateway/GATEWAY-ID/CUSTOMER-NUM IVR-NUMBER XML EFSWITCH-IP
If invalid, the contact status is set to 'failed' and it will not be redialed.
If the gateway is down then the contact status is set back to 'pending' to be tried again later.
The call slots are decremented by 1.
Once the call ends, the dialer receives a call-ended event from the EFSwitch ESL and:
Stores the call result in the database and sets the status to 'ended'.
Sends the call result to the Voice Connector for a Delivery notification to be sent to the CCM.
Increments the call slots by 1.
Agent Campaigns
If the campaign call type is of 'AGENT', then the contact status is set to 'agent_pending' and call information is posted to the voice connector API.
The call slots are decremented by 1.
The voice connector sends back the following payload when it received either an agent reserved or no agent available notification from the CCM:
If no agent was available, the dialer sets the contact status to 'pending' to try again the next time it queries for pending contacts.
If agent was reserved, then the dialer checks via EFSwitch ESL if the gateway provided is valid.
If invalid, the contact status is set to 'failed' and it will not be redialed.
If the gateway is down then the contact status is set back to 'pending' to be tried again later.
In either case call information is sent to the voice connector which will send an END_CHAT payload to the CCM to close the conversation and free up the agent.
The following command is sent to EFSwitch which will call the customer and bridge the answered call to the agent:
JSoriginate {ignore_early_media=true,session_in_hangup_hook=true,sip_h_X-Destination-Number=SERVICE-IDENTIFIER,sip_h_X-CallType=PROGRESSIVE,customer_number=CUSTOMER-NUM,sip_h_X-CALL-VARIABLE0=CALL-ID,sip_h_X-Call-Id=CALL-ID,domain_name=EFSWITCH-IP,record_session=true,call_direction=outbound,sip_h_X-queueType=NAME,sip_h_X-queue='QUEUE_NAME',origination_uuid=CALL-ID,origination_caller_id_name=AGENT-EXTENSION,origination_caller_id_number=AGENT-EXTENSION,sip_h_X-agentExtension=AGENT-EXTENSION}sofia/gateway/GATEWAY-ID/CUSTOMER-NUM agent XML EFSWITCH-IP
Once the call ends, the dialer receives a call-ended event from the EFSwitch ESL and:
Stores the call result in the database and sets the status to 'ended'.
Sends the call result to the Voice Connector for a Delivery notification to be sent to the CCM.
Increments the call slots by 1.
If the customer had dropped the call after answering (before the agent could be bridged):
The dialer detects the case via the call variables in the call-ended event.
Call information is sent to the voice connector which will send an END_CHAT payload to the CCM to close the conversation.
Additional Functions
Campaign controls
The dialer exposes three APIs that can be called by the campaign manager to start, stop or purge campaigns:
Set this campaign's stopped contacts' status to 'pending'.
Set this campaign's pending contacts' status to 'stopped'.
Remove all pending contacts with this campaign ID.
Check Dialer Status
This API can be used to check the configured value of MAX_CONCURRENT_CALLS and the current number of active calls i.e. contacts with the dialed or agent_pending state.
Failover Cases
Scenarios | Behavior |
---|---|
The voice connector is down and the agent reservation request cannot be sent to it. | Contact status remains on pending and will be tried again. |
The database is down and dialer cannot retrieve contacts. | Dialer will retry on its next cycle. |
EFSwitch gateway is invalid. | Contact status is set to failed and call result set as Invalid Gateway. |
EFSwitch gateway is down. | Contact status set to pending. |
EFSwitch is down and call command cant be sent. | Contact status is set to failed. |
Campaign manager sends campaign control command(start/stop/purge) to dialer, but database is down. | A Service Unavailable error is returned. |
Campaign manager sends campaign control command to dialer, but no entries with supplied campaign ID are found. | A Not Found error is returned. |
Voice connector sends agent details to dialer but database is down. | A Service Unavailable error is returned. |
Voice connector sends agent details to dialer but an unexpected error occurs e.g. EFSwitch is down. | An Internal Server error is returned. |