LexoAMD user guide
How to connect your dialer to LexoAMD, set up campaigns, read the results and use the portal. Written for call center admins and the engineers who run the dialer servers
What LexoAMD does
LexoAMD listens to the first seconds of every answered outbound call and tells your dialer who picked up, usually within 2 to 3 seconds. Live people go to your agents. Everything else is handled like an answering machine, so agents stop wasting time on calls nobody will talk on.
| Result | Meaning |
|---|---|
| HUMAN | A live person answered |
| MACHINE | Voicemail or an answering machine greeting |
| FAS | False answer supervision: the carrier marked the call as answered but you hear ringing, silence, a network tone or a recorded announcement. You pay for minutes nobody is on |
| HONEYPOT | A fake-answer number that plays the same recording to every caller to inflate your carrier cost. LexoAMD flags it when the same recording is heard on several different numbers |
| NOTSURE | Not enough audio to decide (for example the call hung up immediately) |
LexoAMD never drops a call it believes could be a live person. When in doubt, the call goes to an agent.
Before you start
You need three things:
- A LexoAMD account. Your account manager creates it and sends you the portal address, your email and a password. Sign in at amd.lexogenix.com and change the password under Account.
- An API key for each dialer server. It starts with
lxa_and is shown in the portal under API and dialers. You can restrict a key to your dialer's public IP addresses. - Root access to the dialer server, with outbound HTTPS (port 443) allowed to
amd.lexogenix.com. No inbound ports are needed.
Supported systems
The LexoAMD client needs no extra packages. It comes in two versions, one for Python and one for Perl, and the installer picks whichever works on your server. Every VICIdial server has Perl, because VICIdial itself is written in Perl.
| Component | Supported versions |
|---|---|
| VICIdial | Any version with VD_amd.agi and the campaign setting AMD Agent Route Options. This covers every VICIdial on ViciBox 8 and later, and current scratch installs |
| ViciBox | 8, 9, 10, 11, 12 and later |
| Other Linux | CentOS / RHEL 6, 7, 8, 9 · AlmaLinux · Rocky Linux · Debian · Ubuntu · openSUSE |
| Asterisk | 1.8 and later, including 11, 13, 16, 18, 20, 21 and 22 |
| Python | 2.6, 2.7 and every 3.x release (tested up to 3.14) |
| Perl | 5.8 and later (tested 5.10 to 5.44). Uses IO::Socket::SSL or the standard openssl command for the secure connection |
Staying compatible after upgrades
- The client uses only the standard library of Python or Perl, so new Python and Perl releases do not break it.
- When a call starts, the client uses the runtime that passed the test at install time. If that runtime is later removed, for example Python 2 during an OS upgrade, it switches to another Python or to Perl automatically.
- If the client cannot run or cannot reach LexoAMD, the call falls back to the stock Asterisk AMD, so calls are never left without a decision.
- After a major upgrade (new ViciBox release, new Asterisk), run the install command again. It is safe to run any number of times.
Install on a VICIdial dialer
Run this as root on every dialer server that places calls. Replace <API_KEY> with your key from the portal.
curl -fsSL https://amd.lexogenix.com/install.sh | bash -s -- <API_KEY>
The installer takes under a minute and prints each step:
- Download clientsSaves
lexo_amd.pyandlexo_amd.plto/var/lib/asterisk/agi-bin/. - ConfigWrites your key to
/etc/lexo-amd/client.conf, readable only by root and Asterisk. - Pick a runtimeTries Python 3, Python 2 and Perl in turn, makes a live test connection with each, and keeps the first one that connects. The test is not counted as a call.
- DialplanBacks up
/etc/asterisk/extensions.conf, then adds a new extension8375right after the stock8369. Your existing extensions, including 8369, 8370 and any custom ones, are not changed. - ReloadReloads the Asterisk dialplan. Calls in progress are not affected.
If your server cannot download with curl (very old CentOS 6), download https://amd.lexogenix.com/install.sh on another machine, copy it over, and run bash install.sh <API_KEY>.
Set up a campaign
In the VICIdial admin, open Campaigns and choose the campaign, then:
- Routing ExtensionSet it to
8375. This sends answered calls through LexoAMD. Setting it back to8369returns the campaign to stock AMD at any time. - AMD Agent Route OptionsSet it to
ENABLED. - Settings containerCreate or edit the container
AMD_AGENT_OPT_<campaign id>and list the results that should reach an agent, one per line:
To also send calls LexoAMD was unsure about to agents, add a lineHUMAN,HUMANNOTSURE,NOTSURE. - SaveThe change applies to the next calls the campaign places.
Machine, FAS and honeypot calls follow the machine handling the campaign already has, such as status AA or a voicemail drop message. You do not need to change it.
Results and routing
LexoAMD sets the same dialplan variables as the stock Asterisk AMD, so VICIdial reads them without changes:
| What was heard | AMDSTATUS | AMDCAUSE | What VICIdial does |
|---|---|---|---|
| Live person | HUMAN | HUMAN | Sends the call to an agent |
| Voicemail | MACHINE | MACHINE | Machine handling |
| False answer | MACHINE | FAS | Machine handling |
| Honeypot number | MACHINE | HONEYPOT | Machine handling |
| Not enough audio | NOTSURE | NOTSURE or NO_AUDIO | Per your AMD_AGENT_OPT container |
| LexoAMD unreachable | CONNECTION_ERROR or PROCESSING_ERROR | Stock Asterisk AMD decides instead | |
AMDSTATS holds the raw verdict, for example MACHINE-2.50-0.9912: the result, the second it was decided at, and the confidence.
Check that it works
- Test the connection from the dialer:
It prints/var/lib/asterisk/agi-bin/lexo_amd.agi --testok … reply=NOTSURE-0.00-0.0000when the key and network are fine. - Watch live decisions in the Asterisk console:
Each answered call prints a line such asasterisk -rvvv | grep LexoAMDLexoAMD: HUMAN/HUMAN HUMAN-2.56-0.9675. - Open Detections in the portal. Every call appears within a second, with a play button to hear exactly what LexoAMD heard.
Update or remove
Update: run the install command again. It replaces the client, keeps your key and your dialplan, and makes a new backup of extensions.conf.
Remove:
curl -fsSL https://amd.lexogenix.com/install.sh | bash -s -- --uninstall
This removes extension 8375, the client and its config, and keeps a backup of extensions.conf. Before removing, set every campaign's Routing Extension back to 8369.
Using the portal
Sign in at amd.lexogenix.com. You see only your own company's calls and data.
| Page | What it is for |
|---|---|
| Overview | Calls in the last 24 hours by result, an hourly chart and a 30-day trend |
| Detections | Every call with its number, result, decision time and confidence. Filter by result or search a number. Press play to listen to the call audio |
| Test a recording | Upload any recording and see what LexoAMD would decide, with the moment of the decision marked on the waveform |
| Send recordings | Upload recordings in bulk and label them Human, Machine, FAS or Honeypot |
| Import call report | Upload a VICIdial call export (CSV) with its recordings. The dispositions become labels automatically |
| My recordings | Recordings you sent and whether they were accepted for training |
| API and dialers | Create, restrict and disable API keys, and copy the install command |
| Account | Change your password |
Every list is paged on the server, so pages stay fast as your call history grows. Use the light and dark switch at the bottom of the sidebar.
Improving accuracy
LexoAMD learns from real calls. The most useful thing you can do is send examples from your own traffic, especially calls you think it got wrong:
- On Detections, listen to calls and note any wrong ones.
- On Send recordings, upload those recordings with the correct label. Honeypot and FAS examples are especially valuable.
- Or import a VICIdial call report with recordings. Calls dispositioned as answering machine become Machine examples, and so on.
The LexoAMD team reviews what you send and retrains the model regularly. A new model only goes live if it is at least as accurate as the current one on a fixed test set, so updates never make results worse.
Other dialers: WebSocket API
Any dialer that can stream call audio over a WebSocket can use LexoAMD, for example FreeSWITCH with mod_audio_fork, LiveKit or your own software.
URL wss://amd.lexogenix.com/v1/detect
Header X-API-Key: <API_KEY>
1. Send one text frame with the call settings:
{"config":{"sample_rate":8000,"encoding":"pcm16","call_id":"123","phone":"15551234567","max_detection_time":6}}
sample_rate 8000 or 16000
encoding pcm16 (16-bit little endian), mulaw or alaw
phone the dialed number (used for honeypot detection; optional but recommended)
2. Stream the answered call's audio as binary frames, 20 ms to 1 s each.
3. After each frame LexoAMD replies with a text frame:
"" keep streaming
HUMAN-2.56-0.9675 decision: RESULT-SECONDS-CONFIDENCE
4. To force a decision (call ended), send {"eof":1}.
Results are HUMAN, MACHINE, FAS, HONEYPOT or NOTSURE. Stop sending audio once you have a decision and close the connection. A wrong key or a blocked IP closes the connection with code 1008.
Minimal example (Python)
import json, websocket # pip install websocket-client
ws = websocket.create_connection("wss://amd.lexogenix.com/v1/detect", header=["X-API-Key: lxa_..."])
ws.send(json.dumps({"config": {"sample_rate": 8000, "encoding": "pcm16", "call_id": "123", "phone": "15551234567"}}))
for chunk in audio_chunks(): # 8 kHz, 16-bit mono, e.g. 250 ms = 4000 bytes
ws.send_binary(chunk)
reply = ws.recv()
if reply:
print(reply) # e.g. MACHINE-2.05-0.9718
break
ws.close()
Troubleshooting
| What you see | What to do |
|---|---|
unauthorized (API key / IP) | The key is wrong, disabled, or the server's public IP is not in the key's allowed IPs. Check the key under API and dialers |
CONNECTION_ERROR in the console | The dialer cannot reach amd.lexogenix.com on port 443. Check the firewall and DNS: curl -I https://amd.lexogenix.com. Calls fall back to stock AMD meanwhile |
| Installer warns about the certificate | The server's list of trusted certificates is out of date. Update the ca-certificates package, then run the install command again |
No LexoAMD: lines in the console | The campaign is not using extension 8375. Check the Routing Extension, and run asterisk -rx "dialplan show 8375@default" |
Many NO_AUDIO results | Asterisk is not passing audio to the client. Make sure calls are answered before reaching 8375, which is the normal VICIdial flow |
| A result you disagree with | Listen on Detections, then send the recording with the right label on Send recordings |
For anything else, contact your Lexogenix account manager with the call time and the number. The audio for each call is kept for 3 days, so report problems promptly.
Data and privacy
- LexoAMD receives only the first seconds of each answered call, until it decides (at most 6 seconds), never the conversation with your agent.
- That audio is kept for 3 days so you can listen to it on the Detections page, then deleted automatically.
- Detection results (time, number, result) are kept for 180 days for your reports.
- Audio travels over an encrypted connection (TLS). Your data is visible only to your company's logins and the LexoAMD team.
- Recordings you send for training are used only to improve LexoAMD.