Statuses and causes
Every AMDSTATUS and AMDCAUSE value AMD Cop sets, and what ViciDial does with it.
AMD Cop gives ViciDial its answer the same way Asterisk's own AMD does: two channel variables, AMDSTATUS and AMDCAUSE, read by ViciDial's VD_amd.agi. The status decides the routing; the cause says why. Every cause AMD Cop sets starts with the status, then -AMDCOP, then AMD Cop's detail, so you can tell its calls apart in any report. A call AMD Cop could not answer carries one more, AMDCOP_CAUSE (see When AMD Cop cannot answer).
Routing
ViciDial sends a call to an agent when AMDSTATUS is HUMAN or NOTSURE, and treats MACHINE as an answering machine: it hangs up, or plays your voicemail message if the campaign has one. A campaign with AMD Agent Route Options ENABLED routes by its settings container instead (see Agent route containers).
The values
AMDSTATUS |
AMDCAUSE |
What happened | Where the call goes |
|---|---|---|---|
HUMAN |
HUMAN-AMDCOP |
A person answered, or a voice started too late to judge in time: somebody is there | An agent |
MACHINE |
MACHINE-AMDCOP |
A voicemail greeting or a recorded message answered | Dropped, or your voicemail message |
MACHINE |
MACHINE-AMDCOP_ and a greeting type, such as MACHINE-AMDCOP_WELCOMEVMAMD |
The same, with the kind of greeting recognised | Dropped, or your voicemail message |
MACHINE |
MACHINE-AMDCOP_SILENCE |
Nobody spoke within the time limit: a dead line | Dropped |
NOTSURE |
NOTSURE-AMDCOP or NOTSURE-AMDCOP_UNDETERMINED |
Not enough to decide either way | An agent |
HUMAN |
HUMAN-AMDCOP_SHADOW_ and the verdict, such as HUMAN-AMDCOP_SHADOW_MACHINE |
A sampled call, sent to an agent whatever the verdict, so that wrong machine verdicts can be counted | An agent |
NOTSURE |
NOTSURE-AMDCOP_UNAVAILABLE |
AMD Cop could not answer in time, and the call goes to an agent: always if Detection says so, and with the default when the problem shows more than 1 second after the answer | An agent |
NOTSURE |
NOTSURE-AMDCOP_NOT_CONFIGURED |
/etc/amdcop/config.json has no key or address to ask with, and the call goes to an agent as above |
An agent |
NOTSURE |
NOTSURE-AMDCOP_NO_CALL_ID |
The dialplan block was edited and lost the call's id, and the call goes to an agent as above | An agent |
NOTSURE |
NOTSURE-AMDCOP_UNKNOWN_ and a value |
An answer this version of the connector does not know | An agent |
Why the cause starts with the status
VD_amd.agi reads a campaign's agent route container against the cause up to its first dash. Asterisk's own AMD sets causes such as HUMAN-1500-2500, which it reads as HUMAN. AMD Cop's causes have the same shape: HUMAN-AMDCOP is read as HUMAN, and HUMAN-AMDCOP_SHADOW_MACHINE too. So a container written for Asterisk's AMD or for AMDY passes AMD Cop's people.
ViciDial's AMD log keeps the first 30 characters of a cause. A few of AMD Cop's are longer, such as HUMAN-AMDCOP_SHADOW_WELCOMEVMAMD (32), and are cut there. If your database runs in strict mode, the log leaves that call out instead. Routing reads only the part before the first dash, so the call still goes where it should, and the portal keeps every cause whole.
Agent route containers
With AMD Agent Route Options ENABLED, ViciDial reads a settings container named AMD_AGENT_OPT_ and the campaign. Each line is a status and a response, such as HUMAN,HUMAN. A call goes to an agent only when a line matches both; every other call is hung up as a machine. For AMD Cop the container needs:
| Line | What it lets through |
|---|---|
HUMAN,HUMAN |
People, and sampled calls |
NOTSURE,NOTSURE |
Calls AMD Cop is not sure of, and calls it could not answer that go to an agent, whatever Detection says |
AMDY's container holds only HUMAN,HUMAN. Under it, a call AMD Cop is not sure of is hung up, and so is a call it could not answer in time. Add the line NOTSURE,NOTSURE, or set AMD Agent Route Options to DISABLED. You need the line whatever Detection says. With the default, a problem that shows more than 1 second after the answer, such as AMD Cop's server not answering, still sends the call to an agent as NOTSURE. Without the line, such an outage hangs up every call on the campaign, people included, and the doctor reports a FAIL. The doctor checks each campaign's container when the campaign lookup is on: run the install command with AMDCOP_CAMPAIGN_LOOKUP=1, then sudo /usr/local/lib/amdcop/doctor.py.
When AMD Cop cannot answer
If the dialer gets no verdict from AMD Cop in time, the call falls back the way Detection, If AMD Cop cannot answer, says:
- Use your dialer's own AMD, the default: if the problem shows within 1 second of the answer, your own
AMD()line runs, andAMDSTATUSandAMDCAUSEare its own. That isMACHINE,HUMANorNOTSURE, with causes such asINITIALSILENCE-2000-2000that do not containAMDCOP. ViciDial routes them as it did before AMD Cop. If the problem shows later, the call goes to an agent as below:AMD()started that late can take a person who has already said hello for a machine. - Send every call to an agent: the call goes to an agent with the status and cause the connector set, usually
NOTSUREandNOTSURE-AMDCOP_UNAVAILABLE.
Either way, AMDCOP_FALLBACK says which way the call went, amd or agent, and AMDCOP_CAUSE says why there was no verdict:
AMDCOP_CAUSE |
What happened |
|---|---|
FALLBACK_UNREACHABLE |
The dialer could not connect to AMD Cop |
FALLBACK_TIMEOUT |
AMD Cop did not answer within 2 seconds |
FALLBACK_REFUSED |
AMD Cop refused the call: the key was revoked, or the dialer is not active in the portal |
FALLBACK_ERROR |
AMD Cop answered with an error, or without a verdict |
FALLBACK_NOT_CONFIGURED |
/etc/amdcop/config.json is missing, or has no key or address to ask with |
FALLBACK_NO_CALL_ID |
The dialplan block was edited and lost the call's id |
A call AMD Cop decided carries neither.
Why the doubtful cases go to an agent
Hanging up on a person costs a sale and counts against you with regulators; an agent hearing a voicemail costs a few seconds. So everything AMD Cop is not sure of ends in NOTSURE, a voice that starts too late to judge ends in HUMAN, and ViciDial puts both through. A fault on our side is different: AMD Cop has not judged that call at all, so by default the AMD you ran before judges it instead, if it can start within 1 second of the answer.
Sampled calls
The sample exists so the portal can report a measured rate of people wrongly called machines, rather than an estimate. Its size is set per account, and it is off unless it has been turned on. A sampled call reaches an agent, and its disposition tells us whether the verdict was right. It carries HUMAN, so a container holding HUMAN,HUMAN lets it through; the verdict AMD Cop gave is in the cause, and on the call in Analytics.
Installed before connector 1.5.0?
Every new install is connector 1.6.0. A dialer installed earlier needs the install command run again before anything else on this page: it upgrades in place, keeps the extension and your settings, and Dialers then shows 1.6.0. Until it is upgraded, it sets older causes.
A dialer on connector 1.3.0 or older sets the older causes, which start with AMDCOP_: AMDCOP_HUMAN, AMDCOP_MACHINE, AMDCOP_SHADOW_MACHINE (with NOTSURE), AMDCOP_UNAVAILABLE and so on. A container written for AMDY or for Asterisk's AMD does not match them, so under HUMAN,HUMAN that dialer's people are hung up. Run the install command on it again to move it to the new causes. The portal reads both forms, so your reports cover the calls from before and after.
Before you upgrade, check two things:
- A container written for the older causes, with a line such as
HUMAN,AMDCOP_HUMAN, stops matching after the upgrade, and that campaign's people are hung up. Replace such lines withHUMAN,HUMANandNOTSURE,NOTSUREwhen you upgrade. The doctor reports a container withoutHUMAN,HUMANas a FAIL. - A campaign that dials from several servers needs lines for both forms while some servers are upgraded and some are not. Keep the old lines, add
HUMAN,HUMANandNOTSURE,NOTSURE, and take the old lines out once every server is on the new version.
Before connector 1.2.0, a call AMD Cop could not answer goes to an agent with the AMDCAUSE alone, and carries no AMDCOP_CAUSE.
Next: Troubleshooting