<?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>Fred Posner (.com) &#187; Asterisk</title>
	<atom:link href="http://www.fredposner.com/tag/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fredposner.com</link>
	<description>The World of FISPosner.</description>
	<lastBuildDate>Fri, 27 Jan 2012 21:26:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Astricon, here I come!</title>
		<link>http://www.fredposner.com/miscellaneous/640/astricon-here-i-come/</link>
		<comments>http://www.fredposner.com/miscellaneous/640/astricon-here-i-come/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 21:42:19 +0000</pubDate>
		<dc:creator>Fred Posner</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Astricon]]></category>
		<category><![CDATA[Fred Posner]]></category>
		<category><![CDATA[Yeni]]></category>

		<guid isPermaLink="false">http://www.fredposner.com/?p=640</guid>
		<description><![CDATA[It&#8217;s October and that means I&#8217;m going to Phoenix! Astricon, the meet-up of Asterisk users / developers / fans / etc, starts October 13th, and this year I received the honor of presenting. My talk, Asterisk Applications: Unexpected Hurdles, showcases &#8230; <a href="http://www.fredposner.com/miscellaneous/640/astricon-here-i-come/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_641" class="wp-caption alignright" style="width: 217px"><a href="http://www.astricon.net" onclick="pageTracker._trackPageview('/outgoing/www.astricon.net?referer=');"><img class="size-full wp-image-641" title="astricon-posner" src="http://www.fredposner.com/wp-content/uploads/2009/10/astricon-posner.jpg" alt="Fred Posner @ Astricon 2009" width="207" height="216" /></a><p class="wp-caption-text">Fred Posner @ Astricon 2009</p></div>
<p>It&#8217;s October and that means I&#8217;m going to Phoenix!</p>
<p>Astricon, the meet-up of Asterisk users / developers / fans / etc, starts October 13th, and this year I received the honor of presenting. My talk, Asterisk Applications: Unexpected Hurdles, showcases the Ann Arbor Parking &#8220;Smackdown&#8221; earlier this year.</p>
<p>As an added benefit&#8230; my Wife will be joining me <img src='http://www.fredposner.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fredposner.com/miscellaneous/640/astricon-here-i-come/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Telemarketers Schmelemarketers</title>
		<link>http://www.fredposner.com/rant/614/telemarketers-schmelemarketers/</link>
		<comments>http://www.fredposner.com/rant/614/telemarketers-schmelemarketers/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 05:07:15 +0000</pubDate>
		<dc:creator>Fred Posner</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[Asterisk]]></category>

		<guid isPermaLink="false">http://www.fredposner.com/?p=614</guid>
		<description><![CDATA[Today I posted some recordings I made using something I like to call the &#8220;Annoyatron.&#8221; Basically, using Asterisk (the open source Internet Telephony software) allows me to handle incoming calls based on a variety of issues. Bottom Line: If I &#8230; <a href="http://www.fredposner.com/rant/614/telemarketers-schmelemarketers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_620" class="wp-caption alignright" style="width: 209px"><a href="http://www.fredposner.com/wp-content/uploads/2009/07/2009-07-17-IMG_51051.jpg"><img class="size-medium wp-image-620" title="2009-07-17-IMG_5105" src="http://www.fredposner.com/wp-content/uploads/2009/07/2009-07-17-IMG_51051-199x300.jpg" alt="GRRRRR Telemarketers!" width="199" height="300" /></a><p class="wp-caption-text">GRRRRR Telemarketers!</p></div>
<p>Today I posted some recordings I made using something I like to call the &#8220;Annoyatron.&#8221; Basically, using Asterisk (the open source Internet Telephony software) allows me to handle incoming calls based on a variety of issues.</p>
<p><strong>Bottom Line:</strong> If I know you&#8217;re a telemarketer, you get the annoyatron.</p>
<p><a href="http://www.voiptechchat.com/voip/286/asterisk-101-uses-telemarketer-torture/" onclick="pageTracker._trackPageview('/outgoing/www.voiptechchat.com/voip/286/asterisk-101-uses-telemarketer-torture/?referer=');">The full article is posted on VoIP Tech Chat.</a></p>
<p>You know&#8230; while you&#8217;re checking out the link above, try other articles on VoIP Tech Chat&#8230; lots of great things to read. Some are even&#8230; dare I say&#8230; entertaining?</p>
<p>Take for example that link above&#8230; it has audio of the annoyatron in action. And not just one example. Please, that would be amateur. Friends, I say friends, we here have for your listening pleasure not 1 but 2, I say TWO great examples of the FIS Annoyatron. Come one, come all, welcome to the show!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fredposner.com/rant/614/telemarketers-schmelemarketers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Geeky Item of the Day &#8211; Free CNAM</title>
		<link>http://www.fredposner.com/voip/413/geeky-item-of-the-day-free-cnam/</link>
		<comments>http://www.fredposner.com/voip/413/geeky-item-of-the-day-free-cnam/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 13:57:57 +0000</pubDate>
		<dc:creator>Fred Posner</dc:creator>
				<category><![CDATA[VoIP]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.fredposner.com/?p=413</guid>
		<description><![CDATA[Ok, if you use Asterisk (or a Do It Yourself type VoIP service), you sometimes do not receive the CNAM (think Caller ID with Name data) from your carrier. Well, since geeks like information and anything &#8220;free,&#8221; there&#8217;s a simple &#8230; <a href="http://www.fredposner.com/voip/413/geeky-item-of-the-day-free-cnam/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ok, if you use Asterisk (or a Do It Yourself type VoIP service), you sometimes do not receive the CNAM (think Caller ID with Name data) from your carrier. Well, since geeks like information and anything &#8220;free,&#8221; there&#8217;s a simple way to use the internet to do a reverse number lookup query. So, if you&#8217;re a technical type, keep reading&#8230; otherwise, non-geek posts will return very soon.</p>
<p><span id="more-413"></span>So, using a simple Perl script, you can check many resources and attempt to get the calling party&#8217;s name. There are tons of caller id lookup scripts out there, but most require the Asterisk Perl AGI module, a localized NPA/NXX database, or a local database query.</p>
<p>Since I don&#8217;t like installing the module, don&#8217;t want to install a local lookup table, and don&#8217;t wish to cache CID names in a database, I&#8217;ve modified publicly available scripts as follows (<a href="http://www.teamforrest.com/voip/89/using-agi-to-get-caller-id-name-cnam/" onclick="pageTracker._trackPageview('/outgoing/www.teamforrest.com/voip/89/using-agi-to-get-caller-id-name-cnam/?referer=');">also, check up the write up on Team Forrest, with a little more detail</a>):</p>
<p class="alert">Update: AnyWho changed their url and format, the new code is live on <a href="http://www.teamforrest.com/voip/89/using-agi-to-get-caller-id-name-cnam/" onclick="pageTracker._trackPageview('/outgoing/www.teamforrest.com/voip/89/using-agi-to-get-caller-id-name-cnam/?referer=');">Team Forrest</a> but the old code is still below.</p>
<pre>#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
$|=1;
sub trim($);

my %AGI; my $tests = 0; my $fail = 0; my $pass = 0; my $result = ""; my $cidnum = ""; my $cidname = "";
my $npa = ""; my $nxx = ""; my $station = ""; my $name = "";

$cidnum = $ARGV[0];

while(&lt;STDIN&gt;) {
	chomp;
	last unless length($_);
	if (/^agi_(\w+)\:\s+(.*)$/) {
		$AGI{$1} = $2;
	}
}

my $AnyWho = '1' ;
my $Google = '1' ;
my $www411 = '1' ;

if(substr($cidnum,0,1) eq '1'){
$cidnum=substr($cidnum,1);
}

if(substr($cidnum,0,2) eq '+1'){
$cidnum=substr($cidnum,2);
}

if ($cidnum =~ /^(\d{3})(\d{3})(\d{4})$/) {
	$npa = $1;
	$nxx = $2;
	$station = $3;
	}
elsif($cidnum =~/\&lt;(\d{3})(\d{3})(\d{4})\&gt;/){
	$npa = $1;
	$nxx = $2;
	$station = $3;
	}
else {
	print qq(VERBOSE "ERROR: unable to parse caller id" 2\n);
	exit(0);
} 

if ($AnyWho &gt; '0') {
	print qq(VERBOSE "STATUS: checking AnyWho for name lookup" 2\n);
	if ($name = &amp;anywho_lookup ($npa, $nxx, $station)) {
		$cidname = $name;
		print qq(SET VARIABLE CALLERID\(name\) "$cidname"\n);
		print qq(VERBOSE "STATUS: AnyWho said name was $cidname " 2\n);
		exit(0);
		}
	else {
		print qq(VERBOSE "STATUS: unable to find name with AnyWho" 2\n);
		}
	}
else {
	print qq(VERBOSE "STATUS: AnyWho lookup disabled" 2\n);
}

if ($Google &gt; '0') {
	print qq(VERBOSE "STATUS: checking Google for name lookup" 2\n);
	if ($name = &amp;google_lookup ($npa, $nxx, $station)) {
		$cidname = $name;
		print qq(SET VARIABLE CALLERID\(name\) "$cidname"\n);
		print qq(VERBOSE "STATUS: Google said name was $cidname " 2\n);
		exit(0);
		}
	else {
		print qq(VERBOSE "STATUS: unable to find name with Google" 2\n);
		}
	}
else {
	print qq(VERBOSE "STATUS: Google lookup disabled" 2\n);
}

if ($www411 &gt; '0') {
	print qq(VERBOSE "STATUS: checking www411 for name lookup" 2\n);
	if ($name = &amp;www411_lookup ($npa, $nxx, $station)) {
		$cidname = $name;
		print qq(SET VARIABLE CALLERID\(name\) "$cidname"\n);
		print qq(VERBOSE "STATUS: www411 said name was $cidname " 2\n);
		exit(0);
		}
	else {
		print qq(VERBOSE "STATUS: unable to find name with www411" 2\n);
		}
	}
else {
	print qq(VERBOSE "STATUS: www411 lookup disabled" 2\n);
}

print qq(SET VARIABLE CALLERID\(name\) "$cidnum"\n);
print qq(VERBOSE "STATUS: Unknown name for $cidnum " 2\n);
exit(0); 

sub anywho_lookup {
	my ($npa, $nxx, $station) = @_;
	my $ua = LWP::UserAgent-&gt;new( timeout =&gt; 45);
	my $URL = 'http://www.anywho.com/qry/wp_rl';
	$URL .= '?npa=' . $npa . '&amp;telephone=' . $nxx . $station;
	$ua-&gt;agent('AsteriskAGIQuery/1');
	my $req = new HTTP::Request GET =&gt; $URL;
	my $res = $ua-&gt;request($req);
	if ($res-&gt;is_success()) {
		if ($res-&gt;content =~ /&lt;!-- listing --&gt;(.*)&lt;!-- \/listing --&gt;/s) {
			my $listing = $1;
			if ($listing =~ /&lt;B&gt;(.*)&lt;\/B&gt;/) {
				my $clidname = $1;
				return $clidname;
			}
		}
	}
	return "";
}

sub google_lookup {
  my ($npa, $nxx, $station) = @_;
  my $ua = LWP::UserAgent-&gt;new( timeout =&gt; 45);
  my $URL = 'http://www.google.com/search?rls=en&amp;q=phonebook:' .  $npa . $nxx . $station . '&amp;ie=UTF-8&amp;oe=UTF-8';
  $ua-&gt;agent('AsteriskAGIQuery/1');
  my $req = new HTTP::Request GET =&gt; $URL;
  my $res = $ua-&gt;request($req);
  if ($res-&gt;is_success()) {
    if ($res-&gt;content =~ /&lt;font size=-2&gt;&lt;br&gt;&lt;\/font&gt;&lt;font size=-1&gt;(.+)&lt;font color=green&gt;/) {
      my $temp = $1;
      my $clidname = "";
      if ( $temp =~ /(.+)&lt;font color=green&gt;/o ) {
        $clidname = substr($1, 0, -3);
      } else {
        $clidname = substr($temp, 0, -3);
      }
      if ($clidname =~ /&lt;a href(.+)\//) {
        $clidname = $1 ;
        if ($clidname =~ /&gt;(.+)&lt;/) {
          $clidname = $1 ;
        }
      }
      return $clidname;
    }
  }
  return "";
} 

sub www411_lookup {
  my ($npa, $nxx, $station) = @_;
  my $ua = LWP::UserAgent-&gt;new( timeout =&gt; 45);
  my $URL = 'http://www.411.com/search/Reverse_Phone?phone=' .  $npa . $nxx . $station;
  $ua-&gt;agent('AsteriskAGIQuery/1');
  my $req = new HTTP::Request GET =&gt; $URL;
  my $res = $ua-&gt;request($req);
  if ($res-&gt;is_success()) {
    if ($res-&gt;content =~ /Location: &lt;strong&gt;(.*)&lt;\/strong&gt;/s) {
      my $temp = $1;
      my $clidname = "";
      $temp =~ s/&amp;amp\;/&amp;/g;
      $temp =~ s/%20/ /g;
						$clidname = $temp;
		    return $clidname;
     }
  }
  return "";
}</pre>
<p>Basically, what the script does is lookup the cidname from the CID number. I pass the script an argument (the caller id number) and it checks AnyWho, Google, and 411.com (in order). I chose 411 last and just use it to replace an NPA/NXX table. Basically, if AnyWho and Google fail, I&#8217;m assuming it&#8217;s a cell phone or unlisted number and will assume 411 will only return a location. If all fails, the script sets the callerid name to be the callerid number.</p>
<p>I&#8217;ve integrated it into asterisk by first creating a lookup context:</p>
<pre>[cidname-lookup]
exten =&gt; s,1,NoOp(looking up callerid name)
exten =&gt; s,n,GotoIf($["foo${CALLERID(NAME)}" = "foo" ]?getname)
exten =&gt; s,n,GotoIf($["${CALLERID(NAME)}" = "${CALLERID(NUM)}" ]?getname)
exten =&gt; s,n,NoOp(caller id name exists as ${CALLERID(NAME)})
exten =&gt; s,n,Return
exten =&gt; s,n(getname),AGI(calleridname.pl,${CALLERID(NUM)})
exten =&gt; s,n,NoOp(Caller ID Name is now ${CALLERID(NAME)})
exten =&gt; s,n,Return</pre>
<p>Basically, if the callerid name is present (and not the phonenumber), run the script. You can then call the script from anywhere in your Asterisk dialplan using a gosub routine. Such as:</p>
<pre>exten =&gt; s,n,Gosub(cidname-lookup,s,1)
exten =&gt; s,n,dial(${FREDPHONE},30,mt)</pre>
<p>Are there other ways to do this? Absolutely. And some even better <img src='http://www.fredposner.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This way works for me&#8230; until I see a better way of doing it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fredposner.com/voip/413/geeky-item-of-the-day-free-cnam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s Monday. Ummm. Monday.</title>
		<link>http://www.fredposner.com/family/288/its-monday-ummm-monday/</link>
		<comments>http://www.fredposner.com/family/288/its-monday-ummm-monday/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 20:25:21 +0000</pubDate>
		<dc:creator>Fred Posner</dc:creator>
				<category><![CDATA[Family]]></category>
		<category><![CDATA[Gators]]></category>
		<category><![CDATA[Harley-Davidson]]></category>
		<category><![CDATA[SEC]]></category>
		<category><![CDATA[Yeni]]></category>
		<category><![CDATA[Ann Arbor]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Cannoli]]></category>
		<category><![CDATA[FBI]]></category>
		<category><![CDATA[Fred Posner]]></category>
		<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Pizza]]></category>
		<category><![CDATA[Thanksgiving]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.fredposner.com/?p=288</guid>
		<description><![CDATA[Good morning world and welcome to the snowed in Monday morning edition of Fred Posner dot com. Let&#8217;s discuss the weekend&#8230; Not much happened. Let&#8217;s see, in random order: Yeni and I had Pizza so good I reactivated Fat Freddy &#8230; <a href="http://www.fredposner.com/family/288/its-monday-ummm-monday/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_289" class="wp-caption alignright" style="width: 310px"><a href="http://picasaweb.google.com/fatfreddysays/Thanksgiving2008" onclick="pageTracker._trackPageview('/outgoing/picasaweb.google.com/fatfreddysays/Thanksgiving2008?referer=');"><img class="size-medium wp-image-289" title="thankgiving-2008-fred-posner" src="http://www.fredposner.com/wp-content/uploads/2008/12/thankgiving-2008-fred-posner-300x199.jpg" alt="Fred with family at Thanksgiving" width="300" height="199" /></a><p class="wp-caption-text">Fred with family at Thanksgiving</p></div>
<p>Good morning world and welcome to the snowed in Monday morning edition of Fred Posner dot com. Let&#8217;s discuss the weekend&#8230;</p>
<p>Not much happened. Let&#8217;s see, in random order:</p>
<ul>
<li>Yeni and I had <a href="http://fatfreddysays.com/2008/12/07/bella-italia-pizza-pasta-ann-arbor/" onclick="pageTracker._trackPageview('/outgoing/fatfreddysays.com/2008/12/07/bella-italia-pizza-pasta-ann-arbor/?referer=');">Pizza so good</a> I reactivated <a href="http://fatfreddysays.com/2008/12/07/bella-italia-pizza-pasta-ann-arbor/" onclick="pageTracker._trackPageview('/outgoing/fatfreddysays.com/2008/12/07/bella-italia-pizza-pasta-ann-arbor/?referer=');">Fat Freddy Says</a></li>
<li>The Gators beat Alabama and are headed to Miami for the Championship Game</li>
<li>My Harley is back from the dealer&#8230; and is pretty much packed away until March (but sounds GREAT with my new pipes)</li>
<li>Thanksgiving Pictures were <a href="http://picasaweb.google.com/fatfreddysays/Thanksgiving2008" onclick="pageTracker._trackPageview('/outgoing/picasaweb.google.com/fatfreddysays/Thanksgiving2008?referer=');">posted</a></li>
<li><a href="http://www.voiptechchat.com/voip/146/fbi-security-warnings-and-voip/" onclick="pageTracker._trackPageview('/outgoing/www.voiptechchat.com/voip/146/fbi-security-warnings-and-voip/?referer=');">Blogged about an idiotic FBI Warning</a></li>
<li>Yeni and I started on the Holiday Vegitation</li>
<li>and the <a href="http://www.washingtonpost.com/wp-dyn/content/article/2008/12/08/AR2008120802200.html?hpid=topnews" onclick="pageTracker._trackPageview('/outgoing/www.washingtonpost.com/wp-dyn/content/article/2008/12/08/AR2008120802200.html?hpid=topnews&amp;referer=');">Chicago Tribune filed for bankruptcy</a>.</li>
</ul>
<p>And how&#8217;s your day? Feel free to comment <img src='http://www.fredposner.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fredposner.com/family/288/its-monday-ummm-monday/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

