VICIdial
VICIdial can be integrated with Fone AI using custom SIP trunk connection.
Have the following information in hand from your Fone AI Console and FreePBX service:
- PUBLIC_IP – Your FreePBX server’s public IP. You can get it from executing
curl ifconfig.me
using terminal or visting IP Chicken from that server. - BINDING_PORT – The SIP binding port (usually
5060
) - LOCAL_NET – If NAT is applicable, provide the local subnet
- SIP_USERNAME – Your SIP username. Available in the SIP Integration page.
- SIP_PASSWORD – Your SIP password. Available in the SIP Integration page.
VICIdial Configurations
Custom Carrier
Go to Carriers using Admin
in the left pane.
Click on Add A New Carrier
Give the ID as preferred say ai
.
In the Account Entry section, edit the PJSIP configuration with the values
[ai-aor]
type=aor
max_contacts=20
contact=sip:sip.fone.ai:5060
[ai-auth]
type=auth
auth_type=userpass
username=SIP_USERNAME ; <-- Replace with your SIP username
password=SIP_PASSWORD ; <-- Replace with your SIP password
[ai-endpoint]
type=endpoint
context=ai-transfer
disallow=all
direct_media=no
allow=ulaw,alaw,gsm
transport=transport-udp-ai
outbound_auth=ai-auth
aors=ai-aor
[ai-registration]
type=registration
outbound_auth=ai-auth
server_uri=sip:sip.fone.ai:5060
client_uri=sip:ai@PUBLIC_IP:BINDING_PORT ; <-- Replace with your public IP and binding port
contact_user=ai
retry_interval=60
[transport-udp-ai]
type=transport
protocol=udp
external_media_address=PUBLIC_IP ; <-- Replace with your public IP
;local_net=LOCAL_NET ; <-- Replace with your local net if applicable
external_signaling_address=PUBLIC_IP ; <-- Replace with your public IP
bind=0.0.0.0:BINDING_PORT ; <-- Replace with your binding port
Under the Protocol field, select the PJSIP option
In the Dialplan Entry, input the below dialplan:
[ai]
exten => _XXXXXXXX.,1,NoOP()
same => n,Dial(PJSIP/${EXTEN}@ai-endpoint)
same => n,Hangup()
Apply Config
After you set up the configurations, you can dial into the AI through DID or through internal extensions.
For Inbound DIDs
Create a Custom Trunk
Create a custom trunk by going to Connectivity ➜ Trunks
. Click ✚ Add Trunk ➜ ✚ Add Custom Trunk
.
In the General tab of the Add CUSTOM Trunk, enter the Trunk Name.
Under Custom Settings, enter the Custom Dial String as:
Local/$OUTNUM$@ai
This will invoke the local ai
dialplan context created in extensions_custom.conf
.
Click the Submit button at the bottom to create the custom trunk.
Create an Outbound Route
Create an outbound route by going to Connectivity ➜ Outbound Routes
. Click ✚ Add Outbound Route
.
In the Route Settings tab:
- Enter the Route Name
- Set Trunk Sequence for Matched Routes to the Custom Trunk created earlier
In the Dial Patterns tab:
- Set Prefix to
0000
- Set Match Pattern to
X.
Click the Submit button at the bottom to save the route.
Create a Misc Destination
Go to Applications ➜ Misc Destinations
. Click ✚ Add Misc Destination
.
In the form:
- Set Description appropriately (e.g.,
AI Misc Destination
) - Set Dial to:
0000{campaign_extension}
If you used a different prefix, prepend that to the Campaign Extension from the Fone AI console.
For example, if the prefix is 0000
and the campaign extension is 4140515644
, set Dial to:
00004140515644
Click Submit to create the Misc Destination.
Create an Inbound Route
Go to Connectivity ➜ Inbound Routes
. Click ✚ Add Inbound Route
.
In the form:
- Set the Description
- Set DID Number to your incoming number
- Under Set Destination, choose
Misc Destinations
and select the AI destination created earlier
Once done, calling the DID will route the call to the Fone AI campaign through FreePBX.
Direct Dial Through an Extension
You can also directly dial the AI from an extension by navigating to Connectivity ➜ Extensions
Create a new extension or edit an existing one.
In the Advanced tab of the extension, scroll down to find the Dial field under the Edit Extension form group. Set the Dial value to:
Local/{campaign_extension}@ai
For e.g., Local/4140515644@ai to connect with the campaign 4140515644.
Once done, calling this extension will route the call to the corresponding Fone AI campaign through FreePBX.