> ## Documentation Index
> Fetch the complete documentation index at: https://doc.khcolo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure SIP Trunks in 3CX for Cambodia: Full Guide

> Connect 3CX to Cambodian and international SIP providers, set inbound and outbound routing rules, and tune codecs for reliable call quality.

A SIP trunk is the link between your 3CX phone system and the public telephone network. Without it, your extensions can call each other internally but cannot reach outside numbers — local Cambodian mobiles, landlines, or international destinations. This guide walks you through selecting a SIP provider, entering your trunk credentials in 3CX, and configuring the outbound and inbound routing rules that determine how calls flow in and out of your system.

## Choosing a SIP Trunk Provider

### Local Cambodian Providers

These carriers offer SIP trunk services within Cambodia and are the recommended choice for businesses that primarily make local and national calls. Using a local provider typically delivers lower latency, better regulatory compliance, and local DID (Direct Inward Dialing) numbers.

| Provider     | Notes                                                                       |
| ------------ | --------------------------------------------------------------------------- |
| **Ezecom**   | Enterprise-grade, widely used by corporates and NGOs in Phnom Penh          |
| **Online**   | Competitive rates, reliable coverage across major cities                    |
| **Smart**    | Mobile network operator with SIP trunk offerings for hybrid GSM/VoIP setups |
| **Cellcard** | Established carrier with SIP trunk support and DID allocation               |

<Tip>
  Contact your chosen provider's enterprise sales team to request SIP trunk credentials (registrar hostname, username, password) and a block of DID numbers. Specify that you are running 3CX — most Cambodian carriers are familiar with it.
</Tip>

### International Providers

If your business makes frequent international calls or needs numbers in multiple countries, supplement your local trunk with an international carrier.

| Provider   | Strengths                                                                |
| ---------- | ------------------------------------------------------------------------ |
| **Telnyx** | Competitive international rates, strong API, easy 3CX template available |
| **Twilio** | Flexible programmable voice, global number inventory, pay-as-you-go      |

***

## Adding a SIP Trunk in 3CX

<Steps>
  <Step title="Open the SIP Trunk Configuration">
    In the 3CX Management Console, navigate to **SIP Trunks** in the left sidebar, then click **Add SIP Trunk**.
  </Step>

  <Step title="Select Your Provider Template">
    3CX includes pre-built templates for many common providers. Select your provider from the list. If your Cambodian provider is not listed, choose **Generic SIP Trunk** — the settings below apply universally.
  </Step>

  <Step title="Enter Trunk Credentials">
    Fill in the fields provided by your carrier:

    | Field                      | Value                                      |
    | -------------------------- | ------------------------------------------ |
    | **Registrar / Host**       | e.g., `sip.provider.com.kh`                |
    | **Username**               | SIP account username from your provider    |
    | **Password**               | SIP account password                       |
    | **Number of SIP Channels** | Concurrent call capacity (match your plan) |
    | **Outbound Caller ID**     | Your main published phone number           |

    <Note>
      Some Cambodian carriers require the **Auth ID** field to differ from the **Username**. Check your provider's welcome letter for a separate Authentication ID entry.
    </Note>
  </Step>

  <Step title="Set Codec Preferences">
    Navigate to the **Codecs** tab within your trunk configuration and prioritize:

    1. **G.729** — Compressed codec, ideal for lower-bandwidth connections. Recommended for VPS deployments where upstream bandwidth may be shared.
    2. **G.711 (alaw/ulaw)** — Uncompressed, highest audio quality. Use this when bandwidth is plentiful and you want the best voice clarity.

    Drag your preferred codec to the top of the list and disable codecs you do not need (e.g., G.722 wideband if your carrier does not support it).

    <Info>
      G.729 uses approximately 8 kbps per call channel, while G.711 uses approximately 64 kbps. For a system handling 10 simultaneous calls, the difference is 560 kbps — significant on constrained links.
    </Info>
  </Step>
</Steps>

***

## Outbound Routing Rules

Outbound rules tell 3CX which trunk to use based on the number being dialed. Configure these under **Outbound Rules** in the Management Console.

| Rule Name                     | Dialed Prefix           | Strips Digits | Route To                           |
| ----------------------------- | ----------------------- | ------------- | ---------------------------------- |
| **Local Mobile / National**   | `0[1-9]` (regex)        | 0             | Local Cambodian SIP trunk          |
| **International (00 prefix)** | `00`                    | 0             | Local trunk or international trunk |
| **International (+ prefix)**  | `+`                     | 1             | Local trunk or international trunk |
| **Internal Extensions**       | (handled automatically) | —             | Internal routing                   |

<Tip>
  Always place more specific rules above general ones. If a dialed number matches multiple rules, 3CX uses the first match from the top of the list.
</Tip>

### Example: Emergency Numbers

Add a dedicated rule for Cambodia emergency services to ensure they always route correctly regardless of trunk load:

| Dialed Number     | Route                         |
| ----------------- | ----------------------------- |
| `117` (Police)    | Local trunk, priority routing |
| `118` (Fire)      | Local trunk, priority routing |
| `119` (Ambulance) | Local trunk, priority routing |

***

## Inbound Routing Rules

Inbound rules map incoming DID numbers to destinations inside your 3CX system — an extension, a queue, a digital receptionist, or a ring group.

Navigate to **Inbound Rules** and click **Add DID Rule**:

| Field                          | Description                                                   |
| ------------------------------ | ------------------------------------------------------------- |
| **DID Number**                 | The incoming number from your provider (e.g., `+85523XXXXXX`) |
| **Destination (Office Hours)** | Extension, Queue, or Digital Receptionist                     |
| **Destination (Out of Hours)** | Voicemail or after-hours message                              |
| **Destination (Holidays)**     | Holiday greeting or alternative routing                       |

<Note>
  Your SIP trunk provider must configure each DID number to forward to your 3CX server's public IP on port 5060. Provide them with your server's FQDN or static IP when requesting DID activation.
</Note>

***

## Verifying Your Trunk

After saving your configuration:

1. Check the **SIP Trunks** dashboard — the trunk status indicator should turn **green (Registered)**.
2. Dial an external number from a registered extension to test outbound calls.
3. Call one of your DID numbers from an external phone to test inbound routing.

If registration fails, verify your firewall allows UDP/TCP on port 5060 from your provider's IP ranges, and double-check your username and password. Use **3CX Logs** (under Advanced > Logs) to inspect SIP registration messages in real time.
