Skip to content

CNAM Databases

CNAM (Calling Name) databases allow Yeti to enrich incoming calls with caller name information by querying an external HTTP service during the routing procedure.

When a Customer Auth has a CNAM database assigned, Yeti performs an HTTP lookup after number translation is complete. The response can update the caller name, source/destination numbers, PAI/PPI headers, and routing tags for the call.

Processing flow

The lookup result can override the following call attributes:

Call attributeDescription
src_name_outCaller display name (the primary CNAM result)
src_prefix_outSource number
dst_prefix_outDestination number
pai_outP-Asserted-Identity header value
ppi_outP-Preferred-Identity header value
Routing tagsArray of routing tag IDs to apply to the call

Each attribute is updated only if the parsed response returns a non-null value for it (existing values are preserved otherwise).

General attributes

Id

Unique identifier.

Name

Unique name of the CNAM database. Used for informational purposes only.

Drop call on error

Defines behavior when the HTTP lookup fails or returns an error.

  • If enabled — the call is rejected with Disconnect code 8009 (CNAM Error).
  • If disabled (default) — the lookup failure is ignored and the call continues with the original caller information.
Request Lua

Lua script that transforms the current call profile into the request payload sent to the HTTP endpoint. The script receives the call profile as its argument and must return a value that will be serialized as the request body.

See Request Lua script for details.

Response Lua

Lua script that parses the HTTP response body and maps its fields to call profile attributes. The script receives the raw response text as its argument and must return a table with the expected fields.

See Response Lua script for details.

HTTP configuration

Url
HTTP or HTTPS endpoint URL to send the CNAM lookup request to.
Timeout
HTTP request timeout in milliseconds. Defaults to 5000 (5 seconds).

Request Lua script

The request Lua script is responsible for building the payload that will be sent to the CNAM HTTP endpoint.

Input: the current call profile as a Lua table. The table contains all call attributes available at the time of the lookup, including (but not limited to):

FieldDescription
src_prefix_outSource number after rewriting
dst_prefix_outDestination number after rewriting
src_name_outSource display name
pai_outP-Asserted-Identity value
ppi_outP-Preferred-Identity value

Output: the return value is serialized to JSON and sent as the HTTP request body.

Example — pass the source number as the lookup key:

lua
return { number = arg.src_prefix_out }

Response Lua script

The response Lua script parses the HTTP response and returns a table with the fields to apply to the call profile.

Input: the raw HTTP response body as a string (typically JSON).

Output: a Lua table with any of the following optional fields:

FieldTypeDescription
src_namestringCaller display name to set
src_numberstringSource number to set
dst_numberstringDestination number to set
paistringP-Asserted-Identity value to set
ppistringP-Preferred-Identity value to set
routing_tag_idsarray of integersRouting tag IDs to apply
metadatastringArbitrary JSON metadata stored in the CDR metadata field

Fields that are nil or absent are ignored — the existing call profile values are kept.

Example — parse a JSON response {"name": "John Doe"} and apply the caller name:

lua
local json = require('json')
local data = json.decode(arg)
return { src_name = data.name }