IVR Campaign Configuration Guide (Voice)

This guide explains how to configure an IVR-based outbound campaign in Expertflow CX. IVR campaigns dial contacts automatically and connect answered calls to an IVR script instead of a live agent.

Configuration overview:

  1. CX Environment File — create cx_env-{Domain}-{DN}.lua on the Media Server for your destination number.

  2. Outbound IVR Dialplan — create the dialplan that routes answered calls to outboundIvr.lua.

Configuration

1. CX Environment Configuration File

Each outbound IVR destination number needs a matching environment file on the Media Server. The file name must follow this pattern:

cx_env-{Domain-Name}-{DN}.lua

Placeholder

Description

Example

{Domain-Name}

Media Server / tenant domain

chatsolution

{DN}

Destination number used in the outbound IVR dialplan

6543

Example path:

/usr/share/freeswitch/scripts/cx_env-chatsolution-6543.lua

Create the file

  1. SSH into the Media Server and switch to root.

  2. Create the file for your domain and destination number:

    vi /usr/share/freeswitch/scripts/cx_env-chatsolution-6543.lua
    

    Replace chatsolution and 6543 with your domain and DN.

  3. Paste the following configuration:

Lua
local config = {}

local domain = session:getVariable("domain_name")
local cxFqdn = ""
if domain == "expertflow" then
    cxFqdn = "https://efcx4-voice.expertflow.com"  -- set Default Domain here
else
    cxFqdn = "https://" .. domain .. ".expertflow.com"  -- set Tenant based Domain here
end

config = {
    -- Set to NAME or ID depending on whether queue field contains name or ID of queue
    queueType = '',
    -- Name or ID of queue to reserve agents from
    queue = '',
    -- NOTE: Keeping queue and queueType as '' will cause CX to use the default queue set in the CX Voice channel

    -- FQDN of EF CX
    cxFqdn = cxFqdn,
    -- API of voice connector for reserving an agent
    -- Path of folder containing sound files that play during the IVR menu, DO NOT CHANGE
    ivr_prompts_folder = "/usr/share/freeswitch/sounds/ivr_prompts/",

    auth_enabled = false,
    auth_realm = "expertflow",
    client_secret = "ef61df80-061c-4c29-b9ac-387e6bf67052",
    client_id = "cim",
    username = "voice_auth",
    password = "1234"
}

return config
  1. Save and exit (Esc, then :wq).

  2. Verify the file:

    cat /usr/share/freeswitch/scripts/cx_env-chatsolution-6543.lua
    

When to change variables

Create the file first. Only update values if your environment requires it.

Deployment

What to change

Multi-tenant (MTT)

No configuration changes required. cxFqdn is resolved dynamically from the tenant domain. You may change IVR prompts only if needed.

Single tenant

Update only what differs in your environment — typically cxFqdn

Do not change ivr_prompts_folder unless your Media Server uses a non-standard prompts path.

2. Outbound IVR Dialplan

Create a dialplan on the Media Server that routes answered outbound IVR calls to outboundIvr.lua.

The destination number in this dialplan (e.g. 6543) must match the {DN} used in the cx_env file created in Section 1.

  1. Log in to the Media Server web interface.

  2. Open DialplanDialplan Manager.

  3. Click Add to create a new dialplan.

  4. Fill in the form:

    • Name = outbound-ivr

    • Condition 1 = destination_number with value ^(6543)$ (replace 6543 with your DN if different)

    • Action 1 = select the first item from the list (temporary; replace after saving)

  5. Click Save, then re-open the dialplan.

  6. Delete the temporary Action row (select the checkbox and click Save).

  7. Add the following rows and save:

Tag

Type

Data

Inline

Group

Order

Enabled

action

set

sip_h_X-Destination-Number=$1

true

0

10

true

action

lua

outboundIvr.lua


0

20

true

  • Set Context to global.

  • Set Domain to global.

  • Set Continue to False.

The configured dialplan should look like this:

image-20260804-051053.png
Dialplan XML reference
XML
<extension name="outbound-ivr" continue="false" uuid="0a662ef8-b653-4424-9272-f1e9d448d24a">
	<condition field="destination_number" expression="^(6543)$">
		<action application="set" data="sip_h_X-Destination-Number=$1" inline="true"/>
		<action application="lua" data="outboundIvr.lua"/>
	</condition>
</extension>

Important

  • Ensure outboundIvr.lua is present under /usr/share/freeswitch/scripts.

  • The destination number must be unique and must match the DN in the cx_env file and the number used by the dialer for IVR campaign calls.

  • Related setup: Media Server Configurations for CX Voice