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

# SIP Using Custom Headers

> Learn how to enable SIP dial-in for Zero Runtime rooms. This guide explains how to set up SIP Gateways, configure inbound routing, and forward PSTN calls into Zero Runtime rooms using providers like Twilio, Vonage, and Telnyx. Includes examples for dynamic room routing, webhook handling, and SIP URI formatting.

### Forwarding a PSTN Call Into a Zero Runtime Room

When using Twilio as your SIP/PSTN provider, you may need to forward an incoming phone call into a specific Zero Runtime room.\
This is useful when:

* You want to route calls dynamically to different room IDs.
* You don't want to configure a fixed room inside Zero Runtime Routing Rules.

Twilio requires a webhook endpoint that returns **TwiML**, telling Twilio which SIP URI to dial. This SIP URI connects directly to the Zero Runtime SIP Gateway with the room ID appended as a query parameter.

### Example: Node.js Express Webhook

Create a simple Express server that Twilio will call whenever someone dials your Twilio number.

```js theme={null}
const express = require("express");
const VoiceResponse = require("twilio").twiml.VoiceResponse;
const urlencoded = require("body-parser").urlencoded;

const app = express();
app.use(urlencoded({ extended: false }));

// This endpoint is called by Twilio on incoming PSTN call
app.post("/incoming-call-handler", (request, response) => {
  const twiml = new VoiceResponse();

  const dial = twiml.dial();

  // Replace roomId with the Zero Runtime room you want to route the call into
  const roomId = "your-room-id";

  // SIP address provided by Zero Runtime Inbound Gateway
  const sipUri = `sip:your_twilio_number@INBOUND_GATEWAY_ID?x-videosdk-room-id=${roomId}`;

  dial.sip({}, sipUri);

  response.type("text/xml");
  response.send(twiml.toString());
});

// Start server
app.listen(8000, () => {
  console.log("Server running on port 8000");
});
```

## How It Works

1. Twilio receives an incoming call on your phone number, then it sends a webhook to your server for call instructions.
2. Your server responds with TwiML containing the SIP URI + room ID.
3. Twilio dials the Zero Runtime SIP Gateway, which connects the caller into the room.
