vCon-C Library
What libvcon 0.1.0 covers, which Python library version it matches, and how to build and use it from C.
libvcon is the C implementation of the vCon specification, a peer to the Python vcon library and vcon-js. Version 0.1.0 reads and writes the vCon JSON structure from C and C++ with libc, OpenSSL 3, and a vendored cJSON.
Version:
libvcon0.1.0 · Single headervcon.h· Requires OpenSSL 3. libcurl and ffprobe are optional · Source: vcon-dev/vcon-c.
Parity baseline
libvcon 0.1.0 matches Python vcon-lib 0.9.6 and draft-ietf-vcon-vcon-core-02 (syntax "0.4.0"). Parity is behavioral, proven by golden fixtures generated from vcon-lib 0.9.6.
libvcon has not yet tracked the 0.10 changes in vcon-lib, which targets core-04. These differ from what the C library writes today:
Empty
metaandmetadataplaceholders.vcon_add_dialogaddsmeta:{}andmetadata:{}as 0.9.6 did. Newer Python drops emptymeta.The tags attachment body shape.
vcon_add_tagwrites the body as a list of"name:value"strings. vcon-js writes an object.base64url padding rules.
The three libraries read each other's output, but do not rely on identical serialized bytes. Field rules are in the field reference.
When to use vcon-c
vcon-c for C and C++ services, embedded targets, telephony and media daemons, or native code where libc and OpenSSL are the only safe dependencies.
Python
vconfor conserver links, data pipelines, and ML preprocessing.vcon-js for Node, edge functions, and browser code.
What is covered
Core tree, JSON I/O, and
property_handling(default, strict, meta)Validation with the same error strings as Python
is_validuuid8 (domain and time), strict RFC 3339, base64url
Builders: party, dialog (including transfer, incomplete, inline data), attachment, analysis, tags, extension and critical lists
Content hashing (sha512, sha256, legacy unprefixed), through OpenSSL
JWS RS256 sign and verify, cross-verified with Python in both directions
Extensions: lawful basis and WTF transcription builders and finders
Optional HTTP through libcurl and media metadata through ffprobe and header parsing
The API reference has the function list, return codes, ownership rules, and the Python-to-C map.
Deliberate divergences from vcon-lib 0.9.6
created_atis preserved verbatim on parse. Python reformats it through dateutil, turningZinto+00:00non-idempotently.The lawful basis permission check evaluates the grant. In vcon-lib 0.9.x,
check_lawful_basis_permissionreturnsFalsefor every input.vcon_check_lawful_basis_permissionfollowsdraft-howe-vcon-lawful-basis: the grant is present,grantedis true, and the basis is unexpired. Python 0.10.0 returnsTruefor a granted grant.Strict RFC 3339 timestamps rather than lenient dateutil parsing. A non-array
parties,dialog, oranalysisis a parse error.
Build
Options: -DVCON_WITH_CURL=OFF drops HTTP (vcon_load_url, vcon_post_url). -DVCON_WITH_MEDIA=ON adds image, PDF, and ffprobe metadata. The default build compiles the worked example to ./build/call_recording.
Quickstart
This builds a vCon with one party, one text dialog, and a lawful basis attachment, checks it, and prints it. It was built and run against the 0.1.0 source.
The lawful basis attachment carries purpose: "lawful_basis", encoding: "json", and a body that is a JSON string. The builder adds lawful_basis to extensions. It does not set start, which the core schema requires on every attachment. To include one, build the attachment object yourself and add it with vcon_add_attachment.
For a full walkthrough with a recording dialog, content hash, transcript and summary analysis, tags, JWS signing, and serialization, read examples/call_recording.c.
See also
Last updated
Was this helpful?