<?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>Erics Tech Blog &#187; Asterisk</title>
	<atom:link href="http://eric.lubow.org/category/system-administration/asterisk-pbx/feed/" rel="self" type="application/rss+xml" />
	<link>http://eric.lubow.org</link>
	<description>Thoughts, musings, and other idealistic (sometimes useful) systems and development hoopla.</description>
	<lastBuildDate>Fri, 18 Nov 2011 14:56:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>1 Extension, Multiple Phones</title>
		<link>http://eric.lubow.org/2008/system-administration/asterisk-pbx/1-extension-multiple-phones/</link>
		<comments>http://eric.lubow.org/2008/system-administration/asterisk-pbx/1-extension-multiple-phones/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 11:00:21 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[asterisk]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/blog/2008/system-administration/asterisk-pbx/48/1-extension-multiple-phones/</guid>
		<description><![CDATA[In order to setup Asterisk to ring multiple phones from the same dialed extension, you will need to create a phantom extension. I accomplished this by doing the following&#8230; Before we go any further, let&#8217;s use the following information as true. The extension we want to have ring in multiple places is extension 100. For [...]]]></description>
			<content:encoded><![CDATA[<p>In order to setup Asterisk to ring multiple phones from the same dialed extension, you will need to create a phantom extension. I accomplished this by doing the following&#8230;</p>
<p>Before we go any further, let&#8217;s use the following information as true.  The extension we want to have ring in multiple places is extension 100.  For sanity&#8217;s sake, let&#8217;s say we want it to ring in 3 places (regardless of the reason).  This means that each phone will need its own extension and auth information according to the <strong>sip.conf</strong>.</p>
<p>First you need to assign each device (phone), its own extension.  Let&#8217;s give each device the extension of &lt;ext&gt;&lt;n&gt;.  Therefore our 3 phones will have the extensions of 1001,1002,1003 respectively.  Their entries in the <strong>sip.conf</strong> will look like this:</p>
<pre>
[1001]
type=peer
context=internal
username=1001
callerid=Eric Lubow <100>
host=dynamic
auth=1001@192.168.1.2
call-limit=100
nat=no
canreinvite=yes
mailbox=100@allstaff
disallow=all
allow=gsm
allow=ulaw
astdb=chan2ext/SIP/1001=1001

[1002]
type=peer
context=internal
username=1002
callerid=Eric Lubow <100>
host=dynamic
auth=1002@192.168.1.2
call-limit=100
nat=no
canreinvite=yes
mailbox=100@allstaff
disallow=all
allow=gsm
allow=ulaw
astdb=chan2ext/SIP/1002=1002

[1003]
type=peer
context=internal
username=1003
callerid=Eric Lubow <100>
host=dynamic
auth=1003@192.168.1.2
call-limit=100
nat=no
canreinvite=yes
mailbox=100@allstaff
disallow=all
allow=gsm
allow=ulaw
astdb=chan2ext/SIP/1003=1003
</pre>
<p>Next, in your <strong>extensions.conf</strong>, add the entry to ring all the extensions when the <em>phantom</em> extension is dialed.  The Dial() command should now look as follows:</p>
<pre>
exten => 100,1,Dial(SIP/1001&#038;SIP/1002&#038;SIP1003,18)
</pre>
<p>A nice thing to do to (in order to not confuse the user) is, in your tftp files, ensure that the label on the phone (each phone) is still the actual extension of the phone that one would dial to get to it.  Label the phone elsewhere with your REAL extension to keep track of it.</p>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-69-with-14x/' rel='bookmark' title='Asterisk *69 with 1.4.x'>Asterisk *69 with 1.4.x</a></li>
<li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-caller-id-blocking-recipe/' rel='bookmark' title='Asterisk Caller ID Blocking Recipe'>Asterisk Caller ID Blocking Recipe</a></li>
<li><a href='http://eric.lubow.org/2007/misc/text-messages-to-cell-phones-via-email/' rel='bookmark' title='Text Messages to Cell Phones via Email'>Text Messages to Cell Phones via Email</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2008/system-administration/asterisk-pbx/1-extension-multiple-phones/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Asterisk Caller ID Blocking Recipe</title>
		<link>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-caller-id-blocking-recipe/</link>
		<comments>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-caller-id-blocking-recipe/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 13:36:28 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Asterisk]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/blog/2007/system-administration/asterisk-pbx/41/asterisk-caller-id-blocking-recipe/</guid>
		<description><![CDATA[Here&#8217;s another quick little Asterisk recipe that I threw together. It&#8217;s a handy because it only takes about 10 minutes to setup and is infinitely useful to the sales types. Just a note, this was done with Asterisk 1.4.8. I wanted to do a little in AEL just to get a feel for it. It [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another quick little Asterisk recipe that I threw together.  It&#8217;s a handy because it only takes about 10 minutes to setup and is infinitely useful to the sales types.  Just a note, this was done with Asterisk 1.4.8.</p>
<p>I wanted to do a little in AEL just to get a feel for it.  It is a little AEL and a little regular <em>extensions.conf</em> type stuff.</p>
<p>The basic way that this CallerID Blocking recipe works is to use the Asterisk DB.  An entry with the family of <strong>CIDBlock</strong> and the key of the dialing users extension will have a value of <strong>1</strong> or <strong>0</strong>.  The user initially sets their preference to either enabled (1) or disabled (0).  When the number gets dialed, the preference gets checked and then the CALLERID(name)/CALLERID(number) values are set accordingly.  In order for the user to enable CID Blocking, they need to dial *81.  It will stay enabled until they dial *82.</p>
<p>How do we accomplish this?  Easy. The sounds come with the asterisk sounds package.  </p>
<p>Open up your extensions.conf and add the following lines (to whichever context works for you):</p>
<pre>
; Enable CallerID Blocking for the dialing extension
exten => *81,1,Set(DB(CIDBlock/${CHANNEL:4:4})=1)
exten => *81,2,Playback(privacy-your-callerid-is)
exten => *81,3,Playback(enabled)
exten => *81,4,Hangup()

; Disable CallerID Blocking for the dialing extension
exten => *82,1,Set(DB(CIDBlock/${CHANNEL:4:4})=0)
exten => *82,2,Playback(privacy-your-callerid-is)
exten => *82,3,Playback(disabled)
exten => *82,4,Hangup()
</pre>
<p>The last modification that needs to happen is that you have to change the <em>exten</em> that dials out to check the DB and react accordingly.  Here is a snippet of mine (with the numbers changed to protect the innocent):</p>
<pre>
; Outbound calling for 111.222.3456 (my phone number)
exten =>_1NXXNXXXXXX,1,Set(CIDBlock=${DB(CIDBlock/${CHANNEL:4:4})})
exten =>_1NXXNXXXXXX,2,Set(${IF($[${CIDBlock} = 1]?CALLERID(name)=Unavailable:CALLERID(name)=MyCompany)})
exten =>_1NXXNXXXXXX,3,Set(${IF($[${CIDBlock} = 1]?CALLERID(number)=0-1-999:CALLERID(number)=1112223456)})
exten =>_1NXXNXXXXXX,4,DIAL(SIP/provider/${EXTEN},60,tr)
exten =>_1NXXNXXXXXX,5,Hangup
</pre>
<p>That&#8217;s really all it takes to set it up.  Quick and handy.</p>
<p>* Note: *81 &#038; *82 are arbitrary number combinations.  Adjust to what works for you.</p>
<p>If you&#8217;re feeling really frisky, I added this AEL extension to check the status of your CallerID Blocking on *83.  For fun, I have also included my *67 script for those who need an idea of how its done.  As with almost anything in Asterisk, there are many ways to do it, this is just how I chose to accomplish this.</p>
<pre>
// Extra's for sending things outbound
context outbound-extra {
   *83 => {
            Playback(privacy-your-callerid-is);
            Set(CIDBlock=${DB(CIDBlock/${CHANNEL:4:4})});
            if(${CIDBlock} == 1) {
                Playback(enabled);
            }
            else {
                Playback(disabled);
            }
            Hangup();
   };

   *67 => {
      // Remove the *67 from the number we are dialing
      Set(dialed_number=${EXTEN:3:11});
      Set(CALLERID(name)=Unavailable):
      Set(CALLERID(number)=0-1-999):
      DIAL(SIP/provider/${dialed_number},60,tr);
      Hangup();
   };
};
</pre>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-69-with-14x/' rel='bookmark' title='Asterisk *69 with 1.4.x'>Asterisk *69 with 1.4.x</a></li>
<li><a href='http://eric.lubow.org/2008/system-administration/asterisk-pbx/1-extension-multiple-phones/' rel='bookmark' title='1 Extension, Multiple Phones'>1 Extension, Multiple Phones</a></li>
<li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/configuring-a-cisco-7961-for-sip-and-asterisk/' rel='bookmark' title='Configuring a Cisco 7961 for SIP and Asterisk'>Configuring a Cisco 7961 for SIP and Asterisk</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-caller-id-blocking-recipe/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Asterisk *69 with 1.4.x</title>
		<link>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-69-with-14x/</link>
		<comments>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-69-with-14x/#comments</comments>
		<pubDate>Mon, 02 Jul 2007 18:32:05 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Asterisk]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/blog/2007/system-administration/asterisk-pbx/39/asterisk-69-with-14x/</guid>
		<description><![CDATA[Many phone users just take for granted the service provided by the Telco called *69 (pronouced &#8220;Star six nine&#8221;). Since Asterisk is a telephony platform, it doesn&#8217;t just come with *69 built in. So if you want it, you have to implement it. To save you some time, I have implemented it with a few [...]]]></description>
			<content:encoded><![CDATA[<p>Many phone users just take for granted the service provided by the Telco called *69 (pronouced &#8220;Star six nine&#8221;).  Since Asterisk is a telephony platform, it doesn&#8217;t just come with *69 built in.  So if you want it, you have to implement it.  To save you some time, I have implemented it with a few tweaks.  This setup works, but YMMV (your mileage may vary).</p>
<p>The concept of the operation here is as follows:  When a call comes in, we grab the caller id number and store it in the Asterisk DB.  When a user makes an outgoing call to *69, we then get that last phone number that called in from the AstDB and dial it using our standard Dial() function. I will get deeper into each phase as I go through the process.</p>
<p>Just to make this all a little clearer, I will say that the context for making outgoing calls is <strong>outbound</strong> and the context for internal calls is <strong>internal</strong>.</p>
<p>1. The first thing to do is to modify the actions a call takes when it comes to the phone.  Assuming the first line of your dialplan for the phone was:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt; _1[0]XX,1,Dial(SIP/${EXTEN},21)</div></div>
<p>This would take the call and send it to which ever SIP peer matched (be it 1000, 1001, etc).  To ensure that only non-internal calls get saved to our AstDB, I have added a statement to avoid calls coming from the <strong>internal</strong> context.  This is our new step 1. If the call comes from the internal context, goto step 3.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt; _1[0]XX,1,GotoIf($[&quot;${CONTEXT}&quot; = &quot;internal&quot;]?3)</div></div>
<p>If not, continue on to our step 2.  Here we are going to make use of the <em>DB(family/key)</em> function.  (Note: For those who had trouble with this function (like me), the family is like a table and they key is like a column name).  I set the family name to <strong>LastCIDNum</strong> and the key to be the receiving caller&#8217;s extension.  The value was set to the callerid number.  This was done as follows:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt; _1[0]XX,2,Set(DB(LastCIDNum/${EXTEN})=${CALLERID(number)})</div></div>
<p>I then move the original Dial back to step 3.  Our final internal product looks something like this:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt; _1[0]XX,1,GotoIf($[&quot;${CONTEXT}&quot; = &quot;internal&quot;]?3)<br />
exten =&gt; _1[0]XX,2,Set(DB(LastCIDNum/${EXTEN})=${CALLERID(number)})<br />
exten =&gt; _1[0]XX,3,Dial(SIP/${EXTEN},21)<br />
exten =&gt; _1[0]XX,4,Voicemail(${EXTEN}@voicemail,u)<br />
exten =&gt; _1[0]XX,5,Hangup()<br />
exten =&gt; _1[0]XX,102,Voicemail(${EXTEN}@voicemail,b)<br />
exten =&gt; _1[0]XX,103,Hangup()</div></div>
<p>2. The next step is handle the outbound context for when a *69 call is placed.  Assuming you don&#8217;t have an outbound dialing macro, we will handle this similarly to way an outbound SIP call would be placed.  First we set the outbound callerid information:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt; *69,1,Set(CALLERID(number)=12345678901)<br />
exten =&gt; *69,2,Set(CALLERID(name)=MyCompany)</div></div>
<p>Then we grab the last caller id information obtained.  It would probably be a good idea to check if its there and if its not set to <em>anonymous</em> or something along those lines, but that is something that would be relatively easy to implement after the basics are up and running.  To obtain the caller id information from the AstDB, I use the ${CHANNEL} variable to get the callers extension for the query.  I use the substring variable syntax to pull the 4 digit extension out of the ${CHANNEL} variable.  I then stick it in a temporary variable that I can <strong>lastcall</strong>.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt; *69,3,Set(lastcall=${DB(LastCIDNum/${CHANNEL:4:4})})</div></div>
<p>Once we have that information, we can dial out almost as normal.  The one issue is that for all US calls, it doesn&#8217;t receive the <em>1</em> in the callerid(num).  So in the Dial function, I add a <strong>1</strong> for domestic calls.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt; *69,4,DIAL(SIP/yourprovider/1${lastcall},60,tr)</div></div>
<p>(Note: The record in the CDR gets added as the outbound dialed number, not *69.)<br />
Our final product for the outbound context should look something like this:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">exten =&gt;exten =&gt; *69,1,Set(CALLERID(number)=12345678901)<br />
exten =&gt; *69,2,Set(CALLERID(name)=MyCompany)<br />
exten =&gt; *69,3,Set(lastcall=${DB(LastCIDNum/${CHANNEL:4:4})})<br />
exten =&gt; *69,4,DIAL(SIP/paetec/1${lastcall},60,tr)<br />
exten =&gt; *69,5,GotoIf(${DIALSTATUS} = CHANUNAVAIL,7)<br />
exten =&gt; *69,6,GotoIf(${DIALSTATUS} = CONGESTION,7)<br />
exten =&gt; *69,7,Hangup<br />
exten =&gt; *69,101,Congestion</div></div>
<p>In order to see if your DB() calls are working properly, you can run the command <strong>database show</strong> from the Asterisk console.  It will find all the keys entered in the family &#8220;LastCIDNum&#8221;.  If these are all (or mostly) external phone numbers, then you have likely done this setup correctly.</p>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-caller-id-blocking-recipe/' rel='bookmark' title='Asterisk Caller ID Blocking Recipe'>Asterisk Caller ID Blocking Recipe</a></li>
<li><a href='http://eric.lubow.org/2008/system-administration/asterisk-pbx/1-extension-multiple-phones/' rel='bookmark' title='1 Extension, Multiple Phones'>1 Extension, Multiple Phones</a></li>
<li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-echo-cancellation/' rel='bookmark' title='Asterisk Echo Cancellation'>Asterisk Echo Cancellation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-69-with-14x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring a Cisco 7961 for SIP and Asterisk</title>
		<link>http://eric.lubow.org/2007/system-administration/asterisk-pbx/configuring-a-cisco-7961-for-sip-and-asterisk/</link>
		<comments>http://eric.lubow.org/2007/system-administration/asterisk-pbx/configuring-a-cisco-7961-for-sip-and-asterisk/#comments</comments>
		<pubDate>Tue, 29 May 2007 19:39:28 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Asterisk]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/blog/2007/system-administration/asterisk-pbx/38/configuring-a-cisco-7961-for-sip-and-asterisk/</guid>
		<description><![CDATA[Just prior to writing this, I think I was about ready to kill someone. Setting up this phone was probably one of the most challenging things I have done in a long time. So this will be my attempt to explain to other&#8217;s what I did and I will hopefully save some people some time. [...]]]></description>
			<content:encoded><![CDATA[<p>Just prior to writing this, I think I was about ready to kill someone.  Setting up this phone was probably one of the most challenging things I have done in a long time.  So this will be my attempt to explain to other&#8217;s what I did and I will hopefully save some people some time.</p>
<p>Since we all need to be on the same page, let&#8217;s start out with the <em>conventions</em>:</p>
<ul>
<li>Asterisk: Gentoo Linux, 192.168.1.5</li>
<li>Workhorse: Gentoo Linux (DHCP, TFTP, NTP), 192.168.1.20</li>
<li>Phone: Cisco 7961</li>
<li>Anything starting with a <strong>$</strong> means you put your value in it.  I will name the variable something descriptive for you</li>
<li>Remember that all filenames with Cisco are case sensitive
<li>If there are some files you need examples of or access to and aren&#8217;t listed, please don&#8217;t hesitate to contact me.</li>
</ul>
<p>I am not going to go into a lot of detail with things, just give some overview and some examples and it will hopefully be enough to get you in the right direction.  Check throughout the document for some references and read up on those if need be.</p>
<p>DISCLAIMER: I am not an expert.  If you break your phone while doing anything I mention here, I am not responsible.  This is just what I did to get everything to work.</p>
<p>1. The first order of business was to add the phone&#8217;s MAC address to DHCP so I could be sure what was accessing the tftp server.  I also needed to know the MAC address to create the proper files in the tftp directory.  Ensure that you set the tftp server, ntp server, and SIP server in DHCP.</p>
<pre>
group voip {
        option domain-name-servers 192.168.1.20, 1.2.3.4;
        option domain-name "inside.mycompany.com";
        option smtp-server 192.168.1.20;
        option ntp-servers 192.168.1.20;
        option time-servers 192.168.1.20;
        option routers 192.168.1.1;
        option sip-server 192.168.1.5;
        default-lease-time 86400; # 1 day
        max-lease-time 86400;
        server-name "192.168.1.20";
        option tftp-server-name "192.168.1.20";

        host myphone {
            hardware ethernet 00:19:E8:F4:B4:D0;
            fixed-address 192.168.1.200;
        }
}
</pre>
<p>2. When you first plug in the phone, it&#8217;s loaded with the Skinny protocol software only (SCCP), nothing for SIP.  This is because the phone was designed to work best (and really only) with the Cisco Call Manager.  The first thing I had to do was to obtain the files that go in the tftproot on 192.168.1.20.  In the upgrade package were the files:</p>
<ul>
<li>apps41.1-1-3-15.sbn</li>
<li>cnu41.3-1-3-15.sbn</li>
<li>copstart.sh</li>
<li>cvm41sip.8-0-3-16.sbn</li>
<li>dsp41.1-1-3-15.sbn</li>
<li>jar41sip.8-0-3-16.sbn</li>
<li>load115.txt</li>
<li>load30018.txt</li>
<li>load308.txt</li>
<li>load309.txt</li>
<li>SIP41.8-0-4SR1S.loads</li>
<li>term41.default.loads</li>
<li>term61.default.loads</li>
</ul>
<p>3. Once you place these files in the tftp root directory, you are ready for the upgrade.  (Note: You need a Cisco smartnet file (or be good with Google) to find these files).  Upgrading requires a factory reboot of the phone so it will look for the <strong>term61.default.loads</strong> file.  To perform a factory reset of the phone, hold down the &#8216;<strong>#</strong>&#8216; as the phone powers up.  Then dial &#8216;<strong>123456789*0#</strong>&#8216; and then let it work.  The next time it reboots, it should then grab the necessary files from the tftp server and upgrade itself.  You can watch the tftp logs and the phones LCD to ensure that everything that is supposed to be happening is happening.</p>
<p>4. At this point, the phone should be able to completely boot up and will likely just show you the word <em>Unprovisioned</em> at the bottom of the screen.  The next step is to create the files that each phone needs to survive.  The first file we are going to create is the <strong>SEP$MAC.cnf.xml</strong>.  In the case of the phone that I am going to use for this demo, the filename is: <strong>SEP0019E8F490AD.cnf.xml</strong>.  I know that the phone is also requesting the file <strong>CTLSEP0019E8F490AD.tlv</strong>, but you can safely ignore that.  The minimalist version of the SEP$MAC.cnf.xml file:</p>
<pre>
&lt;device&gt;
   &lt;deviceProtocol&gt;SIP&lt;/deviceProtocol&gt;
   &lt;sshUserId&gt;cisco&lt;/sshUserId&gt;
   &lt;sshPassword&gt;cisco&lt;/sshPassword&gt;
   &lt;devicePool&gt;
      &lt;dateTimeSetting&gt;
         &lt;dateTemplate&gt;M/D/Ya&lt;/dateTemplate&gt;
         &lt;timeZone&gt;Eastern Standard/Daylight Time&lt;/timeZone&gt;
         &lt;ntps&gt;
              &lt;ntp&gt;
                  &lt;name&gt;192.168.1.20&lt;/name&gt;
                  &lt;ntpMode&gt;Unicast&lt;/ntpMode&gt;
              &lt;/ntp&gt;
         &lt;/ntps&gt;
      &lt;/dateTimeSetting&gt;
      &lt;callManagerGroup&gt;
         &lt;members&gt;
            &lt;member priority="0"&gt;
               &lt;callManager&gt;
                  &lt;ports&gt;
                     &lt;ethernetPhonePort&gt;2000&lt;/ethernetPhonePort&gt;
                     &lt;sipPort&gt;5060&lt;/sipPort&gt;
                     &lt;securedSipPort&gt;5061&lt;/securedSipPort&gt;
                  &lt;/ports&gt;
                  &lt;processNodeName&gt;192.168.1.5&lt;/processNodeName&gt;
               &lt;/callManager&gt;
            &lt;/member&gt;
         &lt;/members&gt;
      &lt;/callManagerGroup&gt;
   &lt;/devicePool&gt;
   &lt;sipProfile&gt;
      &lt;sipProxies&gt;
         &lt;backupProxy&gt;&lt;/backupProxy&gt;
         &lt;backupProxyPort&gt;&lt;/backupProxyPort&gt;
         &lt;emergencyProxy&gt;&lt;/emergencyProxy&gt;
         &lt;emergencyProxyPort&gt;&lt;/emergencyProxyPort&gt;
         &lt;outboundProxy&gt;&lt;/outboundProxy&gt;
         &lt;outboundProxyPort&gt;&lt;/outboundProxyPort&gt;
         &lt;registerWithProxy&gt;true&lt;/registerWithProxy&gt;
      &lt;/sipProxies&gt;
      &lt;sipCallFeatures&gt;
         &lt;cnfJoinEnabled&gt;true&lt;/cnfJoinEnabled&gt;
         &lt;callForwardURI&gt;x--serviceuri-cfwdall&lt;/callForwardURI&gt;
         &lt;callPickupURI&gt;x-cisco-serviceuri-pickup&lt;/callPickupURI&gt;
         &lt;callPickupListURI&gt;x-cisco-serviceuri-opickup&lt;/callPickupListURI&gt;
         &lt;callPickupGroupURI&gt;x-cisco-serviceuri-gpickup&lt;/callPickupGroupURI&gt;
         &lt;meetMeServiceURI&gt;x-cisco-serviceuri-meetme&lt;/meetMeServiceURI&gt;
         &lt;abbreviatedDialURI&gt;x-cisco-serviceuri-abbrdial&lt;/abbreviatedDialURI&gt;
         &lt;rfc2543Hold&gt;false&lt;/rfc2543Hold&gt;
         &lt;callHoldRingback&gt;2&lt;/callHoldRingback&gt;
         &lt;localCfwdEnable&gt;true&lt;/localCfwdEnable&gt;
         &lt;semiAttendedTransfer&gt;true&lt;/semiAttendedTransfer&gt;
         &lt;anonymousCallBlock&gt;2&lt;/anonymousCallBlock&gt;
         &lt;callerIdBlocking&gt;2&lt;/callerIdBlocking&gt;
         &lt;dndControl&gt;1&lt;/dndControl&gt;
         &lt;remoteCcEnable&gt;true&lt;/remoteCcEnable&gt;
      &lt;/sipCallFeatures&gt;
      &lt;sipStack&gt;
         &lt;sipInviteRetx&gt;6&lt;/sipInviteRetx&gt;
         &lt;sipRetx&gt;10&lt;/sipRetx&gt;
         &lt;timerInviteExpires&gt;180&lt;/timerInviteExpires&gt;
         &lt;timerRegisterExpires&gt;3600&lt;/timerRegisterExpires&gt;
         &lt;timerRegisterDelta&gt;5&lt;/timerRegisterDelta&gt;
         &lt;timerKeepAliveExpires&gt;120&lt;/timerKeepAliveExpires&gt;
         &lt;timerSubscribeExpires&gt;120&lt;/timerSubscribeExpires&gt;
         &lt;timerSubscribeDelta&gt;5&lt;/timerSubscribeDelta&gt;
         &lt;timerT1&gt;500&lt;/timerT1&gt;
         &lt;timerT2&gt;4000&lt;/timerT2&gt;
         &lt;maxRedirects&gt;70&lt;/maxRedirects&gt;
         &lt;remotePartyID&gt;true&lt;/remotePartyID&gt;
         &lt;userInfo&gt;None&lt;/userInfo&gt;
      &lt;/sipStack&gt;
      &lt;autoAnswerTimer&gt;1&lt;/autoAnswerTimer&gt;
      &lt;autoAnswerAltBehavior&gt;false&lt;/autoAnswerAltBehavior&gt;
      &lt;autoAnswerOverride&gt;true&lt;/autoAnswerOverride&gt;
      &lt;transferOnhookEnabled&gt;false&lt;/transferOnhookEnabled&gt;
      &lt;enableVad&gt;false&lt;/enableVad&gt;
      &lt;preferredCodec&gt;g711ulaw&lt;/preferredCodec&gt;
      &lt;dtmfAvtPayload&gt;101&lt;/dtmfAvtPayload&gt;
      &lt;dtmfDbLevel&gt;3&lt;/dtmfDbLevel&gt;
      &lt;dtmfOutofBand&gt;avt&lt;/dtmfOutofBand&gt;
      &lt;alwaysUsePrimeLine&gt;false&lt;/alwaysUsePrimeLine&gt;
      &lt;alwaysUsePrimeLineVoiceMail&gt;false&lt;/alwaysUsePrimeLineVoiceMail&gt;
      &lt;kpml&gt;3&lt;/kpml&gt;
      &lt;natEnabled&gt;0&lt;/natEnabled&gt;
      &lt;natAddress&gt;&lt;/natAddress&gt;
      &lt;phoneLabel&gt;LinkExperts&lt;/phoneLabel&gt;
      &lt;stutterMsgWaiting&gt;1&lt;/stutterMsgWaiting&gt;
      &lt;callStats&gt;true&lt;/callStats&gt;
      &lt;silentPeriodBetweenCallWaitingBursts&gt;10&lt;/silentPeriodBetweenCallWaitingBursts&gt;
      &lt;disableLocalSpeedDialConfig&gt;false&lt;/disableLocalSpeedDialConfig&gt;
      &lt;startMediaPort&gt;16384&lt;/startMediaPort&gt;
      &lt;stopMediaPort&gt;32766&lt;/stopMediaPort&gt;
      &lt;sipLines&gt;
         &lt;line button="1"&gt;
            &lt;featureID&gt;9&lt;/featureID&gt;
            &lt;featureLabel&gt;100&lt;/featureLabel&gt;
            &lt;proxy&gt;192.168.0.205&lt;/proxy&gt;
            &lt;port&gt;5060&lt;/port&gt;
            &lt;name&gt;100&lt;/name&gt;
            &lt;displayName&gt;Eric Lubow&lt;/displayName&gt;
            &lt;autoAnswer&gt;
               &lt;autoAnswerEnabled&gt;2&lt;/autoAnswerEnabled&gt;
            &lt;/autoAnswer&gt;
            &lt;callWaiting&gt;3&lt;/callWaiting&gt;
            &lt;authName&gt;100&lt;/authName&gt;
            &lt;authPassword&gt;&lt;/authPassword&gt;
            &lt;sharedLine&gt;false&lt;/sharedLine&gt;
            &lt;messageWaitingLampPolicy&gt;1&lt;/messageWaitingLampPolicy&gt;
            &lt;messagesNumber&gt;*97&lt;/messagesNumber&gt;
            &lt;ringSettingIdle&gt;4&lt;/ringSettingIdle&gt;
            &lt;ringSettingActive&gt;5&lt;/ringSettingActive&gt;
            &lt;contact&gt;100&lt;/contact&gt;
            &lt;forwardCallInfoDisplay&gt;
               &lt;callerName&gt;true&lt;/callerName&gt;
               &lt;callerNumber&gt;true&lt;/callerNumber&gt;
               &lt;redirectedNumber&gt;false&lt;/redirectedNumber&gt;
               &lt;dialedNumber&gt;true&lt;/dialedNumber&gt;
            &lt;/forwardCallInfoDisplay&gt;
         &lt;/line&gt;
      &lt;/sipLines&gt;
      &lt;voipControlPort&gt;5060&lt;/voipControlPort&gt;
      &lt;dscpForAudio&gt;184&lt;/dscpForAudio&gt;
      &lt;ringSettingBusyStationPolicy&gt;0&lt;/ringSettingBusyStationPolicy&gt;
      &lt;dialTemplate&gt;dialplan.xml&lt;/dialTemplate&gt;
   &lt;/sipProfile&gt;
   &lt;commonProfile&gt;
      &lt;phonePassword&gt;&lt;/phonePassword&gt;
      &lt;backgroundImageAccess&gt;true&lt;/backgroundImageAccess&gt;
      &lt;callLogBlfEnabled&gt;1&lt;/callLogBlfEnabled&gt;
   &lt;/commonProfile&gt;
   &lt;loadInformation&gt;SIP41.8-0-4SR1S&lt;/loadInformation&gt;
   &lt;vendorConfig&gt;
      &lt;disableSpeaker&gt;false&lt;/disableSpeaker&gt;
      &lt;disableSpeakerAndHeadset&gt;false&lt;/disableSpeakerAndHeadset&gt;
      &lt;pcPort&gt;1&lt;/pcPort&gt;
      &lt;settingsAccess&gt;1&lt;/settingsAccess&gt;
      &lt;garp&gt;0&lt;/garp&gt;
      &lt;voiceVlanAccess&gt;0&lt;/voiceVlanAccess&gt;
      &lt;videoCapability&gt;0&lt;/videoCapability&gt;
      &lt;autoSelectLineEnable&gt;0&lt;/autoSelectLineEnable&gt;
      &lt;webAccess&gt;1&lt;/webAccess&gt;
      &lt;spanToPCPort&gt;1&lt;/spanToPCPort&gt;
      &lt;loggingDisplay&gt;1&lt;/loggingDisplay&gt;
      &lt;loadServer&gt;&lt;/loadServer&gt;
   &lt;/vendorConfig&gt;
   &lt;versionStamp&gt;1143565489-a3cbf294-7526-4c29-8791-c4fce4ce4c37&lt;/versionStamp&gt;
   &lt;networkLocale&gt;US&lt;/networkLocale&gt;
   &lt;networkLocaleInfo&gt;
      &lt;name&gt;US&lt;/name&gt;
      &lt;version&gt;5.0(2)&lt;/version&gt;
   &lt;/networkLocaleInfo&gt;
   &lt;deviceSecurityMode&gt;1&lt;/deviceSecurityMode&gt;
   &lt;authenticationURL&gt;&lt;/authenticationURL&gt;
   &lt;directoryURL&gt;&lt;/directoryURL&gt;
   &lt;idleURL&gt;&lt;/idleURL&gt;
   &lt;informationURL&gt;&lt;/informationURL&gt;
   &lt;messagesURL&gt;&lt;/messagesURL&gt;
   &lt;proxyServerURL&gt;proxy:3128&lt;/proxyServerURL&gt;
   &lt;servicesURL&gt;&lt;/servicesURL&gt;
   &lt;dscpForSCCPPhoneConfig&gt;96&lt;/dscpForSCCPPhoneConfig&gt;
   &lt;dscpForSCCPPhoneServices&gt;0&lt;/dscpForSCCPPhoneServices&gt;
   &lt;dscpForCm2Dvce&gt;96&lt;/dscpForCm2Dvce&gt;
   &lt;transportLayerProtocol&gt;4&lt;/transportLayerProtocol&gt;
   &lt;capfAuthMode&gt;0&lt;/capfAuthMode&gt;
   &lt;capfList&gt;
      &lt;capf&gt;
         &lt;phonePort&gt;3804&lt;/phonePort&gt;
      &lt;/capf&gt;
   &lt;/capfList&gt;
   &lt;certHash&gt;&lt;/certHash&gt;
   &lt;encrConfig&gt;false&lt;/encrConfig&gt;
&lt;/device&gt;
</pre>
<p>5. You will also need to create a dialplan so the phone doesn&#8217;t try to dial immediately.  Below is a minimalist <strong>dialplan.xml</strong> (which is the filename we used in the above schema).</p>
<pre>
&lt;DIALTEMPLATE&gt;
  &lt;TEMPLATE MATCH="." TIMEOUT="5" User="Phone" /&gt;
  &lt;TEMPLATE MATCH="2500" TIMEOUT="2" User="Phone" /&gt;
  &lt;TEMPLATE MATCH=".97" TIMEOUT="2" User="Phone" /&gt;
  &lt;TEMPLATE MATCH="5..." TIMEOUT="2" User="Phone" /&gt;
  &lt;TEMPLATE MATCH="1.........." TIMEOUT="2" User="Phone" /&gt;
&lt;/DIALTEMPLATE&gt;
</pre>
<p>6. Although I am still not entirely sure that you need them, here are 2 other files that I was told need to be referenced:<br />
<strong>SIPDefault.cnf:</strong></p>
<pre>
# Image Version
image_version: "P0S3-08-6-00"

# Proxy Server
proxy1_address: "192.168.1.5"

# Proxy Server Port (default - 5060)
proxy1_port:"5060"

# Emergency Proxy info
proxy_emergency: "192.168.1.5" # IP address here alternatively
proxy_emergency_port: "5060"

# Backup Proxy info
proxy_backup: "192.168.0.205"
proxy_backup_port: "5060"

# Outbound Proxy info
outbound_proxy: ""
outbound_proxy_port: "5060"

# NAT/Firewall Traversal
nat_enable: "0"
nat_address: "192.168.1.5"
voip_control_port: "5061"
start_media_port: "16384"
end_media_port: "32766"
nat_received_processing: "0"

# Proxy Registration (0-disable (default), 1-enable)
proxy_register: "1"

# Phone Registration Expiration [1-3932100 sec] (Default - 3600)
timer_register_expires: "3600"

# Codec for media stream (g711ulaw (default), g711alaw, g729)
preferred_codec: "none"

# TOS bits in media stream [0-5] (Default - 5)
tos_media: "5"

# Enable VAD (0-disable (default), 1-enable)
enable_vad: "0"

# Allow for the bridge on a 3way call to join remaining parties upon hangup
cnf_join_enable: "1" ; 0-Disabled, 1-Enabled (default)

# Allow Transfer to be completed while target phone is still ringing
semi_attended_transfer: "0" ; 0-Disabled, 1-Enabled (default)

# Telnet Level (enable or disable the ability to telnet into this phone
telnet_level: "2" ; 0-Disabled (default), 1-Enabled, 2-Privileged

# Inband DTMF Settings (0-disable, 1-enable (default))
dtmf_inband: "1"

# Out of band DTMF Settings (none-disable, avt-avt enable (default), avt_always - always avt ) dtmf_outofband: "avt" ~np~# DTMF dB Level Settings (1-6dB down, 2-3db down, 3-nominal (default), 4-3db up, 5-6dB up)
dtmf_db_level: "3"

# SIP Timers
timer_t1: "500" ; Default 500 msec
timer_t2: "4000" ; Default 4 sec
sip_retx: "10" ; Default 11
sip_invite_retx: "6" ; Default 7
timer_invite_expires: "180" ; Default 180 sec

# Setting for Message speeddial to UOne box
messages_uri: "*97"

# TFTP Phone Specific Configuration File Directory
tftp_cfg_dir: "./"
# Time Server
sntp_mode: "unicast"
sntp_server: "ntp2.usno.navy.mil" # IP address here alternatively
time_zone: "EST"
dst_offset: "1"
dst_start_month: "April"
dst_start_day: ""
dst_start_day_of_week: "Sun"
dst_start_week_of_month: "1"
dst_start_time: "02"
dst_stop_month: "Oct"
dst_stop_day: ""
dst_stop_day_of_week: "Sunday"
dst_stop_week_of_month: "8"
dst_stop_time: "2"
dst_auto_adjust: "1"

# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
dnd_control: "0" ; Default 0 (Do Not Disturb feature is off)

# Caller ID Blocking (0-disabled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)

# Anonymous Call Blocking (0-disbaled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
anonymous_call_block: "0" ; Default 0 (Disable blocking of anonymous calls)

# Call Waiting (0-disabled, 1-enabled, 2-disabled with no user control, 3-enabled with no user control)
call_waiting: "1" ; Default 1 (Call Waiting enabled)

# DTMF AVT Payload (Dynamic payload range for AVT tones - 96-127)
dtmf_avt_payload: "101" ; Default 100

# XML file that specifies the dialplan desired
dial_template: "dialplan"

# Network Media Type (auto, full100, full10, half100, half10)
network_media_type: "auto"

#Autocompletion During Dial (0-off, 1-on [default])
autocomplete: "0"

#Time Format (0-12hr, 1-24hr [default])
time_format_24hr: "1"

# URL for external Phone Services
services_url: "" # IP address here alternatively

# URL for external Directory location
directory_url: "" # IP address here alternatively

# URL for branding logo
logo_url: "" # IP address here alternatively

# Remote Party ID
remote_party_id: 1 ; 0-Disabled (default), 1-Enabled
</pre>
<p>and<br />
<strong>XmlDefault.cnf.xml</strong></p>
<pre>
&lt;Default&gt;
&lt;callManagerGroup&gt;
    &lt;members&gt;
       &lt;member priority="0"&gt;
          &lt;callManager&gt;
             &lt;ports&gt;
                &lt;ethernetPhonePort&gt;2000&lt;/ethernetPhonePort&gt;
                &lt;mgcpPorts&gt;
                   &lt;listen&gt;2427&lt;/listen&gt;
                   &lt;keepAlive&gt;2428&lt;/keepAlive&gt;
                &lt;/mgcpPorts&gt;
             &lt;/ports&gt;
             &lt;processNodeName&gt;&lt;/processNodeName&gt;
          &lt;/callManager&gt;
       &lt;/member&gt;
    &lt;/members&gt;
 &lt;/callManagerGroup&gt;
&lt;loadInformation30018 model="IP Phone 7961"&gt;P0S3-08-6-00&lt;/loadInformation30018&gt;
&lt;loadInformation308 model="IP Phone 7961G-GE"&gt;P0S3-08-6-00&lt;/loadInformation308&gt;
&lt;authenticationURL&gt;&lt;/authenticationURL&gt;
&lt;directoryURL&gt;&lt;/directoryURL&gt;
&lt;idleURL&gt;&lt;/idleURL&gt;
&lt;informationURL&gt;&lt;/informationURL&gt;
&lt;messagesURL&gt;&lt;/messagesURL&gt;
&lt;servicesURL&gt;&lt;/servicesURL&gt;
&lt;/Default&gt;
</pre>
<p>This should be all the examples and information that you need to get going with your Cisco 7961(|G|GE) phone.  Simplicity at it&#8217;s finest, eh Cisco?</p>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-caller-id-blocking-recipe/' rel='bookmark' title='Asterisk Caller ID Blocking Recipe'>Asterisk Caller ID Blocking Recipe</a></li>
<li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-69-with-14x/' rel='bookmark' title='Asterisk *69 with 1.4.x'>Asterisk *69 with 1.4.x</a></li>
<li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-echo-cancellation/' rel='bookmark' title='Asterisk Echo Cancellation'>Asterisk Echo Cancellation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2007/system-administration/asterisk-pbx/configuring-a-cisco-7961-for-sip-and-asterisk/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Asterisk Echo Cancellation</title>
		<link>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-echo-cancellation/</link>
		<comments>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-echo-cancellation/#comments</comments>
		<pubDate>Thu, 17 May 2007 20:47:49 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Asterisk]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/blog/2007/system-administration/asterisk-pbx/37/asterisk-echo-cancellation/</guid>
		<description><![CDATA[I was lucky (or unlucky) enough to have to rebuild my company&#8217;s Asterisk server to prepare to have a backup. I took a slightly less powerful machine, installed Debian Etch on it and threw Asterisk 1.2.13 on it. The goal was to mimic the Asterisk configuration on its sister machine which was a Gentoo 1.2.10 [...]]]></description>
			<content:encoded><![CDATA[<p>I was lucky (or unlucky) enough to have to rebuild my company&#8217;s Asterisk server to prepare to have a backup.  I took a slightly less powerful machine, installed Debian Etch on it and threw Asterisk 1.2.13 on it.  The goal was to mimic the Asterisk configuration on its sister machine which was a Gentoo 1.2.10 install (eventually to be upgraded to 1.4.4).  The FXO cards in both machines are exactly the same.  They are the TDM400P.  Everything went smoothly except when I got the computer in place, the echo that came in was unbearable.</p>
<p>This brings me to the topic title.  There is a lot of information that one needs to know to be good at this.  And like usual, I didn&#8217;t have time to get to it all.  Therefore I will show a summary of commands and tasks and provide you with a few links that helped me out.  Long story short, read the docs so you don&#8217;t completely mess everything up.</p>
<p>It should also be noted that the config files that some of these options reside in may differ slightly depending on your configuration.</p>
<p>One of the first things that should be done is to run <a href="http://www.voip-info.org/wiki/view/Asterisk+fxotune">fxotune</a>.  Ensure Asterisk isn&#8217;t running when you run this and beware because it took approximately 20mins to run on my P4 2.8GHz w/ 256M RAM.  Run it using the following command:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">fxotune -i 4</div></div>
<p>The eventual result came out to be below in my /etc/fxotune.conf.  Just be sure that run</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">fxotune -s</div></div>
<p>before starting Asterisk so your settings get used.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">1=8,0,0,0,0,0,0,0,0<br />
2=6,0,0,0,0,0,0,0,0<br />
3=6,0,0,0,0,0,0,0,0<br />
4=6,0,0,0,0,0,0,0,0</div></div>
<p>That did a good job, but it just wasn&#8217;t where it needed to be yet.  The next thing I did should have been the first thing I did.  Ensure all the telephone wires are as short as possible (while still being long enough to serve their purpose) and are away from all sources of power.  This helped with the slight hum I would hear on some calls (this whole scenario is scary to me and thankfully it will be fixed shortly).</p>
<p>Next I moved on to the echo cancellation internals that Asterisk has.  First, in the <em>phone.conf</em>, I changed the variable <strong>echocancel</strong> to <strong>high</strong>.  Obviously, you should step through the possible values incrementally, but mine was already set on <strong>medium</strong>, so <strong>high</strong> was the next logical value.</p>
<p>Most of the work was done here in the <em>zapata.conf</em> file.  The first value that I tinkered with here is the <strong>echocancel</strong> (same name as in the <em>phone.conf</em> file).  It was initially set to <strong>yes</strong> which means that Asterisk automatically defaults to a value of 128 taps.  Knowing that this variable has to be a power of 2, I decided to have some fun.  I started at 2 and went straight up through 256.  As it turned out, <strong>64</strong> ended up being the best.  They say it is impossible to hear with the normal ear, but there was enough of a difference that I was able to discern which sounded better.  Sometimes I couldn&#8217;t hear a difference at all (which is what I assume the docs were referencing), but as soon as I heard the difference between 64 and 128, I left it at 64.  The last variable I toyed with was <strong>echotraining</strong>.  <strong>echotraining</strong> was off initially. I tried calls with it on and off and there was a significant difference in initial call quality when <strong>echotraining</strong> was on.  If these didn&#8217;t work, I would have messed with the value of the <strong>jitterbuffers</strong>.  However, it is sufficient at <strong>10</strong> because of the small amount of memory that this machine has.</p>
<p>Eventually, once I have more time (and all sysadmins know this is a rarity), I want to move on to adjusting the <em>rxgain/txgain</em>.  More information on this can be found <a href="http://www.asteriskdocs.org/modules/tinycontent/content/docbook/current/docs-html/x1695.html">here</a>.  I didn&#8217;t have a need for it now since I have reached what is believed to be tolerable.  But ultimately I don&#8217;t want to have to deal with this again and I want to finish the job.</p>
<p>Hope this allows at least one person to have a one stop shop for information on echo cancellation and can save them a long night or headache.</p>
<p>References:</p>
<ul>
<li><a href="http://www.voip-info.org/wiki/view/Causes+of+Echo">Causes of Echo</a></li>
<li><a href="http://www.voip-info.org/wiki/view/Asterisk+echo+cancellation">Asterisk Echo Cancellation</a></li>
<li><a href="http://www.voip-info.org/wiki/index.php?page=Asterisk+echo+analog+lines">Asterisk Echo Analog Lines</a></li>
<li><a href="http://www.google.com/url?sa=t&#038;ct=res&#038;cd=6&#038;url=http%3A%2F%2Fwww.linuxjournal.com%2Farticle%2F8424&#038;ei=CblMRo_FMZj-wQKe04SLDQ&#038;usg=AFrqEzdKLcPiidETUNw0MM7KC6IOFSYg1w&#038;sig2=tmA1U3KxiUuJruARdJ-fng">Echo and SoftVoIP PBX Systems</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-69-with-14x/' rel='bookmark' title='Asterisk *69 with 1.4.x'>Asterisk *69 with 1.4.x</a></li>
<li><a href='http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-caller-id-blocking-recipe/' rel='bookmark' title='Asterisk Caller ID Blocking Recipe'>Asterisk Caller ID Blocking Recipe</a></li>
<li><a href='http://eric.lubow.org/2007/book-reviews/building-telephony-systems-with-asterisk/' rel='bookmark' title='Building Telephony Systems With Asterisk'>Building Telephony Systems With Asterisk</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2007/system-administration/asterisk-pbx/asterisk-echo-cancellation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

