<?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>Sekiur My Thoughts &#187; iax</title>
	<atom:link href="http://blog.sekiur.com/tag/iax/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sekiur.com</link>
	<description>VoIP, Mobility, Security, Open Source, Science, Politics, and Technology.</description>
	<lastBuildDate>Wed, 24 Aug 2011 19:46:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Monitoring VoIP Trunks</title>
		<link>http://blog.sekiur.com/2008/12/monitoring-voip-trunks/</link>
		<comments>http://blog.sekiur.com/2008/12/monitoring-voip-trunks/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 03:28:19 +0000</pubDate>
		<dc:creator>Jose Vicente Ortega</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[iax]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[sip]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">http://blog.sekiur.com/?p=662</guid>
		<description><![CDATA[<p><a href="http://blog.sekiur.com/wp-content/uploads/2008/12/monitoring2.jpg"></a>Using VoIP lines to save on long distance and/or international calls is smart but real savings come in when you are able to dump your landline and go all the way with VoIP.</p> <p>Over the years the technology has matured to the point where its possible to provide reliable phone service over the Internet. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.sekiur.com/wp-content/uploads/2008/12/monitoring2.jpg"><img class="alignleft size-medium wp-image-664" title="monitoring2" src="http://blog.sekiur.com/wp-content/uploads/2008/12/monitoring2-300x200.jpg" alt="" width="300" height="200" /></a>Using VoIP lines to save on long distance and/or international calls is smart but real savings come in when you are able to dump your landline and go all the way with VoIP.</p>
<p>Over the years the technology has matured to the point where its possible to provide reliable phone service over the Internet. Vonage being a pioneer in this market and recently major telcos offering this service to their existing client base has begun to erode the excepticism on VoIP.</p>
<p>When migrating for landline to VoIP its very important for the service to just work. People expect the phone to have a dial tone when its picked up just as they expect the lights to come on when the switch is flipped. It has become a utility.</p>
<p>Even though VoIP has come a long way, its important to keep an eye on it. Because voice now travels the same path that data those, there is a wide variety of tools available to measure and monitor performance and availability.</p>
<p>The script below allows you to e-mail you the status of a SIP or IAX trunk on an asterisk based VoIP phone system. The script scheduled every 5 minutes would check the status of the registration status for the specific trunk.</p>
<p>We being by creating two files in the /etc/asterisk directory.</p>
<ul>
<li>trunkalerts_iax.txt</li>
<li>trunkalerts_sip.txt</li>
</ul>
<p>Each file contains the registration domain and port as shown when querying sip and iax registrations.</p>
<p><strong>Example of trunkalerts_sip.txt</strong></p>
<blockquote><p>sip.broadvoice.com:5060</p></blockquote>
<p><strong>Script:</strong> (download <a href="http://blog.sekiur.com/dl/trunk-down-notify.sh" target="_self">here</a>)</p>
<p>#!/usr/bin/perl</p>
<p>################################################## #############################<br />
##################### ###########################<br />
####<br />
#### Trunk Alerts script written by Jim Hribnak Oct 7th 2007<br />
#### if there is any questions please feel free to drop me an email at jimh at d<br />
omain nucleus.com<br />
#### Called using Cron job</p>
<p>################################################## #############################<br />
##################### ###########################<br />
####<br />
#### Create the following 2 files in /etc/asterisk<br />
####<br />
#### in the files below add the hosts entry from asterisk -rx &#8220;sip show registry<br />
&#8221; and<br />
#### from asterisk -rx &#8220;iax2 show registry&#8221;.<br />
####</p>
<p>open(IAXTRUNKS,&#8221;/etc/asterisk/trunkalerts_iax.txt&#8221;);<br />
open(SIPTRUNKS,&#8221;/etc/asterisk/trunkalerts_sip.txt&#8221;);</p>
<p>################################################## #############################<br />
##################### ###########################<br />
####<br />
#### SIP Related Code<br />
####</p>
<p>#print &#8220;================================================= ===========\n&#8221;;<br />
#print &#8220;SIP Trunk information\n&#8221;;<br />
#print &#8220;================================================= ===========\n&#8221;;</p>
<p>while (&lt;SIPTRUNKS&gt;) {<br />
chomp;<br />
$siptrunks = `/usr/sbin/asterisk -rx &#8220;sip show registry&#8221; |grep \&#8221;$_\&#8221; | awk &#8216;{pr<br />
int $4}&#8217;`;</p>
<p>#print &#8220;siptrunks = $siptrunks\n&#8221;;<br />
if ($siptrunks =~ &#8220;Registered&#8221;) {<br />
#print &#8220;$_ is up\n&#8221; ;</p>
<p>} else {<br />
#print &#8220;We have a problem\n&#8221;;<br />
print &#8220;$_ trunk is not registering\n&#8221;;<br />
mailalert();</p>
<p>}<br />
} #end of while loop (read SIP file)</p>
<p>################################################## #############################<br />
##################### ###########################<br />
####<br />
#### IAX Related Code<br />
####</p>
<p>#print &#8220;\n\n============================================= ===============\n&#8221;;<br />
#print &#8220;IAX2 Trunk information\n&#8221;;<br />
#print &#8220;================================================= ===========\n&#8221;;</p>
<p>while (&lt;IAXTRUNKS&gt;) {<br />
chomp;<br />
$iaxtrunks = `/usr/sbin/asterisk -rx &#8220;iax2 show registry&#8221; |/bin/grep \&#8221;$_\&#8221; | aw<br />
k &#8216;{print $5}&#8217;`;</p>
<p>#print &#8220;iaxtrunks = $iaxtrunks\n&#8221;;</p>
<p>if ($iaxtrunks =~ &#8220;Registered&#8221;) {<br />
#print &#8220;$_ is up\n&#8221; ;</p>
<p>} else {<br />
mailalert();<br />
print &#8220;We have a problem\n&#8221;;<br />
print &#8220;$_ trunk is not registering\n&#8221;;<br />
my $subject = &#8220;Subject: TRUNK $iaxtrunks is DOWN!!!!\n&#8221;;<br />
my $content = &#8220;TRUNK $iaxtrunks is DOWN!!!!\n&#8221;;</p>
<p>}<br />
} #end of while loop (read SIP file)</p>
<p>################################################## ########################<br />
####<br />
#### Email Subroutines<br />
#### Change anywhere below where there is an email address an email addres<br />
#### must have \@ as perl needs to escape the @ symbol<br />
####<br />
################################################## ########################</p>
<p>sub mailalert {</p>
<p>my $sendmail = &#8220;/usr/sbin/sendmail -t&#8221;;<br />
my $from= &#8220;FROM: &lt;pbx\@sekiur.com&gt;\n&#8221;; #replace xxx with your FROM email ID<br />
my $reply_to = &#8220;Reply-to: &lt;support\@sekiur.com\n&#8221;;<br />
my $subject = &#8220;Subject: $_ is DOWN!!!!\n&#8221;;<br />
my $content = &#8220;TRUNK $_ is DOWN!!!!\n&#8221;;<br />
my $send_to = &#8220;To:&lt;support\@sekiur.com&gt;\n&#8221;; #replace xxx with your TO email ID<br />
open(SENDMAIL, &#8220;|$sendmail&#8221;) or die &#8220;Cannot open $sendmail: $!&#8221;;<br />
print SENDMAIL $from;<br />
print SENDMAIL $reply_to;<br />
print SENDMAIL $subject;<br />
print SENDMAIL $send_to;<br />
print SENDMAIL $content;<br />
close(SENDMAIL);</p>
<p>#log<br />
my $logfile = &#8220;/var/log/asterisk/trunkfailure.log&#8221;;<br />
my $date = localtime();<br />
my $logmsg = &#8220;$date TRUNK $_ is down&#8221;;<br />
open LOGFILE, &#8220;&gt;&gt;$logfile&#8221; or die &#8220;cannot open logfile $logfile for append: $!&#8221;;<br />
print LOGFILE $logmsg, &#8220;\n&#8221;;<br />
close LOGFILE;</p>
<p>print &#8220;An email has been sent!\n\n&#8221;;<br />
}</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-3340920433757461";
google_ui_features = "rc:10";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";

//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sekiur.com/2008/12/monitoring-voip-trunks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting Two Asterisk @Home Servers via IAX2</title>
		<link>http://blog.sekiur.com/2005/06/connecting-two-asterisk-home-servers-via-iax2/</link>
		<comments>http://blog.sekiur.com/2005/06/connecting-two-asterisk-home-servers-via-iax2/#comments</comments>
		<pubDate>Sat, 25 Jun 2005 22:06:26 +0000</pubDate>
		<dc:creator>Jose Vicente Ortega</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[iax]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">http://blog.sekiur.com/?p=48</guid>
		<description><![CDATA[<p>I have found very scattered and little documentation on connecting two asterisk servers via IAX2, so I decided to put these words together. <a href="http://en.wikipedia.org/wiki/IAX2" target="_blank">IAX2</a> is a protocol that plays nice with NAT and very powerful.</p> <p>The most important thing to keep in mind is the client/server relationship when calling/forwarding from one server to [...]]]></description>
			<content:encoded><![CDATA[<p>I have found very scattered and little documentation on connecting two  asterisk servers via IAX2, so I decided to put these words together. <a href="http://en.wikipedia.org/wiki/IAX2" target="_blank">IAX2</a> is a protocol  that plays nice with NAT and very powerful.</p>
<p>The most important thing to  keep in mind is the client/server relationship when calling/forwarding from one  server to another. So when you are calling from Server A to Server B, then  Server A is the &#8220;Client&#8221; and Server B is the &#8220;Server&#8221; and of course if you are  calling from Server B to Server A, then Server B would be the &#8220;Client&#8221; and  Server A would be the &#8220;Server&#8221;.</p>
<h4>MORE&#8230;</h4>
<p>The next thing to know is that &#8220;Trunks&#8221; allow endpoints to establish a  communication channel between each other, but Outbound &amp; Inbound Routes also  need to be established.</p>
<p>Home Server:</p>
<p>TRUNKS:</p>
<p>Add IAX2  Trunk</p>
<p>OUTGOING SETTINGS</p>
<p>Trunk name: SOHO<br />
Peer  Details:<br />
auth=rsa<br />
context=from-pstn<br />
host=Office server IP address/dns  address<br />
inkeys=otherserver<br />
secret=<br />
type=friend<br />
username=home</p>
<p>INCOMING  SETTINGS</p>
<p>User Context: office<br />
User  Details:<br />
context=from-pstn<br />
host=dynamic<br />
outkey=otherservervoip<br />
secret=<br />
type=friend<br />
username=office</p>
<p>Registration  String:<br />
home:@</p>
<p>OUTBOUND  ROUTING:</p>
<p>Dial Patterns:<br />
7|.</p>
<p>Trunk Sequence:<br />
Select trunk  just built.</p>
<p>Office Server:</p>
<p>TRUNKS:</p>
<p>Add IAX2  Trunk</p>
<p>OUTGOING SETTINGS</p>
<p>Trunk name: SOHO<br />
Peer  Details:<br />
auth=rsa<br />
context=from-pstn<br />
host=home server IP address/dns  address<br />
inkeys=otherserver<br />
secret=<br />
type=friend<br />
username=office</p>
<p>INCOMING  SETTINGS</p>
<p>User Context: home<br />
User  Details:<br />
context=from-pstn<br />
host=dynamic<br />
outkey=otherservervoip<br />
secret=<br />
type=friend<br />
username=home</p>
<p>Registration  String:<br />
office:@</p>
<p>OUTBOUND ROUTING:</p>
<p>Dial Patterns:<br />
7|.</p>
<p>Trunk  Sequence:<br />
Select trunk just built.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sekiur.com/2005/06/connecting-two-asterisk-home-servers-via-iax2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

