# Vital PBX

## Setting Up VitalPBX with DIDForSale

VitalPBX is a powerful and flexible PBX system that allows users to manage VoIP communications efficiently. This guide will walk you through configuring VitalPBX with SIP credentials from DIDForSale to enable seamless inbound and outbound calling.

### Step 1: Generate SIP Credentials

Before setting up your trunk in VitalPBX, you need to obtain your SIP credentials from DIDForSale. Follow the instructions provided at the link below to generate your SIP username, password, and SIP domain:

[**Generate SIP Credentials**](https://docs.didforsale.com/sip-trunking/sip-account)

### Step 2: Creating a Trunk in VitalPBX

1. **Login to the VitalPBX Admin Dashboard.**
2. Navigate to **PBX > Call Routing > Trunks**.
3. Click on **Add Trunk** and fill in the following details:
   * **Description:** Trunk Name (e.g., DIDForSale Trunk)
   * **Codecs:** ulaw, alaw, g729
   * **Local Username:** SIP Username (from DIDForSale)
   * **Remote Host:** SIP Domain (from DIDForSale)
   * **Remote Port:** 5060
   * **Transport:** UDP/TCP
   * **Identify By:** Username, Auth Username
   * **Trunk CID:** SIP Username (from DIDForSale)
   * **Remote Username:** SIP Username (from DIDForSale)
   * **Remote Secret:** SIP Password (from DIDForSale)
   * **From User:** SIP Username (from DIDForSale)
   * **From Domain:** SIP Domain (from DIDForSale)
4. Click **Update** to save the trunk settings.

<figure><img src="https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LUHjv4EwOoqWXb2by8A%2Fuploads%2F0UK4Kfjf6SbCP2sao2JX%2FVitalPBX_TRUNK.png?alt=media&#x26;token=ce22a5a3-381e-4784-9885-a085295c4771" alt=""><figcaption><p>Vital PBX Trunk</p></figcaption></figure>

### Step 3: Creating an Inbound Route

1. Navigate to **PBX > Call Routing > Inbound Routes**.
2. Click on **Add Route** and configure the following:
   * **Description:** Route Name (e.g., DIDForSale Inbound)
   * **DID Pattern:** Your DID in 11-digit format (e.g., 13125551234, without the ‘+’ sign)
   * **Inbound Destination:** Choose where incoming calls should be routed (e.g., an extension, IVR, or queue)
3. Click **Save** to apply the settings.

<figure><img src="https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LUHjv4EwOoqWXb2by8A%2Fuploads%2FYNMDAOeF47VSI5vzrRqs%2FVitalPBX_Inbound_Route.png?alt=media&#x26;token=32be2f60-6432-4540-825d-98e1236213b7" alt=""><figcaption><p>Vital PBX Inbound Route</p></figcaption></figure>

### Step 4: Creating an Outbound Route

1. Navigate to **PBX > Call Routing > Outbound Routes**.
2. Click on **Add Route** and enter the following details:
   * **Description:** Trunk Name (e.g., DIDForSale Outbound)
   * **Trunks:** Select the trunk created in Step 2
   * **Dial Patterns:** 1NXXNXXXXXX (for US dialling)
3. Click **Save** to complete the configuration.

<figure><img src="https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LUHjv4EwOoqWXb2by8A%2Fuploads%2FPVWonD5Gfx3iay5VPkTf%2FVitalPBX_Outbound_Route.png?alt=media&#x26;token=fcf25e75-d907-44e6-bd74-31ba7b9ff787" alt=""><figcaption><p>Vital PBX Outbound Route</p></figcaption></figure>

### Step 5: Configure your DID to the SIP Trunk

Follow the instructions provided at the link below to configure your DID number to the SIP trunk:

{% content-ref url="../configuration-of-phone-numbers/sip-to-sip-account" %}
[sip-to-sip-account](https://docs.didforsale.com/sip-trunking/configuration-of-phone-numbers/sip-to-sip-account)
{% endcontent-ref %}

### Final Steps: Testing and Validation

Once all configurations are in place, follow these steps to test your setup:

* **Test Incoming Calls:** Dial your DID number from an external phone and check if it routes correctly to your inbound destination.
* **Test Outgoing Calls:** Place a call using a registered extension and confirm it routes through the DIDForSale trunk.
* **Monitor Call Logs:** Navigate to **PBX > Reports > Call Detail Records** to verify call status and troubleshoot any issues.

#### Conclusion

You have now successfully set up VitalPBX with SIP credentials from DIDForSale. This configuration allows you to handle inbound and outbound VoIP calls efficiently. For further customization or troubleshooting, refer to the [VitalPBX Documentation](https://vitalpbx.org/docs/) or contact DIDForSale support.
