# Answer phone calls with your AI agent using a SIP trunk > Connect a number you already own from a PBX, SIP provider or GSM gateway so your QwryAI agent answers its calls The **SIP trunk** phone method connects a phone number you already own, on your own PBX, SIP provider or GSM gateway, to a QwryAI agent. You enter the number, QwryAI creates a SIP URI for it, and you route the number's inbound calls to that URI. Your agent then answers those calls with its voice settings, instructions, data sources and Actions. > [card] What you can do: | /docs/user-guides/integrations/sip-trunk#how-to-connect-a-sip-trunk | Keep the number your customers already call, and route its inbound calls to your agent instead of buying a new one. > [!NOTE] > > Use this method when you already have numbers with a carrier or run your own telephony. To use numbers from a Twilio account instead, see [Twilio](/docs/user-guides/integrations/twilio). ## Before you start * An existing phone number on a PBX, SIP provider or GSM gateway. * Access to that trunk's inbound call routing (origination), so you can point it at an external SIP URI. Where this setting lives depends on your provider. * A QwryAI agent with the voice you want callers to hear. Set the voice, language and greeting on the agent's [Voice](/docs/user-guides/chatbot/voice) page. * A plan that includes voice: Starter, Growth or Enterprise. ## How to connect a SIP trunk **1. Open the Phone channel** 1. Open your agent and select **Channels** in the sidebar. 2. On the **Phone** card, *Let your AI agent handle inbound phone calls*, select **Setup** (or **Manage** if numbers are already assigned). ![The Phone card on the Channels page with the pointer on its Setup button.](annotated/01-phone-card.webp "Channels › Phone.") 3. Go to the **Connections** tab. This is where you assign phone numbers to the agent. ![The Phone channel's Connections tab with Assign phone numbers, No numbers assigned and the Assign a new number button.](annotated/02-connections.webp "Connections › Assign a new number.") **2. Choose the SIP trunk method** 1. Under **Assign phone numbers**, select **Assign a new number**. 2. In **Assign a new number**, choose **SIP trunk**: *Connect an existing number from your PBX, SIP provider or GSM gateway.* 3. Select **Continue**. ![The Assign a new number dialog with SIP trunk selected and the pointer on Continue.](annotated/03-choose-sip.webp "Choose SIP trunk.") > [!NOTE] > > **SIP trunk** is selected by default. **Twilio number** shows **Integrate with Twilio** until a Twilio account is connected to the agent. **3. Enter the number details** In the **Connect SIP trunk** dialog, *Enter a name and phone number for the SIP trunk you want to connect*: 1. Enter a **Name**, a label to recognise the number later, such as "Main office trunk". 2. Enter the **Phone number** in E.164 format, with the country code, such as `+15550100123`. 3. Select **Connect SIP trunk**. ![The Connect SIP trunk dialog with Main office trunk as the Name and +15550100123 as the Phone number, and the pointer on Connect SIP trunk.](annotated/04-sip-form.webp "Name and number in E.164 format.") If the number isn't valid E.164, the form shows *Enter a valid phone number in E.164 format (e.g. +15550000000)*. A number already connected to an agent shows *This phone number is already in use.* **4. Copy the SIP URI** The **SIP trunk created** dialog says *Copy the SIP URI below and add it to your PBX or SIP provider configuration.* Select the copy button, then **Done**. The URI looks like this, with QwryAI's SIP host after the `@`: ```text sip:+15550100123@:5061;transport=tls ``` ![Selecting Connect SIP trunk, the SIP trunk created dialog with the SIP URI, the copy button and Done, and the new number on the Connections tab as Active with a SIP trunk badge.](walkthroughs/sip-trunk-created.gif) > [!WARNING] > > Copy the SIP URI **exactly** as shown, including the `+`, the port and `;transport=tls`. You can copy it again at any time from the number's menu. See [Managing phone numbers](#managing-phone-numbers). **5. Point your carrier at the SIP URI** In your carrier, PBX, SIP provider or GSM gateway, route inbound calls for this number to the SIP URI you copied. This is usually the trunk's **origination**, **inbound route** or **SIP destination** for the number. In general: 1. Open your provider's trunk or number settings. 2. Set the inbound call destination (origination URI or SIP endpoint) to the copied SIP URI, over TLS. 3. Turn off digest authentication and registration for this destination. QwryAI uses neither. 4. Save the configuration. > [!TIP] > > A new SIP trunk number is **Active** as soon as you create it. On the **Connections** tab it shows the phone number, its name, a **SIP trunk** badge and **Active** with the switch on. Place a test call and check that your agent answers with the greeting from its voice settings. ## How calls work Once a SIP trunk number is connected and on: * **Inbound calls** to that number go through your carrier to QwryAI and are answered by the agent. * The agent speaks with the **voice settings** on its [Voice](/docs/user-guides/chatbot/voice) page and greets the caller with its first message. * The conversation follows the agent's instructions, data sources and Actions, just like a chat. * Each call is saved as a conversation in the **Inbox**. * If the caller asks for a person, the [Transfer to phone number](/docs/user-guides/chatbot/actions/transfer-to-phone) Action can hand the call over. * To get each call's summary in your own system, add a URL under **Call summary webhook** on the **Connections** tab. Each call uses **6 credits per minute**, plus the voice model's credits for each reply. Every started minute counts as a full minute. Your carrier bills you separately for the line. See [Voice](/docs/user-guides/chatbot/voice). ## Managing phone numbers ### Copy the SIP URI again 1. On the **Connections** tab, open the number's menu. 2. Select **Copy SIP URI**. QwryAI shows *SIP URI copied*. ### Turn a number on or off Use the switch on the number. Turning it off shows *Phone number unassigned* and the number shows **Paused**: it stops taking calls but stays on the agent, and the SIP URI doesn't change, so you can turn it back on without touching your carrier. ### Delete a number 1. Open the number's menu and select **Delete**. 2. Confirm in the **Delete phone number?** dialog. > [!WARNING] > > Deleting removes the number from this agent and can't be undone. The number stays with your carrier, and you can connect it again later; its SIP URI will be the same. ## Limitations * **Routing happens at your carrier.** QwryAI creates the SIP URI, but calls only reach your agent once your provider sends them there. * **The SIP URI must match exactly,** including the port, the transport and the `+` in the number, or calls won't connect. * **No keypad input.** The agent doesn't act on keypad presses (DTMF), so don't rely on "press 1" menus after the call reaches it. * **A voice plan is required.** Starter, Growth or Enterprise. ## Troubleshooting > [accordion] Calls ring but the agent never answers > > Check that: > > 1. The number's switch is on. > 2. Your plan includes voice. > 3. Your workspace has enough credits for the first minute. > 4. No concurrent or daily call limit has been reached. See **Limits** on the [Voice](/docs/user-guides/chatbot/voice) page. > 5. Your carrier sends the call to the exact SIP URI, over TLS on port 5061, without authentication. ## Frequently asked questions > [accordion] Does QwryAI need SIP credentials or registration? > > No. There's no digest authentication and no registration. Calls are accepted only for numbers connected in QwryAI. > [accordion] Is a new SIP number active right away? > > Yes. New SIP trunk numbers start **Active**. Turn off the switch if you want to stop calls while you finish setting up your carrier. > [accordion] How much does a SIP call cost in QwryAI? > > 6 credits per minute, plus the voice model's credits for each reply. Every started minute counts as a full minute. Your carrier bills you separately for the line. ## Next steps > [card] Twilio | /docs/user-guides/integrations/twilio | Use numbers from your Twilio account instead. > [card] Transfer to phone number | /docs/user-guides/chatbot/actions/transfer-to-phone | Let the agent hand a live call to a person.