vcon-server

Producers

Sending vCons to vcon-server from a recorder, a conserver or any other producer: keys, retries, and what each answer means.

A producer is anything that makes vCons: a call recorder, a contact-centre platform, a conserver pipeline, a capture tool. vcon-server takes them over one route, POST /vcons, with a bearer key.

Give each producer its own key

Make a tenant key with only the write scope, labelled with the producer's name:

curl https://vcon.example.com/admin/tenants/$TENANT/keys \
  -H "Authorization: Bearer $OPERATOR_KEY" -H "Content-Type: application/json" \
  -d '{"scopes": ["write"], "label": "recorder-east-1"}'
# 201 {"id":"…","token":"vcs_…"}

The token is shown once. A producer that also reads back what it sent needs read too; one that replaces vCons as analysis arrives needs only write.

Send

curl https://vcon.example.com/vcons \
  -H "Authorization: Bearer $VCON_KEY" \
  -H "Content-Type: application/vcon" \
  --data-binary @call.vcon

Send gzipped bodies as application/vcon+gzip. Send signed or encrypted vCons as they are: they are stored byte for byte, so signatures stay valid.

What each answer means

AnswerMeaningWhat to do
201stored; ETag is its versiondone
200the same bytes were already storeddone: this is a safe retry
409 conflictanother vCon already has this uuida bug upstream: two vCons share a uuid, or this one changed and needs PUT
410 gonethis uuid was deleteddo not resend; a deleted uuid stays deleted
413 too-largeover limits.body, or inflates past limits.inflatedsend the recording by URL instead of inline
422 (format problems)the body is not a vCon the server can storefix the producer; resending will not help
401 / 403the key is wrong, revoked, or lacks writefix the key
408 timeout, 503, connection errorsthe request may not have been carried outretry with backoff: a retry of the same bytes is safe

Because the same bytes answer 200, a producer can retry any request whose answer it did not see, without creating a duplicate.

Keep recordings by URL

vCons let a recording be held inline (base64url in the dialog body) or by URL with a content hash. Of 25,471 recordings in the vCons measured to set the defaults, all but 26 were by URL. Inline audio costs about 43 kB a second of an 8 kHz 16-bit stereo WAV, so the 16 MiB default body holds about six and a half minutes. Long calls belong in object storage, referenced by URL.

Updating a vCon

When analysis arrives after the call, read the current ETag and replace with If-Match. A 412 means someone else replaced it first: read again, merge, and retry. Signed and encrypted vCons are never replaced: send a new vCon instead.

Source of this page: website/content/docs/producers.md