<?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>Chris Schuld&#039;s Blog &#187; hylafax</title>
	<atom:link href="http://chrisschuld.com/tag/hylafax/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisschuld.com</link>
	<description>personal musings on the composition of software</description>
	<lastBuildDate>Mon, 30 Aug 2010 03:48:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Building an IAXModem-based HylaFax+ server using OpenVZ</title>
		<link>http://chrisschuld.com/2008/11/building-an-iaxmodem-based-hylafax-server-using-openvz/</link>
		<comments>http://chrisschuld.com/2008/11/building-an-iaxmodem-based-hylafax-server-using-openvz/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 03:23:13 +0000</pubDate>
		<dc:creator>Chris Schuld</dc:creator>
				<category><![CDATA[CentOS5]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenVZ]]></category>
		<category><![CDATA[hylafax]]></category>
		<category><![CDATA[IAXModem]]></category>

		<guid isPermaLink="false">http://chrisschuld.com/?p=158</guid>
		<description><![CDATA[If you happen to have a Asterisk solution for voice on your network occasionally it is nice to be able to send faxes from your network without the need of a PSTN line at your endpoint. At my company we do this by running a fax server on an OpenVZ VPS on the same subnet [...]]]></description>
			<content:encoded><![CDATA[<p>If you happen to have a Asterisk solution for voice on your network occasionally it is nice to be able to send faxes from your network without the need of a PSTN line at your endpoint.  At my company we do this by running a fax server on an OpenVZ VPS on the same subnet as our Asterisk PBX.  Here is how we build our fax server:</p>
<p>First, we build the OpenVZ VPS with CentOS and add the /dev/ptmx device (your VPS will likely already have this on it):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vzctl create <span style="color: #000000;">1057</span> <span style="color: #660033;">--ostemplate</span> centos-<span style="color: #000000;">5</span>-i386-default <span style="color: #660033;">--config</span> vps.basic
vzctl <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #000000;">1057</span> <span style="color: #660033;">--hostname</span> fax.aztecsoftware.net <span style="color: #660033;">--save</span>
vzctl <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #000000;">1057</span> <span style="color: #660033;">--ipadd</span> 10.0.0.57 <span style="color: #660033;">--save</span>
vzctl <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #000000;">1057</span> <span style="color: #660033;">--nameserver</span> 10.0.0.15 <span style="color: #660033;">--save</span>
<span style="color: #c20cb9; font-weight: bold;">mknod</span> <span style="color: #660033;">--mode</span> <span style="color: #000000;">666</span> <span style="color: #000000; font-weight: bold;">/</span>vz<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1057</span><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ptmx c <span style="color: #000000;">5</span> <span style="color: #000000;">2</span></pre></div></div>

<p><em>(Note: there is a good chance the 98 UNIX device /dev/ptmx is going to already be there from your template &#8212; you can disregard any errors you get during the &#8220;forced&#8221; creation of that device)</em></p>
<p>Next, we start the VPS and enter the VE by running the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vzctl start <span style="color: #000000;">1057</span>
vzctl enter <span style="color: #000000;">1057</span></pre></div></div>

<p>Next, we start the update and install process via yum and a few RPMs I built for <a href="http://chrisschuld.com/2008/11/updating-ghostscript-on-centos-52-ghostscript-863/">Ghostscript</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> update
yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> rpm-build <span style="color: #c20cb9; font-weight: bold;">make</span> libtiff-devel zlib-devel <span style="color: #c20cb9; font-weight: bold;">gcc</span> gcc-c++ pam-devel openldap-devel freeglut libjpeg-devel libICE libSM libXt cairo urw-fonts
&nbsp;
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>centos52<span style="color: #000000; font-weight: bold;">/</span>jasper-libs-1.900.1-8.i386.rpm
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>centos52<span style="color: #000000; font-weight: bold;">/</span>jasper-1.900.1-8.i386.rpm
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>centos52<span style="color: #000000; font-weight: bold;">/</span>jasper-utils-1.900.1-8.i386.rpm
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>centos52<span style="color: #000000; font-weight: bold;">/</span>jasper-devel-1.900.1-8.i386.rpm
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>centos52<span style="color: #000000; font-weight: bold;">/</span>ghostscript-fonts-<span style="color: #000000;">8.11</span>-1ht.noarch.rpm
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>centos52<span style="color: #000000; font-weight: bold;">/</span>ghostscript-<span style="color: #000000;">8.63</span>-1.i386.rpm
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>centos52<span style="color: #000000; font-weight: bold;">/</span>ghostscript-devel-<span style="color: #000000;">8.63</span>-1.i386.rpm
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>root
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>internap.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>hylafax<span style="color: #000000; font-weight: bold;">/</span>hylafax-5.2.7-1.src.rpm
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>internap.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>hylafax<span style="color: #000000; font-weight: bold;">/</span>hylafax.spec
&nbsp;
rpm <span style="color: #660033;">-i</span> hylafax-5.2.7-1.src.rpm
rpmbuild <span style="color: #660033;">-bb</span> hylafax.spec
rpm <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>hylafax-5.2.7-1.i386.rpm
chkconfig <span style="color: #660033;">--levels</span> <span style="color: #000000;">345</span> hylafax on</pre></div></div>

<p>Now, because we are on Asterisk we&#8217;ll use an IAXModem for our communication device; if you do have access to a &#8220;real&#8221; PSTN by all means use a fax-capable modem and don&#8217;t use the IAXModem because it is not a good 100% solution.  However, here is our IAXModem method:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>root
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>voxel.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>iaxmodem<span style="color: #000000; font-weight: bold;">/</span>iaxmodem-1.1.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf iaxmodem-1.1.1.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> iaxmodem-1.1.1
.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> iaxmodem <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>iaxmodem <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>iaxmodem
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>iaxmodem<span style="color: #000000; font-weight: bold;">/</span>iaxmodem
<span style="color: #7a0874; font-weight: bold;">pushd</span> .; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>iaxmodem
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2008</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11</span><span style="color: #000000; font-weight: bold;">/</span>ttyIAX0
<span style="color: #7a0874; font-weight: bold;">popd</span>
<span style="color: #7a0874; font-weight: bold;">pushd</span> .; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>chrisschuld.com<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2008</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11</span><span style="color: #000000; font-weight: bold;">/</span>iaxmodem
<span style="color: #7a0874; font-weight: bold;">popd</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> config.ttyIAX <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>spool<span style="color: #000000; font-weight: bold;">/</span>hylafax<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>config.ttyIAX0
&nbsp;
<span style="color: #666666; font-style: italic;">### Add our local configuration differences</span>
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>iaxmodem<span style="color: #000000; font-weight: bold;">/</span>ttyIAX0
&nbsp;
<span style="color: #666666; font-style: italic;">### Add our local configuration differences</span>
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>spool<span style="color: #000000; font-weight: bold;">/</span>hylafax<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>config.ttyIAX0
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>iaxmodem
chkconfig <span style="color: #660033;">--add</span> iaxmodem
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iaxmodem
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;iax0:2345:respawn:/usr/sbin/faxgetty ttyIAX0&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>inittab</pre></div></div>

<p>Now, we REBOOT to make sure everything comes up:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">reboot</pre></div></div>

<p>After the VE re-appears we run our fax setup program:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">faxsetup</pre></div></div>

<p>That should do 90% of the work for you &#8212; no you just have to configure the server for your needs!</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisschuld.com/2008/11/building-an-iaxmodem-based-hylafax-server-using-openvz/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
