API reference / Voice and AI
Connect VICIdial
This page connects VICIdial to Drop Cowboy® in three ways:
- Text to speech. VICIdial's Text To Speech entries play in Drop Cowboy voices, with no change to VICIdial itself.
- AI agents. A carrier sends live calls to one of your published AI agents over SIP.
- Sends. A campaign's Dispo Call URL and No Agent Call URL trigger a send preset, such as a voicemail or a text after a call.
For answering machine detection, see Replace VICIdial AMD. GOautodial runs on VICIdial, so the same steps work there.
| What you install | dc-connect, one static Linux binary, on every server that places calls |
| What you need | A connector key, with the scopes for the parts you use |
| Where secrets live | /etc/dc-tts/dc-tts.conf, mode 0640, and the campaign's call URLs |
| What VICIdial changes | Text To Speech entries, a carrier, and two campaign fields |
Before you start
- A connector key. Create one in the dashboard or with the API. See
Create a connector key. Give
it
tts:synthesizefor text to speech,connect:triggerfor sends, and the SIP scope described in SIP login for AI agents. - Allowed addresses. Set the key's
allowed_cidrsto the public address of every VICIdial web and dialer server. Call URLs are sent from the web servers, and speech and SIP come from the dialers. - Outbound access from each server to
api-v2.dropcowboy.comon port- AI agents also need
sip.dropcowboy.comon the SIP port you choose.
- AI agents also need
- Root access on each server, and VICIdial admin access.
Text to speech
VICIdial speaks its Text To Speech entries, in TTS prompts and survey
campaigns, by running a speech command at /opt/swift/bin/swift. The
installer puts dc-tts there.
Install
Run this as root on every server that places calls:
curl -fsSL https://github.com/Drop-Cowboy/pbx-connect/releases/latest/download/install.sh | sudo bash -s tts-install --default-voice VOICE_ID
VOICE_ID is a voice's voice_id, from the dashboard or
GET /voice/public/voices. See Pick a voice.
The installer:
- downloads
dc-connectfor the server's CPU and checks it against the release'sSHA256SUMS; - links
dc-ttsin/var/lib/asterisk/agi-bin; - moves any speech command already at
/opt/swift/bin/swiftto/opt/swift/bin/swift.dc-tts-orig, and links the path todc-tts; - asks for your connector key and its secret without showing them, and
writes
/etc/dc-tts/dc-tts.conf, mode 0640; - runs
dc-tts check.
To install from a script, pass --tts-key-file PATH, a file with the key on
the first line and the secret on the second. DC_TTS_KEY and
DC_TTS_SECRET in the environment work too.
| Exit code | Meaning |
|---|---|
| 0 | Done. |
| 1 | A download, checksum or install step failed. |
| 2 | Bad arguments. |
| 4 | Installed, but dc-tts check failed. Prompts have no audio until it passes. |
Choose the voices
In Admin > Text To Speech, set each entry's TTS Voice to a voice_id. VICIdial accepts a voice_id as it is.
To use short names instead, add them to /etc/dc-tts/dc-tts.conf on every
server:
[voices]
support = 7d2a9e4b-1c6f-4b3a-8e5d-2f9c7a1b4e63
Then set TTS Voice to support. Any other voice, including VICIdial's
stock default, uses default_voice.
How it plays
- VICIdial makes each entry's audio the first time it plays, and keeps it. You're billed per character fetched, and each fetch counts toward the key's daily spend cap.
- The audio is 8 kHz, as VICIdial expects.
- Markup in the text, such as
<audio>tags for local sound files, is removed. Only the spoken text is sent. - If the audio can't be made in time, that prompt has no audio. The reason
is in
/var/log/dc-tts/dc-tts.log, which never contains the text.
To remove it, run sudo bash install.sh tts-uninstall. It puts back the
speech command it moved aside. --purge also removes the config file, cache
and logs. dc-amd and dc-tts share the binary, so removing one leaves the
other working.
AI agents over SIP
A call you send to sip:<agent_id>@sip.dropcowboy.com is answered by that
AI agent. Your account must have SIP calls to AI agents turned on, and the
agent must be published. See Publish an agent.
Add the carrier
- Open Admin > Carriers and click Add A New Carrier.
- Set Carrier ID to
DROPCOWBOYand Protocol to SIP. - Put this in Account Entry, with your key's
key_idandsip_secret:
[dropcowboy-agents]
type=peer
host=sip.dropcowboy.com
port=5080
transport=udp
fromuser=<key_id>
defaultuser=<key_id>
secret=<sip_secret>
insecure=port,invite
disallow=all
allow=ulaw
allow=alaw
context=from-dropcowboy
- Put this in Dialplan Entry, with your agent's
agent_id:
exten => 8390,1,Dial(SIP/dropcowboy-agents/4c8e2a6f-3b9d-4e1a-9c7b-5d2f8a3e6b19,45)
exten => 8390,n,Hangup()
- Set Server IP to each dialer, set Active to Y, and submit.
Use a free extension in place of 8390. For more than one agent, add one line
pair per agent with its own extension. For TCP, set transport=tcp. The
sip_secret is shown once, when the key gets the SIP scope.
Send calls to an agent
Anything in VICIdial that can send a call to an extension in the default
context can reach 8390:
- A DID. In Inbound > Add A New DID, set DID Route to EXTEN,
Extension to 8390 and Extension Context to
default. - A Call Menu option, with route EXTENSION, extension 8390 and context
default. - An in-group's after hours or no agent action, sent to extension 8390.
Hand calls back
The agent sends a call back with a blind transfer. The transfer arrives in
from-dropcowboy, at the extension a preset on the key names. Add that
context to /etc/asterisk/extensions.conf on each dialer, with a line for
each DID you want calls back on:
[from-dropcowboy]
exten => 2001,1,Goto(trunkinbound,2001,1)
Route DID 2001 to the in-group or agent you want in Inbound > DIDs, then run
asterisk -rx "dialplan reload".
Where the agent can transfer to is set on the connector key's preset:
refer_targets for transfers it chooses during the call, and
outcome_routes for where it sends the call when it finishes. See
Connector presets. Call results also
arrive on the ai_agent.* webhooks. See Call results.
Sends from a campaign
A send preset fixes what is sent: the action, the content, the phone line, the dispositions that trigger it, its consent rule and the connector key it uses. VICIdial's call URL supplies only who to send it to.
Create a preset
- In the dashboard, open Settings > PBX Connect and click New send preset.
- Enter a Name, and choose what it Sends: Ringless voicemail, Text message, Voice broadcast or AI voice broadcast.
- Fill in its content: a recording or text to speech, a text template, or an AI agent. Choose the Phone line it sends from.
- Under Connector key, choose a key with
connect:trigger. Its allowed addresses and daily caps apply. - Under Dispositions that trigger it, list the VICIdial statuses that
may send, such as
NA,BandCALLBK. Leave it empty to send on any. - Choose the consent rule. See Consent.
- Save, then copy both URLs: the Dispo Call URL and the No Agent Call URL. They are shown once. Click I saved them.
The URLs carry the preset's send token, so keep them as secret as a key. If you lose them, revoke the preset and make a new one.
Add the URLs to the campaign
Open Campaigns, choose the campaign, and open Detail:
- Paste the Dispo Call URL into Dispo Call URL. VICIdial calls it when an agent sets a disposition.
- Paste the No Agent Call URL into No Agent Call URL. VICIdial calls it for calls no agent took, such as drops and answering machines.
Submit the campaign. After the send token, each URL carries VICIdial's own
fields, such as --A--lead_id--B--, which VICIdial fills in for each call:
?lead_id=--A--lead_id--B--&uniqueid=--A--uniqueid--B--&phone_number=--A--phone_number--B--&phone_code=--A--phone_code--B--&dispo=--A--dispo--B--&postal_code=--A--postal_code--B--&url_type=dispo
Don't edit the fields. A preset with a lead field consent rule adds that field too.
What happens on each call
| Outcome | Meaning |
|---|---|
| Queued | Accepted. It then goes through the same checks as a send made with the API, including Do Not Call and calling hours. |
| Refused | The consent rule wasn't met. The reason is Opt-in Missing, code 6011. |
| Skipped | The call's status isn't one that triggers the preset. Nothing is sent. |
| Duplicate | This lead and call already sent. Nothing is sent twice. |
Dispositions are compared without regard to case. A preset, a lead and a call name one send, so VICIdial calling a URL twice for the same call never sends twice.
Every send shows under Sends on the PBX Connect page, with when it came in, the lead, the phone, the disposition, the outcome and the detail.
10DLC and consent
Texts need a 10DLC line
A preset that sends a text sends from its phone line. That line must be linked to a registered texting (10DLC) campaign, or the preset can't be created.
Consent
Every preset has a consent rule, and a send that doesn't meet it is refused
with 6011:
- A lead field records consent. Name the VICIdial field and the value
that means consent, such as the custom field
rvm_optinandY. The call URLs then pass that field for each lead. A lead without the value is refused. - We attest every lead consented. Your account attests that every lead this preset sends to has consented.
A send that passes its consent rule then goes through the same checks as a send made with the API. See Consent.
Common problems
- A prompt has no audio. Check
/var/log/dc-tts/dc-tts.log. A 401 means the key or secret indc-tts.confis wrong, a 403 that the server's address isn't inallowed_cidrs, and a 402 that the balance or the daily spend cap ran out. - A prompt plays the default voice. The TTS Voice isn't a voice_id and
isn't under
[voices]on that server. - The installer exits with 4.
dc-tts checkfailed. Run/var/lib/asterisk/agi-bin/dc-tts checkto see why. - The agent call fails with 403. The SIP username or secret is wrong, the
key lacks the SIP scope, or the dialer's address isn't in
allowed_cidrs. - The agent call fails with 404. The
agent_idis wrong, or the agent isn't published. - The agent call fails with 486. The call went past
max_concurrentormax_cpson the key. Raise them, or clear them for no cap. - A transfer back fails.
from-dropcowboyhas no line for that DID, or the DID isn't routed in VICIdial. - No sends show on the PBX Connect page. The URL isn't on the campaign,
or the web server's address isn't in the key's
allowed_cidrs. - Every send is Refused. The consent field is empty or has another value on those leads.
- Every send is Skipped. The preset's dispositions don't include the statuses your agents set.
- Sends stop with a daily cap error. The key reached a daily cap. It resets at 00:00 UTC, or raise it.
Ringless voicemail technology delivers messages directly to voicemail inboxes. Delivery success depends on carrier compatibility, device type, and recipient settings. While designed for voicemail delivery, technical factors may affect performance. Drop Cowboy does not guarantee delivery rates or specific outcomes.
While Drop Cowboy provides tools to support compliance efforts, customers remain solely responsible for obtaining proper consent, maintaining opt-out lists, and complying with all federal and state telemarketing regulations. Consult with your legal counsel to ensure your specific use case and consent mechanisms comply with applicable laws.
This information is for educational purposes only and does not constitute legal advice. Regulations vary by jurisdiction and use case. Always consult with qualified legal counsel to ensure your specific practices comply with applicable federal and state laws.