<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elastix Blogs &#187; inbound routes</title>
	<atom:link href="http://blogs.elastix.org/en/tag/inbound-routes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.elastix.org/en</link>
	<description>Elastix Community Blog</description>
	<lastBuildDate>Tue, 06 Jul 2010 09:54:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Interoffice Trunking with Elastix &amp; IAX Part1</title>
		<link>http://blogs.elastix.org/en/2009/11/interoffice-trunking-with-elastix-iax/</link>
		<comments>http://blogs.elastix.org/en/2009/11/interoffice-trunking-with-elastix-iax/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:56:02 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[Elastix]]></category>
		<category><![CDATA[VOIP]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[elastix to elastix]]></category>
		<category><![CDATA[iax]]></category>
		<category><![CDATA[iax trunks]]></category>
		<category><![CDATA[inbound routes]]></category>
		<category><![CDATA[routes]]></category>

		<guid isPermaLink="false">http://blogs.elastix.org/en/?p=19</guid>
		<description><![CDATA[A quick visual guide on setting up Inter-office IAX trunks between to Elastix systems]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction<br />
=========</strong></p>
<p>As a business grows, it is necessary to open further offices, usually in separate locations, or due to geographic requirements, they need a warehouse or distribution center that is separate to the head office.</p>
<p>One of the issues that occurs is the isolation of the two or more offices, almost as though they are two separate businesses. This occurs due the geographic isolation, but also in many cases isolation as they are using separate systems. Even the necessity, when dialling the other office, to dial a full phone number, continues to enforce this isolation.</p>
<p>It is surprising, especially in an office culture, how a simple change of dialling other office extensions directly, makes a change to the mentality of how the other office(s) are perceived. Add a few other functions such as the receptionist console providing visibility of the other office extensions (and their visibility of yours), and even an internal Instant Messaging/Presence ability that works across the two offices, and the culture changes. Further add in the ability for any staff to call the person that they need direct, knowing that there is no cost for the call.</p>
<p>I have seen it on many occasions, and I have had discussions with company directors who will categorically state that it has had a huge impact on their business efficiency and co-operation between branches due to a more homogenous single business. They also know that calls between all their offices have no call costs, and even if they wish to, they could stretch it further to include video between the various offices, either in a single room at each site, or at key staff desktops.</p>
<p>This document is not going to cover how to implement instant messaging, or the receptionist console, or how to setup video as these are generally covered by other tutorials on this site. Like all good systems, it is best implemented one building block at a time, test, and then move to the next phase, unless you are very experienced in which case, you generally don&#8217;t require this tutorial .</p>
<p>So the purpose of this guide is to provide you with the step by step guide on how to connect two offices together utilising an Elastix system in both offices.</p>
<p><strong>Planning<br />
======</strong></p>
<p>Connecting two offices or sites with Elastix is relatively simple, but like all good things a bit of planning ahead of implementation is a good investment. I have seen many mistakes made, not from not understanding the concepts, but actually becoming confused with setup details and not putting the basic building blocks in place first. Some do start with the basic building blocks, but part way through they make a leap feeling confident, making changes on the fly, and then it ends up not working.</p>
<p>So it is important to write out what you are trying to do, it will make it easier in the long run. Even printing the configs from this tutorial, making changes to the names to suit your setup, will keep you on the right track.</p>
<p>This planning also extends to making sure that each site is using a separate set of Extension numbers e.g. 200 range in Sydney and the 500 range in Melbourne. This simplifies your routing rules. If you are setting up the two Elastix systems for the first time, then this is worth considering the particular numbering separation to make it easy for both yourself and the business. It may not always possible, especially if the two systems are already in existence and already using a common extension numbering scheme, and this is covered quickly at the end of this tutorial.</p>
<p><strong>The Scenario<br />
===========</strong></p>
<p>This is scenario and configurations are taken from a production system, so you know that they work.</p>
<p>The company has two offices one in Sydney and one in Melbourne. The office in Sydney has 60 staff and the one Melbourne has 20 staff</p>
<p>The two offices have a Virtual Private Network (VPN) between them which will generally be the case with most businesses that need to share or access data between their offices.</p>
<p><strong>Elastix IP Address &amp; IP Ranges used by each office</strong><br />
The Sydney office has a 192.168.0.0/255.255.255.0 ip address range<br />
The Sydney Elastix system has an ip address of 192.168.0.100<br />
The Melbourne office as a 192.168.1.0/255.255.255.0 ip address range<br />
The Melbourne Elastix system has an ip address of 192.168.1.100</p>
<p><strong>Extensions setup on Elastix at each Office</strong></p>
<p>Sydney : Extensions 201 &#8211; 260<br />
Melbourne : Extensions 501 &#8211; 521<br />
<img class="aligncenter size-full wp-image-35" src="http://blogs.elastix.org/en/wp-content/uploads/2009/11/MelSydOfficeVisio2.png" alt="MelSydOfficeVisio" width="599" height="250" /><span id="more-19"></span><br />
<strong>IAX Trunk Setup<br />
==============</strong></p>
<p>On the Sydney Elastix system</p>
<p>Add an IAX Trunk</p>
<p>Leave all other options until you reach Trunk Name as default. I know it hurts to leave fields blank, resist the temptation until you have a working trunk, then come back and tweak these options. Enter all the details below listed under the Sydney Elastix System.</p>
<p>On the Melbourne Elastix System, Add an IAX Trunk, and enter the information listed under the Melbourne Elastix System</p>
<div style="direction: ltr">
<table style="border: 1pt solid #a3a3a3;direction: ltr;border-collapse: collapse" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid #a3a3a3; padding: 4pt; vertical-align: top; width: 3.5006in;">
<p style="margin: 0in;font-weight: bold;font-family: Calibri;font-size: 14pt">Sydney   Elastix System</p>
</td>
<td style="border: 1pt solid #a3a3a3; padding: 4pt; vertical-align: top; width: 3.4562in;">
<p style="margin: 0in;font-weight: bold;font-family: Calibri;font-size: 14pt">Melbourne   Elastix System</p>
</td>
</tr>
<tr>
<td style="border: 1pt solid #a3a3a3; padding: 4pt; vertical-align: top; width: 3.5006in;">
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">Trunk Name : melbourne</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">PEER DETAILS</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">username=melbourne</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">type=peer</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">secret=yellow47</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">qualify=yes</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">host=192.168.1.100</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">context=from-internal</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">trunk=yes</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">disallow=all</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">allow=gsm</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">User Context : sydney</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">
<p style="margin: 0in;font-weight: bold;font-family: Calibri;font-size: 11pt">USER   DETAILS</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">type=user</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">secret=yellow47</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">host=192.168.1.100</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">context=from-internal</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">disallow=all</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">allow=gsm</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">
<p style="margin: 0in;font-weight: bold;font-family: Calibri;font-size: 11pt">Registration</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">{Blank}</p>
</td>
<td style="border: 1pt solid #a3a3a3; padding: 4pt; vertical-align: top; width: 3.4562in;">
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">Trunk name : sydney</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">PEER DETAILS</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">username=sydney</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">type=peer</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">secret=yellow47</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">qualify=yes</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">host=192.168.0.100</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">context=from-internal</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">trunk=yes</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">disallow=all</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">allow=gsm</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">User Context : melbourne</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">
<p style="margin: 0in;font-weight: bold;font-family: Calibri;font-size: 11pt">USER   DETAILS</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">type=user</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">secret=yellow47</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">host=192.168.0.100</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">context=from-internal</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">disallow=all</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">allow=gsm</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">
<p style="margin: 0in;font-weight: bold;font-family: Calibri;font-size: 11pt">Registration</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11pt">{Blank}</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>You should now be able to access the Asterisk CLI and type the command iax2 show peers on the Sydney Elastix system and see the following</p>
<p><img class="aligncenter size-full wp-image-37" src="http://blogs.elastix.org/en/wp-content/uploads/2009/11/SydShowPeers1.png" alt="SydShowPeers" width="600" height="97" /></p>
<p>And similarly on the Melbourne system</p>
<p><img class="aligncenter size-full wp-image-38" src="http://blogs.elastix.org/en/wp-content/uploads/2009/11/melshowpeers.png" alt="melshowpeers" width="599" height="105" /></p>
<p>So what have we done in the configurations that we have completed so far?</p>
<p>The Peer Details on the Sydney Elastix system, we have setup under Trunk Name Melbourne the details which include how to contact the Melbourne System, what password to use, the context to use, the codec to use, and we have also told it to trunk the calls. You can omit the Trunk=yes if you want, but it needs to be removed from both sides.<strong> Trunk=yes</strong> reduces the overhead a little especially if you have a number of calls being handled by that trunk.</p>
<p>The User Details on the Sydney System, are basically the authentication information for the Melbourne system when it tries to make contact with the Sydney system. The Sydney system will match the authentication being provided by the Melbourne system with the information here. If it matches then it will let the call come through.</p>
<p>The reverse is the same on the Melbourne Elastix System</p>
<p>It is as simple as this, you have setup a trunk between two offices. Now we need to get the Elastix systems on both ends to use this trunk because as it stands now, other than a but of authentication traffic, it doesn&#8217;t do much else. That&#8217;s where the next part of this tutorial comes into play.On both systems, we need to setup an outbound route to tell it what to do when a caller in Sydney wants to call an extension in Melbourne.</p>
<p>So on the Sydney Elastix system, setup an outbound route called MelbourneExts</p>
<p><img class="alignnone size-full wp-image-39" src="http://blogs.elastix.org/en/wp-content/uploads/2009/11/MelbourneExts.png" alt="MelbourneExts" width="600" height="420" /></p>
<p>So, what we have completed here is an outbound route that tells the Sydney Elastix system, when a user calls any three digit extension that starts with a five(5) that it is to be directed to the IAX2/melbourne Trunk.</p>
<p>We have also ticked the Intra Company Route option which tells the system to preserve the CID information when transferring the call to the Melbourne system.</p>
<p>On the Melbourne System, setup basically a mirror image of the Sydney outbound route.</p>
<p><img class="alignnone size-full wp-image-40" src="http://blogs.elastix.org/en/wp-content/uploads/2009/11/SydneyExts.png" alt="SydneyExts" width="600" height="413" /></p>
<p>As you will note, the route name is called SydneyExts, again Intra Company Route is ticked, and the other main difference is that we are telling the Melbourne Elastix system to handle any Melbourne users that dial 2xx and redirect the call to the IAX2/sydney Trunk.</p>
<p>That is it. The best way to test it is to dial a Melbourne extension from the Sydney office. There is no other science needed, no magic potions. The main reason for failure for many is usually the failure of the IAX trunk. There are many configurations on websites, some that contain lines using the G729 codec only (which is common), but on freshly installed Elastix systems, you are generally not going to have the G729 codec loaded. My recommendation is leave the codec setting as GSM until you have completed basic testing.</p>
<p><strong>What to do if the same extension numbers exist at both branches<br />
================================================</strong><br />
For staff sanity, it is better to plan for a change on one of the branches so that the extensions are unique to each branch. However, if this is not possible, then you can implement a slightly different way of calling extensions in each office.</p>
<p>The IAX Trunk setup remains exactly the same, however the difference is in the outbound routing for each system.</p>
<p>Since the company wants to maintain their extensions as they are, this means as an example, Sydney has extensions 201 &#8211; 260 and Melbourne has extensions 201-220, after discussion with the business, we decided that to call and Melbourne extension from Sydney, they will place a 3 in front of an extension number. Likewise Melbourne to call Sydney extensions they would place a 2 in front of the three digit extension they wanted to call.</p>
<p>So if Melbourne wanted to call Sydney Ext 201 they would call 2201<br />
If Sydney wanted to call Melbourne Ext 203 they would call 3203</p>
<p>So the only change to implement this is in the outbound route in the examples shown previously of the outbound routes. In the Sydney Elastix system, I change the outbound route Dial Pattern from 5xx to 3|2xx and on the Melbourne Elastix system, I change the outbound route Dial Pattern from 2xx to 2|2xx</p>
<p>So you can see it visually, the following is the change to the Sydney System</p>
<p><img class="alignnone size-full wp-image-41" src="http://blogs.elastix.org/en/wp-content/uploads/2009/11/AddRouteMelExt.png" alt="AddRouteMelExt" width="382" height="334" /><br />
And the following diagram is the changes to the Melbourne system</p>
<p><img class="alignnone size-full wp-image-44" src="http://blogs.elastix.org/en/wp-content/uploads/2009/11/AddRouteSydExt1.png" alt="AddRouteSydExt" width="410" height="337" /></p>
<p>In a nutshell, from the Sydney Elastix System, if we just dialled 201 hoping to reach Melbourne it will never happen. it will always ring the Sydney 201 extension. By adding the digit, e.g. 3201, Elastix will not see it as a local extension number and will look at the outbound routes for a match. Now as soon as it makes a match (which is the 3|2xx), it will strip off the 3 digit, and pass 201 down the IAX Trunk to Melbourne. The Elastix System in Melbourne will recognise that it has an extension 201 and will connect the call.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblogs.elastix.org%2Fen%2F2009%2F11%2Finteroffice-trunking-with-elastix-iax%2F&amp;linkname=Interoffice%20Trunking%20with%20Elastix%20%26amp%3B%20IAX%20Part1"><img src="http://blogs.elastix.org/en/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blogs.elastix.org/en/2009/11/interoffice-trunking-with-elastix-iax/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
