Peering Two Switchvox PBXs Over SIP
A Customer Center entry from January 16, 2005
Let's assume that you have two offices, one in Los Angeles and one in Tokyo. Both have their own Switchvox installation and broadband connection. Your goal is to be able to reach any 3 digit extension in either office without dialing extra numbers. This can be accomplished by SIP peering. By using SIP peering, calls between the Los Angeles and Tokyo offices are free, due to the fact that we do not use any phone service provider to make them.
The following steps illustrate how you would set up SIP peering between two sites.
-
Your first step is to decide how to assign extensions. In order to make the call routing easier, it's a good idea to make all the Tokyo extensions start with one number, and all of the Los Angeles extensions start with another number. For example, you would make all Tokyo extensions start with 8 and all Los Angeles extensions start with 7. eg: 7XX will reach LA, 8XX will reach Tokyo.
-
Next, configure each Switchvox PBX in each area as usual, assigning Los Angeles extensions in the 700s and assigning Tokyo extensions in the 800s. The rest of this document will involve logging into the admins on both sites, so if you only have access to one network you'll need a person at the other site with access to the PBX admin. Order doesn't really matter here. If the Los Angeles admin gets configured on Monday, but the Tokyo PBX isn't configured until Tuesday, it will still work after both are completed.
-
The next goal is to allow calling across any network router that performs NAT. If the IP address of your Switchvox PBX is in the following ranges, it is likely that it is behind a NATting router:
192.168.0.0 - 192.168.255.255
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.32.255.255If neither of your Switchvox PBXes are behind a NATting router, you can skip to step 5.
You will need to enable port forwarding on your router to allow calls to reach your PBX. The following ports need to be forwarded from your router to your pbx:
UDP port 5060
UDP ports 10000-10500To enable port forwarding, check with the documentation for your router. Documentation on port forwarding for many common brands of routers can be found at: http://www.portforward.com
You will need to forward the above ports on both networks, IE: both the Los Angeles and Tokyo routers will have to be configured in our example.
-
After port forwarding has been enabled on both routers, you will need to tell the PBX of this change. This will need to be done on each PBX that is behind a NATting router.
-
To do this, go to the "Network Settings" tab of the "Machine Admin" menu of your Switchvox admin page.
-
In the middle of the screen, click and expand the option that says "Click to Show Advanced Options"
-
Select the "Yes" option under "Allow Nat Port Forwarding", and fill in th external IP address of your router in the box below. If you don't know your router's external ip address, it can be obtained from your ISP. You can also obtain it from: http://www.portforward.com
-
Click the "Update Network Settings" box.
-
-
Now you are ready to define the peering relationships in the Switchvox admin. Let's return to the Tokyo/Los Angeles example:
On the Tokyo pbx admin:
-
Click the "SIP Providers" option of the "System Setup" menu. Select "Add A New SIP Provider".
-
Name the PBX you are planning to peer with and fill it in in the "SIP Provider Name" section. For example: "Los Angeles".
-
You'll need to come up with a account id and password. These are completely arbitrary but you will need to remember them. Fill in the "Your Account ID" and "Your Password" fields.
-
For the "Hostname/IP Address" you will fill in the External IP address of the Los Angeles office.
-
Leave the "Callback Extension" option blank, and "DTMF Mode" is fine at "RFC2833". Expand the "Click to Show Advanced Options" button.
-
There are three options you need to change in the Advanced section. First, change the "Host Type" option to "Peer". Secondly, select "No" for "Apply Incoming Call Rules to Provider". Finally, make sure you check the box for "Allow" in the "Outgoing Call Rules Section" for the rule "Internal".
-
Scroll down and click on the "Add SIP Provider" button.
-
Like before you will select "Add A New SIP Provider" from the "SIP Providers" section of the "System Setup" menu.
-
The name this time is the name of the other office, "Tokyo" in our case.
-
Now, you use the same Account ID and Password that you selected when setting up the Tokyo PBX. Although the Account ID and Passwords can be anything, they must be the same on both peers.
-
"Hostname/IP Address" will be the external IP address of the Tokyo Office
-
"Callback Extension" is still blank, "DTMF Mode" is still "RFC2833", Advanced Options are expanded.
-
Just as before, "Host Type" is "Peer", "Apply Incoming Call Rules to Provider" is "No", and the "Allow" checkbox for the "Internal" Outgoing Call Rule should be checked.
-
click "Add SIP Provider" at the bottom.
-
-
Now that the two peers have been created, you need to tell Switchvox how to route calls between the two sites. As with the SIP Providers setup, this needs to be done on both PBXes.
On the Tokyo admin page:
-
Select the "Outgoing Calls" option from the "System Setup" menu. Click "Add New Rule".
-
Under "Rule Name" you will type "Los Angeles". This is a rule to tell the PBX how to reach the Los Angeles office.
-
"Is this rule final?" should say "Yes".
-
For the "Pattern to Match" section, fill in 8 for the digits that the number begins with. Since this example uses 3 digit extensions (eg: 8XX for Los Angeles), the rest of the number must be between 2 and 2 digits in length. You can leave the last two boxes blank for this rule (there's no need to trim or prepend any digits).
-
Under "Call Through" select "SIP Provider". Under "Sip Provider" select the name of the peer you setup in step 5. eg: "Los Angeles"
-
Click "Add Outgoing Rule"
-
You now should see the message in green "Successfully created the outgoing rule" along with the list of outgoing rules below. Your new rule should be highlighted in blue. Click on the Up arrow next to your new rule to move it to a higher priority than internal.
Next, return to the Los Angeles admin page and add a call rule to allow LA to call Tokyo.
-
As before, select the "Outgoing Calls" option from the "System Setup" menu. Click "Add New Rule".
-
Under "Rule Name" you will type "Tokyo".
-
"Is this rule final?" should say "Yes".
-
For the "Pattern to Match" section, fill in 7 for the digits that the number begins with. Since this example uses 3 digit extensions (eg: 7XX for Tokyo), the rest of the number must be between 2 and 2 digits in length. You can leave the last two boxes blank for this rule (there's no need to trim or prepend any digits).
-
Under "Call Through" select "SIP Provider". Under "SIP Provider" select the name of the peer you setup in step 5. eg: "Tokyo"
-
Click "Add Outgoing Rule"
-
You now should see the message in green "Successfully created the outgoing rule" along with the list of outgoing rules below. Your new rule should be highlighted in blue. Click on the Up arrow next to your new rule to move it to a higher priority than internal.
-
-
Finally, you need to allow each account to dial out through the new pathway that you have created. you need to do the following for each account in both the Los Angeles and Tokyo PBXes:
-
Click on the "Manage Extensions" option of the "Extensions" menu.
-
Click on the "Modify" button and scroll down to the bottom of the screen.
-
Select "Allow" next to the rule you just created for dialing the other peer.
-
Click "Save Extension Settings"
-
Repeat this process for each extension.
-
-
You are now ready to call between peers. At this point, a person in Los Angeles can dial a 7XX extension and reach somebody in Tokyo free of charge.
— January 13, 2005