Call record
An Operations service keeps its state for the call under one
global_data key: ops by default, or the service’s namespace. Prompts and SWML can
read it as ${global_data.ops.<key>}, and the conscience param shows its now line
on every request. Your code reads the record as call.data.
A service keeps a record when it has operations, identifies callers, or finds the
medium on each request. A service with only lookups and a fixed medium keeps none.
Properties
v
The record’s version, RECORD_VERSION (currently 1). It goes up when a key is
renamed or changes meaning, and never when a key is added.
account_id
The account identified, or "".
account
The account in a few words, as identify()’s describe gives it.
asked
What the caller asked for before they were identified.
medium
"voice" or "chat", or "".
history
The settled changes, oldest first.
history.kind
The operation’s kind.
history.touches
The change’s touches keys.
history.read_back
The read-back the caller answered.
history.outcome
made, not made, declined, or replaced. A not made entry also has reason,
the backend’s reason.
history.done
What the caller was told was done.
history.money
The money the writes that went through moved, as an exact decimal string such as
"-54.04".
history.currency
The money’s ISO 4217 code, or "".
now
Where the call stands, in words: the medium, what the caller asked for, what’s done, what waits for their answer, and what’s set aside. Worked out again on every update.
The keys waiting, queued, proposals, and state are the service’s own. Read your
own per-call state through call.state.
Constants
RECORD: the default key,"ops".RECORD_KEYS: a tuple of every key of the record.RECORD_VERSION: the current version,1.
Example
A record after one cancelled order: