<?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>dmacias . org &#187; Cisco</title>
	<atom:link href="http://dmacias.org/category/cisco/feed/" rel="self" type="application/rss+xml" />
	<link>http://dmacias.org</link>
	<description>Not quite crazy not quite sane.</description>
	<lastBuildDate>Sun, 22 Apr 2012 23:49:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Cisco CUIC 8.x More Value List and Collections</title>
		<link>http://dmacias.org/2012/04/13/cisco-cuic-8-x-more-value-list-and-collections/</link>
		<comments>http://dmacias.org/2012/04/13/cisco-cuic-8-x-more-value-list-and-collections/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 02:40:41 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cisco CUIC 8.x]]></category>

		<guid isPermaLink="false">http://dmacias.org/?p=518</guid>
		<description><![CDATA[I wanted to make a clarification to my earlier post about Value Lists and Collections.&#160; This post will explain how to create a new Value List which will retrieve agents who have a specific value in their Agent.Description field.&#160; Then Collections can be used to extract other more specific agents.&#160; This could be used to [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to make a clarification to my earlier post about Value Lists and Collections.&#160; This post will explain how to create a new Value List which will retrieve agents who have a specific value in their Agent.Description field.&#160; Then Collections can be used to extract other more specific agents.&#160; This could be used to retrieve agents from a single peripheral or agents named David, etc..&#160; First, here’s the Value List:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Value List" border="0" alt="Value List" src="http://dmacias.org/wp-content/uploads/2012/04/Value-List.png" width="514" height="484" /></p>
<p>And finally here’s a Collection:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Collection" border="0" alt="Collection" src="http://dmacias.org/wp-content/uploads/2012/04/Collection.png" width="644" height="439" /></p>
<p>Hope this makes sense and will help you create your own Value List and Collections.</p>
<p>~david</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2012/04/13/cisco-cuic-8-x-more-value-list-and-collections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco CUIC Creating Value Lists and Collections</title>
		<link>http://dmacias.org/2012/03/14/cisco-cuic-creating-value-lists-and-collections/</link>
		<comments>http://dmacias.org/2012/03/14/cisco-cuic-creating-value-lists-and-collections/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 08:35:37 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cuic]]></category>
		<category><![CDATA[reporting]]></category>

		<guid isPermaLink="false">http://dmacias.org/?p=507</guid>
		<description><![CDATA[This one should be pretty simple, but figure I would add it here for posterity’s sake.&#160; I wanted to setup a real time Value List of all the call types, then break down my Value List into smaller Collections for each specific type of call type. First step is to log in to CUIC and [...]]]></description>
			<content:encoded><![CDATA[<p>This one should be pretty simple, but figure I would add it here for posterity’s sake.&#160; I wanted to setup a real time Value List of all the call types, then break down my Value List into smaller Collections for each specific type of call type.</p>
<p>First step is to log in to CUIC and got to Value Lists and click on Create.</p>
<p><a href="http://dmacias.org/wp-content/uploads/2012/03/Untitled.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Untitled" border="0" alt="Untitled" src="http://dmacias.org/wp-content/uploads/2012/03/Untitled_thumb.png" width="644" height="364" /></a></p>
<p>The Value List Query:</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">SELECT</span> Call_Type.CallTypeID <span class="kwrd">AS</span> ID, Call_Type.EnterpriseName <span class="kwrd">AS</span> <span class="kwrd">VALUE</span> <span class="kwrd">FROM</span> Call_Type (nolock) </pre>
<pre><span class="kwrd">Order</span> <span class="kwrd">by</span> Call_Type.EnterpriseName</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>The Collection Query:</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">SELECT</span> Call_Type.CallTypeID <span class="kwrd">AS</span> ID, Call_Type.EnterpriseName <span class="kwrd">AS</span> <span class="kwrd">VALUE</span> <span class="kwrd">FROM</span> Call_Type (nolock) </pre>
<pre><span class="kwrd">WHERE</span> Call_Type.CustomerDefinitionID = (<span class="kwrd">SELECT</span> User_Group.CustomerDefinitionID <span class="kwrd">FROM</span> User_Group (nolock) </pre>
<pre class="alt"><span class="kwrd">WHERE</span> <span class="kwrd">UPPER</span>(User_Group.UserGroupName) = <span class="kwrd">UPPER</span>(&lt;COLLECTIONIDENTIFIER&gt;)) <span class="kwrd">OR</span> (<span class="kwrd">SELECT</span> <span class="kwrd">COUNT</span>(User_Group.CustomerDefinitionID) </pre>
<pre><span class="kwrd">FROM</span> User_Group (nolock) <span class="kwrd">WHERE</span> <span class="kwrd">UPPER</span>(User_Group.UserGroupName) = <span class="kwrd">UPPER</span>(&lt;COLLECTIONIDENTIFIER&gt;)) = 0 <span class="kwrd">ORDER</span> <span class="kwrd">BY</span> Call_Type.EnterpriseName ASC</pre>
</div>
<p>Validate your query and save.</p>
<p>Second, click on your Value List and click on Collections.</p>
<p><a href="http://dmacias.org/wp-content/uploads/2012/03/Untitled1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Untitled1" border="0" alt="Untitled1" src="http://dmacias.org/wp-content/uploads/2012/03/Untitled1_thumb.png" width="644" height="364" /></a></p>
<p>Notice the Collection Type of Wildcard which allows your create a wildcard which references all your call types.&#160; This could be French* or CustomerService*.&#160; Hit Save, Populate Values, and confirm the values to ensure the collection has the call types you’re looking for.</p>
<p>~dmacias</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2012/03/14/cisco-cuic-creating-value-lists-and-collections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco CUIC Real Time Agent Report with Not Ready Reason Code</title>
		<link>http://dmacias.org/2012/03/12/cisco-cuic-real-time-agent-report-with-not-ready-reason-code/</link>
		<comments>http://dmacias.org/2012/03/12/cisco-cuic-real-time-agent-report-with-not-ready-reason-code/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 01:48:23 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cuic]]></category>
		<category><![CDATA[reporting]]></category>

		<guid isPermaLink="false">http://dmacias.org/?p=500</guid>
		<description><![CDATA[I had my first exposure to CUIC last week and was glad to finally see this product and get to play with it.&#160; For the most part it looks just like CUIS, except for the whole appliance model.&#160; The UI is a little more streamlined, but what I remember from CUIS, it’s all there.&#160; Now, [...]]]></description>
			<content:encoded><![CDATA[<p>I had my first exposure to CUIC last week and was glad to finally see this product and get to play with it.&#160; For the most part it looks just like CUIS, except for the whole appliance model.&#160; The UI is a little more streamlined, but what I remember from CUIS, it’s all there.&#160; Now, one big change is that with CUIC, reports are cut down to a standard set (20 if I remember correctly) as opposed to the dozens of reports available through WebView.&#160; This created some initial confusion as you try to familiarize yourself with what kind of data the new reports have.&#160; Perhaps the best feature is the ability to remove columns from reports and just display the data you want to see.</p>
<p>One report which comes up all the time is an agent real time report showing the agent’s current not ready reason code.&#160; I have an SQL query I use to get this data myself, but now that CUIC is supposed to make it easier to create your own reports, I wanted to give it a shot and create my very first custom report.</p>
<p>First, let’s start with the SQL query which joins the real time agent states as well as reason code tables.</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">SELECT</span> [awdb].[dbo].[t_Agent_Real_Time].[SkillTargetID]</pre>
<pre><span class="lnum">   2:  </span>        ,[awdb].[dbo].[t_Agent].[EnterpriseName]</pre>
<pre class="alt"><span class="lnum">   3:  </span>      ,[DateTime]</pre>
<pre><span class="lnum">   4:  </span>      ,[SkillGroupSkillTargetID]</pre>
<pre class="alt"><span class="lnum">   5:  </span>      ,[ServiceSkillTargetID]</pre>
<pre><span class="lnum">   6:  </span>      ,[AgentState]</pre>
<pre class="alt"><span class="lnum">   7:  </span>      ,<span class="str">'Agent State'</span> =</pre>
<pre><span class="lnum">   8:  </span>            <span class="kwrd">CASE</span></pre>
<pre class="alt"><span class="lnum">   9:  </span>                  <span class="kwrd">WHEN</span> [AgentState] = 2 <span class="kwrd">THEN</span> <span class="str">'Not Ready'</span></pre>
<pre><span class="lnum">  10:  </span>                  <span class="kwrd">WHEN</span> [AgentState] = 3 <span class="kwrd">THEN</span> <span class="str">'Ready'</span></pre>
<pre class="alt"><span class="lnum">  11:  </span>                  <span class="kwrd">WHEN</span> [AgentState] = 4 <span class="kwrd">THEN</span> <span class="str">'Talking'</span></pre>
<pre><span class="lnum">  12:  </span>                  <span class="kwrd">WHEN</span> [AgentState] = 5 <span class="kwrd">THEN</span> <span class="str">'Wrap Up'</span></pre>
<pre class="alt"><span class="lnum">  13:  </span>            <span class="kwrd">END</span></pre>
<pre><span class="lnum">  14:  </span>      ,[awdb].[dbo].[t_Agent_Real_Time].[ReasonCode]</pre>
<pre class="alt"><span class="lnum">  15:  </span>      ,[awdb].[dbo].[t_Reason_Code].[ReasonText]</pre>
<pre><span class="lnum">  16:  </span>      ,[Extension]</pre>
<pre class="alt"><span class="lnum">  17:  </span>      ,[DateTimeLastStateChange]</pre>
<pre><span class="lnum">  18:  </span>  <span class="kwrd">FROM</span> [awdb].[dbo].[t_Agent_Real_Time] </pre>
<pre class="alt"><span class="lnum">  19:  </span>  <span class="kwrd">JOIN</span> [awdb].[dbo].[t_Reason_Code] <span class="kwrd">ON</span> ([awdb].[dbo].[t_Agent_Real_Time].[ReasonCode]=[awdb].[dbo].[t_Reason_Code].[ReasonCode])</pre>
<pre><span class="lnum">  20:  </span>  <span class="kwrd">JOIN</span> [awdb].[dbo].[t_Agent] <span class="kwrd">ON</span> [awdb].[dbo].[t_Agent_Real_Time].[SkillTargetID] = [awdb].[dbo].[t_Agent].[SkillTargetID]</pre>
<pre class="alt"><span class="lnum">  21:  </span>GO</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Now, don’t judge me on a) the poor SQL writing skills or b) my affinity to spacing.&#160; It’s important to understand what the above query is doing to ensure you know where your reason codes are coming from.</p>
<p>Second, you will need to create a new report definition based on the stock Agent Real Time report definition.&#160; You will need to extract the SQL of the report query shown below.</p>
<blockquote>
<p>SELECT Agent.EnterpriseName, full_name=(Person.LastName + &#8216;, &#8216; + Person.FirstName) , Skill_Group.EnterpriseName as SkillName, Agent.SkillTargetID, Agent_Real_Time.DateTime, Datepart(yy, Agent_Real_Time.DateTime) as Year, Datepart(mm, Agent_Real_Time.DateTime) as Month, Datepart(ww, Agent_Real_Time.DateTime) as Week, Datepart(dy, Agent_Real_Time.DateTime) as DOY, Datepart(dw, Agent_Real_Time.DateTime) as DOW, CONVERT(char(10),Agent_Real_Time.DateTime,101) as DATE, Agent_Real_Time.SkillGroupSkillTargetID, ServiceName = Service.EnterpriseName, Media = Media_Routing_Domain.EnterpriseName, CASE Agent_Real_Time.AgentState WHEN 0 THEN &#8216;Logged Out&#8217; WHEN 1 THEN &#8216;Logged On&#8217; WHEN 2 THEN &#8216;Not Ready&#8217; WHEN 3 THEN &#8216;Ready&#8217; WHEN 4 THEN &#8216;Talking&#8217; WHEN 5 THEN &#8216;Work Not Ready&#8217; WHEN 6 THEN &#8216;Work Ready&#8217; WHEN 7 THEN &#8216;Busy Other&#8217; WHEN 8 THEN &#8216;Reserved&#8217; WHEN 9 THEN &#8216;Unknown&#8217; WHEN 10 THEN &#8216;Hold&#8217; WHEN 11 THEN &#8216;Active&#8217; WHEN 12 THEN &#8216;Paused&#8217; WHEN 13 THEN &#8216;Interrupted&#8217; WHEN 14 THEN &#8216;Not Active&#8217; ELSE CONVERT(VARCHAR, Agent_Real_Time.AgentState) END AgentState, CASE Agent_Real_Time.PhoneType When 0 THEN &#8216;Not Mobile&#8217; WHEN 1 THEN &#8216;Call By Call&#8217; WHEN 2 THEN &#8216;Nailed Connection&#8217; Else &#8216;Not Applicable&#8217; END phonetypetext, remotephonenumber = Agent_Real_Time.RemotePhoneNumber, ReasonCode = CASE WHEN Agent_Real_Time.ReasonCode = 0 THEN &#8216;NONE&#8217; ELSE CONVERT(VARCHAR, Agent_Real_Time.ReasonCode) END , Agent_Real_Time.Extension, Agent_Real_Time.DateTimeLastStateChange, Agent_Real_Time.DateTimeLogin, CASE WHEN RequestedSupervisorAssist = 1 THEN &#8216;Yes&#8217; ELSE &#8216;No&#8217; END RequestedSupervisorAssist, CASE Agent_Real_Time.Destination WHEN 1 THEN &#8216;ACD&#8217; WHEN 2 THEN &#8216;Direct&#8217; WHEN 3 THEN &#8216;Auto Out&#8217; WHEN 4 THEN &#8216;Reserve&#8217; WHEN 5 THEN &#8216;Preview&#8217; ELSE &#8216;Not Applicable&#8217; END Destination, CASE Agent_Real_Time.Direction WHEN 1 THEN &#8216;In&#8217; WHEN 2 THEN &#8216;Out&#8217; WHEN 3 THEN &#8216;Other&#8217; ELSE &#8216;Not Applicable&#8217; END Direction, CASE WHEN Agent_Real_Time.OnHold = 1 THEN &#8216;Yes&#8217; ELSE &#8216;No&#8217; END OnHold, Agent_Real_Time.NetworkTargetID, Agent_Real_Time.AgentStatus, Agent_Real_Time.CustomerPhoneNumber, Agent_Real_Time.CustomerAccountNumber, Agent_Real_Time.CampaignID, Agent_Real_Time.QueryRuleID, Duration = DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, CASE WHEN (DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, (SELECT NowTime from Controller_Time (nolock))) &lt;= 0 ) THEN Agent_Real_Time.DateTimeLastStateChange ELSE(SELECT NowTime FROM Controller_Time (nolock)) END), CASE WHEN Agent_Real_Time.Routable = 1 THEN &#8216;Yes&#8217; ELSE &#8216;No&#8217; END RoutableText,Agent_Real_Time.DateTimeLastModeChange, Agent_Real_Time.CallInProgress, Agent_Real_Time.MaxTasks, CASE WHEN Agent_Real_Time.AvailableInMRD = 0 THEN &#8216;No&#8217; WHEN Agent_Real_Time.AvailableInMRD = 1 THEN &#8216;Yes_ICM&#8217; WHEN Agent_Real_Time.AvailableInMRD = 2 THEN &#8216;Yes_APP&#8217; ELSE &#8216;No&#8217; END AvailInMRDText, Agent_Real_Time.DateTimeTaskLevelChange, Agent_Real_Time.RouterCallsQueueNow, Agent_Real_Time.RouterLongestCallQ FROM Agent (nolock), Person (nolock), Media_Routing_Domain (nolock), Agent_Real_Time (nolock) LEFT JOIN Service (nolock) ON Agent_Real_Time.ServiceSkillTargetID = Service.SkillTargetID, Skill_Group WHERE ( Agent_Real_Time.SkillGroupSkillTargetID = Skill_Group.SkillTargetID) and Agent.PersonID=Person.PersonID and Media_Routing_Domain.MRDomainID = Agent_Real_Time.MRDomainID and ( Agent.SkillTargetID = Agent_Real_Time.SkillTargetID ) UNION SELECT Agent.EnterpriseName, full_name=(Person.LastName + &#8216;, &#8216; + Person.FirstName) , convert(varchar,&#8217;Not Applicable&#8217;), Agent_Real_Time.SkillTargetID, Agent_Real_Time.DateTime, Datepart(yy, Agent_Real_Time.DateTime) as Year, Datepart(mm, Agent_Real_Time.DateTime) as Month, Datepart(ww, Agent_Real_Time.DateTime) as Week, Datepart(dy, Agent_Real_Time.DateTime) as DOY, Datepart(dw, Agent_Real_Time.DateTime) as DOW, CONVERT(char(10),Agent_Real_Time.DateTime,101) as DATE, Agent_Real_Time.SkillGroupSkillTargetID, ServiceName = Service.EnterpriseName, Media=Media_Routing_Domain.EnterpriseName, CASE Agent_Real_Time.AgentState WHEN 0 THEN &#8216;Logged Out&#8217; WHEN 1 THEN &#8216;Logged On&#8217; WHEN 2 THEN &#8216;Not Ready&#8217; WHEN 3 THEN &#8216;Ready&#8217; WHEN 4 THEN &#8216;Talking&#8217; WHEN 5 THEN &#8216;Work Not Ready&#8217; WHEN 6 THEN &#8216;Work Ready&#8217; WHEN 7 THEN &#8216;Busy Other&#8217; WHEN 8 THEN &#8216;Reserved&#8217; WHEN 9 THEN &#8216;Unknown&#8217; WHEN 10 THEN &#8216;Hold&#8217; WHEN 11 THEN &#8216;Active&#8217; WHEN 12 THEN &#8216;Paused&#8217; WHEN 13 THEN &#8216;Interrupted&#8217; WHEN 14 THEN &#8216;Not Active&#8217; ELSE CONVERT(VARCHAR, Agent_Real_Time.AgentState) END AgentState, CASE Agent_Real_Time.PhoneType When 0 THEN &#8216;Not Mobile&#8217;WHEN 1 THEN &#8216;Call By Call&#8217; WHEN 2 THEN &#8216;Nailed Connection&#8217; Else &#8216;Not Applicable&#8217; END phonetypetext, remotephonenumber = Agent_Real_Time.RemotePhoneNumber, ReasonCode = CASE WHEN Agent_Real_Time.ReasonCode = 0 THEN &#8216;NONE&#8217; ELSE CONVERT(VARCHAR, Agent_Real_Time.ReasonCode) END , Agent_Real_Time.Extension, Agent_Real_Time.DateTimeLastStateChange, Agent_Real_Time.DateTimeLogin, CASE WHEN RequestedSupervisorAssist = 1 THEN &#8216;Yes&#8217; ELSE &#8216;No&#8217; END RequestedSupervisorAssist, CASE Agent_Real_Time.Destination WHEN 1 THEN &#8216;ACD&#8217; WHEN 2 THEN &#8216;Direct&#8217; WHEN 3 THEN &#8216;Auto Out&#8217; WHEN 4 THEN &#8216;Reserve&#8217; WHEN 5 THEN &#8216;Preview&#8217; ELSE &#8216;Not Applicable&#8217; END Destination, CASE Agent_Real_Time.Direction WHEN 1 THEN &#8216;In&#8217; WHEN 2 THEN &#8216;Out&#8217; WHEN 3 THEN &#8216;Other&#8217; ELSE &#8216;Not Applicable&#8217; END Direction, CASE WHEN Agent_Real_Time.OnHold = 1 THEN &#8216;Yes&#8217; ELSE &#8216;No&#8217; END OnHold, Agent_Real_Time.NetworkTargetID, Agent_Real_Time.AgentStatus, Agent_Real_Time.CustomerPhoneNumber, Agent_Real_Time.CustomerAccountNumber, Agent_Real_Time.CampaignID, Agent_Real_Time.QueryRuleID, Duration=DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, CASE WHEN (DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, (SELECT NowTime from Controller_Time (nolock))) &lt;= 0 ) THEN Agent_Real_Time.DateTimeLastStateChange ELSE (SELECT NowTime FROM Controller_Time (nolock)) END), CASE WHEN Agent_Real_Time.Routable = 1 THEN &#8216;Yes&#8217; ELSE &#8216;No&#8217; END RoutableText , Agent_Real_Time.DateTimeLastModeChange, Agent_Real_Time.CallInProgress, Agent_Real_Time.MaxTasks, CASE WHEN Agent_Real_Time.AvailableInMRD = 0 THEN &#8216;No&#8217; WHEN Agent_Real_Time.AvailableInMRD = 1 THEN &#8216;Yes_ICM&#8217; WHEN Agent_Real_Time.AvailableInMRD = 2 THEN &#8216;Yes_APP&#8217; ELSE &#8216;No&#8217; END AvailInMRDText, Agent_Real_Time.DateTimeTaskLevelChange, Agent_Real_Time.RouterCallsQueueNow, Agent_Real_Time.RouterLongestCallQ FROM Agent (nolock), Person (nolock), Media_Routing_Domain (nolock), Agent_Real_Time (nolock) LEFT JOIN Service (nolock) ON Agent_Real_Time.ServiceSkillTargetID = Service.SkillTargetID WHERE ((Agent_Real_Time.SkillGroupSkillTargetID = 0) OR (Agent_Real_Time.SkillGroupSkillTargetID IS NULL)) and Agent.PersonID=Person.PersonID and Media_Routing_Domain.MRDomainID = Agent_Real_Time.MRDomainID and ( Agent.SkillTargetID = Agent_Real_Time.SkillTargetID )</p>
</blockquote>
<p>Third, modify the SQL query.&#160; Also, it helps a lot to actually arrange the above query and break it down section by section.</p>
<p>&#160;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span>&#160;</pre>
<pre><span class="lnum">   2:  </span><span class="kwrd">SELECT</span> </pre>
<pre class="alt"><span class="lnum">   3:  </span>                Agent.EnterpriseName, </pre>
<pre><span class="lnum">   4:  </span>                full_name=(Person.LastName + <span class="str">', '</span> + Person.FirstName), </pre>
<pre class="alt"><span class="lnum">   5:  </span>                Skill_Group.EnterpriseName <span class="kwrd">as</span> SkillName, </pre>
<pre><span class="lnum">   6:  </span>                Agent.SkillTargetID, </pre>
<pre class="alt"><span class="lnum">   7:  </span>                Agent_Real_Time.DateTime, </pre>
<pre><span class="lnum">   8:  </span>                Datepart(yy, Agent_Real_Time.DateTime) <span class="kwrd">as</span> <span class="kwrd">Year</span>, </pre>
<pre class="alt"><span class="lnum">   9:  </span>                Datepart(mm, Agent_Real_Time.DateTime) <span class="kwrd">as</span> <span class="kwrd">Month</span>, </pre>
<pre><span class="lnum">  10:  </span>                Datepart(ww, Agent_Real_Time.DateTime) <span class="kwrd">as</span> Week, </pre>
<pre class="alt"><span class="lnum">  11:  </span>                Datepart(dy, Agent_Real_Time.DateTime) <span class="kwrd">as</span> DOY, </pre>
<pre><span class="lnum">  12:  </span>                Datepart(dw, Agent_Real_Time.DateTime) <span class="kwrd">as</span> DOW, </pre>
<pre class="alt"><span class="lnum">  13:  </span>                <span class="kwrd">CONVERT</span>(<span class="kwrd">char</span>(10),Agent_Real_Time.DateTime,101) <span class="kwrd">as</span> <span class="kwrd">DATE</span>, Agent_Real_Time.SkillGroupSkillTargetID, </pre>
<pre><span class="lnum">  14:  </span>                ServiceName = Service.EnterpriseName, </pre>
<pre class="alt"><span class="lnum">  15:  </span>                Media = Media_Routing_Domain.EnterpriseName, </pre>
<pre><span class="lnum">  16:  </span>                <span class="kwrd">CASE</span> Agent_Real_Time.AgentState  </pre>
<pre class="alt"><span class="lnum">  17:  </span>                                <span class="kwrd">WHEN</span> 0 <span class="kwrd">THEN</span> <span class="str">'Logged Out'</span> </pre>
<pre><span class="lnum">  18:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'Logged On'</span> </pre>
<pre class="alt"><span class="lnum">  19:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Not Ready'</span> </pre>
<pre><span class="lnum">  20:  </span>                                <span class="kwrd">WHEN</span> 3 <span class="kwrd">THEN</span> <span class="str">'Ready'</span> </pre>
<pre class="alt"><span class="lnum">  21:  </span>                                <span class="kwrd">WHEN</span> 4 <span class="kwrd">THEN</span> <span class="str">'Talking'</span> </pre>
<pre><span class="lnum">  22:  </span>                                <span class="kwrd">WHEN</span> 5 <span class="kwrd">THEN</span> <span class="str">'Work Not Ready'</span> </pre>
<pre class="alt"><span class="lnum">  23:  </span>                                <span class="kwrd">WHEN</span> 6 <span class="kwrd">THEN</span> <span class="str">'Work Ready'</span> </pre>
<pre><span class="lnum">  24:  </span>                                <span class="kwrd">WHEN</span> 7 <span class="kwrd">THEN</span> <span class="str">'Busy Other'</span> </pre>
<pre class="alt"><span class="lnum">  25:  </span>                                <span class="kwrd">WHEN</span> 8 <span class="kwrd">THEN</span> <span class="str">'Reserved'</span>  </pre>
<pre><span class="lnum">  26:  </span>                                <span class="kwrd">WHEN</span> 9 <span class="kwrd">THEN</span> <span class="str">'Unknown'</span> </pre>
<pre class="alt"><span class="lnum">  27:  </span>                                <span class="kwrd">WHEN</span> 10 <span class="kwrd">THEN</span> <span class="str">'Hold'</span> </pre>
<pre><span class="lnum">  28:  </span>                                <span class="kwrd">WHEN</span> 11 <span class="kwrd">THEN</span> <span class="str">'Active'</span>  </pre>
<pre class="alt"><span class="lnum">  29:  </span>                                <span class="kwrd">WHEN</span> 12 <span class="kwrd">THEN</span> <span class="str">'Paused'</span> </pre>
<pre><span class="lnum">  30:  </span>                                <span class="kwrd">WHEN</span> 13 <span class="kwrd">THEN</span> <span class="str">'Interrupted'</span> </pre>
<pre class="alt"><span class="lnum">  31:  </span>                                <span class="kwrd">WHEN</span> 14 <span class="kwrd">THEN</span> <span class="str">'Not Active'</span> </pre>
<pre><span class="lnum">  32:  </span>                                <span class="kwrd">ELSE</span> <span class="kwrd">CONVERT</span>(<span class="kwrd">VARCHAR</span>, Agent_Real_Time.AgentState) </pre>
<pre class="alt"><span class="lnum">  33:  </span>                <span class="kwrd">END</span> AgentState, </pre>
<pre><span class="lnum">  34:  </span>                <span class="kwrd">CASE</span> Agent_Real_Time.PhoneType </pre>
<pre class="alt"><span class="lnum">  35:  </span>                                <span class="kwrd">When</span> 0 <span class="kwrd">THEN</span> <span class="str">'Not Mobile'</span> </pre>
<pre><span class="lnum">  36:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'Call By Call'</span> </pre>
<pre class="alt"><span class="lnum">  37:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Nailed Connection'</span> </pre>
<pre><span class="lnum">  38:  </span>                                <span class="kwrd">Else</span> <span class="str">'Not Applicable'</span> </pre>
<pre class="alt"><span class="lnum">  39:  </span>                <span class="kwrd">END</span> phonetypetext, </pre>
<pre><span class="lnum">  40:  </span>                remotephonenumber = Agent_Real_Time.RemotePhoneNumber, </pre>
<pre class="alt"><span class="lnum">  41:  </span>                ReasonCode = <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum">  42:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.ReasonCode = 0 </pre>
<pre class="alt"><span class="lnum">  43:  </span>                                <span class="kwrd">THEN</span> <span class="str">'NONE'</span> </pre>
<pre><span class="lnum">  44:  </span>                                <span class="kwrd">ELSE</span> <span class="kwrd">CONVERT</span>(<span class="kwrd">VARCHAR</span>, Agent_Real_Time.ReasonCode) </pre>
<pre class="alt"><span class="lnum">  45:  </span>                                <span class="kwrd">END</span> , </pre>
<pre><span class="lnum">  46:  </span>                Reason_Code.ReasonText,</pre>
<pre class="alt"><span class="lnum">  47:  </span>                Agent_Real_Time.Extension, </pre>
<pre><span class="lnum">  48:  </span>                Agent_Real_Time.DateTimeLastStateChange, </pre>
<pre class="alt"><span class="lnum">  49:  </span>                Agent_Real_Time.DateTimeLogin, </pre>
<pre><span class="lnum">  50:  </span>                <span class="kwrd">CASE</span> </pre>
<pre class="alt"><span class="lnum">  51:  </span>                                <span class="kwrd">WHEN</span> RequestedSupervisorAssist = 1 <span class="kwrd">THEN</span> <span class="str">'Yes'</span> <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre><span class="lnum">  52:  </span>                <span class="kwrd">END</span> RequestedSupervisorAssist, </pre>
<pre class="alt"><span class="lnum">  53:  </span>                <span class="kwrd">CASE</span> Agent_Real_Time.Destination </pre>
<pre><span class="lnum">  54:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'ACD'</span> </pre>
<pre class="alt"><span class="lnum">  55:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Direct'</span> </pre>
<pre><span class="lnum">  56:  </span>                                <span class="kwrd">WHEN</span> 3 <span class="kwrd">THEN</span> <span class="str">'Auto Out'</span> </pre>
<pre class="alt"><span class="lnum">  57:  </span>                                <span class="kwrd">WHEN</span> 4 <span class="kwrd">THEN</span> <span class="str">'Reserve'</span> </pre>
<pre><span class="lnum">  58:  </span>                                <span class="kwrd">WHEN</span> 5 <span class="kwrd">THEN</span> <span class="str">'Preview'</span> </pre>
<pre class="alt"><span class="lnum">  59:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'Not Applicable'</span> </pre>
<pre><span class="lnum">  60:  </span>                <span class="kwrd">END</span> Destination, </pre>
<pre class="alt"><span class="lnum">  61:  </span>                <span class="kwrd">CASE</span>  Agent_Real_Time.Direction </pre>
<pre><span class="lnum">  62:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'In'</span> </pre>
<pre class="alt"><span class="lnum">  63:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Out'</span> </pre>
<pre><span class="lnum">  64:  </span>                                <span class="kwrd">WHEN</span> 3 <span class="kwrd">THEN</span> <span class="str">'Other'</span> </pre>
<pre class="alt"><span class="lnum">  65:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'Not Applicable'</span> </pre>
<pre><span class="lnum">  66:  </span>                <span class="kwrd">END</span> Direction, </pre>
<pre class="alt"><span class="lnum">  67:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum">  68:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.OnHold = 1 <span class="kwrd">THEN</span> <span class="str">'Yes'</span> </pre>
<pre class="alt"><span class="lnum">  69:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre><span class="lnum">  70:  </span>                <span class="kwrd">END</span> OnHold, </pre>
<pre class="alt"><span class="lnum">  71:  </span>                Agent_Real_Time.NetworkTargetID, </pre>
<pre><span class="lnum">  72:  </span>                Agent_Real_Time.AgentStatus, </pre>
<pre class="alt"><span class="lnum">  73:  </span>                Agent_Real_Time.CustomerPhoneNumber, </pre>
<pre><span class="lnum">  74:  </span>                Agent_Real_Time.CustomerAccountNumber, </pre>
<pre class="alt"><span class="lnum">  75:  </span>                Agent_Real_Time.CampaignID, </pre>
<pre><span class="lnum">  76:  </span>                Agent_Real_Time.QueryRuleID, </pre>
<pre class="alt"><span class="lnum">  77:  </span>                Duration = DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, </pre>
<pre><span class="lnum">  78:  </span>                <span class="kwrd">CASE</span> </pre>
<pre class="alt"><span class="lnum">  79:  </span>                                <span class="kwrd">WHEN</span> (DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, (<span class="kwrd">SELECT</span> NowTime <span class="kwrd">from</span> Controller_Time (nolock))) &lt;= 0 ) </pre>
<pre><span class="lnum">  80:  </span>                                <span class="kwrd">THEN</span> Agent_Real_Time.DateTimeLastStateChange </pre>
<pre class="alt"><span class="lnum">  81:  </span>                                <span class="kwrd">ELSE</span>(<span class="kwrd">SELECT</span> NowTime <span class="kwrd">FROM</span> Controller_Time (nolock)) </pre>
<pre><span class="lnum">  82:  </span>                <span class="kwrd">END</span>), </pre>
<pre class="alt"><span class="lnum">  83:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum">  84:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.Routable = 1 </pre>
<pre class="alt"><span class="lnum">  85:  </span>                                <span class="kwrd">THEN</span> <span class="str">'Yes'</span> <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre><span class="lnum">  86:  </span>                <span class="kwrd">END</span> RoutableText, </pre>
<pre class="alt"><span class="lnum">  87:  </span>                Agent_Real_Time.DateTimeLastModeChange, </pre>
<pre><span class="lnum">  88:  </span>                Agent_Real_Time.CallInProgress, </pre>
<pre class="alt"><span class="lnum">  89:  </span>                Agent_Real_Time.MaxTasks, </pre>
<pre><span class="lnum">  90:  </span>                <span class="kwrd">CASE</span> </pre>
<pre class="alt"><span class="lnum">  91:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.AvailableInMRD = 0 <span class="kwrd">THEN</span> <span class="str">'No'</span> </pre>
<pre><span class="lnum">  92:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.AvailableInMRD = 1 <span class="kwrd">THEN</span> <span class="str">'Yes_ICM'</span> </pre>
<pre class="alt"><span class="lnum">  93:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.AvailableInMRD = 2 <span class="kwrd">THEN</span> <span class="str">'Yes_APP'</span> </pre>
<pre><span class="lnum">  94:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre class="alt"><span class="lnum">  95:  </span>                <span class="kwrd">END</span> AvailInMRDText, </pre>
<pre><span class="lnum">  96:  </span>                Agent_Real_Time.DateTimeTaskLevelChange, </pre>
<pre class="alt"><span class="lnum">  97:  </span>                Agent_Real_Time.RouterCallsQueueNow, </pre>
<pre><span class="lnum">  98:  </span>                Agent_Real_Time.RouterLongestCallQ </pre>
<pre class="alt"><span class="lnum">  99:  </span><span class="kwrd">FROM</span> </pre>
<pre><span class="lnum"> 100:  </span>                Agent (nolock), </pre>
<pre class="alt"><span class="lnum"> 101:  </span>                Person (nolock), </pre>
<pre><span class="lnum"> 102:  </span>                Media_Routing_Domain (nolock), </pre>
<pre class="alt"><span class="lnum"> 103:  </span>                Agent_Real_Time (nolock) <span class="kwrd">LEFT</span> <span class="kwrd">JOIN</span> Service (nolock) <span class="kwrd">ON</span> Agent_Real_Time.ServiceSkillTargetID = Service.SkillTargetID </pre>
<pre><span class="lnum"> 104:  </span>                <span class="kwrd">JOIN</span> Reason_Code <span class="kwrd">ON</span> Agent_Real_Time.ReasonCode = Reason_Code.ReasonCode,</pre>
<pre class="alt"><span class="lnum"> 105:  </span>                Skill_Group</pre>
<pre><span class="lnum"> 106:  </span><span class="kwrd">WHERE</span> ( Agent_Real_Time.SkillGroupSkillTargetID = Skill_Group.SkillTargetID) </pre>
<pre class="alt"><span class="lnum"> 107:  </span>                <span class="kwrd">and</span> Agent.PersonID=Person.PersonID </pre>
<pre><span class="lnum"> 108:  </span>                <span class="kwrd">and</span> Media_Routing_Domain.MRDomainID = Agent_Real_Time.MRDomainID </pre>
<pre class="alt"><span class="lnum"> 109:  </span>                <span class="kwrd">and</span> ( Agent.SkillTargetID = Agent_Real_Time.SkillTargetID ) </pre>
<pre><span class="lnum"> 110:  </span><span class="kwrd">UNION</span> <span class="kwrd">SELECT</span> </pre>
<pre class="alt"><span class="lnum"> 111:  </span>                Agent.EnterpriseName, </pre>
<pre><span class="lnum"> 112:  </span>                full_name=(Person.LastName + <span class="str">', '</span> + Person.FirstName) , </pre>
<pre class="alt"><span class="lnum"> 113:  </span>                <span class="kwrd">convert</span>(<span class="kwrd">varchar</span>,<span class="str">'Not Applicable'</span>), </pre>
<pre><span class="lnum"> 114:  </span>                Agent_Real_Time.SkillTargetID, </pre>
<pre class="alt"><span class="lnum"> 115:  </span>                Agent_Real_Time.DateTime, </pre>
<pre><span class="lnum"> 116:  </span>                Datepart(yy, Agent_Real_Time.DateTime) <span class="kwrd">as</span> <span class="kwrd">Year</span>, </pre>
<pre class="alt"><span class="lnum"> 117:  </span>                Datepart(mm, Agent_Real_Time.DateTime) <span class="kwrd">as</span> <span class="kwrd">Month</span>, </pre>
<pre><span class="lnum"> 118:  </span>                Datepart(ww, Agent_Real_Time.DateTime) <span class="kwrd">as</span> Week, </pre>
<pre class="alt"><span class="lnum"> 119:  </span>                Datepart(dy, Agent_Real_Time.DateTime) <span class="kwrd">as</span> DOY, </pre>
<pre><span class="lnum"> 120:  </span>                Datepart(dw, Agent_Real_Time.DateTime) <span class="kwrd">as</span> DOW, </pre>
<pre class="alt"><span class="lnum"> 121:  </span>                <span class="kwrd">CONVERT</span>(<span class="kwrd">char</span>(10),Agent_Real_Time.DateTime,101) <span class="kwrd">as</span> <span class="kwrd">DATE</span>, </pre>
<pre><span class="lnum"> 122:  </span>                Agent_Real_Time.SkillGroupSkillTargetID, </pre>
<pre class="alt"><span class="lnum"> 123:  </span>                ServiceName = Service.EnterpriseName, </pre>
<pre><span class="lnum"> 124:  </span>                Media=Media_Routing_Domain.EnterpriseName, </pre>
<pre class="alt"><span class="lnum"> 125:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum"> 126:  </span>                                Agent_Real_Time.AgentState </pre>
<pre class="alt"><span class="lnum"> 127:  </span>                                <span class="kwrd">WHEN</span> 0 <span class="kwrd">THEN</span> <span class="str">'Logged Out'</span> </pre>
<pre><span class="lnum"> 128:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'Logged On'</span> </pre>
<pre class="alt"><span class="lnum"> 129:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Not Ready'</span> </pre>
<pre><span class="lnum"> 130:  </span>                                <span class="kwrd">WHEN</span> 3 <span class="kwrd">THEN</span> <span class="str">'Ready'</span> </pre>
<pre class="alt"><span class="lnum"> 131:  </span>                                <span class="kwrd">WHEN</span> 4 <span class="kwrd">THEN</span> <span class="str">'Talking'</span> </pre>
<pre><span class="lnum"> 132:  </span>                                <span class="kwrd">WHEN</span> 5 <span class="kwrd">THEN</span> <span class="str">'Work Not Ready'</span> </pre>
<pre class="alt"><span class="lnum"> 133:  </span>                                <span class="kwrd">WHEN</span> 6 <span class="kwrd">THEN</span> <span class="str">'Work Ready'</span> </pre>
<pre><span class="lnum"> 134:  </span>                                <span class="kwrd">WHEN</span> 7 <span class="kwrd">THEN</span> <span class="str">'Busy Other'</span> </pre>
<pre class="alt"><span class="lnum"> 135:  </span>                                <span class="kwrd">WHEN</span> 8 <span class="kwrd">THEN</span> <span class="str">'Reserved'</span>  </pre>
<pre><span class="lnum"> 136:  </span>                                <span class="kwrd">WHEN</span> 9 <span class="kwrd">THEN</span> <span class="str">'Unknown'</span> </pre>
<pre class="alt"><span class="lnum"> 137:  </span>                                <span class="kwrd">WHEN</span> 10 <span class="kwrd">THEN</span> <span class="str">'Hold'</span> </pre>
<pre><span class="lnum"> 138:  </span>                                <span class="kwrd">WHEN</span> 11 <span class="kwrd">THEN</span> <span class="str">'Active'</span>  </pre>
<pre class="alt"><span class="lnum"> 139:  </span>                                <span class="kwrd">WHEN</span> 12 <span class="kwrd">THEN</span> <span class="str">'Paused'</span> </pre>
<pre><span class="lnum"> 140:  </span>                                <span class="kwrd">WHEN</span> 13 <span class="kwrd">THEN</span> <span class="str">'Interrupted'</span> </pre>
<pre class="alt"><span class="lnum"> 141:  </span>                                <span class="kwrd">WHEN</span> 14 <span class="kwrd">THEN</span> <span class="str">'Not Active'</span> </pre>
<pre><span class="lnum"> 142:  </span>                                <span class="kwrd">ELSE</span> <span class="kwrd">CONVERT</span>(<span class="kwrd">VARCHAR</span>, Agent_Real_Time.AgentState) </pre>
<pre class="alt"><span class="lnum"> 143:  </span>                <span class="kwrd">END</span> AgentState, </pre>
<pre><span class="lnum"> 144:  </span>                <span class="kwrd">CASE</span> </pre>
<pre class="alt"><span class="lnum"> 145:  </span>                                Agent_Real_Time.PhoneType </pre>
<pre><span class="lnum"> 146:  </span>                                <span class="kwrd">When</span> 0 <span class="kwrd">THEN</span> <span class="str">'Not Mobile'</span></pre>
<pre class="alt"><span class="lnum"> 147:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'Call By Call'</span> </pre>
<pre><span class="lnum"> 148:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Nailed Connection'</span> </pre>
<pre class="alt"><span class="lnum"> 149:  </span>                                <span class="kwrd">Else</span> <span class="str">'Not Applicable'</span> </pre>
<pre><span class="lnum"> 150:  </span>                <span class="kwrd">END</span> phonetypetext, </pre>
<pre class="alt"><span class="lnum"> 151:  </span>                remotephonenumber = Agent_Real_Time.RemotePhoneNumber, </pre>
<pre><span class="lnum"> 152:  </span>                ReasonCode = </pre>
<pre class="alt"><span class="lnum"> 153:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum"> 154:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.ReasonCode = 0 <span class="kwrd">THEN</span> <span class="str">'NONE'</span> </pre>
<pre class="alt"><span class="lnum"> 155:  </span>                                <span class="kwrd">ELSE</span> <span class="kwrd">CONVERT</span>(<span class="kwrd">VARCHAR</span>, Agent_Real_Time.ReasonCode) </pre>
<pre><span class="lnum"> 156:  </span>                <span class="kwrd">END</span> , </pre>
<pre class="alt"><span class="lnum"> 157:  </span>                Reason_Code.ReasonText,</pre>
<pre><span class="lnum"> 158:  </span>                Agent_Real_Time.Extension, </pre>
<pre class="alt"><span class="lnum"> 159:  </span>                Agent_Real_Time.DateTimeLastStateChange, </pre>
<pre><span class="lnum"> 160:  </span>                Agent_Real_Time.DateTimeLogin, </pre>
<pre class="alt"><span class="lnum"> 161:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum"> 162:  </span>                                <span class="kwrd">WHEN</span> RequestedSupervisorAssist = 1 <span class="kwrd">THEN</span> <span class="str">'Yes'</span> </pre>
<pre class="alt"><span class="lnum"> 163:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre><span class="lnum"> 164:  </span>                <span class="kwrd">END</span> RequestedSupervisorAssist, </pre>
<pre class="alt"><span class="lnum"> 165:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum"> 166:  </span>                                Agent_Real_Time.Destination </pre>
<pre class="alt"><span class="lnum"> 167:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'ACD'</span> </pre>
<pre><span class="lnum"> 168:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Direct'</span> </pre>
<pre class="alt"><span class="lnum"> 169:  </span>                                <span class="kwrd">WHEN</span> 3 <span class="kwrd">THEN</span> <span class="str">'Auto Out'</span> </pre>
<pre><span class="lnum"> 170:  </span>                                <span class="kwrd">WHEN</span> 4 <span class="kwrd">THEN</span> <span class="str">'Reserve'</span> </pre>
<pre class="alt"><span class="lnum"> 171:  </span>                                <span class="kwrd">WHEN</span> 5 <span class="kwrd">THEN</span> <span class="str">'Preview'</span> </pre>
<pre><span class="lnum"> 172:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'Not Applicable'</span> </pre>
<pre class="alt"><span class="lnum"> 173:  </span>                <span class="kwrd">END</span> Destination, </pre>
<pre><span class="lnum"> 174:  </span>                <span class="kwrd">CASE</span>  </pre>
<pre class="alt"><span class="lnum"> 175:  </span>                                Agent_Real_Time.Direction </pre>
<pre><span class="lnum"> 176:  </span>                                <span class="kwrd">WHEN</span> 1 <span class="kwrd">THEN</span> <span class="str">'In'</span> </pre>
<pre class="alt"><span class="lnum"> 177:  </span>                                <span class="kwrd">WHEN</span> 2 <span class="kwrd">THEN</span> <span class="str">'Out'</span> </pre>
<pre><span class="lnum"> 178:  </span>                                <span class="kwrd">WHEN</span> 3 <span class="kwrd">THEN</span> <span class="str">'Other'</span> </pre>
<pre class="alt"><span class="lnum"> 179:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'Not Applicable'</span> </pre>
<pre><span class="lnum"> 180:  </span>                <span class="kwrd">END</span> Direction, </pre>
<pre class="alt"><span class="lnum"> 181:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum"> 182:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.OnHold = 1 <span class="kwrd">THEN</span> <span class="str">'Yes'</span> </pre>
<pre class="alt"><span class="lnum"> 183:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre><span class="lnum"> 184:  </span>                <span class="kwrd">END</span> OnHold, </pre>
<pre class="alt"><span class="lnum"> 185:  </span>                Agent_Real_Time.NetworkTargetID, </pre>
<pre><span class="lnum"> 186:  </span>                Agent_Real_Time.AgentStatus, </pre>
<pre class="alt"><span class="lnum"> 187:  </span>                Agent_Real_Time.CustomerPhoneNumber, </pre>
<pre><span class="lnum"> 188:  </span>                Agent_Real_Time.CustomerAccountNumber, </pre>
<pre class="alt"><span class="lnum"> 189:  </span>                Agent_Real_Time.CampaignID, </pre>
<pre><span class="lnum"> 190:  </span>                Agent_Real_Time.QueryRuleID, </pre>
<pre class="alt"><span class="lnum"> 191:  </span>                Duration=DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, </pre>
<pre><span class="lnum"> 192:  </span>                <span class="kwrd">CASE</span> </pre>
<pre class="alt"><span class="lnum"> 193:  </span>                                <span class="kwrd">WHEN</span> (DATEDIFF(ss, Agent_Real_Time.DateTimeLastStateChange, </pre>
<pre><span class="lnum"> 194:  </span>                                (<span class="kwrd">SELECT</span> NowTime <span class="kwrd">from</span> Controller_Time (nolock)))  &lt;= 0 ) </pre>
<pre class="alt"><span class="lnum"> 195:  </span>                                <span class="kwrd">THEN</span> Agent_Real_Time.DateTimeLastStateChange    </pre>
<pre><span class="lnum"> 196:  </span>                                <span class="kwrd">ELSE</span> (<span class="kwrd">SELECT</span> NowTime <span class="kwrd">FROM</span> Controller_Time (nolock)) </pre>
<pre class="alt"><span class="lnum"> 197:  </span>                <span class="kwrd">END</span>), </pre>
<pre><span class="lnum"> 198:  </span>                <span class="kwrd">CASE</span> </pre>
<pre class="alt"><span class="lnum"> 199:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.Routable = 1 <span class="kwrd">THEN</span> <span class="str">'Yes'</span> </pre>
<pre><span class="lnum"> 200:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre class="alt"><span class="lnum"> 201:  </span>                <span class="kwrd">END</span> RoutableText , </pre>
<pre><span class="lnum"> 202:  </span>                Agent_Real_Time.DateTimeLastModeChange, </pre>
<pre class="alt"><span class="lnum"> 203:  </span>                Agent_Real_Time.CallInProgress, </pre>
<pre><span class="lnum"> 204:  </span>                Agent_Real_Time.MaxTasks, </pre>
<pre class="alt"><span class="lnum"> 205:  </span>                <span class="kwrd">CASE</span> </pre>
<pre><span class="lnum"> 206:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.AvailableInMRD = 0 <span class="kwrd">THEN</span> <span class="str">'No'</span> </pre>
<pre class="alt"><span class="lnum"> 207:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.AvailableInMRD = 1 <span class="kwrd">THEN</span> <span class="str">'Yes_ICM'</span> </pre>
<pre><span class="lnum"> 208:  </span>                                <span class="kwrd">WHEN</span> Agent_Real_Time.AvailableInMRD = 2 <span class="kwrd">THEN</span> <span class="str">'Yes_APP'</span> </pre>
<pre class="alt"><span class="lnum"> 209:  </span>                                <span class="kwrd">ELSE</span> <span class="str">'No'</span> </pre>
<pre><span class="lnum"> 210:  </span>                <span class="kwrd">END</span> AvailInMRDText, </pre>
<pre class="alt"><span class="lnum"> 211:  </span>                Agent_Real_Time.DateTimeTaskLevelChange, </pre>
<pre><span class="lnum"> 212:  </span>                Agent_Real_Time.RouterCallsQueueNow, </pre>
<pre class="alt"><span class="lnum"> 213:  </span>                Agent_Real_Time.RouterLongestCallQ </pre>
<pre><span class="lnum"> 214:  </span>                <span class="kwrd">FROM</span>   </pre>
<pre class="alt"><span class="lnum"> 215:  </span>                                Agent (nolock), </pre>
<pre><span class="lnum"> 216:  </span>                                Person (nolock), </pre>
<pre class="alt"><span class="lnum"> 217:  </span>                                Media_Routing_Domain (nolock), </pre>
<pre><span class="lnum"> 218:  </span>                                Agent_Real_Time (nolock) <span class="kwrd">LEFT</span> <span class="kwrd">JOIN</span> Service (nolock) <span class="kwrd">ON</span> Agent_Real_Time.ServiceSkillTargetID = Service.SkillTargetID</pre>
<pre class="alt"><span class="lnum"> 219:  </span>                                <span class="kwrd">JOIN</span> Reason_Code <span class="kwrd">ON</span> Agent_Real_Time.ReasonCode = Reason_Code.ReasonCode</pre>
<pre><span class="lnum"> 220:  </span>                <span class="kwrd">WHERE</span> </pre>
<pre class="alt"><span class="lnum"> 221:  </span>                                ((Agent_Real_Time.SkillGroupSkillTargetID = 0) <span class="kwrd">OR</span> (Agent_Real_Time.SkillGroupSkillTargetID <span class="kwrd">IS</span> <span class="kwrd">NULL</span>)) </pre>
<pre><span class="lnum"> 222:  </span>                                <span class="kwrd">and</span> Agent.PersonID=Person.PersonID</pre>
<pre class="alt"><span class="lnum"> 223:  </span>                                <span class="kwrd">and</span> Media_Routing_Domain.MRDomainID = Agent_Real_Time.MRDomainID </pre>
<pre><span class="lnum"> 224:  </span>                                <span class="kwrd">and</span> ( Agent.SkillTargetID = Agent_Real_Time.SkillTargetID )</pre>
</div>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>Note line 46 and 104 where the join is made to retrieve the reason text.&#160; Also note that you need to duplicate these lines in the Union Select statement.</p>
<p>Finally, create a new report definition, create a new report based off the definition, and test.&#160; This posts assumes that you know at least the very basics around CUIC.&#160; It doesn’t hurt to know some SQL, personally I know enough to be dangerous, but touch it so seldom that I’m no expert.</p>
<p>Hope this helps others out there as this is a pretty common report and a lot of customer ask for it.</p>
<p>~david</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2012/03/12/cisco-cuic-real-time-agent-report-with-not-ready-reason-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How many Cisco CTI OS agents are current logged in?</title>
		<link>http://dmacias.org/2012/02/01/how-many-cisco-cti-os-agents-are-current-logged-in/</link>
		<comments>http://dmacias.org/2012/02/01/how-many-cisco-cti-os-agents-are-current-logged-in/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 01:24:50 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cisco ICM]]></category>
		<category><![CDATA[ctios]]></category>

		<guid isPermaLink="false">http://dmacias.org/?p=494</guid>
		<description><![CDATA[I’ve seen this question come up a few times in the Cisco Support Community.&#160; Figured I would post something about it here.&#160; The question is to find out how many agents are currently logged to CTI OS.&#160; The following will give you the current number of logged in agents and if you leave it running [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve seen this question come up a few times in the Cisco Support Community.&#160; Figured I would post something about it here.&#160; The question is to find out how many agents are currently logged to CTI OS.&#160; The following will give you the current number of logged in agents and if you leave it running for a long period of time it will tell you how many agents logged in by average, minimum, and maximum number of logged in agents.</p>
<p>- All Programs &gt; Administrator Tools &gt; Performance   <br />- Click on New Counter Set    <br />- Right click on the counter screen and click on Add Counters…    <br />- Select the following counter below</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002[4]" border="0" alt="clip_image002[4]" src="http://dmacias.org/wp-content/uploads/2012/02/clip_image00241.jpg" width="244" height="241" /></p>
<p>- You will see the counter increase/decrease as agents log in and out.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://dmacias.org/wp-content/uploads/2012/02/clip_image0021.jpg" width="644" height="456" /></p>
<p>~dmacias</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2012/02/01/how-many-cisco-cti-os-agents-are-current-logged-in/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>David gets a gold star (Cisco Support Community)!</title>
		<link>http://dmacias.org/2011/09/15/david-gets-a-gold-star-cisco-support-community/</link>
		<comments>http://dmacias.org/2011/09/15/david-gets-a-gold-star-cisco-support-community/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 21:23:19 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[General News]]></category>

		<guid isPermaLink="false">http://dmacias.org/2011/09/15/david-gets-a-gold-star-cisco-support-community/</guid>
		<description><![CDATA[I like to contribute a lot to Cisco’s NetPro Forums, now called Cisco Support Community.&#160; I’ve been a member since 2005 and love the community since everyone seems to help everyone out a lot.&#160; For this particular reason I feel inclined to give back as much as possible.&#160; That being said, when you post a [...]]]></description>
			<content:encoded><![CDATA[<p>I like to contribute a lot to Cisco’s NetPro Forums, now called Cisco Support Community.&#160; I’ve been a member since 2005 and love the community since everyone seems to help everyone out a lot.&#160; For this particular reason I feel inclined to give back as much as possible.&#160; That being said, when you post a reply posters can give you points for how good your response was or how much it helped them.&#160; So, that’s one way to get some recognition if you’re actually being helpful.</p>
<p>That being said, there are different levels based on how many points you’ve been awarded.&#160; Just recently I reached the gold start level by surpassing 750 points.&#160; While I still have a long way to go to catch some of the top contributors who are in the 10s of thousands of points, it does feel nice to hit a small milestone.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://dmacias.org/wp-content/uploads/2011/09/image1.png" width="638" height="484" /></p>
<p>~dmacias</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2011/09/15/david-gets-a-gold-star-cisco-support-community/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco CRM Adapter with Firefox</title>
		<link>http://dmacias.org/2011/09/10/cisco-crm-adapter-with-firefox/</link>
		<comments>http://dmacias.org/2011/09/10/cisco-crm-adapter-with-firefox/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 11:34:43 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cisco CRM Adapter]]></category>
		<category><![CDATA[Salesforce.com]]></category>
		<category><![CDATA[SFDC]]></category>

		<guid isPermaLink="false">http://dmacias.org/2011/09/10/cisco-crm-adapter-with-firefox/</guid>
		<description><![CDATA[I will assume you have the server connected and working properly, this post focuses solely on getting the CRM adapter working with Firefox 3.x, 6.x.&#160; The version I’m working with is Cisco_Unified_CRM_Connector_7.52, which allows you to install the server or client.&#160; This is Cisco’s latest version and upon install it includes Salesforce.com Adapter 3.00.&#160; Install [...]]]></description>
			<content:encoded><![CDATA[<p>I will assume you have the server connected and working properly, this post focuses solely on getting the CRM adapter working with Firefox 3.x, 6.x.&#160; The version I’m working with is Cisco_Unified_CRM_Connector_7.52, which allows you to install the server or client.&#160; This is Cisco’s latest version and upon install it includes Salesforce.com Adapter 3.00.&#160; Install the adapter, including the Firefox extension and perform the following steps:</p>
<ul>
<li>Download the <a href="http://developerforce_shared.s3.amazonaws.com/media/CTI Toolkit/CTI-3.01/demo_3_01_setup.exe">Demo Adapter 3.01</a>.&#160; This includes the Salesforce.com Adapter 3.01.</li>
<li>Run through setup and install it in a different directory.&#160; Ensure you install the Firefox extension.&#160; Cisco’s in C:\Program Files\Cisco\CRM Connector\Salesforce.com Adapter\ and Salesforce in C:\Program Files\Salesforce.com\Demo Adapter 3.01.</li>
<li>Go to the Demo Adapter 3.01 folder and register the SFDCFirefoxConnector.dll and SFDCFirefoxConnectorPS.dll.</li>
<ul>
<li>You can register them by double clicking on the file and opening them with C:\Windows\System32\regsvr32.exe</li>
</ul>
<li>Restart Firefox.</li>
</ul>
<p>Firefox should now be working with your Salesforce.com instance.&#160; Please note that you now have two adapters and you must be running Cisco’s version 3.00 in order for this to work.&#160; I’m assuming someone at Cisco didn’t package the right DLL and or the right Firefox extension (which is included in the Demo Adapter 3.01 folder sfdcffextension.xpi).</p>
<p>~dmacias</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2011/09/10/cisco-crm-adapter-with-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mRemote and Cisco&#8217;s AnyConnect Client Issues</title>
		<link>http://dmacias.org/2010/12/08/mremote-and-ciscos-anyconnect-client-issues/</link>
		<comments>http://dmacias.org/2010/12/08/mremote-and-ciscos-anyconnect-client-issues/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 00:11:21 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cisco AnyConnect]]></category>
		<category><![CDATA[mRemote]]></category>
		<category><![CDATA[mRemoteNG]]></category>

		<guid isPermaLink="false">http://dmacias.org/2010/12/08/mremote-and-ciscos-anyconnect-client-issues/</guid>
		<description><![CDATA[I love mRemote.&#160; Makes keeping track of all the different connections (RDP, VNC, SSH, etc.) a breeze.&#160; However, I’ve recently noticed that after I installed Cisco’s AnyConnect client I could no longer open my existing connections or create new connections.&#160; Upon startup I would receive the following window: What I ended up having to do [...]]]></description>
			<content:encoded><![CDATA[<p>I love mRemote.&#160; Makes keeping track of all the different connections (RDP, VNC, SSH, etc.) a breeze.&#160; However, I’ve recently noticed that after I installed Cisco’s AnyConnect client I could no longer open my existing connections or create new connections.&#160; Upon startup I would receive the following window:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto 1px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="mRemoteSecurityPassword" border="0" alt="mRemoteSecurityPassword" src="http://dmacias.org/wp-content/uploads/2010/12/mRemoteSecurityPassword1.jpg" width="357" height="232" /></p>
<p>What I ended up having to do is remove AnyConnect and then disable FIPS encryption following this link <a title="http://support.microsoft.com/kb/811770" href="http://support.microsoft.com/kb/811770">http://support.microsoft.com/kb/811770</a>.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px auto 1px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="WindowsPolicy" border="0" alt="WindowsPolicy" src="http://dmacias.org/wp-content/uploads/2010/12/WindowsPolicy1.png" width="450" height="96" /></p>
<p>Works like a charm now.&#160; More than likely you don’t have to remove AnyConnect, however I don’t use it that much and rather just remove it all together.</p>
<p>~david</p>
<p>PS: The mRemote project is dead at version 1.5, there’s a fork out there called mRemoteNG which I’m trying out check it out here <a title="http://www.mremoteng.org/" href="http://www.mremoteng.org/">http://www.mremoteng.org/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2010/12/08/mremote-and-ciscos-anyconnect-client-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco UCCE Outbound Option Find Query Rule for Dialed Record</title>
		<link>http://dmacias.org/2010/10/02/cisco-ucce-outbound-option-find-query-rule-for-dialed-record/</link>
		<comments>http://dmacias.org/2010/10/02/cisco-ucce-outbound-option-find-query-rule-for-dialed-record/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 09:33:40 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cisco UCCE]]></category>
		<category><![CDATA[Outbound Option]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://dmacias.org/2010/10/02/cisco-ucce-outbound-option-find-query-rule-for-dialed-record/</guid>
		<description><![CDATA[Here’s a simple query using an inner join to find out which query rule added a certain record to the dialer.&#160; This is pretty useful when you’re trying to figure out why a record was dialed which went to the wrong skill group.&#160; The only challenge here is joining two different tables in two different [...]]]></description>
			<content:encoded><![CDATA[<p>Here’s a simple query using an inner join to find out which query rule added a certain record to the dialer.&#160; This is pretty useful when you’re trying to figure out why a record was dialed which went to the wrong skill group.&#160; The only challenge here is joining two different tables in two different databases, in this case the HDS and AW databases.</p>
<blockquote><p>&#160;</p>
<p>SELECT [DateTime]     <br />&#160;&#160;&#160;&#160;&#160; ,[CustomerTimeZone] AS CustTimeZone      <br />&#160;&#160;&#160;&#160;&#160; ,[CampaignID]      <br />&#160;&#160;&#160;&#160;&#160; ,[CallResult]      <br />&#160;&#160;&#160;&#160;&#160; ,[CallStatusZone1]      <br />&#160;&#160;&#160;&#160;&#160; ,[CallStatusZone2]      <br />&#160;&#160;&#160;&#160;&#160; ,[asp_awdb].[dbo].[t_Query_Rule].QueryRuleName      <br />&#160;&#160;&#160;&#160;&#160; ,[DialingListID]      <br />&#160;&#160;&#160;&#160;&#160; ,[Phone]      <br />&#160;&#160;&#160;&#160;&#160; ,[SkillGroupSkillTargetID] AS SGID      <br />&#160;&#160;&#160;&#160;&#160; ,[AgentPeripheralNumber] AS AgentExt      <br />&#160;&#160;&#160;&#160;&#160; ,[PeripheralCallKey]      <br />&#160;&#160;&#160;&#160;&#160; ,[CallDuration]      <br />&#160;&#160;&#160;&#160;&#160; ,[AccountNumber]      <br />&#160;&#160;&#160;&#160;&#160; ,[FirstName]      <br />&#160;&#160;&#160;&#160;&#160; ,[LastName]      <br />&#160;&#160;&#160;&#160;&#160; ,[CallbackPhone]      <br />&#160;&#160;&#160;&#160;&#160; ,[CallbackDateTime]      <br />&#160;&#160;&#160;&#160;&#160; ,[DialingMode]      <br />&#160;&#160;&#160;&#160;&#160; ,[DialerID]      <br />&#160;&#160;&#160;&#160;&#160; ,[ImportRuleDateTime]      <br />&#160; FROM [dam_hds].[dbo].[t_Dialer_Detail]      <br />INNER JOIN [dam_awdb].[dbo].[t_Query_Rule] on [dam_hds].[dbo].[t_Dialer_Detail].QueryRuleID = [dam_awdb].[dbo].[t_Query_Rule].QueryRuleID      <br />WHERE DateTime &gt; &#8217;10/01/2010&#8242;       <br />ORDER BY DateTime DESC</p>
<p>Presto!</p>
<p>~david</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2010/10/02/cisco-ucce-outbound-option-find-query-rule-for-dialed-record/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CTIOS Error 10125</title>
		<link>http://dmacias.org/2010/06/01/ctios-error-10125/</link>
		<comments>http://dmacias.org/2010/06/01/ctios-error-10125/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 03:03:22 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cisco ICM]]></category>
		<category><![CDATA[Cisco Unified Communications Manager]]></category>

		<guid isPermaLink="false">http://dmacias.org/2010/06/01/ctios-error-10125/</guid>
		<description><![CDATA[PeripheralErrorCode:10125 AgentID:1000 UniqueObjectID:agent.5000.1000 &#160;&#160;&#160;&#160; MessageID:eControlFailureConf MessageType:eSetAgentStateRequest &#160;&#160;&#160;&#160; ErrorMessage:IPCC Error [10125]You have attempted to log into an invalid &#160;&#160;&#160;&#160; instrument.&#160; If you think it is correct there could be a configuration error. &#160;&#160;&#160;&#160;&#160; Otherwise, check the number and try again. FilterTarget:agent.5000.1000 I recently ran into this error and for the life of me could not figure [...]]]></description>
			<content:encoded><![CDATA[<p>PeripheralErrorCode:10125 AgentID:1000 UniqueObjectID:agent.5000.1000   <br />&#160;&#160;&#160;&#160; MessageID:eControlFailureConf MessageType:eSetAgentStateRequest    <br />&#160;&#160;&#160;&#160; ErrorMessage:IPCC Error [10125]You have attempted to log into an invalid    <br />&#160;&#160;&#160;&#160; instrument.&#160; If you think it is correct there could be a configuration error.    <br />&#160;&#160;&#160;&#160;&#160; Otherwise, check the number and try again. FilterTarget:agent.5000.1000</p>
<p>I recently ran into this error and for the life of me could not figure out what was wrong.&#160; So, the first thing I did was make sure it was happening on more than one PC, check.&#160; Next, checked if it was happening with more than one phone, check.&#160; Next, check if it happens with both PGs… this is where I noticed that I could login to one PG, but not to the other.&#160; Which then lead me to check the configuration of both PGs and found that the PG configuration for the PG where the login was failing had an agent extension of 7 digits instead of 10 digits.&#160; Thus why CTIOS was rejecting my login to a phone with an extension with 10 digits.</p>
<p>Presto!</p>
<p>~david</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2010/06/01/ctios-error-10125/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco ICM Admin Script Will Not Run</title>
		<link>http://dmacias.org/2009/06/25/cisco-icm-admin-script-will-not-run/</link>
		<comments>http://dmacias.org/2009/06/25/cisco-icm-admin-script-will-not-run/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 11:28:35 +0000</pubDate>
		<dc:creator>dmacias</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Admin Script]]></category>
		<category><![CDATA[Cisco ICM Script Editor]]></category>

		<guid isPermaLink="false">http://dmacias.org/2009/06/25/cisco-icm-admin-script-will-not-run/</guid>
		<description><![CDATA[I ran into an issue yesterday which I’m still not 100% sure as to why it happened, but I at least was able to clear it&#160; up.&#160; I created an administrator script which did run even though it was scheduled to run every 30 seconds.&#160; The script even when down to a start and end [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an issue yesterday which I’m still not 100% sure as to why it happened, but I at least was able to clear it&#160; up.&#160; I created an administrator script which did run even though it was scheduled to run every 30 seconds.&#160; The script even when down to a start and end node only and still no response.&#160; So, when making changes in ICM the first place to look at is the router.&#160; Did a quick “cdlog ra /last /o” and the ra.log showed the following:</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span>21:02:40 ra-rtr Trace: Undefined symbol: Global.userMy_UserVar. </pre>
<pre><span class="lnum">   2:  </span>21:02:40 ra-rtr Add of ScriptData warning. </pre>
<pre>Unable complete script load 7300: Undefined symbol: Global.userMy_UserVar. </pre>
<pre class="alt"><span class="lnum">   3:  </span>21:02:40 ra-rtr All configuration operations complete. </pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>So, if nothing else, this lets me know that there is something in my config which is not right and it’s possible that new changes might be queued up and that’s why my admin script is not running.&#160; I went through all references of my user variable and removed them.&#160; I then deleted the user variable and created a new one with the same name and put it back in every script.&#160; Looked at the router log again and it looked clean.&#160; After that, the admin script ran fine.</p>
<p>&#160;</p>
<p>~david</p>
]]></content:encoded>
			<wfw:commentRss>http://dmacias.org/2009/06/25/cisco-icm-admin-script-will-not-run/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

