# Dial Number — Telnyx

> Dial a number or SIP URI from a given Call Control App. See the documentation

- Key: `telnyx-dial-number`
- Type: Action (Write)
- Version: 0.0.2
- App: Telnyx (`telnyx`) — https://pipedream.com/apps/telnyx.md
- This page (HTML): https://pipedream.com/apps/telnyx/actions/dial-number
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/telnyx/actions/dial-number/dial-number.mjs

## Description

Dial a number or SIP URI from a given Call Control App. [See the documentation](https://developers.telnyx.com/api/call-control/dial-call)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `callControlAppId` | `string` | Yes | The ID of the Call Control App to be used when dialing the destination. Options are loaded from the connected account. |
| `phoneNumber` | `string` | Yes | The phone number to send the message from. Options are loaded from the connected account. |
| `to` | `string` | Yes | The DID or SIP URI to dial out to |
| `fromDisplayName` | `string` | No | The string to be used as the caller id name (SIP From Display Name) presented to the destination (to number). |
| `audioUrl` | `string` | No | The URL of a file to be played back to the callee when the call is answered. The URL can point to either a WAV or MP3 file. |
| `webhookUrl` | `string` | No | Use this field to override the URL to which Telnyx will send subsequent webhooks for this call. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "telnyx",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "telnyx-dial-number",
  arguments: {
    callControlAppId: "Call Control Application ID",
    phoneNumber: "Phone Number",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "telnyx-dial-number",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    telnyx: { authProvisionId: "apn_xxxxxxx" },
    callControlAppId: "Call Control Application ID",
    phoneNumber: "Phone Number",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "telnyx-dial-number",
    "configured_props": {
      "telnyx": { "authProvisionId": "apn_xxxxxxx" },
      "callControlAppId": "Call Control Application ID",
      "phoneNumber": "Phone Number"
    }
  }'
```

---

- App: https://pipedream.com/apps/telnyx.md · All apps: https://pipedream.com/apps
