> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telzino.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Context in SIP Headers

> Pass call context to your Telzino AI agent with the X-Inject-Context SIP header.

When your PBX or SIP platform routes a call to a Telzino agent, it can attach context about the call using a custom SIP header. The agent uses this context to personalize its greeting and to understand who the call was originally intended for.

This is most useful with **Message Taker** agents: the header tells the agent whose calls it is answering, so it can greet callers correctly and route the message summary email to the right person.

## The Header

Add one of the following headers to the SIP INVITE sent to Telzino (both spellings are accepted):

```
X-InjectContext
X-Inject-Context
```

## Supported Value Formats

### Extension Format

```
X-Inject-Context: 1004@pbx.example.com
```

When the value is formatted as `extension@host`, Telzino resolves the extension to a person using your PBX directory (for example, via the NetSapiens integration) or the agent's saved message-taker directory. This yields the person's display name and email address.

If your agents are deployed through Telzino Connect on a NetSapiens platform, this header is attached automatically when a user's call is forwarded to your agent — no extra configuration is needed.

### Free Text

```
X-Inject-Context: take a message for Jane Smith <jsmith@example.com>
```

Any value that is not in extension format is treated as free text. Telzino uses AI to extract the person's name and email address from the text. The full header text is also made available to the agent as background context during the call, so descriptive details (for example, "Jane is out until Monday") can inform the agent's responses.

## What the Agent Does With It

### Greeting Personalization

* If your agent's greeting contains the `{name}` placeholder, it is replaced with the resolved name.

  ```plaintext theme={null}
  Greeting:  "Hi, you've reached the office of {name}. How can I help?"
  Spoken:    "Hi, you've reached the office of Jane Smith. How can I help?"
  ```

* If the greeting has no placeholder, the agent prepends an introduction:

  ```plaintext theme={null}
  Greeting:  "How can I help you today?"
  Spoken:    "Hi, you have reached the assistant for Jane Smith. How can I help you today?"
  ```

* If the resolved name matches the agent's own name (for example, the header carries the agent's own PBX extension), the greeting is spoken unchanged — the agent will not announce itself as its own assistant.

### In-Call Context

The agent is informed that the call was originally dialed for the resolved person and that it is answering on their behalf. If an email address was resolved, the agent sends the message summary email to that address. When a caller asks who the agent is taking a message for, it answers with the resolved name.

## Adding the Header From Your PBX

Most SIP platforms can add custom headers on the leg that forwards the call to Telzino. For example, in an Asterisk dialplan:

```plaintext theme={null}
same => n,Set(PJSIP_HEADER(add,X-Inject-Context)=take a message for Jane Smith <jsmith@example.com>)
same => n,Dial(PJSIP/your-telzino-trunk)
```

Consult your PBX documentation for the equivalent way to add a custom SIP header to outbound or forwarded calls.

## Behavior Notes

* The header value is always treated as data about the call — never as instructions to the agent.
* If the value cannot be resolved or parsed, the call proceeds normally, exactly as if no header were present.
* Extracted names and email addresses are validated and sanitized before use.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.