# Configure your origination SIP Trunk

In this article, we’ll show you how to set up the following:

* [Incoming calls from your Virtual Number(s) to Forwarding Rule (IP-PBX)](#h_01F4EABQNZYARNC6QK05KBTBXA)
* [Incoming calls from your Virtual Number(s) to another Number via your SIP Server](#h_01F4EAC0X9Q2Z9SH4H7RFFCQWF)
* [Incoming calls from your Virtual Number(s) to your SIP Server - Dynamic Forwarding](#h_01F4EAC90GR9NDQHJ0542M4V9Y)

You can receive inbound calls to your MessageBird number from our platform in multiple ways:

* Forwarding to a specific PSTN number in E.164 format e.g. +31612345678 or 31612345678
* Forwarding to a SIP server/node e.g. your Session Border Controller, IP-PBX, SIP Proxy Server, etc.

### Requirements

* A [MessageBird account](https://dashboard.messagebird.com)
* Add [MessageBird's IPs](https://docs.bird.com/connectivity-platform/sip-trunking/messagebird-ip-whitelist-for-voice-calls) to your firewall or PBX to whitelist them

**NOTE**: It’s free to make a MessageBird account, but you’ll need to add funds to your account to place calls.

&#x20;

## Incoming calls from a Virtual Number to Forwarding Rule (IP-PBX) <a href="#h_01f4eabqnzyarnc6qk05kbtbxa" id="h_01f4eabqnzyarnc6qk05kbtbxa"></a>

Follow these steps:

1. Log into your [MessageBird Dashboard](https://dashboard.messagebird.com/en/login), then click the **Numbers** icon on the toolbar on the left-hand side of your screen.<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-8f65f81901d2170c7e2db71a06109b578da2cac9%2Fezgif.com-gif-maker__2_.gif?alt=media" alt=""><figcaption></figcaption></figure>
2. Here, you’ll be able to see a list of the virtual numbers you have purchased and see the status of those numbers. Find the active number that you want to set up forwarding for.
3. Next to the **Status** column, you’ll see a column titled **Edit**. Click the three dots, then select **Create forwarding rule** from the options that appear.<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-1d2e67054642ee4ef0a80b27a8f94f99b15b16d8%2Fezgif.com-gif-maker__3_.gif?alt=media" alt=""><figcaption></figcaption></figure>
4. On the [Forwarding Rules](https://dashboard.messagebird.com/en/voice/sip/forwarding/) page, click **Create rule**. A pop-up will appear.<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-a17fe23a43a2bead4402a78ba79f43d5a3705588%2Fpasted_image_0__5_.png?alt=media" alt=""><figcaption></figcaption></figure>
5. In the **Name** field, enter a recognizable name for your forwarding rule.
6. In the **Prefix Number with ‘+’ sign** field, select **Enabled** (default) or **Disabled**.
7. In the **Domain** field, enter the IP or Domain name of the PBX where you want the calls to be forwarded.
8. Click **Save** to save your changes.
9. If you want to assign more numbers to the rule that you just created, click on **Add New** and select the number from the drop-down.<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-650c53337f3996c967333aa4165ab2759d6a54ee%2Fpasted_image_0__6_.png?alt=media" alt=""><figcaption></figcaption></figure>

**NOTE**: The **Forwarding Rule** option can only be used to create a flow where the calls are forwarded to a customer-defined PBX.

&#x20;

## Incoming calls from your Virtual Number(s) to another Number via your SIP Server <a href="#h_01f4eac0x9q2z9sh4h7rffcqwf" id="h_01f4eac0x9q2z9sh4h7rffcqwf"></a>

Follow these steps:

1. Log into your [Dashboard](https://dashboard.messagebird.com/en/login), then navigate to [Flow Builder](https://dashboard.messagebird.com/en/flow-builder).
2. If you want, you can use our pre-made **Forward Flow** template. If you’d prefer to manually create a flow, click **Create new Flow**.
3. Choose **Phone Call** as the trigger, and select the number or numbers that you would like to forward calls from, then click **Save**.
4. Click the **Forward Call** step.
5. In the step settings, add the SIP URL that you would like the calls to forward to into the **Forward to number** field. Take a look at the screenshot below to see how we’ve formatted this, replacing “1.1.1.1” with your own SIP Server IP.<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-f83d885df3a8a4ad37e9bcd77e3f7b7fc5d09666%2Fpasted_image_0__7_.png?alt=media" alt=""><figcaption></figcaption></figure>
6. Click **Save**.
7. To see how your flow works before you make it live, click **Simulate**.
8. Click **Publish** in the top right-hand corner of your screen to start your flow!

**NOTE**: A SIP URI is the SIP addressing schema or identifying string of characters to call another person via SIP. It is, essentially, a user’s sip “phone number”, and it is formatted similarly to email. The format is “sip:user\@host, or sometimes “sip:user\@host:port.”

&#x20;

## Incoming calls from a Virtual Number to your SIP Server - Dynamic Forwarding <a href="#h_01f4eac90gr9ndqhj0542m4v9y" id="h_01f4eac90gr9ndqhj0542m4v9y"></a>

Follow these steps:

1. Log into your [Dashboard](https://dashboard.messagebird.com/en/login), then navigate to [Flow Builder](https://dashboard.messagebird.com/en/flow-builder).
2. If you want, you can use our pre-made **Forward Flow** template. If you’d prefer to manually create a flow, click **Create new Flow**.
3. Choose **Phone Call** as the trigger, and select the number or numbers that you would like to forward calls from, then click **Save**.<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-907657d9d9477c0895bb8800d9c1ecc38ade74f8%2Fpasted_image_0__8_.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Click the **Forward Call** step.
5. In the step settings, under the **Forward to Number** field, drag and drop the **Destination** variable to build your SIP URI. Example SIP URI: sip:destination\@1.1.1.1 (replacing @1.1.1.1 with your own.)<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-fb06b434d766820a1ce1de429c30a3e8f646c921%2Fpasted_image_0__9_.png?alt=media" alt=""><figcaption></figcaption></figure>
6. Click **Save**.
7. To see how your flow works before you make it live, click **Simulate**.
8. Click **Publish** in the top right-hand corner of your screen to start your flow!
