<?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>Ahmed El Gamil &#187; Asterisk</title>
	<atom:link href="http://www.blog.manhag.org/tag/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.manhag.org</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 10:54:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<image>
<link>http://www.blog.manhag.org</link>
<url>http://www.blog.manhag.org/wp-content/mbp-favicon/favicon.ico</url>
<title>Ahmed El Gamil</title>
</image>
	<atom:link rel='hub' href='http://www.blog.manhag.org/?pushpress=hub'/>
		<item>
		<title>Installing the free G729 Codec for Asterisk</title>
		<link>http://www.blog.manhag.org/2010/05/installing-the-free-g729-codec-for-asterisk/</link>
		<comments>http://www.blog.manhag.org/2010/05/installing-the-free-g729-codec-for-asterisk/#comments</comments>
		<pubDate>Fri, 28 May 2010 09:32:07 +0000</pubDate>
		<dc:creator>Ahmed El Gamil</dc:creator>
				<category><![CDATA[Asterisk/VoIP]]></category>
		<category><![CDATA[Open Source Technologies]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Codecs]]></category>
		<category><![CDATA[G729]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.blog.manhag.org/?p=479</guid>
		<description><![CDATA[This tutorial will let you install the G729 Codec on an Asterisk installation in under 5 minutes. Navigate to the codecs directory: cd /usr/lib/asterisk/modules Download the codec Codecs are provided as binary .so files, you can find the archive at  http://asterisk.hosting.lv/#bin Take care of the following when picking up one of the files, they depend on [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will let you install the G729 Codec on an Asterisk installation in under 5 minutes.</p>
<h3 id="Navigatetothecodecsdirectory:">Navigate to the codecs directory:<a title="Link to this section" href="#Navigatetothecodecsdirectory:"></a></h3>
<pre>cd /usr/lib/asterisk/modules</pre>
<h3 id="Downloadthecodec">Download the codec<a title="Link to this section" href="#Downloadthecodec"></a></h3>
<ul>
<li>Codecs are provided as binary .so files, you can find the archive at <a href="http://asterisk.hosting.lv/#bin"> http://asterisk.hosting.lv/#bin</a></li>
<li>Take care of the following when picking up one of the files, they depend on your hardware/software:
<ul>
<li>Processor Architecture: Check the kernel type installed on your system (using &#8220;uname -a&#8221; )</li>
<li>Asterisk Version: As you can see there is codecs for Asterisk 1.2, 1.4 and also 1.6</li>
<li>The most used ones are the following:
<ul>
<li><a href="http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-pentium.so"> http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-pentium.so</a></li>
<li><a href="http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-x86_64-core2.so"> http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-x86_64-core2.so</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<pre>[root@Machine modules]# wget http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-pentium.so</pre>
<p>Notice that we are in the modules directory</p>
<h3 id="Renamethecodecfile">Rename the codec file<a title="Link to this section" href="#Renamethecodecfile"></a></h3>
<pre>mv codec_g729-ast14-gcc4-glibc-pentium4.so codec_g729.so</pre>
<h3 id="RestartAsterisk">Restart Asterisk<a title="Link to this section" href="#RestartAsterisk"></a></h3>
<pre>/etc/init.d/asterisk restart</pre>
<h3 id="Checkyourwork">Check your work<a title="Link to this section" href="#Checkyourwork"></a></h3>
<p>Connect to Asterisk</p>
<pre>asterisk -r</pre>
<p>Then show all of the codec translations available using the command below, and check g729 at the left, you should see that it can be translated to many other codecs on the top of the table</p>
<pre>Machine*CLI&gt; show translations

         Translation times between formats (in milliseconds) for one second of data

          Source Format (Rows) Destination Format (Columns)

          g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722

     g723    -   -    -    -        -     -    -     -    -     -    -    -    -

      gsm    -   -    2    2        2     2    1     2    3     -    -    2    -

     ulaw    -   3    -    1        2     2    1     2    3     -    -    2    -

     alaw    -   3    1    -        2     2    1     2    3     -    -    2    -

 g726aal2    -   3    2    2        -     2    1     2    3     -    -    2    -

    adpcm    -   3    2    2        2     -    1     2    3     -    -    2    -

     slin    -   2    1    1        1     1    -     1    2     -    -    1    -

    lpc10    -   3    2    2        2     2    1     -    3     -    -    2    -

     g729    -   3    2    2        2     2    1     2    -     -    -    2    -

    speex    -   -    -    -        -     -    -     -    -     -    -    -    -

     ilbc    -   -    -    -        -     -    -     -    -     -    -    -    -

     g726    -   3    2    2        2     2    1     2    3     -    -    -    -

     g722    -   -    -    -        -     -    -     -    -     -    -    -    -

Machine*CLI&gt; quit</pre>
<h3 id="Troubleshooting">Troubleshooting<a title="Link to this section" href="#Troubleshooting"></a></h3>
<p>If you didn&#8217;t see the codec translation as mentioned above then probably you downloaded the wrong codec, please check again the points mentioned during downloading the codec, you can use the following commands to help you:</p>
<pre>asterisk -V

uname -a</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.manhag.org/2010/05/installing-the-free-g729-codec-for-asterisk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Routing calls from Zap Trunks to SIP trunks in Asterisk</title>
		<link>http://www.blog.manhag.org/2010/03/routing-calls-from-zap-trunks-to-sip-trunks-in-asterisk/</link>
		<comments>http://www.blog.manhag.org/2010/03/routing-calls-from-zap-trunks-to-sip-trunks-in-asterisk/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 12:35:40 +0000</pubDate>
		<dc:creator>Ahmed El Gamil</dc:creator>
				<category><![CDATA[Asterisk/VoIP]]></category>
		<category><![CDATA[Open Source Technologies]]></category>
		<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[FreePBX]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[SIP]]></category>
		<category><![CDATA[Zap]]></category>

		<guid isPermaLink="false">http://www.blog.manhag.org/?p=429</guid>
		<description><![CDATA[So i had this situation where i have 2 Asterisk boxes, the 1st one of them had a PRI card and the 2nd one is just attached to the network through an ethernet card Goal: redirect all of the incoming calls on the PRI to the 2nd Asterisk box through a SIP Trunk (The 2nd [...]]]></description>
			<content:encoded><![CDATA[<p>So i had this situation where i have 2 Asterisk boxes, the 1st one of them had a PRI card and the 2nd one is just attached to the network through an ethernet card</p>
<p><strong><span style="text-decoration: underline;">Goal:</span></strong> redirect all of the incoming calls on the PRI to the 2nd Asterisk box through a SIP Trunk (The 2nd box holds the IVR and all of those stuff, all of the IP phones are connecting to this one), There was no decent documentation about this out there so i am documenting this and may be someone will find it useful.</p>
<p>Here is what you should do (I am assuming you are using an Asterisk installation that uses FreePBX):</p>
<ul>
<li>Create the Zap Trunk as you normally do from the FreePBX interface: Trunks -&gt; Add Zap Trunk</li>
<li>Create a SIP trunk that points to the 2nd Asterisk box, we will use this Trunk later in the configuration: Trunks -&gt; Add SIP Trunk, scroll down to outgoing settings and add the following
<ul>
<li>Trunk name: to-2ndAsterisk</li>
<li>Peer details:</li>
</ul>
</li>
</ul>
<blockquote><p>type=peer</p>
<p>host=&lt;IP Address of 2nd Asterisk Box&gt;</p></blockquote>
<ul>
<li>Connect to the 1st Asterisk box using SSH and edit the file /etc/asterisk/dahdi-channels.conf, you will find some configuration like</li>
</ul>
<blockquote>
<div id="_mcePaste">group=0,11</div>
<div id="_mcePaste"><strong>context=from-pstn</strong></div>
<div id="_mcePaste">switchtype = euroisdn</div>
<div id="_mcePaste">signalling = pri_cpe</div>
<div id="_mcePaste">channel =&gt; 1-15,17-31</div>
<div id="_mcePaste">context = default</div>
<div id="_mcePaste">group = 63</div>
</blockquote>
<ul>
<li>So as you can see all of the incoming calls are directed to the from-pstn context, we will now edit this line to direct the calls to the from-pstn-custom context and do the rest of the magic in this context so the file should be as follows</li>
</ul>
<blockquote>
<div id="_mcePaste">group=0,11</div>
<div id="_mcePaste"><strong>context=from-pstn-custom</strong></div>
<div id="_mcePaste">switchtype = euroisdn</div>
<div id="_mcePaste">signalling = pri_cpe</div>
<div id="_mcePaste">channel =&gt; 1-15,17-31</div>
<div id="_mcePaste">context = default</div>
<div id="_mcePaste">group = 63</div>
</blockquote>
<ul>
<li>Now edit the file /etc/asterisk/extensions_custom.conf and add the following at the end of the file</li>
</ul>
<blockquote><p>[from-pstn-custom]<br />
exten =&gt; _.,1,Dial(SIP/to-2ndAsterisk/${EXTEN:2},20,rt)</p></blockquote>
<p>So what this does is that it matches all of the calls (_.) then redirect them through the SIP trunk to the 2nd Asterisk box</p>
<ul>
<li>And the last step is to allow calls coming from the 1st Box to the 2nd Box, you should do IP-based authentication on the 2nd box by editing /etc/asterisk/sip_custom.conf and add the following</li>
</ul>
<blockquote><p>[1stAsterisk]<br />
type=peer<br />
canreinvite=no<br />
host=&lt;IP Address of 1st Asterisk Box&gt;<br />
context=from-pstn<br />
nat=no<br />
dtmfmode=rfc2833<br />
disallow=all<br />
allow=ulaw<br />
insecure=port<br />
qualify=yes</p></blockquote>
<p>Of course you can now create any inbound routes on the 2nd Asterisk Box to match your needs.</p>
<p>I hope this works for you, and if you need any assistance please don&#8217;t hesitate to ask me in the comments</p>
<p>Thanks for listening <img src='http://www.blog.manhag.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.manhag.org/2010/03/routing-calls-from-zap-trunks-to-sip-trunks-in-asterisk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
