<?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>MCB Systems &#187; asterisk</title>
	<atom:link href="http://www.mcbsys.com/techblog/tag/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mcbsys.com/techblog</link>
	<description>Custom Software and I.T. Services</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:58:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linksys SPA942 Busy Lamp Field with PiaF</title>
		<link>http://www.mcbsys.com/techblog/2011/11/linksys-spa942-busy-lamp-field-with-piaf/</link>
		<comments>http://www.mcbsys.com/techblog/2011/11/linksys-spa942-busy-lamp-field-with-piaf/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 20:37:27 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[linksys]]></category>
		<category><![CDATA[pbx in a flash]]></category>
		<category><![CDATA[piaf]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2011/11/spa942-busy-lamp-field-with-piaf/</guid>
		<description><![CDATA[A client has an old PBX in a Flash 1.3 installation running Asterisk 1.4.21.2. I’ve upgraded their Linksys SPA942 phones to the latest firmware, version 6.1.5(a). Can we get Busy Lamp Field (BLF) functionality to work on the empty line keys?

This post has a concise guide to SPA942 BLF configuration:
How to configure BLF with a [...]]]></description>
			<content:encoded><![CDATA[<p>A client has an old PBX in a Flash 1.3 installation running Asterisk 1.4.21.2. I’ve upgraded their Linksys SPA942 phones to the latest firmware, version 6.1.5(a). Can we get Busy Lamp Field (BLF) functionality to work on the empty line keys?</p>
<p><span id="more-1038"></span></p>
<p>This post has a concise guide to SPA942 BLF configuration:</p>
<p><a href="http://www.adrianandgenese.com/blogger/2011/02/15/how-to-configure-blf-with-a-linksys-spa942-and-asterisk-1-4/">How to configure BLF with a Linksys SPA942 and Asterisk 1.4</a></p>
<p>I found that I didn’t have to change the PBX in a Flash (PiaF) setup of Asterisk at all. To monitor extension 203, I just made these changes to <strong>Phone</strong> tab of the phone used by extension 200:</p>
<p><a href="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/SPA942-BLF.png" target="_blank"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SPA942 BLF" src="http://www.mcbsys.com/techblog/wp-content/uploads/2011/11/SPA942-BLF_thumb.png" border="0" alt="SPA942 BLF" width="554" height="161" /></a></p>
<h4>Notes</h4>
<ul>
<li>The <strong>Extension</strong> is <strong>Disabled</strong> and <strong>Shared Call Appearance</strong> is <strong>private.</strong></li>
<li>The extension being monitored does <em>not</em> need to be defined on an <strong>Ext</strong> tab on the “remote” phone. So if the admin is on 200 and is monitoring 203, the admin does not need 203 defined on an <strong>Ext</strong> tab.</li>
<li>The <strong>Short Name</strong> appears next to the line key when the phone is on hook.</li>
<li>The <strong>Extended Function</strong> looks like this:<br />
<code>fnc=blf+sd+cp;sub=203@$PROXY;ext=203@$PROXY</code></p>
<ul>
<li>blf = Busy Lamp Field</li>
<li>sd = Speed Dial</li>
<li>cp = Call Pickup</li>
</ul>
</li>
</ul>
<h4>Issues</h4>
<ul>
<li>The BLF function does work. However, when the line is off hook, the Short Names are not shown. So users would have to remember which line key is for whom, or use physical labels to identify the lines.</li>
<li>A quick test of transferring a call with the button failed. It could be that that requires some of the Asterisk-side modifications. I didn’t pursue this.</li>
<li>BLF subscriptions may not be supported by a hosted PBX solution, where you register each extensions directly with the external provider. Since most other functions are available in a hosted solution (e.g. <a href="http://voip.ms" target="_blank">voip.ms</a>), it may come down to whether it is worth running an in-house Asterisk server just to have BLF.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2011/11/linksys-spa942-busy-lamp-field-with-piaf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Asterisk to Use the G.729a Codec</title>
		<link>http://www.mcbsys.com/techblog/2011/11/get-asterisk-to-use-the-g-729a-codec/</link>
		<comments>http://www.mcbsys.com/techblog/2011/11/get-asterisk-to-use-the-g-729a-codec/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 06:37:19 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[piaf]]></category>

		<guid isPermaLink="false">http://www.mcbsys.com/techblog/2011/11/get-asterisk-to-use-the-g-729a-codec/</guid>
		<description><![CDATA[I’m using Asterisk 1.8.5 under FreePBX 2.8.1.4. My endpoints (Polycom IP430 phone, SPA3102 ATA) and my ITSP all support the G.729a codec. I wanted to test audio quality using this compressed codec.

G.729a requires that you purchase a license if you are converting (transcoding) the audio to another codec. Although the licenses are inexpensive, I preferred [...]]]></description>
			<content:encoded><![CDATA[<p>I’m using Asterisk 1.8.5 under FreePBX 2.8.1.4. My endpoints (Polycom IP430 phone, SPA3102 ATA) and my ITSP all support the <a href="http://en.wikipedia.org/wiki/G.729" target="_blank">G.729a codec</a>. I wanted to test audio quality using this compressed codec.</p>
<p><span id="more-1016"></span></p>
<p>G.729a requires that you purchase a license if you are converting (transcoding) the audio to another codec. Although the licenses are inexpensive, I preferred to avoid the overhead of transcoding by simply <a href="http://www.voip-info.org/wiki/view/Asterisk+G.729+pass-thru" target="_blank">passing through</a> the G.729a packets.</p>
<p>“Passing through” means that both legs of the call must use G.729a. At first I hoped to be able to use the standard ulaw (G.711u) codec for all calls except those going to my ITSP. However, I eventually found that if the first leg of a call prefers ulaw, and the second leg requires G.729a, Asterisk will not go back and reinvite the first leg using G.729a (see my comment in <a href="http://www.freepbx.org/forum/freepbx/users/force-g729-codec-at-endpoint-phone-on-outbound-sip-trunk#comment-43130" target="_blank">this thread</a>). Bottom line:&nbsp; we need to set up the PBX to use G.729a on <em>all</em> calls, internal and external.</p>
<h3>Setting It Up</h3>
<p>Once that was clear, the setup was fairly simple:</p>
<ol>
<li>Download the current g729 sound files from <a href="http://downloads.asterisk.org/pub/telephony/sounds/" target="_blank">Digium</a>:<br />
<code>asterisk-core-sounds-en-g729-current.tar.gz<br />
asterisk-extra-sounds-en-g729-current.tar.gz</code><br />
These are required for the voicemail system to work after converting to G.729.</li>
<li>On the Asterisk machine, under <code>/var/lib/asterisk/sounds</code>, rename the <code>en</code> directory to <code>en.gsm</code>.</li>
<li>Create a new <code>en</code> directory and extract the new sounds there. Recursively change the group and Owner to <strong>asterisk</strong> and the permissions to <strong>775</strong> to match the original “en” directory.</li>
<li>In the FreePBX admin panel, go to <strong>Tools &gt; Config Edit</strong>. Add the following lines to sip_general_custom.conf:<br />
<code>disallow=all<br />
allow=g729<br />
allow=ulaw<br />
allow=alaw<br />
allow=gsm</code><br />
That puts g729 as the first priority for the whole system.</li>
<li>From the console, open the Asterisk CLI (<strong>asterisk –r</strong>). Make a call and type <strong>sip show channels</strong>. You should see the g729 codec on both legs of the call, whether you call internally or externally. Do try all combinations to make sure that G.729a is supported throughout. If not, the call will fail and you’ll see a corresponding message in the log (Tools &gt; Asterisk Logfiles). (Or if you a the G.729a license, the call will succeed but will be transcoded.)</li>
</ol>
<h3>Update:&nbsp; Still Need to Transcode</h3>
<p><span style="color: #0000ff;"><strong>November 5, 2011:</strong></span> Alas, not as easy as I thought. The above did set up G.729a pass-through on outbound calls. However, some problems remained:</p>
<ul>
<li>Inbound calls through the SPA3102 were still in G.711u format. Since Asterisk tried to use G.729a for the second leg, the call failed without a transcoder. Changing the SPA3102’s Preferred Codec to G729a solved that problem.</li>
<li>Voicemail greetings are not available in .g729 format. Converting from .WAV to .g729, or even creating new greetings in .g729, seems to require a transcoder.</li>
<li>Voicemail messages are not stored in .g729. This can be remedied by adding g729 to the list of formats in <code>voicemail.conf</code>, but still seems to have trouble without a transcoder.</li>
<li>Rod Montgomery, Directory of Services at Digium, writes in <a href="http://www.fonality.com/trixbox/forums/trixbox-pro/trixbox-pro-help/do-we-need-install-g729-if-we-want-use-it" target="_blank">this thread</a> that without a transcoder, Asterisk will not be able to process audio, e.g. DTMF codes for IVR and voicemail. I’m not sure about this one—it seemed to handle the DTMF when I called internally anyway.</li>
</ul>
<p>Bottom line, it still makes sense to set up pass-through for actual phone calls, but there are so many places that audio conversion is needed that it makes sense to get the transcoder. As Mr. Montgomery says in the post linked above, you only need as many licenses as you have simultaneous channels doing transcoding. So if you are making all calls in pass-through mode, you only need a few licenses for receiving and accessing voicemail, and possibly for IVR.</p>
<p>Info on transcoder licensing is available <a href="http://www.voip-info.org/wiki/view/Asterisk+G.729+Licensing" target="_blank">here</a>. For testing purposes, open-source binaries are available <a href="http://asterisk.hosting.lv/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2011/11/get-asterisk-to-use-the-g-729a-codec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping Asterisk Traffic Inside the VPN</title>
		<link>http://www.mcbsys.com/techblog/2009/01/keeping-asterisk-traffic-inside-the-vpn/</link>
		<comments>http://www.mcbsys.com/techblog/2009/01/keeping-asterisk-traffic-inside-the-vpn/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 16:38:11 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[dtmf]]></category>
		<category><![CDATA[piaf]]></category>
		<category><![CDATA[voip]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">/mark/post/Keeping-Asterisk-Traffic-Inside-the-VPN.aspx</guid>
		<description><![CDATA[No DTMF
I&#8217;m setting up a new PBX in a Flash (PiaF) machine running Asterisk 1.4.21.2. I&#8217;m testing it by calling in with SJPhone across a VPN (the PiaF machine is at a client site). When I dial 7777, I get my top-level IVR, but when I press a number, nothing happens. If I dial into [...]]]></description>
			<content:encoded><![CDATA[<h1>No DTMF</h1>
<p>I&#8217;m setting up a new PBX in a Flash (PiaF) machine running Asterisk 1.4.21.2. I&#8217;m testing it by calling in with SJPhone across a VPN (the PiaF machine is at a client site). When I dial 7777, I get my top-level IVR, but when I press a number, nothing happens. If I dial into a voicemail box, the * and # keys have no effect. It seems PiaF is not hearing my DTMF tones at all.<br />
<h1>Unexpected Public Traffic</h1>
<p><span id="more-45"></span></p>
<p>I ran Ethereal to make sure the DTMF digits were being generated, and sure enough, they were. But what&#8217;s this? In spite of using a VPN, the RTP traffic was re-routed to the public Internet address, i.e. to 180.12.12.12. Since the hardware firewall in front of the PiaF machine does not allow inbound RTP traffic from the public Internet, no tones were getting through. But how does it even know to re-route the traffic to the external IP?</p>
<p>I remembered that, based on the <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-PBX-in-a-Flash2c-Part-2-Before-Running-FreePBX.aspx" target="_blank">Part 2</a> of the setup instructions, the section &#8220;Getting Rid of One-Way Audio&#8221; calls for the following modification to /etc/asterisk/sip_custom.conf:</p>
<p><code>externip=180.12.12.12</code></p>
<p>I don&#8217;t really need that now, since I&#8217;m only using analog lines. Commenting out the &#8220;externip&#8221; line does solve the DTMF problem, but what if I want to use a VoIP provider in the future?</p>
<h1>Keep It Inside the VPN</h1>
<p>A glance at Voip-Info&#8217;s <a href="http://www.voip-info.org/wiki/index.php?page=Asterisk+SIP+externip" target="_blank">Asterisk SIP externip</a> article gave me the clue I needed:&#160; all that is required is to add a second localnet line identifying the IP range of the computers at the other end of the VPN. That allows the RTP traffic to stay inside the VPN, and PiaF was again able to &#8220;hear&#8221; DTMF digits. So my sip_custom.conf now looks like this:</p>
<p><code>externip=180.12.12.12<br />
localnet=192.168.1.0/255.255.255.0 ; address range of local computers<br />
localnet=192.168.2.0/255.255.255.0 ; address range of VPN-connected computers</code></p>
<p>If I decide to add VoIP providers in the future, &#8220;all&#8221; I&#8217;ll have to do is to get the firewall set up to allow external (encrypted?) VoIP traffic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2009/01/keeping-asterisk-traffic-inside-the-vpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving PBX in a Flash from a Virtual to a Physical Machine</title>
		<link>http://www.mcbsys.com/techblog/2008/11/moving-pbx-in-a-flash-from-a-virtual-to-a-physical-machine/</link>
		<comments>http://www.mcbsys.com/techblog/2008/11/moving-pbx-in-a-flash-from-a-virtual-to-a-physical-machine/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 17:45:28 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[piaf]]></category>
		<category><![CDATA[v2p]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vm]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">/mark/post/Moving-PBX-in-a-Flash-from-a-Virtual-to-a-Physical-Machine.aspx</guid>
		<description><![CDATA[After running PBX in a Flash (PiaF) in a virtual machine for a few days, I had a couple issues:
The system would generate an occasional message &#8220;TSC appears to be running slowly. Marking it as unstable.&#8221; This issue did not keep the PBX from running.
Voice quality was sometimes jittery. In a call, it would sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>After running PBX in a Flash (PiaF) in a virtual machine for a few days, I had a couple issues:</p>
<p>The system would generate an occasional message &#8220;TSC appears to be running slowly. Marking it as unstable.&#8221; This issue did not keep the PBX from running.</p>
<p>Voice quality was sometimes jittery. In a call, it would sometimes &#8220;cut out&#8221; (like a bad cell connection). In voicemail, even listening to the pre-recorded prompts, there was frequently some garbled-sounding audio.</p>
<p><span id="more-47"></span></p>
<h1>Workarounds</h1>
<p>The jittery voice seemed to be a horsepower issue. It&#8217;s like it couldn&#8217;t read the virtual disk fast enough and/or it couldn&#8217;t process the audio stream fast enough.</p>
<p>I was running PiaF under Microsoft Virtual Server 2005. The host was an old Dell Optiplex GX260, a Pentium 4 2GHz with 1GB of RAM. I dedicated 512MB of RAM to the virtual machine.</p>
<p>I found that if I moved the virtual machine to my IBM T60p laptop (T5300 Dual Core), still with 512MB of RAM, the jittery voice problem went away. I still got the &#8220;TSC&#8221; message, though.</p>
<p>Another workaround is to get Asterisk out of the audio stream altogether. I blogged this <a href="http://blogs.mcbsys.com/mark/post/Getting-Asterisk-to-Bridge-Audio.aspx">here</a>. That solves the problem when two endpoints are talking, but it doesn&#8217;t solve the voicemail problem, and it does limit some of Asterisk&#8217;s features (call recording and transfer, for example).</p>
<h1>Getting Physical</h1>
<p>I concluded that I needed to convert to a physical setup to see if I could permanently solve these issues.</p>
<p>I hated to convert my fully-configured Windows XP machine to a dedicated PiaF box. I noticed in the PiaF status window that it was consistently using less than 40% of the 512MB RAM. Could it possibly run on the old Dell PowerEdge 2400 that has been sitting in the garage collecting dust? That&#8217;s a Pentium III 733 MHz with a whopping 256MB of RAM. Well, doesn&#8217;t hurt to try.</p>
<p>Following the instructions in my earlier posts, skipping the parts relating to virtual machines, I was able to get PiaF installed on the PE 2400 in a little over an hour (it took quite a while to compile Asterisk!). Transferring my setup from the virtual to the physical machine using the FreePBX Backup &#038; Restore functionality was a snap. I forgot the tftp setup at first, but was able to quickly add that, simply copying the contents of /tftpboot from the virtual to the physical machine. </p>
<p>Somewhat to my astonishment, it works great! This old clunker, destined for the <a href="http://www.dell.com/content/topics/global.aspx/corp/pressoffice/en/2008/2008_11_12_rr_000" target="_blank">free Dell recycling at Staples</a>, now has new life. Even without bridging the audio, the jittery voice is gone. I wouldn&#8217;t try this in a large office, but for a home office, it seems fine. In fact, my <a href="http://www.p3international.com/products/special/P4400/P4400-CE.html" target="_blank">Kill A Watt</a> tells me that this old PowerEdge only uses about 75 &#8211; 90 watts of power, not much more than the Optiplex workstation (53 &#8211; 80 watts).</p>
<h1>Conclusions</h1>
<p>I still love the idea of using a virtual machine for a PBX, and with a strong enough host, it&#8217;s probably a viable alternative for production. It&#8217;s definitely a great way to test various configurations and features. And if my physical machine fails, I can boot the virtual machine and have phone service again in about three minutes. But based on the hardware I already have and the Asterisk features I like, it looks like I&#8217;ll be running physical for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2008/11/moving-pbx-in-a-flash-from-a-virtual-to-a-physical-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Asterisk to Bridge Audio</title>
		<link>http://www.mcbsys.com/techblog/2008/11/getting-asterisk-to-bridge-audio/</link>
		<comments>http://www.mcbsys.com/techblog/2008/11/getting-asterisk-to-bridge-audio/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 19:38:00 +0000</pubDate>
		<dc:creator>Mark Berry</dc:creator>
				<category><![CDATA[IT Administration]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[canreinvite]]></category>
		<category><![CDATA[sip]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">/mark/post/Getting-Asterisk-to-Bridge-Audio.aspx</guid>
		<description><![CDATA[In my original PBX in a Flash setup, Asterisk is set to &#8220;listen in&#8221; on calls. One advantage of this is that it can then respond to commands sent from a phone keypad during the call, e.g. to transfer or record the call. However, it does add processing overhead. If your devices support it, you [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://blogs.mcbsys.com/mark/post/Setting-Up-PBX-in-a-Flash2c-Part-3-Configuring-FreePBX.aspx">original PBX in a Flash setup</a>, Asterisk is set to &#8220;listen in&#8221; on calls. One advantage of this is that it can then respond to commands sent from a phone keypad during the call, e.g. to transfer or record the call. However, it does add processing overhead. If your devices support it, you can tell Asterisk to butt out of your conversations, allowing connections to &#8220;bridge&#8221; directly between endpoints and avoid going through Asterisk. Here&#8217;s how.</p>
<p><span id="more-48"></span></p>
<h1>Set Up General Settings</h1>
<p>Log in to the FreePBX administration page and make the following changes:</p>
<ol>
<li>In the left column under Basic, click on General Settings.</li>
<li>At the top of the page, under Dialing Options, set these values:<br />
- Asterisk Dial command options:&nbsp; r<br />
- Asterisk Outbound Dial command options:&nbsp; <em>leave blank</em></li>
<li>Click on Submit.</li>
</ol>
<p>You have now told Asterisk not to listen for DTMF commands to transfer or record calls. Note that this means you will not be able to do any transfers from an analog phone connected to an FXS port. However, a SIP phone can &#8220;break in&#8221; to a call to do a transfer, put the call on hold, etc.</p>
<h1>Set Up Extensions</h1>
<p>Log in to the FreePBX administration page and make the following changes:</p>
<ol>
<li>In the left column under Basic, click on Extensions.</li>
<li>From the list at the right side of the page, click on each extension that is connected to a device that supports the &#8220;reinvite&#8221; command. (I&#8217;m using a Linksys SPA3102 and a Polycom IP430, both of which support reinvites.) Under Device Options, set this value:<br />
<span style="font-family: Courier New;">canreinvite=nonat</span></li>
<li>Click on Submit after changing each extension.</li>
</ol>
<p>This tells Asterisk that the device can handle a reinvite as long as the device is not behind a NAT.</p>
<h1>Set Up Trunks</h1>
<p>Log in to the FreePBX administration page and make the following changes:</p>
<ol>
<li>In the left column under Basic, click on Trunks.</li>
<li>From the list at the right side of the page, click on each trunk is connected to a device that supports the &#8220;reinvite&#8221; command. (The Linksys SPA3102 also supports reinvites on the trunk or PSTN side.) In the PEER Details box, add this line:<br />
<code>canreinvite=nonat</code></li>
</ol>
<p>This tells Asterisk that the trunk can handle a reinvite as long as the device is not behind a NAT.</p>
<h1>Apply Your Changes</h1>
<p>Once you have updated the General Settings, Extensions, and Trunks, click on the orange bar at the top of the FreePBX administration page, then confirm. That&#8217;s it! Asterisk will now get out of the way whenever possible.</p>
<h1>Testing</h1>
<p>If you know how to use a packet sniffer, you should be able to see the difference in how the RTP (audio) packets are routed:&nbsp; the source and destination will no longer include the Asterisk server.</p>
<p>A simpler method:&nbsp; once the dial plans have been updated as described above, start the Asterisk Command Line Interface (CLI) with a verbosity of 3 (<code>asterisk -r -vvv</code>). Call in from an outside line and answer the internal extension. Right after you answer, you should see a message like this:</p>
<p style="padding-left: 30px;"><code>Native bridging SIP/Personal-12345678 and SIP/20-abcdefgh</code></p>
<p>If instead you see this:</p>
<p style="padding-left: 30px;"><code>Packet2Packet bridging SIP/Personal-12345678 and SIP/20-abcdefgh</code></p>
<p>then Asterisk is still &#8220;in&#8221; the media stream, but the RTP packets are not going through the Asterisk core.</p>
<p><strong>Tip:</strong>&nbsp; to reduce the level of verbosity, while still in the Asterisk CLI, type</p>
<p style="padding-left: 30px;"><code>core set verbose 0</code></p>
<p>That makes it easier to use the <code>sip show</code> commands described below.</p>
<h1>References</h1>
<p>Voip-Info has a long and informative article titled <a href="http://www.voip-info.org/wiki/view/Asterisk+sip+canreinvite" target="_blank">Asterisk sip canreinvite</a>. It even includes instructions on how to use the <code>tcpdump</code> packet sniffer from the Linux command line.</p>
<p>The <a href="http://www.asterisk.org/doxygen/trunk/Config_sip.html" target="_blank">default sip.conf from Digium</a> explains the <code>canreinvite=nonat</code> option, new in Asterisk 1.4:</p>
<blockquote><p>An additional option is to allow media path redirection (reinvite) but only when the peer where the media is being sent is known to not be behind a NAT (as the RTP core can determine it based on the apparent IP address the media arrives from).</p></blockquote>
<p>From Joshua Colp, Software Developer at Digium, comes <a href="http://lists.digium.com/pipermail/asterisk-users/2007-March/181854.html" target="_blank">this explanation</a> of bridging:</p>
<blockquote><p>Packet2Packet Bridging = Audio is not going through the Asterisk core, it comes into the RTP stack and goes directly out. This decreases the amount of memory allocation that happens, and things require less processing.</p>
<p>Native Bridging = Audio was reinvited between the two endpoints so it (should) go direct.</p></blockquote>
<p>as well as <a href="http://lists.digium.com/pipermail/asterisk-users/2007-March/181915.html" target="_blank">this helpful note</a> on checking for how Asterisk is handling audio:</p>
<blockquote><p>During the call, run <code>sip show channel xxxyyzz</code> and check &#8220;Audio IP&#8221;. If the audio IP doesn&#8217;t belong to your Asterisk server, media is handled through the native bridge.</p></blockquote>
<p>To get the channel name for that command, while in a call, type <code>sip show channels</code>. Both commands are executed from the Asterisk CLI.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcbsys.com/techblog/2008/11/getting-asterisk-to-bridge-audio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

