<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title><![CDATA[Science Forums - Tutorials and How To's]]></title>
		<link>http://hypography.com/forums/</link>
		<description>How to reset your password, upload an avatar, use the private messaging system and more.</description>
		<language>en</language>
		<lastBuildDate>Fri, 20 Nov 2009 22:59:37 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://hypography.com/forums/images/styles/new_facebook/images/misc/rss.jpg</url>
			<title><![CDATA[Science Forums - Tutorials and How To's]]></title>
			<link>http://hypography.com/forums/</link>
		</image>
		<item>
			<title>Compiling Asterisk with IMAP Voicemail Storage (on CentOS 5.4)</title>
			<link>http://hypography.com/forums/tutorials-how-tos/21452-compiling-asterisk-imap-voicemail-storage-centos-5-4-a.html</link>
			<pubDate>Thu, 19 Nov 2009 21:47:39 GMT</pubDate>
			<description>Another one of my craazeh tuts :) 
 
Prerequisite, please read the tutorial on installing asterisk...</description>
			<content:encoded><![CDATA[<div>Another one of my craazeh tuts :)<br />
<br />
Prerequisite, please read the tutorial on installing asterisk with mysql<br />
<br />
before we start<br />
<br />
install build tools :)<br />
<br />
<i># yum install gcc libevent libevent-devel readline readline-devel ncurses ncurses-devel glib2 glib2-devel mysql-devel</i><br />
<br />
install prerequisites for compiling asterisk<br />
<i><br />
# yum install gcc gcc-c++ kernel-devel bison openssl openssl-devel perl perl-Net-SSLeay perl-Crypt-SSLeay libtermcap-devel ncurses-devel doxygen curl-devel newt-devel mlocate lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron speex speex-devel unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel mysql-connector-odbc mysql mysql-devel mysql-server php-mysql php-mbstring php-mcrypt flex screen bzip2 mlocate vixie-cron tar wget mysql-connector-odbc libxml2-devel libidn-devel krb5-devel krb5-libs zlib-devel libidn-devel</i><br />
<br />
install error reporting lib<br />
<br />
<i># yum install compat-libcom_err<br />
# ln -sf /usr/lib64/libcom_err.so.3.0.0 /usr/lib64/libcom_err.so</i><br />
<br />
ok we now need the asterisk distributables and imap libraries, download from Digium's website the asterisk, asterisk-addons and the dahdi driver source packages<br />
<br />
download the latest imap libraries from <a href="ftp://ftp.cac.washington.edu/mail/" target="_blank">ftp://ftp.cac.washington.edu/mail/</a><br />
<br />
install the prerequisites for the imap client libs<br />
<i># yum install pam-devel</i><br />
<br />
start with the client (note we dont need to actually install the libraries, we do need to compile them to be able to link too them from asterisk<br />
<br />
<i># tar xvzf imap-2007e.tar.gz<br />
# cd imap-2007e<br />
# make clean<br />
# make lr5 EXTRACFLAGS=&quot;-I/usr/include/openssl -fPIC&quot;</i><br />
<br />
note we wont actually make install :)<br />
<br />
next lets build asterisk with imap support :)<br />
<br />
<i># cd /usr/local/src<br />
# tar xvzf asterisk-addons-1.6.2.0-rc1.tar.gz<br />
# tar xvzf asterisk-1.6.2.0-rc3.tar.gz<br />
# tar xvzf dahdi-linux-complete-current.tar.gz</i><br />
<br />
as before we start with dahdi<br />
<br />
<i># cd dahdi-linux-complete-2.2.0.2+2.2.0/<br />
# make clean<br />
# make<br />
# make install<br />
# make config<br />
# chkconfig dahdi on<br />
# /etc/init.d/dahdi start</i><br />
<br />
note: if it screams at you about your kernel, reboot your box, you have a newer kernel installed then you are running...<br />
<br />
<i># cd ../cd asterisk-1.6.2.0-rc3</i><br />
<br />
(note as of this writing the latest version is RC6, and the problem with app queue is probably already fixed, please refer to the other tutorial for how to fix app_queue)<br />
<br />
<i># make clean<br />
# ./configure --with-imap=/usr/local/src/imap-2007e<br />
# make menuselect</i><br />
<br />
make sure you go to Voicemail Build Options and select the IMAP_STORAGE<br />
<br />
<i># make<br />
# make install</i><br />
<br />
aand you are done... only thing left is the configuration, the hard part....</div>

]]></content:encoded>
			<category domain="http://hypography.com/forums/tutorials-how-tos/"><![CDATA[Tutorials and How To's]]></category>
			<dc:creator>alexander</dc:creator>
			<guid isPermaLink="true">http://hypography.com/forums/tutorials-how-tos/21452-compiling-asterisk-imap-voicemail-storage-centos-5-4-a.html</guid>
		</item>
		<item>
			<title>Installing MySQL-Proxy and Asterisk (1.6.2.0-rc3) from source on CentOS 5.3</title>
			<link>http://hypography.com/forums/tutorials-how-tos/21268-installing-mysql-proxy-asterisk-1-6-2-0-rc3-source-centos-5-3-a.html</link>
			<pubDate>Wed, 28 Oct 2009 21:14:52 GMT</pubDate>
			<description>One really needs to know what they are doing for this, but i just need a place to put this so i can...</description>
			<content:encoded><![CDATA[<div>One really needs to know what they are doing for this, but i just need a place to put this so i can reference it in the future... And i am sure there are other people who will find this useful :)<br />
<br />
Ok firstly lets install all the dependencies: for mysql-proxy and lua<br />
for x86_64<br />
# <i>yum install gcc.x86_64 libevent.x86_64 libevent-devel.x86_64 readline.x86_64 readline-devel.x86_64 ncurses.x86_64 ncurses-devel.x86_64 glib2.x86_64 glib2-devel.x86_64 mysql-devel.x86_64</i><br />
<br />
for i386<br />
# <i>yum install gcc libevent libevent-devel readline readline-devel ncurses ncurses-devel glib2 glib2-devel mysql-devel</i><br />
<br />
cd /usr/local/src/<br />
<br />
these are the last versions of these packages that dont depend on the newer libc<br />
<br />
<i># wget http://www.lua.org/ftp/lua-5.1.4.tar.gz</i><br />
<i># wget http://dev.mysql.com/get/Downloads/MySQL-Proxy/mysql-proxy-0.6.1.tar.gz/from/http://www.mirrorservice.org/sites/ftp.mysql.com/</i><br />
<br />
untar everything:<br />
# <i>tar xvzf lua-5.1.4.tar.gz</i><br />
# <i>tar xvzf mysql-proxy-0.6.1.tar.gz<br />
</i><br />
and install lua<br />
# <i>cd lua-5.1.4</i><br />
# <i>make linux<br />
</i># <i>make install<br />
</i><br />
then mysql-proxy<br />
# <i>cd ../mysql-proxy-0.6.1<br />
</i># <i>./configure  LDFLAGS=&quot;-lm -ldl&quot; LUA_CFLAGS=&quot;-I/usr/local/include/&quot; LUA_LIBS=/usr/local/lib/liblua.a</i><br />
# <i>make<br />
</i># <i>make install<br />
</i><br />
make a couple of directories needed for proper operation of mysql-proxy<br />
# <i>mkdir /var/log/mysql-proxy/<br />
</i># <i>mkdir -p /usr/local/mysql/lua-scripts/ <br />
</i><br />
finally lets create an init script to start this sucker up (please notice and edit the PROXY_OPTIONS )<br />
<br />
/etc/init.d/mysql-proxy<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#!/bin/sh<br />
#<br />
# mysql-proxy This script starts and stops the mysql-proxy daemon<br />
#<br />
# chkconfig: - 78 30<br />
# processname: mysql-proxy<br />
# description: mysql-proxy is a proxy daemon to mysql<br />
<br />
# Source function library.<br />
. /etc/rc.d/init.d/functions<br />
<br />
PROXY_PATH=/usr/local/sbin/<br />
<br />
prog=&quot;mysql-proxy&quot;<br />
<br />
# Source networking configuration.<br />
. /etc/sysconfig/network<br />
<br />
# Check that networking is up.<br />
[ ${NETWORKING} = &quot;no&quot; ] &amp;&amp; exit 0<br />
<br />
# Set default mysql-proxy configuration.<br />
PROXY_OPTIONS=&quot;--daemon --proxy-backend-addresses=1.2.3.4:3306 --proxy-backend-addresses=1.2.3.4:3306&quot;<br />
PROXY_PID=/var/run/mysql-proxy.pid<br />
<br />
# Source mysql-proxy configuration.<br />
if [ -f /etc/sysconfig/mysql-proxy ] ; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; . /etc/sysconfig/mysql-proxy<br />
fi<br />
<br />
PATH=$PATH:/usr/bin:/usr/local/bin:$PROXY_PATH<br />
<br />
# By default its all good<br />
RETVAL=0<br />
<br />
# See how we were called.<br />
case &quot;$1&quot; in<br />
&nbsp; start)<br />
&nbsp; &nbsp; &nbsp; &nbsp; # Start daemon.<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Starting $prog: &quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; daemon $NICELEVEL $PROXY_PATH/mysql-proxy $PROXY_OPTIONS --pid-file $PROXY_PID<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ $RETVAL = 0 ]; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; touch /var/lock/subsys/mysql-proxy<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; stop)<br />
&nbsp; &nbsp; &nbsp; &nbsp; # Stop daemons.<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Stopping $prog: &quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; killproc $prog<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ $RETVAL = 0 ]; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rm -f /var/lock/subsys/mysql-proxy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rm -f $PROXY_PID<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; restart)<br />
&nbsp; &nbsp; &nbsp; &nbsp; $0 stop<br />
&nbsp; &nbsp; &nbsp; &nbsp; sleep 3<br />
&nbsp; &nbsp; &nbsp; &nbsp; $0 start<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; condrestart)<br />
&nbsp; &nbsp; &nbsp;  [ -e /var/lock/subsys/mysql-proxy ] &amp;&amp; $0 restart<br />
&nbsp; &nbsp; &nbsp;  ;;<br />
&nbsp; status)<br />
&nbsp; &nbsp; &nbsp; &nbsp; status mysql-proxy<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; *)<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Usage: $0 {start|stop|restart|status|condrestart}&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=1<br />
&nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
esac<br />
<br />
exit $RETVAL</code><hr />
</div>Now lets fight asterisk<br />
<br />
Install pre-requisites :)<br />
<br />
# <i>yum install gcc gcc-c++ kernel-devel bison openssl openssl-devel perl perl-Net-SSLeay perl-Crypt-SSLeay libtermcap-devel ncurses-devel doxygen curl-devel newt-devel mlocate lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron speex speex-devel unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel mysql-connector-odbc mysql mysql-devel mysql-server php-mysql php-mbstring php-mcrypt flex screen bzip2 mlocate vixie-cron tar wget mysql-connector-odbc libxml2-devel libidn-devel krb5-devel krb5-libs zlib-devel libidn-devel</i><br />
<br />
If we are running 64, please link these (its just easier that way)<br />
#<i> ln -sf /usr/lib64/libcom_err.so.2 /usr/lib64/libcom_err.so</i><br />
<br />
Also lets create a /usr/src/linux link (not necessary, but i have it for good measure)<br />
# <i>ln -s /usr/src/kernels/2.6.18-164.el5-x86_64/ /usr/src/linux </i><br />
<br />
now lets get everything we need (note these are prone to changing in the future, check for latest versions)<br />
# <i>wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz</i><br />
# <i>wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.6.2.0-rc3.tar.gz</i><br />
#<i> wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.0-rc1.tar.gz</i><br />
<br />
now then, extract everything<br />
# <i>tar xvzf asterisk-1.6.2.0-rc3.tar.gz</i><br />
# <i>tar xvzf asterisk-addons-1.6.2.0-rc1.tar.gz</i><br />
# <i>tar xvzf dahdi-linux-complete-current.tar.gz</i><br />
<br />
# <i>cd dahdi-linux-complete-2.2.0.2+2.2.0</i><br />
# <i>make all</i><br />
<br />
if it screams at linux sources, check that your uname -r is the same as the kernel source version in /usr/src/kernels, reboot if different<br />
<br />
# <i>make config</i><br />
# <i>chkconfig dahdi on</i><br />
# <i>/etc/init.d/dahdi start</i><br />
<br />
moving on now lets go into asterisk<br />
# <i>cd ../asterisk-1.6.2.0-rc3</i><br />
<br />
first lets make a quick fix (it may be in the newer version that you might be using, just check)<br />
# <i>cat apps/app_queue.c | grep 'if (!strcasecmp(m-&gt;rt_uniqueid, rt_uniqueid))'</i><br />
<br />
if that returns a result, you need to edit that line, it should read <br />
if (strcasecmp(m-&gt;rt_uniqueid, rt_uniqueid))<br />
<br />
save, exit, lets run into our first MAJOR problem :)<br />
# <i>./configure</i><br />
<br />
i wont go over how i configure asterisk for our environment, but you would do that using<br />
# <i>make menuselect  </i><br />
# <i>make</i><br />
<br />
and you will get something like this:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&nbsp;  [LD] pbx_lua.o -&gt; pbx_lua.so<br />
/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC<br />
/usr/local/lib/liblua.a: could not read symbols: Bad value<br />
collect2: ld returned 1 exit status<br />
make[1]: *** [pbx_lua.so] Error 1<br />
make: *** [pbx] Error 2</code><hr />
</div>lets go fix this<br />
#<i> cd ../lua-5.1.4<br />
</i><br />
i use emacs, but feel free to use your favorite editor<br />
# <i>emacs src/Makefile</i><br />
<br />
find the line that says<br />
CFLAGS= -O2 -Wall $(MYCFLAGS)<br />
<br />
and change it to <br />
CFLAGS= -O2 -Wall -fpic $(MYCFLAGS)<br />
<br />
recompile lua now with -fpic (File Position Independent Code, basically creates library files that other programs can link against)<br />
# <i>make clean</i><br />
# <i>make linux</i><br />
#<i> make install</i><br />
<br />
# <i>cd ../asterisk-1.6.2.0-rc3</i><br />
# <i>make</i><br />
<br />
now we finally get to the all-so-desired<br />
 +--------- Asterisk Build Complete ---------+<br />
 + Asterisk has successfully been built, and +<br />
 + can be installed by running:              +<br />
 +                                           +<br />
 +                make install               +<br />
 +-------------------------------------------+<br />
<br />
Well, lets follow it's advise :)<br />
# <i>make install</i><br />
<br />
Finally lets compile the remaining modules:<br />
#<i>cd ../asterisk-addons-1.6.2.0-rc1</i><br />
# <i>./configure</i><br />
<br />
I usually don't even do this, stock apps seem to be what we use anyways, but you NEED this package for realtime mysql connectivity<br />
# <i>make menuselect</i><br />
<br />
# <i>make</i><br />
# <i>make install</i><br />
<br />
Once that completes we are pretty much done and this tutorial will cut off (and i go to finish this install)<br />
<br />
Hope this helps someone, cuz it took me a good chunk of time to figure everything out... Enjoy</div>

]]></content:encoded>
			<category domain="http://hypography.com/forums/tutorials-how-tos/"><![CDATA[Tutorials and How To's]]></category>
			<dc:creator>alexander</dc:creator>
			<guid isPermaLink="true">http://hypography.com/forums/tutorials-how-tos/21268-installing-mysql-proxy-asterisk-1-6-2-0-rc3-source-centos-5-3-a.html</guid>
		</item>
	</channel>
</rss>
