<?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>Blog de Stéphane Berthelot &#187; asterisk faxdetect sip</title>
	<atom:link href="http://stephane.emisfr.info/tag/asterisk-faxdetect-sip/feed/" rel="self" type="application/rss+xml" />
	<link>http://stephane.emisfr.info</link>
	<description>Fan d’opensource, de technologies et d’autres choses palpitantes...</description>
	<lastBuildDate>Tue, 23 Nov 2010 10:35:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SIP Fax detection with Asterisk 1.6.2.0</title>
		<link>http://stephane.emisfr.info/2009/05/15/sip-fax-detection-with-asterisk-1620/</link>
		<comments>http://stephane.emisfr.info/2009/05/15/sip-fax-detection-with-asterisk-1620/#comments</comments>
		<pubDate>Fri, 15 May 2009 17:50:56 +0000</pubDate>
		<dc:creator>sberthelot</dc:creator>
				<category><![CDATA[Général @en]]></category>
		<category><![CDATA[asterisk faxdetect sip]]></category>

		<guid isPermaLink="false">http://stephane.emisfr.info/?p=9</guid>
		<description><![CDATA[Here it goes again, still the same problems for detecting voice based fax calls on Asterisk 1.6. I know that &#171;&#160;we should use T38&#8243; or &#171;&#160;get a decent SIP provider&#160;&#187; are all along the way but hey! I&#8217;m using Free with it&#8217;s freephonie service in France and we&#8217;re even getting multiple ADSL connections (from different [...]]]></description>
			<content:encoded><![CDATA[<p>Here it goes again, still the same problems for detecting voice based fax calls on Asterisk 1.6.</p>
<p>I know that &laquo;&nbsp;we should use T38&#8243; or &laquo;&nbsp;get a decent SIP provider&nbsp;&raquo; are all along the way but hey! I&#8217;m using Free with it&#8217;s freephonie service in France and we&#8217;re even getting multiple ADSL connections (from different companies that are in the same building) and bridged them together to an Asterisk server.</p>
<p>It&#8217;s very handy, we get SIP trunking for a very small fee : free <img src='http://stephane.emisfr.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but in fact it&#8217;s in a whole package for 30€ per month : ADSL2+, Free telephony, HD TV (tax included)</p>
<p>So, I wanted to post about the recent &laquo;&nbsp;patch&nbsp;&raquo; I prepared after upgrading to Asterisk 1.6.2.0-beta2.</p>
<p>Why upgrade to a beta version ? Simple, since there was advertised Fax detection support for T38 (which should work, I didn&#8217;t test since I don&#8217;t have a decent provider with T38 support <img src='http://stephane.emisfr.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p>Looking at the chan_sip.c code I figured out it was very easy to tweak the fax detection code to also do detection on SIP audio channels,but &#8230; I was plain wrong ! In fact it could have worked but it&#8217;s much more difficult than it seems. To make a long story short, I looked more deeply at the NV Faxdetect applications (from Justin Newman) and in fact they use a similar approach that the one I finally got through : use Asterisk DSP to actually do the detection and then branch on the dialplan to &laquo;&nbsp;fax&nbsp;&raquo; extension (code already done in 1.6.2 for T38 only).</p>
<p>Removing specific T38 tests I almost got through after spending 3 hours to finally get to a point that was very near NV Faxdetect : I first had to switch to slinear before using DSP (or it wouldn&#8217;t detect faxes at all, if someone knows why please tell me <img src='http://stephane.emisfr.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) and then switch back to alaw or ulaw (what came first) to get the call through.</p>
<p>Seing that I needed to patch chan_sip.c alot with very dirty hacks I finally decided to go back on app_nv_faxdetect.c and app_nv_backgrounddetect.c and simply patch them (with very little effort surprisingly) and got them to work perfectly with Asterisk 1.6.2.0-beta2 (the patch should certainly apply to later 1.6.2.x version relatively cleanly, just make sure to apply it on vanilla sources *before* ./configure and make menuselect ; issue a make distclean if you didn&#8217;t)</p>
<p>I remembered I used to leave some mails to Justin, asking me to wait for a new version to come out and many people on http://www.voip-info.org seemed to have tried to patch it (or at least asked to) and noone managed to get a working version for 1.6.x.</p>
<p>Here it goes, but I&#8217;m very surprised I had to change very little portions of code (nothing really important, only definition and variable name changes) and everything has been working very well here for more than 2 weeks, with more than a dozen faxes correctly detected.</p>
<p>If you need to, leave me a comment since I started to test at home (yes I also have an Asterisk box at home <img src='http://stephane.emisfr.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) and I patched a version for Asterisk 1.6.1.0 that compiled and worked flawlessly.</p>
<p>Be sure to grab the patch attached here and enjoy your fax detection on voice part of SIP channels <img src='http://stephane.emisfr.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://stephane.emisfr.info/files/2009/05/asterisk-1620-beta2-faxdetect.diff">asterisk-1620-beta2-faxdetect.diff</a></p>
<p>See you for other Asterisk weirdnesses, I have some more to post !!</p>
]]></content:encoded>
			<wfw:commentRss>http://stephane.emisfr.info/2009/05/15/sip-fax-detection-with-asterisk-1620/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

