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 attribute | Description |
|---|---|
src_name_out | Caller display name (the primary CNAM result) |
src_prefix_out | Source number |
dst_prefix_out | Destination number |
pai_out | P-Asserted-Identity header value |
ppi_out | P-Preferred-Identity header value |
| Routing tags | Array 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):
| Field | Description |
|---|---|
src_prefix_out | Source number after rewriting |
dst_prefix_out | Destination number after rewriting |
src_name_out | Source display name |
pai_out | P-Asserted-Identity value |
ppi_out | P-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:
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:
| Field | Type | Description |
|---|---|---|
src_name | string | Caller display name to set |
src_number | string | Source number to set |
dst_number | string | Destination number to set |
pai | string | P-Asserted-Identity value to set |
ppi | string | P-Preferred-Identity value to set |
routing_tag_ids | array of integers | Routing tag IDs to apply |
metadata | string | Arbitrary 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:
local json = require('json')
local data = json.decode(arg)
return { src_name = data.name }