Requirements
Software Requirements
|
Item |
Recommended |
Installation guide |
|
Media Server |
Latest version |
|
|
EFCX |
4.10 |
Key Points to Remember
-
Single-Tenant Setup:
-
The tenant can be of any name, however, tenant name and the realm name must be same.
-
The SIP_URI in the Agent Desk configuration should be set to:
tenant name -
Since the default configuration is shared, multiple Voice Connectors can connect to the same FreeSWITCH server.
-
In this setup, there will be one FreeSWITCH instance and multiple Voice Connectors, all using the tenant
expertflow
-
-
-
Multi-Tenant Setup:
-
The tenant can be of any name, however, tenant name and the realm name must be same.
-
Dynamic configuration values will be generated.
-
For example:
cxFqdn = https://<TENANT-ID>.<ROOT_DOMAIN>
-
-
In this setup, there will be one Voice Connector and one FreeSWITCH instance, both configured dynamically based on the tenant.
1. Default Configuration (Once at the time of Installation of Media Server)
Install Lua libraries
-
SSH into the Debian server onto which the Media Server is installed.
-
Use command
ssh username@server-ip -
Enter user password and press ENTER.
-
Use command
su -
Enter root password and press ENTER.
-
-
Run the following commands, one at a time:
-
apt install lua-socket sudo apt install lua-sec sudo apt-get install lua-json sudo apt-get install -y lua-dkjson
Configure IVR scripts and recordings (Once at the time of Installation of Media Server)
Deployment
-
SSH into the Media Server.
-
Use command
ssh username@server-ip -
Enter user password and press ENTER.
-
Use command
su -
Enter root password and press ENTER.
-
-
Confirm git is installed, and install it if is not.
-
Clone the Media Server scripts repository:
git clone -b TAG https://efcx:RecRpsuH34yqp56YRFUb@gitlab.expertflow.com/rtc/freeswitch-scripts.git-
Where TAG is the latest branch tag of the Media Server scripts repository obtained from here.
-
-
Navigate to the cloned repository to access the files:
cd freeswitch-scripts -
Alter the file name of cx_env.lua to cx_env-{Domain-Name}-{DN}.lua where {Domain-Name} is the name of the Domain eg
expertflow, ortenant1, {DN} is the dialing number of the IVR (Set in the CxIvr Dialplan section below).-
e.g. for an IVR with a dialing number of 1555 and Domain Name is tenant1 the file would be named cx_env-tenant1-1555.lua.
mv cx_env.lua cx_env-tenant1-1555.lua
-
-
Move the files ending in .lua to the Media Server scripts folder:
-
mv *.lua /usr/share/freeswitch/scripts -
Move any custom IVR scripts to the Media Server scripts folder:
mv <custom-lua-IVR-script> /usr/share/freeswitch/scripts -
Move the ivr_prompts folder:
mv ivr_prompts /usr/share/freeswitch/sounds/ -
Assign read-write permissions to the ivr_prompts and scripts folder:
chmod 777 -R /usr/share/freeswitch/sounds/ivr_prompts chmod 777 -R /usr/share/freeswitch/scripts -
Assign the permission to recording directory. run this command to give the permission to recording directory
chmod 777 -R /var/lib/freeswitch/recordings/
Configuration
-
Open cx_env-{Domain-Name}-{DN}.lua :
vi /usr/share/freeswitch/scripts/cx_env-{Domain-Name}-{DN}.lualocal 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 Domian here end config = { -- Set to NAME or ID depending on whether queue field contains name or ID of queue queueType = 'NAME', -- Name or ID of queue to reserve agents from queue = 'Test Voice Queue', -- NOTE: Keeping queue and queueType as '' will cause CX to use the default queue set in the CX Voice channel -- queue = '', -- queueType = '', -- FQDN of EF CX cxFqdn = cxFqdn, -- API of voice connector for reserving an agent voiceConnectorApi = "http://VC-IP:PORT", -- 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 = "1234", client_id = "cim", username = "voice_auth", password = "1234" } return config -
Press the "I" key to enter editing mode.
-
The cxFqdn is dynamic in case of MTT, and for Single Tenant its value is hardcoded on line 7.
-
Single Tenant: set cxFqdn as
https://efcx4-voice.expertflow.com, replace it with actual FQDN. -
MTT: cxFqdn is set dymanically by fetching the domain value form Channel Variables. The Root Domain need to be udpated.
expertflow.comreplace it with actual Domain
-
-
The queueType field can contain one of two values:
-
'NAME'
-
''
-
-
The queue field can contain one of two types of values, based on what the queueType field above contains:
-
Name of the Agent Queue e.g. Support Queue (If queueType contains 'NAME') This name can be obtained from Unified Admin from the Queues section.
-
Empty string i.e. '' (If queueType contains '')
-
-
If queue and queueType are set to '' , then the call will be routed to the default queue set for the CX Voice channel in Unified Admin.
-
The voiceConnectorApi field will contain a URL in the following format:
-
http://VC-IP:VC-PORT/request-agent
-
Replace VC-IP and VC-PORT with IP address and port of the voice connector.
-
-
The ivr_prompts_folder field contains path to the ivr_prompts folder. Leave it at the default value.
-
AUTH_ENABLED: true or false depending on whether APISIX authentication is enabled in EFCX. The four settings below are set if this value is true.
-
API_USERNAME: The username created in Keycloak for API authentication.
-
On Keycloak create a user in the Expertflow realm.
-
Assign the admin and default roles, and have Email-Verified option enabled.
-
Assign a non-temporary password to this user as well.
-
-
API_PASS: The password for the above user created in Keycloak for API authentication
-
CLIENT_ID: Should always be cim.
-
CLIENT_SECRET: Found on Keycloak in the cim client.
-
Save and exit the file by pressing the Esc key, entering :wq and pressing ENTER.
-
Steps 16-21 below are optional, in case Post-Call-Survey is in use.
-
Open pcs1_env.lua:
vi /usr/share/freeswitch/scripts/pcs1_env.lualocal config = {} config = { formId = "form-id123", cxFqdn = "https://devops.expertflow.com", ivr_prompts_folder = "/usr/share/freeswitch/sounds/ivr_prompts/" } return config -
Press the "I" key to enter editing mode.
-
The formId will contain the ID of the PCS Survey form created on Unified Admin (make sure that audio prompts were uploaded for each question).
-
The cxFqdn field contains the fully qualified domain name of the EFCX:
-
Replace devops.expertflow.com with the EFCX domain name.
-
-
The ivr_prompts_folder field contains path to the ivr_prompts folder. Leave it at the default value.
-
Save and exit the file by pressing the Esc key, entering :wq and pressing ENTER.
-
Open vcApi.lua:
vi /usr/share/freeswitch/scripts/vcApi.lua
-
Search for
fsIpand ReplacefsIp = '192.168.1.161'with your actual Media Server Public IP -
Save and exit the file by pressing the Esc key, entering :wq and pressing ENTER.
Multi-Domain Utility Implementaion
For detailed setup instructions and step-by-step process, please refer to the following link:
👉 Multi-Domain Utility Implementation Guide
Configure Dialplans (Global)
Changes in conference profile
Changes in SIP Profile
Configure Access Control List (ACL)
Configure Event Socket Library (ESL)
Media Server Config Files
2. Configuration (on Each Domain)
Configuration
-
Open cx_env-{Domain-Name}-{DN}.lua :
vi /usr/share/freeswitch/scripts/cx_env-{Domain-Name}-{DN}.lualocal 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 Domian here end config = { -- Set to NAME or ID depending on whether queue field contains name or ID of queue queueType = 'NAME', -- Name or ID of queue to reserve agents from queue = 'Test Voice Queue', -- NOTE: Keeping queue and queueType as '' will cause CX to use the default queue set in the CX Voice channel -- queue = '', -- queueType = '', -- FQDN of EF CX cxFqdn = cxFqdn, -- API of voice connector for reserving an agent voiceConnectorApi = "http://VC-IP:PORT", -- 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 = "1234", client_id = "cim", username = "voice_auth", password = "1234" } return config -
Press the "I" key to enter editing mode.
-
The cxFqdn is dynamic in case of MTT, and for Single Tenant its value is hardcoded on line 7.
-
Single Tenant: set cxFqdn as
https://efcx4-voice.expertflow.com, replace it with actual FQDN. -
MTT: cxFqdn is set dymanically by fetching the domain value form Channel Variables. The Root Domain need to be udpated.
expertflow.comreplace it with actual Domain
-
-
The queueType field can contain one of two values:
-
'NAME'
-
''
-
-
The queue field can contain one of two types of values, based on what the queueType field above contains:
-
Name of the Agent Queue e.g. Support Queue (If queueType contains 'NAME') This name can be obtained from Unified Admin from the Queues section.
-
Empty string i.e. '' (If queueType contains '')
-
-
If queue and queueType are set to '' , then the call will be routed to the default queue set for the CX Voice channel in Unified Admin.
-
The voiceConnectorApi field will contain a URL in the following format:
-
http://VC-IP:VC-PORT/request-agent
-
Replace VC-IP and VC-PORT with IP address and port of the voice connector.
-
-
The ivr_prompts_folder field contains path to the ivr_prompts folder. Leave it at the default value.
-
AUTH_ENABLED: true or false depending on whether APISIX authentication is enabled in EFCX. The four settings below are set if this value is true.
-
API_USERNAME: The username created in Keycloak for API authentication.
-
On Keycloak create a user in the Expertflow realm.
-
Assign the admin and default roles, and have Email-Verified option enabled.
-
Assign a non-temporary password to this user as well.
-
-
API_PASS: The password for the above user created in Keycloak for API authentication
-
CLIENT_ID: Should always be cim.
-
CLIENT_SECRET: Found on Keycloak in the cim client.
-
Save and exit the file by pressing the Esc key, entering :wq and pressing ENTER.
-
Steps 16-21 below are optional, in case Post-Call-Survey is in use.
-
Open pcs1_env.lua:
vi /usr/share/freeswitch/scripts/pcs1_env.lualocal config = {} config = { formId = "form-id123", cxFqdn = "https://devops.expertflow.com", ivr_prompts_folder = "/usr/share/freeswitch/sounds/ivr_prompts/" } return config -
Press the "I" key to enter editing mode.
-
The formId will contain the ID of the PCS Survey form created on Unified Admin (make sure that audio prompts were uploaded for each question).
-
The cxFqdn field contains the fully qualified domain name of the EFCX:
-
Replace devops.expertflow.com with the EFCX domain name.
-
-
The ivr_prompts_folder field contains path to the ivr_prompts folder. Leave it at the default value.
-
Save and exit the file by pressing the Esc key, entering :wq and pressing ENTER.
-
Open vcApi.lua:
vi /usr/share/freeswitch/scripts/vcApi.lua
-
Search for
fsIpand ReplacefsIp = '192.168.1.161'with your actual Media Server Public IP -
Save and exit the file by pressing the Esc key, entering :wq and pressing ENTER.
Configure Dialplans
Configure SIP Trunk and routes
Configure Access Control List (ACL)
CX Voice Recording Components
Follow the guide here to deploy the recording link uploader and middleware components.