<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Kevin Withnall &#187; alarm</title>
	<atom:link href="http://kevin.withnall.com/category/alarm/feed/" rel="self" type="application/rss+xml" />
	<link>http://kevin.withnall.com</link>
	<description>My 15 megabytes of fame</description>
	<lastBuildDate>Thu, 06 May 2010 06:37:02 +0000</lastBuildDate>
	<language>en-au</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<copyright>Copyright &#xA9; Kevin Withnall 2011 </copyright>
	<managingEditor>kevin@withnall.com.au (Kevin Withnall)</managingEditor>
	<webMaster>kevin@withnall.com.au (Kevin Withnall)</webMaster>
	<ttl>1440</ttl>
	<image>
		<url>http://kevin.withnall.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Kevin Withnall</title>
		<link>http://kevin.withnall.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>My 15 megabytes of fame</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>Kevin Withnall</itunes:author>
	<itunes:owner>
		<itunes:name>Kevin Withnall</itunes:name>
		<itunes:email>kevin@withnall.com.au</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://kevin.withnall.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Asterisk alarm receiver &#8211; using triggers, mysql5</title>
		<link>http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/</link>
		<comments>http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 06:51:04 +0000</pubDate>
		<dc:creator>Kevin Withnall</dc:creator>
				<category><![CDATA[alarm]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://kevin.withnall.com/asterisk-alarm-receiver-using-triggers-mysql5/</guid>
		<description><![CDATA[This requires MySql 5 or above as it uses triggers. Asterisk alarm receiver &#8211; using triggers, mysql5 This is really rough but it works so far. YMMV. butchered together by kevin at ilb dot com dot au 2006 07 29 &#8211; version 0.00 alpha http://kevin.withnall.com email me for any help or information. This code has [...]]]></description>
			<content:encoded><![CDATA[<p>This requires MySql 5 or above as it uses triggers.</p>
<p><a href="http://kevin.withnall.com/wp-content/uploads/2007/07/alarm_triggers.tgz" title="Asterisk alarm receiver - using triggers, mysql5">Asterisk alarm receiver &#8211; using triggers, mysql5</a></p>
<p>This is really rough but it works so far. YMMV.<br />
butchered together by kevin at ilb dot com dot au<br />
2006 07 29 &#8211; version 0.00 alpha</p>
<p>http://kevin.withnall.com</p>
<p>email me for any help or information.</p>
<p>This code has been shamelessly butchered from wakeup.php (http://www.voip-info.org/tiki-index.php?page=Asterisk+tips+Wake-Up+Call+PHP)<br />
by Andy Wysocki awysocki at absoftware dot_here com</p>
<p>Andy, please don&#8217;t hate me.<br />
Please don&#8217;t blame Andy for the complete lack of style, it was a quick fix and it works. Andy&#8217;s code had much niceness about it which i<br />
removed while developing. I should have put it back and probably will one day.</p>
<p>Flow of events&#8230;.<br />
1. Alarm panel sends codes to asterisk box<br />
2. Shell script is run by alarmreceiver<br />
inserts alarmcode into alarm_event<br />
triggers output_events creation<br />
3. shell script then looks at output_events rows to see what work it has to do<br />
4. shell script then tries to create call files (this step is also triggered by cron)</p>
<p>If its a call&#8230;<br />
1. Plays message &#8220;The alarm has triggered&#8221;<br />
2. plays site name using flite<br />
3. plays zone, event code etc (read alarm.php for more info)<br />
4. lets the user press 1 to ack. they get 3 calls if its not acked. alarm_calls for limits</p>
<hr />eventcmd = /usr/local/ilb/asterisk/alarmproc (or whereever you want to put it)</p>
<hr />/usr/local/ilb/asterisk/alarm_calls</p>
<hr /><a href="http://www.voip-info.org/wiki/view/alarm-out">alarm-out</a><br />
exten =&gt; s,1,NoOp(ID == ${ID})<br />
exten =&gt; s,n,AGI(alarm.php,ID=${ID})<br />
exten =&gt; s,n,Hangupmake an alarm database and upload the sql into it<br />
update triggers<br />
<hr />	* alarm_event contains the actual events, a trigger runs to &#8230;<br />
** set all the appropriate cols<br />
** insert rows into output_events table based on the triggers table<br />
* areas contains the list of areas for each site<br />
* users contains the list of users for each site<br />
* event_groups is the major headings for each category of events<br />
* event_types is the individual events that can be reported<br />
* site is the list of sites with site codes that you listen for<br />
* triggers is the table that has the alerting rules. pretty much, if its blank, it matches.<br />
* action of call means dial<br />
* action of email means emailalarmproc is called by alarmreceiver<br />
alarm_calls just makes the calls (and is called by alarmproc and crontab)edit alarmproc and alarm_calls<br />
* change server.domain.com.au to your mysql server<br />
* set the username/passwords accordingly<br />
* set callerid appropriately<br />
* edit the sendmail line and adjust the from address</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5+http%3A%2F%2Fkevin.withnall.com%2F%3Fp%3D65" title="Post to Twitter"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5+http%3A%2F%2Fkevin.withnall.com%2F%3Fp%3D65" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5+http%3A%2F%2Fkevin.withnall.com%2F%3Fp%3D65" title="Post to Plurk"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5+http%3A%2F%2Fkevin.withnall.com%2F%3Fp%3D65" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/buzz?targetUrl=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;headline=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Yahoo Buzz"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/buzz?targetUrl=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;headline=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Delicious"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Delicious">Post to Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Digg"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;t=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Facebook"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;t=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Facebook">Post to Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;t=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to MySpace"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/myspace/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;t=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to MySpace">Post to MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5&amp;link=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/" title="Post to Ping.fm"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5&amp;link=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Reddit"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to Reddit">Post to Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to StumbleUpon"><img class="nothumb" src="http://kevin.withnall.com/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/&amp;title=Asterisk+alarm+receiver+%E2%80%93+using+triggers%2C+mysql5" title="Post to StumbleUpon">Stumble This Post</a></p></div><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fkevin.withnall.com%2F2007%2F07%2F09%2Fasterisk-alarm-receiver-using-triggers-mysql5%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px;margin-top:5px;"></iframe>]]></content:encoded>
			<wfw:commentRss>http://kevin.withnall.com/2007/07/09/asterisk-alarm-receiver-using-triggers-mysql5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

