FreePBX stripping entire telephone number

From the “System Status” screen, click the “Connectivity” pulldown. On there, click the “outbound routes”.

From there, tell us what things you have set.

For example, on my outbound route for my VOIP providers, I have a Route Type of “Emergency” set, “Call Recording” is “Don’t Care”, PIN Set is “None”.

Below that are the Dialplan Rules.

There are three (maybe four, depending on your version of FreePBX) entries for each rule.

The first column is the “Prepend” rule - this gets added to whatever matches the third column.
The second colum is “Strip” rule - anything in here gets stripped from the number as the “Internal Prefix”.
The third column is the “Match Pattern”, After the strip rule is applied, anything that matches this column get processed through this route (and the prepend gets applied).
Finally, the version specific “Caller ID”. This allows you to tailor your caller ID so that it matches a specific outbound caller ID to this specific number pattern.

So:

Let’s assume you’re in Iowa in the United States. Your VOIP provider needs ‘1’ and the area code for every outbound call and you want people to dial “9” for an outside line (because you’re pretending you’re still using a system from the 1950s) and you want everyone to be able to use 7-digit dialing for local calls. Your rules would look something like this:

Column 1 (prepend) = "1712"
Column 2 (prefix) = "9"
Column 3 (match pattern) = “NXXXXXX”

OR Assume you want everyone to dial the full 10-digit number whenever they call:
Column 1 = "1"
Column 3 = “NXXNXXXXXX”

OR assume everyone has to dial all 11 digits to call out (or you have the vTiger dialer app installed)
Column 3 = “1NXXNXXXXXX”

You can actually use ALL of these rules at the same time (except for the dial “9” for an outside line thing - that’s stupid). If the number dialed matches the rules above, this number gets sent to the trunks specified at the bottom of the page.

The idea here is to match a sequence and modify it so that all of your trunks get the same thing. In our example, this trunk is ONLY used for outbound calls. For any call, the outbound number will always be '1NXXNXXXXXX" where ‘1’ is a “1”, “N” is a digit from 1-9, and X is any valid digit.

The trunk configuration has a similar block of rules (without the caller ID). In here, the rules are used to decide if your traffic is appropriate for this trunk and (if so) how to modify the dialed number to make it correct.

Suppose that you have two VOIP providers and one is good for “domestic” calls (1+areacode+number) and one is good for international calls (011+areacode+number). All of your calls (from your outbound route rules) are sent to the trunk in the form “1NXXNXXXXXX”, so you would “prepend” a “01” onto the front of any call that matches with a ‘1NXXNXXXXXX’ for the International provider and just allow it on your other provider (match “1NXXNXXXXXX”), you are good to go.

If you only have one route out and don’t plan on doing any “abbreviated” dialing (every number is a full number, so no assumed area codes or country codes) you don’t really need any rules in either area. The system is smart enough to know about it’s own numbers and all of the dial codes (Do Not Disturb, etc.) and the local extensions. Everything else gets sent to your outbound route, which then sends everything out to your trunk. As long as you don’t do something that annoys the VOIP provider, the system should just work.