# How to use Twilio IVR Dial Trees with the Zoom Video SDK
**Updated September 17, 2024**
One of the advantages of the [Zoom Video SDK](/docs/video-sdk/) is our [PSTN](/docs/video-sdk/web/pstn/) and [SIP](/docs/video-sdk/web/sip/) call out/call in compatibility. This allows developers to connect phone users to Video SDK Sessions. Going a step further, PSTN and SIP support allows the Video SDK to be used with complex IVR dial tree use cases. For example, if I am calling a phone number to talk to a support agent, pressing numbers along the way to route me to the right point of contact, I can be connected into a Video SDK session via the Zoom PSTN or SIP bridge with an agent present in the Video SDK Session.
Below is an example of how to use the Zoom Video SDK with [Twilio's IVR dial tree](https://www.twilio.com/docs/voice/interactive-voice-response).
## Prerequisites
1. [Twilio account](https://www.twilio.com/docs/voice/quickstart/no-code-voice-studio-quickstart#sign-up-for-or-sign-in-to-twilio) with a [phone number](https://www.twilio.com/docs/voice/quickstart/no-code-voice-studio-quickstart#get-a-phone-number).
2. [Zoom Video SDK account](/docs/video-sdk/get-credentials/) with the [PSTN](/docs/video-sdk/web/pstn/) or [SIP](/docs/video-sdk/web/sip/).
## Getting the Video SDK session dial in info
There are a few ways to get the dial in info for a Video SDK session once the [session has started](/docs/video-sdk/web/get-started/#start-and-join-sessions).
- Video SDK functions ([web example](/docs/video-sdk/web/pstn/#call-into-the-session-call-in)).
```js
stream.getCurrentSessionCallinInfo();
```
```json
{
"meetingId": "123456789",
"password": "1234",
"tollNumbers": [
// ...
{
"number": "+1 1234567890",
"country": "US",
"free": false,
"displayNumber": "+1 123 456 7890",
"countryId": "US",
"type": 0,
"priority": 0,
"businessType": 0,
"countryName": "United States",
"dc": "US"
}
// ...
],
"participantId": "345"
}
```
- [POST](/docs/api/video-sdk/#tag/sessions/POST/videosdk/sessions) or [GET](/docs/api/video-sdk/#tag/sessions/GET/videosdk/sessions/{sessionId}) Video SDK session REST API (see `session_number`, `passcode`, and `settings` → `global_dial_in_numbers`) .
```json
{
"id": "sfk/aOFJSJSYhGwk1hnxgw==",
"session_number": 123456789,
"session_name": "My session",
"passcode": "123456",
"start_time": "2019-08-20T19:09:01Z",
"end_time": "2019-08-20T19:19:01Z",
"duration": "30:00",
"user_count": 2,
"has_voip": true,
"has_video": true,
"has_screen_share": true,
"has_recording": true,
"has_pstn": true,
"session_key": "my_session_key",
"has_session_summary": true,
"created_at": "2022-03-25T07:29:29Z",
"settings": {
"auto_recording": "cloud",
"global_dial_in_countries": [
"US"
],
"global_dial_in_numbers": [
{
"country": "US",
"country_name": "US",
"number": ""+1 1234567890",
"type": "toll"
}
]
}
}
```
The Zoom dial in info convention is Phone Number -> Meeting ID followed by # -> Participant ID (optional) followed by # -> password followed by #. The Participant ID is optional, to bypass it, just press #.
## Using Twilio IVR Dial Tree
The Twilio IVR Dial Tree platform allows you to design dial trees via code using your favorite language with the [TwiML™ language](https://www.twilio.com/docs/voice/twiml), or with a drag and drop studio designer.
### IVR Dial Tree using Twilio Studio
1. Setup the [base IVR flow in Twilio studio](https://www.twilio.com/docs/studio/tutorials/how-to-build-an-ivr).
1. Update the [connect call](https://www.twilio.com/docs/studio/tutorials/how-to-build-an-ivr#connect-the-calls) number to your [Video SDK session dial in number or SIP address](#getting-the-video-sdk-session-dial-in-info).
[Twilio Studio does not currently support including DTMF tones or pauses](https://stackoverflow.com/questions/53356939/dial-an-extension-using-dtmf-tones-after-a-pause-twilio-studio), which would allow you to auto dial the Video SDK session ID (`meetingId` ^) and passcode (`password` ^). However, this is something you can do with Twilio TwiML™, see below for an example.
1. Click save and publish.

### IVR Dial Tree using Twilio TwiML™
1. Use the [Twilio Voice SDK](https://www.twilio.com/docs/voice/twiml/dial) to connect the call to your [Video SDK session dial in number or SIP address](#getting-the-video-sdk-session-dial-in-info).
You can auto dial the Video SDK session ID (`meetingId` ^) and passcode (`password`^) using the [`sendDigits` property](https://www.twilio.com/docs/voice/twiml/number#attributes-senddigits).
TwiML™ example:
```xml
11234567890
```
Node.js example:
```js
const VoiceResponse = require("twilio").twiml.VoiceResponse;
const response = new VoiceResponse();
const dial = response.dial();
dial.number(
{
sendDigits: "wwww123456789#wwww#wwww1234#",
},
"11234567890",
);
console.log(response.toString());
```
TwiML™ SIP example:
```xml
sip:123456789@zoomcrc.com
```
Node.js example:
```js
const VoiceResponse = require("twilio").twiml.VoiceResponse;
const response = new VoiceResponse();
const dial = response.dial();
dial.sip("sip:123456789@zoomcrc.com");
console.log(response.toString());
```
If successful, a PSTN or SIP user will have joined the Video SDK session.
If you are replacing [Twilio Programmable Video](https://www.twilio.com/docs/video/overview) with the [Zoom Video SDK](/docs/video-sdk/), simply update your [``](https://www.twilio.com/docs/voice/twiml/connect/room) flow, to the [``](https://www.twilio.com/docs/voice/twiml/dial) flow, passing in the [Video SDK session dial in number](#getting-the-video-sdk-session-dial-in-info).
You can auto dial the Video SDK session ID (`meetingId` ^) and passcode (`password` ^) using the [`sendDigits` property](https://www.twilio.com/docs/voice/twiml/number#attributes-senddigits).
## Testing the tree
1. Make a phone call to your Twilio number.
1. Press 1. or the respective flow you designed to dial into your Video SDK session number.
1. If successful, a PSTN user will have joined the Video SDK session.
If you are using Twilio Programmable Video, Twilio has chosen the Zoom Video SDK as the [migration path for the Twilio Video deprecation](/docs/video-sdk/twilio/). View the [migration guides](/docs/video-sdk/twilio/#migration-guides) and [feature map](/docs/video-sdk/twilio/#feature-map), [migration services](/docs/video-sdk/twilio/#migration-services), or [contact us](/docs/video-sdk/twilio/#contact-us).