<?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>SelbyTech &#187; Blog</title>
	<atom:link href="http://www.selbytech.com/category/technotes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.selbytech.com</link>
	<description>TechNotes</description>
	<lastBuildDate>Tue, 20 Dec 2011 21:04:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>How to setup Asterisk 1.8 on CentOS 5</title>
		<link>http://www.selbytech.com/2011/05/how-to-setup-asterisk-1-8-on-centos-5/</link>
		<comments>http://www.selbytech.com/2011/05/how-to-setup-asterisk-1-8-on-centos-5/#comments</comments>
		<pubDate>Mon, 23 May 2011 20:20:12 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[Asterisk 101]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[asterisk 1.8]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=200</guid>
		<description><![CDATA[So, time to kick things off! I get a lot of traffic on my older post about setting up Asterisk 1.6.2 on Centos 5.4, but that&#8217;s over a year old now and a lot has changed! The Asterisk project has decided to get sane about their version numbering once again, and has released a long-term [...]]]></description>
			<content:encoded><![CDATA[<p>So, time to kick things off!  I get a lot of traffic on my older post about <a title="How to setup Asterisk 1.6.2 on Centos 5.4" href="http://www.selbytech.com/2010/01/how-to-setup-asterisk-1-6-2-on-centos-5-4/" target="_blank">setting up Asterisk 1.6.2 on Centos 5.4</a>, but that&#8217;s over a year old now and a lot has changed!  The Asterisk project <a title="Asterisk Versions" href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions" target="_blank">has decided to get sane</a> about their version numbering once again, and has released a long-term support version of their project, Asterisk 1.8.  This post will detail the minimum required to get Asterisk 1.8 up and running on CentOS 5.6, but don&#8217;t worry, I&#8217;ll cover adding in extra modules and setting up some of the new features that were included with Asterisk 1.8 in future posts.  With that out of the way, let&#8217;s get on with the post!</p>
<p>First things first, we&#8217;ll assume you&#8217;ve got a fresh CentOS 5.6 installed with the basest of options &#8211; i.e a 1 disc install.  This is how I do it, because this will prevent the installer from installing any extra services or modules that you don&#8217;t need on an Asterisk box.  The first thing you&#8217;ll want to do is update your existing system:</p>
<pre><code>yum update</code></pre>
<p>Next we&#8217;ll disable SELinux &#8211; I&#8217;ve never had this do anything good for me on an Asterisk box.  Use your favorite editor, open the file /etc/selinux/config and change the option SELINUX= to &#8216;disabled&#8217;.</p>
<pre><code>vi /etc/selinux/config

SELINUX=disabled</code></pre>
<p>After you make this change to SELinux, you&#8217;ll need to reboot.  This will also give any new kernels that may have been updated with your &#8216;yum update&#8217; command a chance to be started.</p>
<pre><code>shutdown -r now</code></pre>
<p>Next, we&#8217;ll install the needed dependencies to get a minimal install of asterisk running.  This is the bare minimum needed to get a working asterisk install.  It does not cover any extra modules or any of the new features of Asterisk 1.8.  We&#8217;ll cover the steps needed to get those installed in a later post.</p>
<pre><code>yum install wget gcc gcc-c++ make perl libxml2-devel ncurses-devel newt-devel openssl-devel kernel-devel</code></pre>
<p>This should download and install several programs and additional dependencies needed to make these programs work.  While not needed for the barest of asterisk installs, I am including kernel-devel so that we can install DAHDI, which, even if you don&#8217;t have a TDM card installed in your machine, still provides the best timer option for asterisk.</p>
<p>Next, we&#8217;ll move on to downloading and installing the actual code needed to make asterisk run.  While there are pre-compiled binaries available for asterisk, and asterisk-specific repositories available for yum, I prefer to install asterisk from source.  This gives you complete control over the modules you want installed, and allows you to go back and add in any extra modules or customized (or even patched) code you may want at a later date.</p>
<p>First, I always make a specific asterisk directory under /usr/src, that way I know where all of my asterisk related source code files are.  Then we&#8217;ll download the necessary source code from the asterisk.org download site and extract it.</p>
<pre><code>mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
tar zxvf libpri-1.4-current.tar.gz
tar zxvf dahdi-linux-complete-current.tar.gz
tar zxvf asterisk-1.8-current.tar.gz</code></pre>
<p>First, we&#8217;ll install LibPRI and DAHDI.  If you don&#8217;t have a PRI card installed, don&#8217;t worry, installing LibPRI won&#8217;t hurt anything.  Also, DAHDI is needed if you&#8217;ve got any kind of TDM card installed in your system, but even if you don&#8217;t, DAHDI still provides a great timing source and is required if you want to use the MeetMe() conference application.  In this tutorial I&#8217;ll assume we don&#8217;t have a TDM card and we&#8217;re just using DAHDI as a timing source.</p>
<pre><code>cd /usr/src/asterisk/libpri-1.4.11.5
make
make install
cd /usr/src/asterisk/dahdi-linux-complete-2.4.1.2+2.4.1
make all
make install
make config</code></pre>
<p>Once you&#8217;ve got these installed, you&#8217;ll need to edit the config files for DAHDI for optimal performance.  You&#8217;ll find the necessary config files in the directory /etc/dahdi/, and the specific files you&#8217;ll want to look through and possibly modify are:</p>
<pre><code>/etc/dahdi/modules
/etc/dahdi/system.conf</code></pre>
<p>Go through the modules file and comment out any hardware you don&#8217;t have, to make the DAHDI service load time faster.  In our case of no modules, we comment out every option.  This will force the system to only load DAHDI for timing purposes.</p>
<p>If you&#8217;ve actually got a hardware TDM card installed in the system, the quickest way to get a working system.conf file is to run the command &#8216;dahdi_genconf&#8217;.  This will probe your installed hardware and generate a system.conf that applies to your specific hardware.  You can then go in and make any carrier specific modifications you may need.</p>
<p>Next, we&#8217;ll install asterisk itself.  There are a few more steps involved here than in the previous programs we loaded, but the reward is more control over what goes into your asterisk install.</p>
<pre><code>cd /usr/src/asterisk/asterisk-1.8.4
./configure
make menuselect</code></pre>
<p>On this screen, you&#8217;ll want to go through and make some specific changes.  First, you&#8217;ll want to disable the chan_mgcp Channel Driver.  This is because it works best with a package we haven&#8217;t installed, and unless you specifically need to support MGCP phones, unchecking this won&#8217;t hurt your install any.  Also, for maximum compatibility, I would recommend using the -WAV version of any sound files you may select.  If you&#8217;ve got the bandwidth and the space on your machine, I would also recommend downloading any codec-specific versions of the sound files you plan on using.  You may also want to disable any non-dahdi timing source in the Resource Modules section (look for res_timing_ and uncheck any that aren&#8217;t res_timing_dahdi).</p>
<p>Now that we&#8217;ve got everything we need selected, tab your way over to the &#8216;Save &amp; Exit&#8217; button and we&#8217;ll move on to the next steps, compiling and installing.  These steps will take some time (up to five-ten minutes, depending on your system and the number of cores you have installed), so sit back and relax.</p>
<pre><code>make
make install</code></pre>
<p>Now that we&#8217;ve got the asterisk core installed, let&#8217;s install the sample configuration files and system init files.  You can skip this step if you&#8217;ve got an existing asterisk install and you were just upgrading, but for clean installs, this step is almost necessary.</p>
<pre><code>make samples
make config</code></pre>
<p>Next, we&#8217;ll test our Asterisk install by launching Asterisk from the command line and reviewing the resulting logs that are displayed on-screen for any errors.</p>
<pre><code>service dahdi start
asterisk -cvvvv</code></pre>
<p>If everything looks good, go ahead and exit out of our Asterisk test environment (using the asterisk command &#8220;core stop now&#8221;).</p>
<p>And finally let&#8217;s enable DAHDI and Asterisk to start at system boot time.</p>
<pre><code>chkconfig dahdi on
chkconfig asterisk on</code></pre>
<p>Now either reboot your system or just simply start asterisk using the command &#8216;service asterisk start&#8217;, and away you go!  If you come up with any compile-time errors or run-time errors, or just plain have any questions, please feel free to post them in the comments below and I&#8217;ll do my best to try and answer them quickly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2011/05/how-to-setup-asterisk-1-8-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>New Website is Live!</title>
		<link>http://www.selbytech.com/2011/05/new-website-is-live/</link>
		<comments>http://www.selbytech.com/2011/05/new-website-is-live/#comments</comments>
		<pubDate>Thu, 19 May 2011 06:23:50 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[off-topic]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=239</guid>
		<description><![CDATA[So the SelbyTech.com website has just been redesigned from the ground up! If you haven&#8217;t seen it lately, go check it out! All of the old blog posts are still here, and I should be able to start kicking out 1-3 new blog posts a week from this point forward. I realize it&#8217;s been a [...]]]></description>
			<content:encoded><![CDATA[<p>So the SelbyTech.com website has just been redesigned from the ground up!  If you haven&#8217;t seen it lately, go check it out!  All of the old blog posts are still here, and I should be able to start kicking out 1-3 new blog posts a week from this point forward.  </p>
<p>I realize it&#8217;s been a long time since my last post, and I apologize for that.  But I&#8217;m setting a schedule for myself, and I&#8217;ve already got a few topics planned.  If there&#8217;s anything you&#8217;d like me to cover, please feel free to leave me a comment on this post, or send me an email. </p>
<p>Also, SelbyTech has gone social!  We are now on <a href="http://twitter.com/SelbyTech">Twitter</a> and <a href="http://www.facebook.com/pages/SelbyTech/171505646235665">Facebook</a>, and as always, we have <a href="http://www.selbytech.com/category/technotes/feed/">RSS</a> feeds to keep you up to date on the latest happenings around here!  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2011/05/new-website-is-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup IPTables for Asterisk 1.6.2 on CentOS 5.4</title>
		<link>http://www.selbytech.com/2010/04/how-to-setup-iptables-for-asterisk-1-6-2-on-centos-5-4/</link>
		<comments>http://www.selbytech.com/2010/04/how-to-setup-iptables-for-asterisk-1-6-2-on-centos-5-4/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 05:37:46 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=85</guid>
		<description><![CDATA[So recently, a friend of mine setup his very first linux server.  Since he&#8217;s planning on setting it up as a web-server sitting out on the internet with a public IP, I advised he setup and use iptables.  Now I know there are other options out there (some would argue better options), iptables is what [...]]]></description>
			<content:encoded><![CDATA[<p>So recently, a friend of mine setup his very first linux server.  Since he&#8217;s planning on setting it up as a web-server sitting out on the internet with a public IP, I advised he setup and use iptables.  Now I know there are other options out there (some would argue better options), iptables is what I like to use on my own servers, so that&#8217;s what I helped him set up.  Since I tend to setup iptables and forget about it, I had to go and look for some iptables tutorials.  While I was looking around, I didn&#8217;t find many that covered setting up iptables for use with asterisk, along with the other typical uses you may have on a server.  So that&#8217;s what this how-to is all about.</p>
<p>First things first, I want to point out, if you&#8217;re not careful when you&#8217;re setting up your iptables settings, there&#8217;s a very real possibility of blocking all remote access to your server.  If you&#8217;re working on your server remotely, be very careful, and be sure to read all of this article before proceeding!</p>
<p>First, let&#8217;s make sure we&#8217;ve already got iptables installed on our box.  It should be installed by default on most CentOS 4.x and 5.x installs.</p>
<pre><code># rpm -q iptables
iptables-1.3.5-5.3.el5_4.1

# lsmod | grep ip_tables
ip_tables              17029  1 iptable_filter
x_tables               17349  5 xt_state,ip_tables,ip6t_REJECT,xt_tcpudp,ip6_tables</code></pre>
<p>With that out of the way, we can look at how iptables is currently setup, using the &#8220;iptables -L&#8221; command.  The following should be the default rules on a fresh CentOS 5.4 install.</p>
<pre><code>
# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     esp  --  anywhere             anywhere
ACCEPT     ah   --  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
</code></pre>
<p>If for some reason iptables isn&#8217;t running yet, you can enable it by running</p>
<pre><code># system-config-securitylevel</code></pre>
<p>Now, the defaults are fine and good for defaults, but they aren&#8217;t really what we&#8217;re looking for.  So at this point we&#8217;re going to clear them out, and setup a very basic default set of access rules.  I like to use the basic ruleset from the CentOS wiki, located <a title="CentOS IPTables How-To" href="http://wiki.centos.org/HowTos/Network/IPTables" target="_blank">here</a>.</p>
<pre><code># iptables -P INPUT ACCEPT
# iptables -F
# iptables -A INPUT -i lo -j ACCEPT
# iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# iptables -P INPUT DROP
# iptables -P FORWARD DROP
# iptables -P OUTPUT ACCEPT</code></pre>
<p>Let&#8217;s take a look at what we did here:</p>
<p><strong>iptables -P INPUT ACCEPT</strong> &#8211; This sets the default policy on the input chain to ACCEPT, so we don&#8217;t lock ourselves out if we&#8217;re connected remotely via ssh.</p>
<p><strong>iptables -F</strong> &#8211; This is the command to flush the current rule set and only use the defaults (which we just set to ACCEPT on inbound connections, which gives us a blank slate to work with without locking us out of our own box).</p>
<p><strong>iptables -A INPUT -i lo -j ACCEPT</strong> &#8211; This is a simple rule to allow all access from the loopback adapter.  The -A switch means we&#8217;re Appending a new rule to the chain.  -i means this rule has to do with all traffic flowing through a network interface (in this case, the lo, or loopback, interface).  -j means to Jump to the ACCEPT action.  A lot of applications expect to be able to talk with the loopback adapter, so be sure to include this rule.</p>
<p><strong>iptables -A INPUT -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT</strong> &#8211; You should already recognize some parts of this line.  What&#8217;s new here is the -m switch, which we use to load a module (in this case, the &#8216;state&#8217; module). The state module is able to examine the state of a packet and determine if it is NEW, ESTABLISHED or RELATED. NEW refers to incoming packets that are new incoming connections that weren&#8217;t initiated by the host system. ESTABLISHED and RELATED refers to incoming packets that are part of an already established connection or related to an already established connection.</p>
<p><strong>iptables -A INPUT -p tcp &#8211;dport 22 -j ACCEPT</strong> &#8211; This rule is a very important rule, at least it&#8217;s important if you&#8217;re connecting remotely!  This rule is appended to the INPUT chain and says that any packets coming in on the tcp protocol (-p), on port 22 (&#8211;dport 22), should be accepted.  Port 22 is of course the default ssh port.  If you&#8217;ve changed your ssh port in your sshd_config, you would of course alter this line accordingly.</p>
<p><strong>iptables -P INPUT DROP</strong> &#8211; Remember our first rule?  When we set the default policy for the INPUT chain to ACCEPT?  This line changes the default policy for the INPUT chain back to DROP, which is what is required if you want to actually block traffic coming into your server.  If you correctly set the previous line to allow ssh traffic, you shouldn&#8217;t lock yourself out at this point.</p>
<p><strong>iptables -P FORWARD DROP</strong> &#8211; This rule is pretty much the same as the previous one, except that we&#8217;re setting the default policy for the FORWARD chain, which handles traffic flowing through our system from one interface to another (i.e if you&#8217;re using your server as a router, which in this case we&#8217;re not).</p>
<p><strong>iptables -P OUTPUT ACCEPT</strong> &#8211; And finally, this rule allows all traffic to flow outwards from your server.</p>
<p>Now that we&#8217;ve got these new rules, we should save them so that they&#8217;re applied the next time we restart the iptables service.</p>
<pre><code># iptables-save</code></pre>
<p>or</p>
<pre><code># service iptables save</code></pre>
<p>If you want to learn more about iptables and the various switches available to you, I recommend you read the <a title="CentOS IPTables How-To" href="http://wiki.centos.org/HowTos/Network/IPTables" target="_blank">IPTables How-To on the CentOS wiki</a> I linked to earlier.  There&#8217;s a lot of useful information there.</p>
<p>Now, if you want to run asterisk on your server that you&#8217;ve got protected with IPTables, you&#8217;ll need to setup a few specific rules.  Let&#8217;s go over those here:</p>
<pre><code># iptables -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
# iptables -A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT
# iptables -A INPUT -p udp -m udp --dport 4000:4999 -j ACCEPT
# iptables -A INPUT -p udp -m udp --dport 4569 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 5038 -j ACCEPT</code></pre>
<p>Let&#8217;s take a look at what we&#8217;re doing here:</p>
<p><strong>iptables -A INPUT -p udp -m udp &#8211;dport 5060 -j ACCEPT</strong> &#8211; This rule and the next are needed if you have SIP endpoints or a SIP connection to your ITSP.  UDP port 5060 is the port used for SIP traffic.  If you don&#8217;t want to accept SIP traffic from anyone, anywhere, you can further restrict this line by adding source IP addresses or networks with the -s switch:</p>
<pre><code># iptables -A INPUT -p udp -m udp -s 172.19.240.24 --dport 5060 -j ACCEPT
# iptables -A INPUT -p udp -m udp -s 172.23.129.58 --dport 5060 -j ACCEPT
# iptables -A INPUT -p udp -m udp -s 172.36.15.0/24 --dport 5060 -j ACCEPT</code></pre>
<p><strong>iptables -A INPUT -p udp -m udp &#8211;dport 10000:20000 -j ACCEPT</strong> &#8211; This rule goes hand in hand with the previous rule.  This is the rule that allows RTP traffic.  By default, asterisk uses a large range of rtp ports to establish rtp connections, and you have to set a large range of udp ports as well.  If you&#8217;re uncomfortable with this idea, you can trim down on the number of ports used for your RTP traffic in asterisk&#8217;s /etc/asterisk/rtp.conf file.</p>
<pre><code># cat /etc/asterisk/rtp.conf
[general]
rtpstart=10000
rtpend=10050

# iptables -A INPUT -p udp -m udp --dport 10000:10050 -j ACCEPT</code></pre>
<p>A good rule of thumb is to have 4 ports per concurrent call you plan on having flow through your system, plus 10% for breathing room.  So if you plan on having at most 10 concurrent calls on your system at any time, configure asterisk to use 44 ports (10 calls x 4 ports = 40, 40 * 1.10 = 44).  Be sure the range in your firewall matches the range in your rtp.conf file.</p>
<p><strong>iptables -A INPUT -p udp -m udp &#8211;dport 4000:4999 -j ACCEPT</strong> &#8211; This rule is used to allow udptl traffic, which is a T.38 transport protocol.  If you don&#8217;t plan on doing faxing, you can skip this rule.  I don&#8217;t have any handy rules of thumb for the number of udptl ports used per T.38 fax, so you may want to leave this rule at it&#8217;s default.  You can try changing it down, but until I hear otherwise from the folks at Digium, I&#8217;ll leave the defaults as the recommended.</p>
<p><strong>iptables -A INPUT -p udp -m udp &#8211;dport 4569 -j ACCEPT</strong> &#8211; This rule is for IAX2 connections.  IAX2 is another VoIP protocol, much like SIP.  Unlike SIP, it only needs one port open on your firewall for both control traffic and audio / data traffic.  You don&#8217;t need to open any ranges of ports to allow multiple concurrent calls using IAX2 either, as it&#8217;s all handled through the one port.  If you plan on making any IAX2 connections through your firewall, be sure to open this port.</p>
<p><strong>iptables -A INPUT -p tcp &#8211;dport 5038 -j ACCEPT</strong> &#8211; This rule is to allow connections to the Asterisk Manager Interface, or AMI.  If you&#8217;re not accessing AMI remotely, you should leave this rule off your firewall.</p>
<p>Now that you&#8217;ve got your rules in place, go ahead and test your system.  If everything seems to be working properly, save your new rules to your iptables config by running one of the following commands:</p>
<pre><code># iptables-save</code></pre>
<p>or</p>
<pre><code># service itpables save</code></pre>
<p>And that&#8217;s it!  You should be all set now.  If you have any questions, please feel free to leave a comment below.</p>
<p>Next week we&#8217;ll cover using Fail2Ban along with IPTables to secure your asterisk server from malicious and costly attacks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2010/04/how-to-setup-iptables-for-asterisk-1-6-2-on-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to setup Asterisk 1.6.2 on Centos 5.4</title>
		<link>http://www.selbytech.com/2010/01/how-to-setup-asterisk-1-6-2-on-centos-5-4/</link>
		<comments>http://www.selbytech.com/2010/01/how-to-setup-asterisk-1-6-2-on-centos-5-4/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 19:28:38 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=77</guid>
		<description><![CDATA[UPDATE 05/20/2011 &#8211; An updated version of this post, detailing How to setup Asterisk 1.8, has been posted. Check it out if you want to move to the latest and greatest version of asterisk. If you&#8217;d prefer to stay with version 1.6.2, please, read on! After looking around for a while, I noticed something &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE 05/20/2011 &#8211; An updated version of this post, detailing <a title="How to setup Asterisk 1.8 on CentOS 5" href="http://www.selbytech.com/2011/05/how-to-setup-asterisk-1-8-on-centos-5/">How to setup Asterisk 1.8</a>, has been posted.  Check it out if you want to move to the latest and greatest version of asterisk.  If you&#8217;d prefer to stay with version 1.6.2, please, read on!</p>
<p>After looking around for a while, I noticed something &#8211; there&#8217;s some documentation out there, but not a lot, on how to do a fresh install / setup of the latest version of Asterisk (1.6.2) on the latest version of CentOS (5.4).  So I thought I&#8217;d go ahead and go through the process myself and then post the steps I used.  So let&#8217;s get started&#8230;</p>
<p>First things first, the server.  I ordered a new dedicated server from my <a title="Jaguar PC" href=" 	http://www.jaguarpc.com/r.php?a=102940.72" target="_blank">webhost</a> that was running the latest 32-bit version of CentOS 5.4.  I had nothing else installed on it, this was just a base vanilla server install.  The first thing I did once I had access to the server was to install the latest versions of all installed software:</p>
<pre><code># yum update</code></pre>
<p>A lot of guides out there use the -y switch with yum to auto-install whatever is found to be updated.  You can do this if you like, however, I personally prefer to have to manually select Yes before I do the updates.  That all comes down to personal preference.</p>
<p>Next, we need to install all of Asterisk&#8217;s dependencies.  These are programs that are required to be installed before you can compile asterisk.  This is the list I use, it includes the source compilers, some needed development libraries, as well as some dependencies for various asterisk modules I like to load.</p>
<pre><code># yum install gcc gcc-c++ make openssl-devel newt-devel ncurses-devel libtermcap-devel libxml2-devel kernel-devel perl curl curl-devel</code></pre>
<p>Also, if you have a PAE-based kernel (like I do), which is becoming more and more common these days, you&#8217;ll need to load the PAE kernel headers:</p>
<p><code># yum install kernel-PAE-devel</code></p>
<p>If you&#8217;re not sure if you have a PAE kernel, you can check using the &#8220;uname -r&#8221; command:</p>
<p><code># uname -r<br />
<strong>2.6.18-164.10.1.el5PAE</strong></code></p>
<p>Next, we&#8217;ll install a MySQL database server to handle our CDR (call detail records) storage, and also to prepare the way for using the Asterisk Realtime Architecture (the ability to store our configuration parameters in a database as opposed to flat files).  You can safely skip this step if you feel you&#8217;ll never make that transition, but it doesn&#8217;t hurt anything to go ahead and get this setup now as opposed to later.</p>
<p><code># yum install libtool-ltdl libtool-ltdl-devel unixODBC-devel mysql mysql-devel mysql-server mysql-connector-odbc</code></p>
<p>Now, we&#8217;ve got all of the dependencies installed.  It&#8217;s time to go ahead and get into the meat of the install.  We&#8217;ll start by creating a new directory under /usr/src to keep everything nice and tidy.  Then we&#8217;ll download all of the sources we&#8217;re going to need for this install.</p>
<pre><code># cd /usr/src
# mkdir asterisk
# cd asterisk
# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.0.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.0.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
# wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
# tar zxvf asterisk-1.6.2.0.tar.gz
# tar zxvf asterisk-addons-1.6.2.0.tar.gz
# tar zxvf dahdi-linux-complete-current.tar.gz
# tar zxvf libpri-1.4-current.tar.gz</code></pre>
<p>First, we&#8217;ll install LibPRI.  LibPRI is a library used by TDM cards (T1 / E1 cards, etc).  Even if you don&#8217;t have one of these cards, it&#8217;s safe to install LibPRI &#8211; it won&#8217;t have any negative effects on your system.</p>
<p><code># cd /usr/src/asterisk/libpri-1.4.10.2<br />
# make clean<br />
# make<br />
# make install</code></p>
<p>Next, we&#8217;ll install DAHDI.  DAHDI means &#8220;Digium Asterisk Hardware Device Interface&#8221;, it&#8217;s pronounced &#8220;Daddy&#8221;, and it&#8217;s the replacement of the old Zaptel driver stack.  DAHDI is the set of linux kernel modules and also a set of tools for interfacing with TDM cards.  More importantly, DAHDI provides timing to several asterisk components, such as the MeetMe application as well as Music on Hold.  If you don&#8217;t have a proper timing source installed, you&#8217;ll notice lots of stuttering pauses in any kind of audio playback (Music on Hold, IVR prompts, voicemail greetings) from asterisk.  If you don&#8217;t have any TDM hardware installed in your server, DAHDI also provides a &#8220;dummy&#8221; driver that will provide a timing source to asterisk.</p>
<p>Now, starting with Asterisk 1.6.1, Digium introduced <a title="Documentation for the timing modules used in Asterisk" href="https://reviewboard.asterisk.org/r/164/diff/1-4/" target="_blank">new internal timing options</a> that can be used in place of the DAHDI timer, however, these are only available on systems running the latest kernels (2.6.25+)  in the case of res_timing_timerfd, or on lightly loaded systems, as is the case with res_timing_pthread.  If you would rather use one of these options instead of the DAHDI dummy driver, you may skip this step &#8211; just be sure to select one of the above mentioned res_timing resouces when you build asterisk later.  IMPORTANT NOTE &#8211; if you do have a TDM card installed in your system, you may not skip this step!</p>
<p><code># cd /usr/src/asterisk/dahdi-linux-complete-2.2.1-rc2+2.2.1-rc2/<br />
# make all<br />
# make install<br />
# make config</code></p>
<p>Now that you&#8217;ve installed DAHDI, you need to configure it.  You do that by editing the following files, based on your situation.  The files themselves contain lots of documentation, so I won&#8217;t go over that in much detail here, except to say this &#8211; if you have no TDM cards and are only installing DAHDI for the dummy timing source, you can comment out every driver referenced in the modules file.  I prefer to use vi, you can use whichever editor is your favorite.  If you&#8217;re new to linux, I would suggest using nano with the -w switch.</p>
<p><code># vi /etc/dahdi/modules<br />
# vi /etc/dahdi/system.conf</code></p>
<p>Now that we&#8217;ve got DAHDI configured the way we need for our system, we need to set it to start at boot time, and then we need to start it.</p>
<p><code># chkconfig dahdi on<br />
# service dahdi start</code></p>
<p>Next, let&#8217;s setup our MySQL database for CDR storage.  I&#8217;ll make another post detailing the settings needed for Asterisk Realtime later.  Be sure to run the mysql_secure_installation script after you start MySQL in order to set up a root password to protect your SQL databases!</p>
<p><code># chkconfig mysqld on<br />
# service mysqld start<br />
# /usr/bin/mysql_secure_installation<br />
# mysql -p</code></p>
<p>&nbsp;</p>
<p><code></p>
<pre>SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE DATABASE `asterisk` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `asterisk`;</pre>
<pre>CREATE TABLE IF NOT EXISTS `cdr` (
`recid` mediumint(8) unsigned NOT NULL auto_increment COMMENT 'Record ID',
`calldate` datetime NOT NULL default '0000-00-00 00:00:00',
`clid` varchar(80) NOT NULL default '',
`src` varchar(80) NOT NULL default '',
`dst` varchar(80) NOT NULL default '',
`dcontext` varchar(80) NOT NULL default '',
`channel` varchar(80) NOT NULL default '',
`dstchannel` varchar(80) NOT NULL default '',
`lastapp` varchar(80) NOT NULL default '',
`lastdata` varchar(80) NOT NULL default '',
`duration` int(11) NOT NULL default '0',
`billsec` int(11) NOT NULL default '0',
`disposition` varchar(45) NOT NULL default '',
`amaflags` int(11) NOT NULL default '0',
`accountcode` varchar(20) NOT NULL default '',
`uniqueid` varchar(32) NOT NULL default '',
`userfield` varchar(255) NOT NULL default '',
PRIMARY KEY  (`recid`),
KEY `calldate` (`calldate`),
KEY `dst` (`dst`),
KEY `accountcode` (`accountcode`),
KEY `src` (`src`),
KEY `disposition` (`disposition`),
KEY `uniqueid` (`uniqueid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;</pre>
<pre>CREATE USER 'asterisk'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT FILE ON * . * TO 'asterisk'@'localhost' IDENTIFIED BY 'PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
GRANT INSERT ON `asterisk`.`cdr` TO 'asterisk'@'localhost';</pre>
<p></code></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Be sure to set your own password for the asterisk user (where I used &#8216;PASSWORD&#8217; in the above block).</p>
<p>Now, we&#8217;ve got all the prerequisites installed.  Let&#8217;s install Asterisk!</p>
<p><code># cd /usr/src/asterisk/asterisk-1.6.2.0/<br />
# make clean<br />
# ./configure<br />
# make menuselect</code></p>
<p style="text-align: center;"><a href="http://www.selbytech.com/wp-content/uploads/2010/01/menuselect.jpg"><img class="aligncenter size-medium wp-image-78" title="menuselect" src="http://www.selbytech.com/wp-content/uploads/2010/01/menuselect-300x168.jpg" alt="" width="300" height="168" /></a></p>
<p>This is where you select all of the modules, applications, resource modules, codecs, sound pacakges, etc, that you want installed with Asterisk.  Take a little time to go through the new menu system (much improved over the 1.4 branch) and select the options you want.  Move through menus using the up and down arrow keys, go to the options pane using tab, move up and down through the options and select items using the enter key, and then when you&#8217;re ready to save your selections, tab to the &#8220;Save and Exit&#8221; button and press enter again.  It&#8217;s really that simple!  After you&#8217;ve finished with your selections, move on to the next step:</p>
<p><code># make<br />
# make install<br />
# make samples<br />
# make config<br />
# chkconfig asterisk on</code></p>
<p>Next, we need to verify that asterisk installed correctly.  We do this by manually starting asterisk from the command line.  If everything starts up and there&#8217;s not too many errors or warrnings, we&#8217;re good to go:</p>
<p><code># asterisk -vvvvc<br />
*CLI&gt; core stop now</code></p>
<p>Next, we need to install some of the options from the Asterisk-Addons download.  Asterisk-addons contains additional applications, channel drivers, and resource modules that are useful for asterisk but not necessary.  We&#8217;re going to install the mysql cdr addons for asterisk.</p>
<p><code># cd /usr/src/asterisk/asterisk-addons-1.6.2.0<br />
# make clean<br />
# ./configure<br />
# make menuselect</code></p>
<p>At this point, be sure to select at least the following items:</p>
<ul>
<li>Applications &#8211; app_addon_sql_mysql</li>
<li>Call Detail Recording &#8211; cdr_addon_mysql</li>
<li>Resource Modules &#8211; res_config_mysql</li>
</ul>
<p>After you&#8217;ve got those selected, save and exit.  Then proceed with the following steps:</p>
<p><code># make<br />
# make install<br />
# make samples</code></p>
<p>Once we&#8217;ve got that done, we need to edit the cdr_mysql.conf file to enter the mysql username and password, database, and table we setup earlier.  What&#8217;s listed below should be all we need in this file, if there&#8217;s anything else in there, either comment it out or delete it.</p>
<p><code># vi /etc/asterisk/cdr_mysql.conf<br />
[global]<br />
hostname=localhost<br />
dbname=asterisk<br />
table=cdr<br />
password=PASSWORD<br />
user=asterisk<br />
port=3306<br />
sock=/var/lib/mysql/mysql.sock<br />
userfield=1<br />
loguniqueid=yes</code></p>
<p>And that&#8217;s it!  You should read through several of the key configuration files in order to learn what&#8217;s changed, and also how to customize Asterisk for your installation.  The files to look into would be:</p>
<p><code>/etc/asterisk/asterisk.conf<br />
/etc/asterisk/extensions.ael<br />
/etc/asterisk/extensions.conf<br />
/etc/asterisk/sip.conf<br />
/etc/asterisk/iax.conf<br />
/etc/asterisk/voicemail.conf<br />
/etc/asterisk/users.conf</code></p>
<p>If you have any questions or run into any trouble, please feel free to leave a comment and I&#8217;ll help out where I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2010/01/how-to-setup-asterisk-1-6-2-on-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
		</item>
		<item>
		<title>Customizing dhcpd.conf on CentOS 5.3</title>
		<link>http://www.selbytech.com/2009/11/customizing-dhcpd-conf-on-centos-5-3/</link>
		<comments>http://www.selbytech.com/2009/11/customizing-dhcpd-conf-on-centos-5-3/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 04:23:05 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=63</guid>
		<description><![CDATA[In this article I&#8217;m going to explain some tricks that you can use to create custom dhcp address pools using dhcpd.conf on CentOS 5.3.  I was at a client recently and they had a need to hand out different TFTP servers to different sets of phones on their network.  Their Cisco 7960 phones needed to [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I&#8217;m going to explain some tricks that you can use to create custom dhcp address pools using dhcpd.conf on CentOS 5.3.  I was at a client recently and they had a need to hand out different TFTP servers to different sets of phones on their network.  Their Cisco 7960 phones needed to see one tftp server that contained an older SIP firmware, and their 7961 phones needed to see a separate tftp server with newer firmware.  I&#8217;ve <a href="/2009/10/running-multiple-instances-of-tftp-server-on-centos-5-x/" target="_self">already explained how to setup multiple TFTP servers on a single box</a>, now, I&#8217;ll show you how to setup your dhcpd.conf file to hand out the different settings.</p>
<p>First, let&#8217;s take a look at the file itself.</p>
<pre><code>ddns-update-style none;

option domain-name "example.com";
option domain-name-servers 10.10.11.254;

default-lease-time 600;
max-lease-time 7200;

authoritative;

log-facility local7;</code></pre>
<p>All of this is really basic stuff, and you can set these settings based on your specific network needs.  This is where it starts getting good:</p>
<pre><code>class "cisco7960"
{
match if substring (option vendor-class-identifier,0,36) = "Cisco IP Phone 7960";
option tftp-server-name "10.10.11.254";
}</code></pre>
<p>Here we&#8217;re defining a special class that will receive parameters that override the default.  As you can see, this class is for our Cisco 7960&#8242;s, and we&#8217;re matching based on the vendor-class-identifier, which is part of the DHCP REQUEST packet that the phone sends out onto the network when it first looks for an address.  More on how to find this information in a minute.</p>
<pre><code>class "cisco7961"
{
match if substring (option vendor-class-identifier,0,36) = "Cisco Systems, Inc. IP Phone CP-7961";
option tftp-server-name "10.10.10.1";
}</code></pre>
<p>This is the vendor-class-identifier string for a Cisco 7961.</p>
<pre><code>class "polycom"
{
match if substring (hardware,0,10) = "1:00:04:f2";
option tftp-server-name "10.10.10.1";
}</code></pre>
<p>Now, we won&#8217;t actually use this polycom class for anything in our setup, I just wanted to show how you can also match classes based on the phone&#8217;s MAC address, not just the vendor identifier string.</p>
<p>Below, we&#8217;ll look at the default settings for any device requesting an IP address on this vlan:</p>
<pre><code>subnet 10.10.10.0 netmask 255.255.254.0 {
option subnet-mask 255.255.254.0;
option routers 10.10.10.1;
option domain-name-servers 10.10.10.1;
option ntp-servers 10.10.10.1;
option time-offset -21600;
allow bootp;
range 10.10.10.50 10.10.10.200;
range dynamic-bootp 10.10.10.201 10.10.10.254;</code></pre>
<p>Now, we&#8217;ll add in the pool definitions that will match based on the classes we defined earlier.  This is still a part of the subnet declaration we started in the last section.</p>
<pre><code>pool {
range 10.10.11.25 10.10.11.149;
allow members of "cisco7961";
}
pool {
range 10.10.11.150 10.10.11.225;
allow members of "cisco7960";
}</code></pre>
<p>And lastly, we&#8217;ve got static leases for specific phones, based on their MAC addresses.  I realize I wasn&#8217;t really talking about how to do this in the current article, but it&#8217;s something I always have to look up how to do, so I figured it wouldn&#8217;t hurt to add it into the post.</p>
<pre><code>host conf2570 {
hardware ethernet 00:04:f2:e1:cf:a5;
fixed-address 10.10.10.204;
}
host conf2571 {
hardware ethernet 00:04:f2:e1:8d:2e;
fixed-address 10.10.10.209;
}
}</code></pre>
<p>And that&#8217;s the end of the file.  Now, I mentioned earlier that I&#8217;d explain how to find the vendor-class-identifier string for a new phone as it sends out it&#8217;s DHCP REQUEST packets.  Here&#8217;s what you need to do.  From the shell on your dhcpd server, run the following command while you&#8217;re booting your phone:</p>
<pre><code>root@server [~]# tcpdump -lenv -s 1500 port bootps or port bootpc -i eth1</code></pre>
<p>If you don&#8217;t want to flood your screen, you can pipe it to a log file by adding &#8221; &gt; logfile.txt&#8221; to the end of the above line.  This is the type of output you should expect to see, I&#8217;ve highlighed the important information to watch for:</p>
<pre><code>16:19:44.691011 00:26:0b:5d:0f:48 &gt; 00:22:19:22:db:c6, ethertype IPv4 (0x0800), length 590: (tos 0x60, ttl  64, id 53013, offset 0, flags [none], proto: UDP (17), length: 576) 10.10.11.146.bootpc &gt; 10.10.10.1.bootps: BOOTP/DHCP, Request from 00:26:0b:5d:0f:48, length: 548, xid:0x7ba0, flags: [none]
Client IP: 10.10.11.146
Client Ethernet Address: 00:26:0b:5d:0f:48
Vendor-rfc1048:
DHCP:REQUEST
CID:[ether]00:26:0b:5d:0f:48
HN:"SEP00260B5D0F48"
<span style="color: #ff0000;"> VC:"Cisco Systems, Inc. IP Phone CP-7961G^@"</span>
PR:SM+TFTP+NS+DG+DN+T150+AT</code></pre>
<p>You can pull a lot of data from these tcpdumps, and find whatever unique characteristics you want to create your pools.  But these ones I&#8217;ve given you should get your started on the right path for now.  If you have any questions, feel free to leave a comment, or you can <a href="/contact/" target="_self">contact me</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2009/11/customizing-dhcpd-conf-on-centos-5-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setup Cisco 7941 or 7961 with Asterisk</title>
		<link>http://www.selbytech.com/2009/10/setup-cisco-7941-or-7961-with-asterisk/</link>
		<comments>http://www.selbytech.com/2009/10/setup-cisco-7941-or-7961-with-asterisk/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 01:39:47 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[cisco]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/2009/10/setup-cisco-7941-or-7961-with-asterisk/</guid>
		<description><![CDATA[After spending many hours trying to solve this issue, I thought I&#8217;d post what I&#8217;ve learned while trying to get my new Cisco 7941 IP Phone connected from my house to my remote asterisk server. The same steps should work for a Cisco 7961 as well. First, you&#8217;ll need a SMARTnet license that covers the [...]]]></description>
			<content:encoded><![CDATA[<p>After spending many hours trying to solve this issue, I thought I&#8217;d post what I&#8217;ve learned while trying to get my new Cisco 7941 IP Phone connected from my house to my remote asterisk server.  The same steps should work for a Cisco 7961 as well.</p>
<p>First, you&#8217;ll need a <a title="Cisco SMARTnet extended service agreement - 1 year" href="http://www.cdw.com/shop/products/default.aspx?edc=993513&amp;enkwrd=ALLPROD%3aCON-SNT-CP7941" target="_blank">SMARTnet license</a> that covers the phone.  These cost about US $10.00 from CDW.  Be prepared to go round and round with CDW support while they attempt to process your request.  It took about two weeks once I purchased my contract to the time it was actually activated with Cisco.  You need this license in order to legally download the <a title="SIP Firmware for CP7941" href="http://tools.cisco.com/support/downloads/go/ReleaseType.x?optPlat=&amp;isPlatform=Y&amp;mdfid=280083379&amp;sftType=Session+Initiation+Protocol+(SIP)+Software&amp;treeName=Voice+and+Unified+Communications&amp;modelName=Cisco+Unified+IP+Phone+7941G&amp;mdfLevel=Model&amp;treeMdfId=278875240&amp;modifmdfid=null&amp;imname=&amp;hybrid=Y&amp;imst=N">latest SIP firmware</a> from Cisco&#8217;s site.</p>
<p>Once you&#8217;ve got everything downloaded, you need to extract the following files into the root folder of your tftp server:</p>
<pre><code>apps41.8-5-2TH1-9.sbn
cnu41.8-5-2TH1-9.sbn
cvm41sip.8-5-2TH1-9.sbn
dsp41.8-5-2TH1-9.sbn
jar41sip.8-5-2TH1-9.sbn
SIP41.8-5-2S.loads
term41.default.loads
term61.default.loads</code></pre>
<p>Next, you&#8217;ll need to add two new files to your tftp folder:</p>
<pre><code><a title="Right-click, save file as..." href="/wp-content/uploads/XMLDefault.cnf.xml">XMLDefault.cnf.xml</a>
<a title="Right-click, save file as..." href="/wp-content/uploads/SEP000000000000.cnf.xml">SEP[_MAC-ADDR_].cnf.xml</a></code></pre>
<p>I&#8217;ve included links to my XMLDefault.cnf.xml file that you can use as well as a sample SEP[_MAC-ADDR_].cnf.xml file that you can use.  Remember to replace the [_MAC-ADDR_] with the actual MAC address of your phone (in all caps).  In the example file, wherever you see words like _USER_ or _PASSWD_, replace those fields with the actual username or password you&#8217;re using from your /etc/asterisk/sip.conf file.</p>
<p>Speaking of that sip.conf file, let&#8217;s look at the proper way to configure it for one of these phones.  The key issue with these phones and asterisk is that they WILL NOT WORK if you have &#8220;nat=yes&#8221; anywhere in your sip definition for that phone.  This is because the Cisco 79&#215;1 phones send their SIP traffic from a very high source port, however they will only accept responses from port 5060 (or whatever you&#8217;ve defined in the .cnf.xml file).  Asterisk, however, will try to send it&#8217;s responses back on the source port that traffic arrived on if &#8220;nat=yes&#8221; is set.  Instead, be sure to use &#8220;nat=no&#8221;.  Here&#8217;s an example from my server:</p>
<pre><code>[_USER_]
type=friend
secret=_PASSWD_
username=_USER_
context=phones
<strong><span style="color: red;">nat=no</span></strong>
canreinvite=no
host=dynamic
callerid="Warren Selby" &lt;_EXT_&gt;
mailbox=_MBOX_</code></pre>
<p>Once you&#8217;ve got all the files loaded and ready to go, you need to reconfigure the TFTP server setting on your phone itself.  Boot the phone and press your Settings button (the one with the checkmark on it).  Go to Network Configuration, and then go to IPv4 Configuration.  Scroll down until you find the option &#8220;Alternate TFTP&#8221; and set this to &#8220;Yes&#8221; (if your settings are locked, press **# and wait a few seconds to unlock them).  Once you&#8217;ve changed this to yes, change your TFTP Server 1 setting to the IP address of your TFTP server.  Once you&#8217;ve validated your settings, click Save, and then exit back to the main Settings menu.  You can then reboot your phone by pressing **#** quickly from the settings menu and waiting.</p>
<p>As the phone reboots, you should hold down the # key until the line buttons flash.  Once they begin to flash, press 1,2,3,4,5,6,7,8,9,*,0,#, which should make your phone reboot again and check for firmware updates.  Allow this process to run on it&#8217;s own for about 10-15 minutes.  Once it&#8217;s successfully been reflashed to the latest SIP firmware, it should attempt to automatically download the SEP[_MAC-ADDR_].cnf.xml file you configured earlier.  If everything&#8217;s been setup correctly, your phone should register with your server and you&#8217;ll be good to go!</p>
<p>Let me know if you have any questions or run into any other issues, leave a comment and I&#8217;ll help where I can!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2009/10/setup-cisco-7941-or-7961-with-asterisk/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Astricon 2009</title>
		<link>http://www.selbytech.com/2009/10/astricon-2009/</link>
		<comments>http://www.selbytech.com/2009/10/astricon-2009/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:34:30 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[off-topic]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=52</guid>
		<description><![CDATA[As I wrap up here at Astricon 2009, I thought I&#8217;d post some of my thoughts on the event. First of all, the Digium folks did a great job this year on gathering speakers, developing content, and they certainly know how to have a good time!  On Wednesday, I mostly stayed on the Cloud track, [...]]]></description>
			<content:encoded><![CDATA[<p>As I wrap up here at Astricon 2009, I thought I&#8217;d post some of my thoughts on the event.</p>
<p>First of all, the Digium folks did a great job this year on gathering speakers, developing content, and they certainly know how to have a good time!  On Wednesday, I mostly stayed on the Cloud track, and other than one presentation that I think was aimed at the wrong audience, I learned quite a few things.  The Xen talk given by <a href="http://www.saghul.net/blog/" target="_blank">Saghul</a> certainly gave me quite a few ideas, including a great idea on virtualized hosted PBX systems.</p>
<p>Wednesday night, I hooked up with the crew from Digium and had a blast!  From celebrating Steve&#8217;s birthday at Margaritaville to watching multiple Digium employees (try to) ride a mechanical bull (video coming soon, check back for updates!), these guys know how to have a good time!</p>
<p>Thursday I floated between the Commerce tracks and the Tech Talks.  The Intuit Innovations presentation on the Asterisk cluster they built for the American Army in Iraq was one that seemed to impress everyone in the room.  Entertaining and informative, Dr. Daniel Ali Aman was one of my favorite speakers at the entire event!</p>
<p>All-in-all, I&#8217;ve had a great time these past few days.  I&#8217;ve made quite a few contacts, picked up a lot of product literature from the exhibition hall, and learned some new things all at the same time.  Thanks Digium for a successful Astricon 2009, and here&#8217;s looking forward to Astricon 2010!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2009/10/astricon-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Asterisk.org Gets a Facelift</title>
		<link>http://www.selbytech.com/2009/10/asterisk-org-gets-a-facelift/</link>
		<comments>http://www.selbytech.com/2009/10/asterisk-org-gets-a-facelift/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 00:01:02 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=47</guid>
		<description><![CDATA[Asterisk.org took on a new look this week.  It was debuted here at Astricon this week, along with the announcement of several new community features that Digium is implementing for Asterisk &#8211; features like the new AsteriskForge, and improved Documentation directly from their website.  You can read more about the new look and the goals [...]]]></description>
			<content:encoded><![CDATA[<p>Asterisk.org took on a new look this week.  It was debuted here at Astricon this week, along with the announcement of several new community features that Digium is implementing for Asterisk &#8211; features like the new <a title="AsteriskForge" href="http://forge.asterisk.org" target="_blank">AsteriskForge</a>, and improved <a title="Asterisk Documentation" href="http://www.asterisk.org/docs" target="_blank">Documentation</a> directly from their website.  You can read more about the new look and the goals behind the update in John Todd&#8217;s <a title="John Todd Blog" href="http://blogs.digium.com/2009/10/12/asterisk-org-facelift/" target="_blank">blog post</a>.</p>
<p>I like the new look, what do you think about it?</p>
<p style="text-align: center;">
<div id="attachment_48" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.asterisk.org" target="_blank"><img class="size-full wp-image-48" title="asterisk-org-tn" src="http://www.selbytech.com/wp-content/uploads/2009/10/asterisk-org-tn.png" alt="New look for asterisk.org " width="500" height="272" /></a><p class="wp-caption-text">New look for asterisk.org </p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2009/10/asterisk-org-gets-a-facelift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running multiple instances of TFTP server on CentOS 5.x</title>
		<link>http://www.selbytech.com/2009/10/running-multiple-instances-of-tftp-server-on-centos-5-x/</link>
		<comments>http://www.selbytech.com/2009/10/running-multiple-instances-of-tftp-server-on-centos-5-x/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 06:26:09 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=38</guid>
		<description><![CDATA[Recently, at a client, I needed to combine two TFTP servers onto one CentOS box. Since there were alread clients spread out across the network hard-coded to use specific IP addresses for their TFTP servers, I needed to be able to serve up files from both IP addresses.  A quick look around the web didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, at a client, I needed to combine two TFTP servers onto one CentOS box.  Since there were alread clients spread out across the network hard-coded to use specific IP addresses for their TFTP servers, I needed to be able to serve up files from both IP addresses.  A quick look around the web didn&#8217;t provide a whole lot of help, so I had to come up with my own way of doing things.</p>
<p>First, I decided to install atftpd, an advanced tftp server that could run on multiple interfaces on the same machine.  Before you can install atftpd, you need to uninstall the base tftpd that comes with CentOS.  Using yum, this is rather simple:</p>
<pre><code># yum remove tftpd-server</code></pre>
<p>This clears the way for us to install atftpd.</p>
<pre><code># yum install atftpd-server</code></pre>
<p>Once we&#8217;ve got that installed, now we need to configure it.  By default, yum installs atftpd-server as an xinetd service (this is why we had to remove the tftpd-server package that comes with CentOS).  Open the file /etc/xinetd.d/tftp and replace it&#8217;s contents with the following, adjusting the IP address and directories for your purposes, of course:</p>
<pre><code>service tftp
{
disable = no
bind                    = 10.10.11.254
socket_type             = dgram
protocol                = udp
wait                    = yes
user                    = root
server                  = /usr/sbin/in.tftpd
server_args             = --logfile /var/log/atftpd_primary.log /home/tftpboot/primary
per_source              = 11
cps                     = 100 2
flags                   = IPv4
}
service tftp
{
disable = no
bind                    = 10.10.10.1
socket_type             = dgram
protocol                = udp
wait                    = yes
user                    = root
server                  = /usr/sbin/in.tftpd
server_args             = --logfile /var/log/atftpd_secondary.log /home/tftpboot/secondary
per_source              = 11
cps                     = 100 2
flags                   = IPv4
}</code></pre>
<p>Once you&#8217;ve got this configured, restart your xinetd server and you&#8217;re good to go!</p>
<pre><code># service xinetd restart</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2009/10/running-multiple-instances-of-tftp-server-on-centos-5-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Virtual Network Interfaces on CentOS 5.x</title>
		<link>http://www.selbytech.com/2009/10/adding-virtual-network-interfaces-on-centos-5-x/</link>
		<comments>http://www.selbytech.com/2009/10/adding-virtual-network-interfaces-on-centos-5-x/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 06:12:08 +0000</pubDate>
		<dc:creator>Warren Selby</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.selbytech.com/?p=33</guid>
		<description><![CDATA[Recently at a client, I found myself consolidating two servers into one. Each server hosted their own array of services, a few of which overlapped. The first server was running a TFTP server, an HTTP web server, and an NTP time server. The second server, which would be the target server of the consolidation, was [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at a client, I found myself consolidating two servers into one.  Each server hosted their own array of services, a few of which overlapped.  The first server was running a TFTP server, an HTTP web server, and an NTP time server.  The second server, which would be the target server of the consolidation, was running it&#8217;s own TFTP server, an FTP server, and a DHCP server.  The first thought was to reconfigure all of the clients that pointed at the first server&#8217;s IP address and point them to the second server&#8217;s IP address, but that would involve reconfiguring over 150 IP phones across two floors, most of which would have to be done by hand.  Realizing that this wasn&#8217;t a very good option, I started looking for another solution.</p>
<p>In comes the idea of Virtual Network Interfaces, or assigning multiple IP addresses to the same physical interface.  On Windows this is a pretty simple task, you just right-click the network interface, go to properties, go to the TCP/IP properties for your interface and then click Advanced &#8211; you&#8217;ll be given the option to add additional IP&#8217;s on the first screen.  On a console-based Linux server, the approach is different, but still rather simple.  In my example, the client was running a CentOS 5.3 server, but this will apply across many different Linux variants.</p>
<p>First you need to copy the file /etc/sysconfig/network-scripts/ifconfig-eth0 to /etc/sysconfig/network-scripts/ifconfig-eth0:1.</p>
<pre><code># cd /etc/sysconfig/network-scripts/
# cp ifconfig-eth0 ifconfig-eth0:1</code></pre>
<p>Next, you need to open the new file (/etc/sysconfig/network-scripts/ifconfig-eth0:1) and change the #FILE, DEVICE, and IPADDR settings:</p>
<pre><code># File: <span style="color: blue;">ifcfg-eth0:1
</span>DEVICE=<span style="color: blue;">eth0:1
</span>ONBOOT=yes
BOOTPROTO=static
IPADDR=<span style="color: blue;">10.10.11.254</span>
NETMASK=255.255.255.0
BROADCAST=10.10.11.255
NETWORK=10.10.11.0
HWADDR=00:80:48:8A:33:A3</code></pre>
<p>Finally, you&#8217;ll need to restart your network service.  Don&#8217;t worry if you&#8217;re doing this remotely, as long as you haven&#8217;t changed the settings for your original network file, you&#8217;re interface should come back up within a few seconds.  Your terminal session may hang while the NIC reloads itself, but after that it will come back just fine.</p>
<pre><code># service network restart</code></pre>
<p>That&#8217;s it!  If you&#8217;re consolidating two servers, like I was, you&#8217;ll want to make sure you take the old server off the network before you restart your network service or else you&#8217;ll have an IP address conflict on your hands, and nobody wants that!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selbytech.com/2009/10/adding-virtual-network-interfaces-on-centos-5-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

