Skip to main content

Outbound Routes and Number Formatting

An outbound route tells 4phone which SIP trunk to use for an outgoing call and how to format the destination number before sending it to the telecom carrier.

This setting is needed when an outbound call fails due to the number format. For example, an employee dials +998940560302, but the carrier only accepts 940560302.

Tip

If you have a single standard trunk in Uzbekistan, you often don't need to configure anything: 4phone automatically recognizes numbers like +998XXXXXXXXX and 998XXXXXXXXX and sends the local XXXXXXXXX format to the carrier. Outbound routes are needed when your provider requires a specific format or when you use multiple trunks.

In Plain Terms​

Imagine an employee can dial the same number in different ways:

  1. 940560302
  2. 998940560302
  3. +998940560302

To a person, this is the exact same phone number. To a SIP carrier, these may look like three different formats. One carrier accepts all variants, another only accepts numbers without +998, and a third requires a special prefix.

An outbound route converts the dialed number into the exact format your carrier expects.

When You Need to Configure a Route​

Configure an outbound route if:

  1. calls without +998 go through, but calls with +998 fail;
  2. your provider instructed you to "send the number without the country code";
  3. your provider requires dialing a technical prefix, such as 9;
  4. you have multiple trunks and different numbers should be routed through different carriers;
  5. auto-callback or the auto-dialer cannot reach numbers, even though manual calls in another format succeed.

If outbound calls already work across all required formats, you can leave routes untouched.

What to Ask Your Provider​

Before configuring routes, ask your provider three simple questions:

  1. What format do you expect for the destination number: 901234567, 998901234567, or +998901234567?
  2. Do we need to prepend a technical prefix before the number?
  3. What Caller ID should be sent from our side?
Check

Caller ID is not the number you are calling. It is your own number that the telecom carrier and sometimes the recipient sees. If your provider requires a specific Caller ID, specify it in the SIP trunk settings.

Where to Configure It​

Open the 4phone dashboard and go to:

  1. Settings.
  2. SIP Trunks.
  3. Select the desired trunk.
  4. Open the Outbound Routes section.
  5. Click Add Route.

The section name may vary slightly, but the logic is always the same: a route selects a trunk and transforms the number before sending it to the carrier.

How to Fill in the Fields​

Name​

Enter a clear, descriptive name. For example:

  1. Uzbekistan mobile without 998
  2. Primary outbound route
  3. Calls via Sarkor

The name is only visible inside the dashboard. It helps you remember why the rule was created later on.

Trunk​

Select the SIP trunk through which the call should be sent.

If you have one trunk, select it. If you have multiple trunks, select the carrier that should handle this type of call.

Number Pattern​

The pattern defines which dialed numbers match this rule.

Most common patterns:

What the employee dialsPattern
+998940560302 or 998940560302^998\d{9}$
Only numbers starting with 90^90\d{7}$
Any 9-digit Uzbekistan number^\d{9}$
All numbers with 7 to 15 digits^\d{7,15}$
Tip

The system strips the leading + sign before matching the pattern. Therefore, a single pattern ^998\d{9}$ covers both +998940560302 and 998940560302.

How Many Leading Digits to Strip​

This field is usually labeled Strip Digits, stripDigits, or similar.

It specifies how many leading digits to remove before sending the number to the carrier.

Examples:

Dialed NumberStrip DigitsSent to Carrier
9989405603023940560302
99405603021940560302
9405603020940560302

For the standard +998 case, you usually set 3 to remove the 998 country code.

What to Prepend​

This field is usually labeled Prefix (or prepend).

It adds digits to the beginning of the number after any leading digits have been stripped.

Examples:

Dialed NumberStrip DigitsPrefixSent to Carrier
9405603020empty940560302
940560302099940560302
9989405603023empty940560302

If your provider did not request a special prefix, leave this field empty.

Priority​

Priority determines which rule is evaluated first.

The smaller the number, the earlier the rule is checked. For example, 1 is checked before 10.

A simple approach:

  1. Set 1 for your most specific and important rule.
  2. Set 10 or 20 for broader catch-all rules.
  3. Avoid creating two identical rules with the same priority.

Ready-to-Use Examples​

Example 1. Provider accepts numbers without 998​

Goal: an employee dials +998940560302, and the carrier must receive 940560302.

Settings:

FieldValue
NameUzbekistan without 998
Pattern^998\d{9}$
Strip Digits3
Prefixleave empty
Trunkyour primary trunk
Priority1

Result:

  1. +998940560302 is sent as 940560302;
  2. 998940560302 is sent as 940560302;
  3. 940560302 remains 940560302.

Example 2. Provider requires prepending 9​

Goal: an employee dials 940560302, and the carrier must receive 9940560302.

Settings:

FieldValue
NameVia prefix 9
Pattern^\d{9}$
Strip Digits0
Prefix9
Trunktarget trunk
Priority10

Example 3. Different carriers for different prefixes​

Goal: send numbers starting with 90 through Trunk 1, and numbers starting with 97 through Trunk 2.

Create two routes:

NamePatternTrunkStrip DigitsPrefix
Mobile 90^90\d{7}$Trunk 10empty
Mobile 97^97\d{7}$Trunk 20empty

How to Verify After Saving​

Run a quick test after saving your configuration:

  1. Call a number in the 940560302 format.
  2. Call the same number in the 998940560302 format.
  3. Call the same number in the +998940560302 format.
  4. Open Call History.
  5. Verify that the calls went out through the intended trunk.

If one format works and another fails, check your route: most often the issue is in the pattern or the number of stripped digits.

Before considering the setup complete
  1. The SIP trunk is active or registered.
  2. Caller ID number is populated if required by the provider.
  3. The route pattern matches the number format dialed by employees.
  4. The "Strip Digits" field modifies the number exactly as required by the provider.
  5. Tests have been completed with +998, with 998, and without the country code.

Common Issues​

Calls to 940560302 succeed, but calls to +998940560302 fail​

Most likely, the carrier does not accept the + sign or the 998 country code.

Solution: create a route with the pattern ^998\d{9}$, set Strip Digits = 3, and leave the prefix empty.

The number becomes too short after routing​

Check the Strip Digits field. For example, if 940560302 was dialed and you set 3, the carrier receives 560302, which is invalid.

For a 9-digit number without 998, you should usually set 0.

The call went out through the wrong trunk​

Check the priorities. A more specific rule must have a higher priority (a smaller number).

For example:

  1. ^90\d{7}$ with priority 1;
  2. ^\d{9}$ with priority 10.

That way, numbers starting with 90 match the specific rule first, while all other 9-digit numbers fall back to the general rule.

Provider says the Caller ID is invalid​

An outbound route modifies the destination number, not the Caller ID.

Caller ID is configured on the SIP trunk itself. Open the trunk settings and enter the value provided by your carrier into Caller ID Number.

Need to rotate outbound Caller ID numbers​

An outbound route does not rotate Caller IDs. If you need to alternate between two or more numbers -- for example, every 1,000 calls -- use Caller ID rotation. See Rotating Outbound Caller ID Every N Calls for details.

What to Avoid​

  1. Do not create many overlapping rules unnecessarily.
  2. Do not place a catch-all pattern like ^\d+$ at priority 1, as it may intercept all calls.
  3. Do not guess Caller ID values; many providers block calls with unauthorized numbers.
  4. Do not delete a working rule before testing a new one. Instead, temporarily disable the old rule or test the new one carefully.

When in doubt, start with one simple rule and test a single live outbound call.

Next, it is helpful to review How to Connect a SIP Trunk and Common Issues and Quick Fixes.