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

# How to use SIP Custom Header

## Custom SIP Headers for Outbound Calls

Custom SIP headers let you attach structured metadata to outbound calls. These headers are sent along with the SIP request and can be used by backend systems, CRMs, or receiving endpoints.

<Frame>
  <img src="https://mintcdn.com/sigmamindai/lIJ_jSUS3USjpJXb/images/agents/customheader.png?fit=max&auto=format&n=lIJ_jSUS3USjpJXb&q=85&s=ceed0348b08bb188b663ee1a988e7dea" alt="Customheader" width="1500" height="1500" data-path="images/agents/customheader.png" />
</Frame>

**Key Rules:**

```text theme={null}
Header names must start with X-
Format is key-value pairs
Headers are not visible to the end customer
They are accessible to systems handling the call (e.g., PBX, CRM, agents)
```

***

## Custom SIP Headers for Call Transfers

Custom headers can be included during call transfers.

### Additional capability:

* You can use **dynamic variables** in header values
* This allows passing **real-time data extracted during the call** to the next system or agent

***

## What Custom Headers Do

Custom headers allow you to:

* Send structured metadata along with a call
* Share context between systems
* Improve agent awareness and automation

They are:

* ✅ Hidden from customers
* ✅ Available to backend systems and integrations
* ✅ Useful for routing, tracking, and personalization

***

**Headers are defined as simple key-value pairs:**

```text theme={null}
X-Intent: billing_issue
X-Language: hi
X-Customer-Type: existing
X-Ticket-ID: 12345
X-Call-Source: campaign
```

***

## Mapping Headers to Dynamic Variables

These headers can be mapped and used inside your system or agent workflows:

```text theme={null}
{{ intent }} → billing_issue  
{{ language }} → hi  
{{ customer_type }} → existing  
{{ ticket_id }} → 12345  
{{ call_source }} → campaign  
```

## When to Use Custom Headers

Use custom SIP headers when you need to:

* Pass metadata between systems
* Integrate with CRM or call center tools
* Track call intent, source, or customer type
* Enable smarter routing or automation
* Send structured (non-conversational) data alongside calls

## Custom SIP Headers for Inbound Calls

For inbound calls, custom SIP headers (headers that start with `X-` or `x-`) can be passed from your telephony system (e.g., VICIdial) and automatically converted into dynamic variables at runtime in SigmaMind AI.

These headers are accessible inside your agent without additional configuration.

## How It Works

When an inbound SIP call is received:

1. SigmaMind reads incoming SIP headers
2. Headers with the prefix `X-` or `x-` are extracted
3. The prefix is removed
4. You can access it within your agent by stripping the `X-` or `x-` prefix from the header name, which is then converted into a dynamic variable.

## Example

### Incoming SIP Headers

```text theme={null}
{
  "X-customer_name": "John Doe",
  "X-account_id": "12345",
  "from": "9876543210",
  "to": "1800123456"
}
```

### Runtime Dynamic Variables

These will be available through your agent:

```text theme={null}
{
  "customer_name": "John Doe",
  "account_id": "12345"
}
```

***

## Usage in Agent

You can directly reference these variables in your flows, prompts, or scripts:

* `{{customer_name}}`
* `{{account_id}}`

Example:

```text theme={null}
Hello {{customer_name}}, I see your account ID is {{account_id}}. How can I assist you today?
```

<Note>
  Only headers starting with `X-` or `x-` are processed\
  Header names are normalized by removing the prefix\
  Keys are treated as case-insensitive
</Note>
