<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Don Vaughn</title>
	<atom:link href="http://jaysonvaughn.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaysonvaughn.wordpress.com</link>
	<description>My experiences with Open Source development and engineering</description>
	<lastBuildDate>Thu, 05 Feb 2009 00:41:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jaysonvaughn.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Don Vaughn</title>
		<link>http://jaysonvaughn.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jaysonvaughn.wordpress.com/osd.xml" title="The Don Vaughn" />
	<atom:link rel='hub' href='http://jaysonvaughn.wordpress.com/?pushpress=hub'/>
		<item>
		<title>QueueStatus component for Adhearsion DRb</title>
		<link>http://jaysonvaughn.wordpress.com/2009/02/04/queuestatus-component-for-adhearsion/</link>
		<comments>http://jaysonvaughn.wordpress.com/2009/02/04/queuestatus-component-for-adhearsion/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 23:35:07 +0000</pubDate>
		<dc:creator>thedonvaughn</dc:creator>
				<category><![CDATA[Adhearsion]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Queue-Tip]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jaysonvaughn.wordpress.com/?p=9</guid>
		<description><![CDATA[One of my favorite things about the newest release of Adhearsion is it&#8217;s component system. The component system is designed to provide an easy interface to developing plug-ins for Adhearsion that may be easily shared among the Adhearsion community. I &#8230; <a href="http://jaysonvaughn.wordpress.com/2009/02/04/queuestatus-component-for-adhearsion/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaysonvaughn.wordpress.com&amp;blog=6441302&amp;post=9&amp;subd=jaysonvaughn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of my favorite things about the newest release of <a href="http://adhearsion.com">Adhearsion</a> is it&#8217;s <a href="http://docs.adhearsion.com/display/adhearsion/Components">component system</a>.</p>
<p>The component system is designed to provide an easy interface to developing plug-ins for Adhearsion that may be easily shared among the Adhearsion community.</p>
<p>I recently had to create a new component for my app, <a href="http://queue-tip.rubyforge.org">Queue-Tip</a>.  This component takes the result of the AMI command <em>QueueStatus</em> (ManagerInterface#send_action &#8216;QueueStatus&#8217;) via <strong>DRb</strong> and sorts it into a hash so that it can easily be used pragmatically.</p>
<p>To create a new component, type the following below in your current working directory of your Adhearsion app:</p>
<blockquote><pre>
$ ahn create component queue_status
</pre>
</blockquote>
<p>The directory components/queue_status should now exist with 2 files; <em>queue_status.rb</em> and <em>queue_status.yml</em>.<br />
We are only concerned with queue_status.rb for now.</p>
<p>Open up queue_status.rb with your favorite editor and insert the following code:</p>
<blockquote><pre>
methods_for :rpc do

  def queue_status
    if VoIP::Asterisk.manager_interface
      result = VoIP::Asterisk.manager_interface.send_action 'queuestatus'
    else
      ahn_log.ami_remote.error "AMI has not been enabled in startup.rb!"
    end
    prag_hash = {}
    result.each do |x|
        prag_hash[x['Queue']] = { :members =&gt; {}, :callers =&gt; {} } .merge(x.headers) if x.name =~ /queueparams/i
        prag_hash[x['Queue']][:members].merge!(x.headers['Name'] =&gt; {}.merge(x.headers)) if x.name =~ /queuemember/i
        prag_hash[x['Queue']][:callers].merge!(x.headers['Position'] =&gt; {}.merge(x.headers)) if x.name =~ /queueentry/i
    end
    return prag_hash
  end

end
</pre>
</blockquote>
<p>Now you can start up your Adhearsion app</p>
<blockquote><pre>$ ahn start /path/to/app</pre>
</blockquote>
<p>Assuming you are using <strong>DRb</strong> to talk with Adhearsion and the <strong>DRb</strong> listener is configured for host localhost and port 9050, you can now do the following:</p>
<blockquote><pre>
require 'drb'
require 'rubygems'
require 'adhearsion'
require 'adhearsion/voip/asterisk/manager_interface'

asterisk = DRbObject.new_with_uri 'druby://localhost:9050'
result = asterisk.queue_status
</pre>
</blockquote>
<p>Now <em>result</em> contains the, well result, of asterisk.queue_status.<br />
Let&#8217;s say you want to find out the names of all the queues returned.</p>
<blockquote><pre>
irb(main):01:0&gt; result.keys
=&gt; ["ebo-mgr", "it", "healthcare-sp", "admin", "insurance", "healthcare", "insurance-mgr", "healthcare-mgr", "hc-standby", "ebo", "hr"]
irb(main):02:0&gt;
</pre>
</blockquote>
<p>The names of the queues are the keys for the hash.  Let&#8217;s say I want to find out all agents logged into the <em>healthcare</em> queue</p>
<blockquote><pre>
irb(main):02:0&gt; result["healthcare"][:members].keys
=&gt; ["SIP/3409", "SIP/3410", "SIP/3421", "SIP/3411", "SIP/3422", "SIP/3401", "SIP/3412", "SIP/3423", "SIP/3414", "SIP/3415", "SIP/3426", "SIP/3405", "SIP/3406", "SIP/3419"]
irb(main):03:0&gt;
</pre>
</blockquote>
<p>As you can see above, the agent&#8217;s channel is the key the agent&#8217;s hash. Now let&#8217;s look at a specific agent&#8217;s stats in the queue <em>healthcare</em></p>
<blockquote>
<pre>
irb(main):03:0&gt; result["healthcare"][:members]["SIP/3421"]
=&gt; {"Membership"=&gt;"dynamic", "Penalty"=&gt;"0", "LastCall"=&gt;"0", "Status"=&gt;"1", "Name"=&gt;"SIP/3421", "Location"=&gt;"SIP/3421", "Paused"=&gt;"0", "ActionID"=&gt;"QQ16Gm3e-utlZ-01LM-ILfq-lqVDncPDEkhM", "CallsTaken"=&gt;"0", "Queue"=&gt;"healthcare"}
irb(main):04:0&gt;
</pre>
</blockquote>
<p>This pattern also applies to callers waiting in the queues, except the caller&#8217;s position is the key for the caller hash.</p>
<blockquote><pre>
irb(main):04:0&gt; result["healthcare"][:callers].key
=&gt; ["1"]
irb(main):05:0&gt;
</pre>
</blockquote>
<p>The above tells us we have one caller waiting in the <em>healthcare</em> queue.  Now let&#8217;s take a look at that caller:</p>
<blockquote><pre>
irb(main):05:0&gt; result["healthcare"][:callers]["1"]
=&gt; {"Position"=&gt;"1", "Channel"=&gt;"Zap/25-1", "Wait"=&gt;"2", "CallerID"=&gt;"903XXXXXX", "CallerIDName"=&gt;"DOE,JOHN", "ActionID"=&gt;"3aOnPOvE-MPwr-zpm1-b3dH-x26FOpmYcIlU", "Queue"=&gt;"healthcare"}
irb(main):06:0&gt;
</pre>
</blockquote>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaysonvaughn.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaysonvaughn.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaysonvaughn.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaysonvaughn.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaysonvaughn.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaysonvaughn.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaysonvaughn.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaysonvaughn.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaysonvaughn.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaysonvaughn.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaysonvaughn.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaysonvaughn.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaysonvaughn.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaysonvaughn.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaysonvaughn.wordpress.com&amp;blog=6441302&amp;post=9&amp;subd=jaysonvaughn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaysonvaughn.wordpress.com/2009/02/04/queuestatus-component-for-adhearsion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6cde2529e8af2a8d8c30288aa227d595?s=96&#38;d=identicon" medium="image">
			<media:title type="html">thedonvaughn</media:title>
		</media:content>
	</item>
		<item>
		<title>Queue-Tip 0.9.2 Released! (Formerly Queuetastic)</title>
		<link>http://jaysonvaughn.wordpress.com/2009/02/04/queue-tip-092-released-formerly-queuetastic/</link>
		<comments>http://jaysonvaughn.wordpress.com/2009/02/04/queue-tip-092-released-formerly-queuetastic/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 03:30:38 +0000</pubDate>
		<dc:creator>thedonvaughn</dc:creator>
				<category><![CDATA[Adhearsion]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Queue-Tip]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jaysonvaughn.wordpress.com/?p=4</guid>
		<description><![CDATA[Queue-Tip 0.9.2 has been released! (Formerly Queuetastic) About Queue-Tip is an Asterisk Queue monitoring and reporting tool designed with the Ruby on Rails and Adhearsion frameworks. Features Real-time, live view, of Asterisk queues updated seamlessly using Javascript Queue stats are &#8230; <a href="http://jaysonvaughn.wordpress.com/2009/02/04/queue-tip-092-released-formerly-queuetastic/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaysonvaughn.wordpress.com&amp;blog=6441302&amp;post=4&amp;subd=jaysonvaughn&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://queue-tip.rubyforge.org"><strong>Queue-Tip</strong></a> 0.9.2 has been released! (Formerly Queuetastic)</p>
<h4>About</h4>
<ul>
<li>Queue-Tip is an Asterisk Queue monitoring and reporting tool designed with the <a href="http://www.rubyonrails.org/">Ruby on Rails</a> and <a href="http://adhearsion.com/">Adhearsion</a> frameworks.</li>
</ul>
<h4>Features</h4>
<ul>
<li>Real-time, live view, of Asterisk queues updated seamlessly using Javascript</li>
<li>Queue stats are collected in real-time using Adhearsion</li>
<li>Load Asterisk’s queue_log file into a database</li>
<li>Run reports on agent and queue stats.</li>
<li>Partition agents in to “groups” for reporting needs..</li>
<li>Export reports in csv format</li>
</ul>
<p><a href="http://queue-tip.rubyforge.org">Queue-Tip @ Rubyforge</a><br />
<a href="http://github.com/thedonvaughn/queue-tip/tree/master">Queue-Tip @ GitHub</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaysonvaughn.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaysonvaughn.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaysonvaughn.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaysonvaughn.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaysonvaughn.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaysonvaughn.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaysonvaughn.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaysonvaughn.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaysonvaughn.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaysonvaughn.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaysonvaughn.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaysonvaughn.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaysonvaughn.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaysonvaughn.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaysonvaughn.wordpress.com&amp;blog=6441302&amp;post=4&amp;subd=jaysonvaughn&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaysonvaughn.wordpress.com/2009/02/04/queue-tip-092-released-formerly-queuetastic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6cde2529e8af2a8d8c30288aa227d595?s=96&#38;d=identicon" medium="image">
			<media:title type="html">thedonvaughn</media:title>
		</media:content>
	</item>
	</channel>
</rss>
