API reference / Voice and AI
Connect FreePBX
The Drop Cowboy® Connect module adds these pages under Applications:
| Page | What it does |
|---|---|
| Drop Cowboy TTS | Prompts that speak a text in a Drop Cowboy voice, then send the call on. |
| Drop Cowboy Voices | Short names for the voices you use. |
| Drop Cowboy Connector | Your connector key, send presets and the SMS Connector link. |
| Drop Cowboy Send Now | Sends a preset to a list of numbers. |
| Drop Cowboy AMD | Answering machine detection. See Replace FreePBX AMD. |
Calls to a Drop Cowboy AI agent go through a SIP trunk, which needs no module. See AI agents over SIP.
| What you install | The dcconnect module, and dc-tts for prompts |
| What you need | A connector key, with the scopes for the parts you use |
| Where secrets live | /etc/dc-tts/dc-tts.conf and /etc/dc-connect/dc-connect.conf, mode 0640 |
| Versions | FreePBX 16 and 17 |
Before you start
- A connector key. Create one in the dashboard or with the API. See
Create a connector key. Give
it
tts:synthesizefor prompts and the scope that lets it send texts for UCP. AI agents need the SIP scope described in SIP login. Setallowed_cidrsto the public address your FreePBX server connects from. - Outbound access from the server to
api-v2.dropcowboy.comon port 443. AI agents also needsip.dropcowboy.comon the SIP port you choose. - Root access over SSH.
Install the module
fwconsole ma downloadinstall https://github.com/Drop-Cowboy/pbx-connect/releases/latest/download/dcconnect.tgz
fwconsole reload
Don't add a module repository for it. The module is unsigned, so FreePBX shows a warning. It still installs and runs. If you already installed it for AMD, you have it.
Text-to-speech prompts
Install dc-tts
Prompts speak through dc-tts. Run this as root:
curl -fsSLO https://github.com/Drop-Cowboy/pbx-connect/releases/latest/download/dc-connect-linux-amd64
curl -fsSLO https://github.com/Drop-Cowboy/pbx-connect/releases/latest/download/SHA256SUMS
sha256sum --ignore-missing -c SHA256SUMS
chmod +x dc-connect-linux-amd64
sudo ./dc-connect-linux-amd64 tts install --default-voice VOICE_ID
On an ARM server, use dc-connect-linux-arm64. The installer asks for your
connector key and its secret without showing them, and writes
/etc/dc-tts/dc-tts.conf. The module never asks for this key.
Connect Asterisk lists every option.
VOICE_ID is a voice's voice_id, from the dashboard or
GET /voice/public/voices. See Pick a voice.
Name your voices
Open Applications > Drop Cowboy Voices to give a voice a short name, such as
support.
| Field | What to enter |
|---|---|
| Name | Letters, digits, ., - and _. Saving a name that exists points it at the new voice_id. |
| voice_id | The voice_id from the Voices page in Drop Cowboy. |
Click Save voice name. The page also lists the names in the [voices]
section of dc-tts.conf. A name saved on this page wins over the same name
there.
Add a prompt
- Open Applications > Drop Cowboy TTS and click Add prompt.
- Fill in the fields:
| Field | What to enter |
|---|---|
| Description | The prompt's name in destination pickers, up to 50 characters. |
| Voice | A voice_id, a name from Drop Cowboy Voices, or a name from dc-tts.conf. Leave it blank for the default voice. |
| Text | Up to 1000 characters. Line breaks become spaces, and Asterisk drops double quotes and backslashes. |
| Then go to | Where the call goes after the prompt. |
- Click Submit, then Apply Config.
Each prompt is a destination, listed under Drop Cowboy TTS in every destination picker. Point an inbound route, an IVR option, a time condition or the AMD destination at it.
The first call fetches the audio. Later calls play it from the cache. You're billed per character fetched, and each fetch counts toward the key's daily spend cap.
If the audio can't be made, nothing plays and the call still goes to
Then go to. DC_TTS_STATUS and DC_TTS_ERROR say why, so a Dynamic Route
there can branch on them. See
Speak in the dialplan.
Uninstalling the module deletes the prompts. FreePBX Backup doesn't include them, so note their text before you rebuild a server.
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 trunk
- Open Connectivity > Trunks and click Add Trunk, then Add SIP (chan_pjsip) Trunk.
- On General, set Trunk Name to
dropcowboy-agents. - On pjsip Settings, set:
| Field | Value |
|---|---|
| Username | The connector key's key_id |
| Secret | The key's sip_secret, shown once when the key got the SIP scope |
| Authentication | Outbound |
| Registration | None |
| SIP Server | sip.dropcowboy.com |
| SIP Server Port | 5081 for TLS, or 5080 for UDP or TCP |
| Context | from-dropcowboy |
| Transport | Your TLS transport, or UDP or TCP to match the port |
- On Codecs, keep only ulaw and alaw.
- Submit, then Apply Config.
For TLS, turn on the TLS transport first, in Settings > Asterisk SIP Settings.
The key's allowed_cidrs apply to these calls, so include the address the
server sends SIP from.
Send calls to an agent
Add the dialplan in Admin > Config Edit, in extensions_custom.conf, then
Save and Apply Config:
[dc-ai-agent]
exten => s,1,Dial(PJSIP/4c8e2a6f-3b9d-4e1a-9c7b-5d2f8a3e6b19@dropcowboy-agents,45)
exten => s,n,Return()
[from-dropcowboy]
exten => 2001,1,Goto(from-internal,2001,1)
exten => 2002,1,Goto(ext-queues,2002,1)
The user part of the dial string is the agent's agent_id. Then, in
Admin > Custom Destinations, add a destination:
- Target:
dc-ai-agent,s,1. - Description: for example, Drop Cowboy AI agent.
- Return: Yes.
- Destination after return: where the call goes if the agent doesn't answer.
Choose that Custom Destination in an inbound route, an IVR option, a time condition, or a queue's fail over destination.
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 a line
there only for each extension or queue you want calls back on.
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.
Send presets
A send preset fixes what is sent: a voicemail, a text, a voice broadcast or an AI voice broadcast, with its content, phone line and consent rule. Send Now picks a preset and adds only the numbers.
Create the preset
- In the dashboard, open Settings > PBX Connect and click New send preset.
- Choose what it sends, its content and its phone line.
- Under Connector key, choose a key with
connect:trigger. - Leave Dispositions that trigger it empty. Send Now sends no disposition.
- Under consent, choose We attest every lead consented. Send Now has no lead field to pass. See Consent.
- Copy the Dispo Call URL. It is shown once, and it carries the preset's send token, so keep it as secret as a key.
Add it to the PBX
Open Applications > Drop Cowboy Connector. Under Send presets:
| Field | What to enter |
|---|---|
| Name | How the preset is listed on the Send Now page. |
| Send URL | The whole Dispo Call URL. The dialer fields after the ? are dropped. |
Click Add preset. Removing a preset here removes it from the PBX only. Revoke it in Drop Cowboy too if you no longer use it.
Send to a list of numbers
- Open Applications > Drop Cowboy Send Now.
- Choose the Preset.
- Paste up to 100 Numbers, one per line or separated by commas. Use
+and the country code, or ten digits for a North American number. - Click Review, check the list, then click Send now.
Each number gets a result:
| Result | Meaning |
|---|---|
| Queued | Accepted. It then goes through the same checks as a send made with the API, including Do Not Call and calling hours. The outcome shows under Sends on the PBX Connect page. |
| Already sent | This batch already sent to the number. |
| Refused | The preset's consent rule wasn't met. The detail shows the reason, Opt-in Missing. |
| Skipped | The preset only sends on certain dispositions. Clear them on the preset. |
| Failed | The request didn't reach Drop Cowboy, or came back with an error. The detail says why. |
| Not sent | The batch stopped before this number. |
A 401, 403, 404 or 429 stops the batch, and so do three failures in a
row. Send again to N numbers sends the rest in the same batch, so a
number that went through isn't sent twice. Send another starts a new
batch.
Texts in UCP
With SMS Connector, users send and receive texts in UCP from your Drop Cowboy numbers.
- Each texting number must be on a Drop Cowboy line linked to a registered texting (10DLC) campaign. Texts from any other number are refused.
- Open Applications > Drop Cowboy Connector. Under Texts in UCP, click Add Drop Cowboy to SMS Connector.
- In SMS Connector, add each texting number and choose Drop Cowboy as its provider.
- In Drop Cowboy, under Settings > Webhooks, add a webhook for the
contact.msg.receivedevent athttps://pbx.example.com/smsconn/provider.php?provider=dropcowboy, with your PBX's address. - Back on the connector page, paste the webhook's signing secret into Webhook signing secret.
- Paste the Connector key and Connector key secret, and click Save. Texts sent from UCP go out with this key, so limit it to this PBX's public address.
Each received text is checked against the signing secret. One without a valid signature, or more than five minutes old, is refused. See Verify the signature. A text to a number SMS Connector doesn't have is dropped.
Attachments on received texts are noted in the text. Open the conversation in Drop Cowboy to see them.
What the PBX keeps
The connector page saves everything only in /etc/dc-connect/dc-connect.conf,
owned by root:asterisk, mode 0640. It isn't in the FreePBX database or a
backup, and the page shows at most the last four characters of a saved
value.
| Setting | What it is |
|---|---|
api_key, api_secret |
The connector key and its secret. Never a full API key. |
webhook_secret |
The signing secret of the webhook that delivers texts. |
url |
The API URL. Blank uses https://api-v2.dropcowboy.com. |
[preset-N] |
Each preset's name and send_url. |
Forget the connector key and Forget the signing secret remove them from the PBX. Revoke the key in Drop Cowboy too.
Consent
Every preset has a consent rule, and a send that doesn't meet it is refused
with 6011. Send Now works only with We attest every lead consented:
your account attests that every number 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
- The TTS page says dc-tts is not installed in agi-bin. Install it. See Install dc-tts.
- A prompt plays nothing. Check
/var/log/dc-tts/dc-tts.logandDC_TTS_ERROR.http_401means the key indc-tts.confis wrong,http_403that the server's address isn't allowed,http_402that the balance or the daily spend cap ran out, andunknown_voicethat the voice name isn't defined. - Saving a page fails with a permissions error. Run
fwconsole chown, then save again. - The agent call fails with 403. The SIP username or secret is wrong, the
key lacks the SIP scope, or the server'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 extension. - Every Send Now number is Refused. The preset's consent rule is a lead field. Use We attest every lead consented for Send Now.
- Every Send Now number is Skipped. The preset lists dispositions. Clear them.
- Send Now stops with 403. The preset has no connector key, or the key's
allowed_cidrsdon't include this server. - A preset shows "not a send URL". The pasted URL is incomplete. Remove it, copy the Dispo Call URL again, and add it.
- UCP texts don't arrive. Check that the webhook URL is your PBX's public address, that the signing secret on the connector page matches, and that the number is in SMS Connector with Drop Cowboy as its provider.
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.