<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Agent Changing Not Ready to Not Ready</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=1961978" />
  <subtitle>Agent Changing Not Ready to Not Ready</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=1961978</id>
  <updated>2013-05-25T03:48:12Z</updated>
  <dc:date>2013-05-25T03:48:12Z</dc:date>
  <entry>
    <title>RE: Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6425374" />
    <author>
      <name>SEAN NILSEN</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6425374</id>
    <updated>2012-09-05T15:26:05Z</updated>
    <published>2012-09-05T15:26:05Z</published>
    <summary type="html">I know that this thread is super-old but I figured that since this came up in one of my searches recently I should close it out with what I finally did in this case.

If you open the CTIOSSoftphoneCSharp project and take a look at the ProcessOnButtonEnablementMaskChange function, you'll see a few lines down where the NotReady button enablement is handled, around line 3397 depending on how much I have messed with this project since the original version.

			if ((mask &amp; (long)ButtonEnablement.ENABLE_NOTREADY) &gt;0)
				EnableCtlState(btnNotReady, true);
			else if ((mask &amp; (long)ButtonEnablement.ENABLE_NOTREADY_WITH_REASON) &gt;0)
				EnableCtlState(btnNotReady, true);
			else
				EnableCtlState(btnNotReady, false);

In my case I simply changed the "else" clause to also set the button to "true".

Functionally this means that the Not Ready button stays enabled for the entire duration of the Login period and the agent never has to go Ready in order to set a NR code.

No messing with Thread ID's or other functions necessary.

Looking forward to all sorts of Finesse fun.</summary>
    <dc:creator>SEAN NILSEN</dc:creator>
    <dc:date>2012-09-05T15:26:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2358157" />
    <author>
      <name>Shannon McCoy</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2358157</id>
    <updated>2010-07-15T14:24:10Z</updated>
    <published>2010-07-15T14:24:10Z</published>
    <summary type="html">[quote]Sean,
 
I was wondering if you were able to do this.  I am using the c# desktop and I am using m_CtiObject.SetAgentState(AgentState.eWorkReady, -1).  However when I do this from the NotReady button click I get an exception. "Cross-thread operation not valid: Control 'SoftPhoneForm' accessed from a thread other than the thread it was created on."
 
I also get an IPCC Error[10110] You may not go to a wrap up state because your call has ended.
 
I am using the same code that is found in the btnWorkReady_Click event.  After which I would like to set the status back to NotReady.
 
Thanks,
Rick[/quote]
 
You are getting the CrossThreading exception because you are calling methods from a different thread than the UI Thread. WinForms apps only have one UI thread and async events such as the CILs come in on different threads. There are 2 ways to handle this. 
 
At the top of your form ( like in the ctor ) you can set CheckForIllegalCrossThreadCalls = false; Or you can set do a context switch to the UI thread like below. This is a constant issue with WinForms apps and well documented.
 
Below is an excerpt from msdn but you can find a bunch of generic ways to do these calls. 
 
http://msdn.microsoft.com/en-us/library/ms171728.aspx
 
&lt;pre&gt;		[color=green]// This method demonstrates a pattern for making thread-safe[/color]
		[color=green]// calls on a Windows Forms control. [/color]
		[color=green]//[/color]
		[color=green]// If the calling thread is different from the thread that[/color]
		[color=green]// created the TextBox control, this method creates a[/color]
		[color=green]// SetTextCallback and calls itself asynchronously using the[/color]
		[color=green]// Invoke method.[/color]
		[color=green]//[/color]
		[color=green]// If the calling thread is the same as the thread that created[/color]
		[color=green]// the TextBox control, the Text property is set directly. [/color]

		[color=blue]private[/color] [color=blue]void[/color] SetText([color=blue]string[/color] text)
		{
			[color=green]// InvokeRequired required compares the thread ID of the[/color]
			[color=green]// calling thread to the thread ID of the creating thread.[/color]
			[color=green]// If these threads are different, it returns true.[/color]
			[color=blue]if[/color] ([color=blue]this[/color].textBox1.InvokeRequired)
			{	
				SetTextCallback d = [color=blue]new[/color] SetTextCallback(SetText);
				[color=blue]this[/color].Invoke(d, [color=blue]new[/color] [color=blue]object[/color][] { text });
			}
			[color=blue]else[/color]
			{
				[color=blue]this[/color].textBox1.Text = text;
			}
		}



&lt;/pre&gt;</summary>
    <dc:creator>Shannon McCoy</dc:creator>
    <dc:date>2010-07-15T14:24:10Z</dc:date>
  </entry>
  <entry>
    <title>RE: New Message from Ofer Shany in Computer Telephony Integration Object Se</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2353151" />
    <author>
      <name>David Lender</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2353151</id>
    <updated>2010-07-13T18:58:19Z</updated>
    <published>2010-07-13T18:58:19Z</published>
    <summary type="html">Are you not getting the agent state change event to confirm your reason
code change?  If not, I suggest opening a Service Request for Developer
Services using your CDN subscription.  Be sure to specify Other for
Technology and Cisco Developer Network - Contact Center Applications for
SubTechnology when you use the TAC case open tool.</summary>
    <dc:creator>David Lender</dc:creator>
    <dc:date>2010-07-13T18:58:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2352369" />
    <author>
      <name>Ofer Shany</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2352369</id>
    <updated>2010-07-13T11:35:02Z</updated>
    <published>2010-07-13T11:35:02Z</published>
    <summary type="html">[quote]Not ready to Not ready IS supported for CUCCE (IPCC) beginning with v7.5(4)
 
http://developer.cisco.com/web/ctios/blogroll/-/blogs/not-ready-reason-code-in-not-ready-state?_33_redirect=%2Fweb%2Fctios%2Fblogroll[/quote]
 
 
Hi,
We're working with CTIOS 7.5.1 (ICM version 7.5.1 as well) and the Java CIL SDK.
Does anyone know if this option is avaiable for us ? 
I tried impementing it but when I move from one Not Ready reason to antoher Not Ready reason directyl I do not get any indication back from the CTIOS that this worked. 
 
Has anyone tried it ?
 
Thanks,
Ofer</summary>
    <dc:creator>Ofer Shany</dc:creator>
    <dc:date>2010-07-13T11:35:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2107585" />
    <author>
      <name>Brandy Totten</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2107585</id>
    <updated>2010-04-14T02:00:49Z</updated>
    <published>2010-04-14T02:00:49Z</published>
    <summary type="html">[quote]Sean,
 
I was wondering if you were able to do this.  I am using the c# desktop and I am using m_CtiObject.SetAgentState(AgentState.eWorkReady, -1).  However when I do this from the NotReady button click I get an exception. "Cross-thread operation not valid: Control 'SoftPhoneForm' accessed from a thread other than the thread it was created on."
 
I also get an IPCC Error[10110] You may not go to a wrap up state because your call has ended.
 
I am using the same code that is found in the btnWorkReady_Click event.  After which I would like to set the status back to NotReady.
 
Thanks,
Rick[/quote]

Your cross thread error is probably because you are trying to change the state in an event other than a button event (or other GUI event). In order to get around this, I suggest creating a timer that will update your buttons for you. You can also get around it by doing an Invoke.
 
As for your other error, I have not been successful in changing the state to work ready. I am only able to go ready, not ready, unknown. If you figure it out, please let us know</summary>
    <dc:creator>Brandy Totten</dc:creator>
    <dc:date>2010-04-14T02:00:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2070917" />
    <author>
      <name>Richard Rhinehart</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2070917</id>
    <updated>2010-03-26T04:23:10Z</updated>
    <published>2010-03-26T04:05:43Z</published>
    <summary type="html">Sean,
 
I was wondering if you were able to do this.  I am using the c# desktop and I am using m_CtiObject.SetAgentState(AgentState.eWorkReady, -1).  However when I do this from the NotReady button click I get an exception. "Cross-thread operation not valid: Control 'SoftPhoneForm' accessed from a thread other than the thread it was created on."
 
I also get an IPCC Error[10110] You may not go to a wrap up state because your call has ended.
 
I am using the same code that is found in the btnWorkReady_Click event.  After which I would like to set the status back to NotReady.
 
Thanks,
Rick</summary>
    <dc:creator>Richard Rhinehart</dc:creator>
    <dc:date>2010-03-26T04:05:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2055160" />
    <author>
      <name>David Lender</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2055160</id>
    <updated>2010-03-19T18:53:30Z</updated>
    <published>2010-03-19T18:53:30Z</published>
    <summary type="html">Not ready to Not ready IS supported for CUCCE (IPCC) beginning with v7.5(4)
 
http://developer.cisco.com/web/ctios/blogroll/-/blogs/not-ready-reason-code-in-not-ready-state?_33_redirect=%2Fweb%2Fctios%2Fblogroll</summary>
    <dc:creator>David Lender</dc:creator>
    <dc:date>2010-03-19T18:53:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2055150" />
    <author>
      <name>Darryl Bell</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2055150</id>
    <updated>2010-03-19T18:41:45Z</updated>
    <published>2010-03-19T18:41:45Z</published>
    <summary type="html">Yes; it's technically possible. However with that said, you must go into a "Ready" state to go into a Not Ready State. The workaround is to use a Work Ready (Wrap Up) or Reserved State for a Milisecond even, from the Not Ready Button. This way it will allow Not Ready to Not Ready State change without getting a call between states. ie; when transitioning from a non phone answering state to say lunch without getting a call between. 
 
With each click the milisecond of Work Ready's will eventually add up so taht you might see a few extra seconds of this state reporting wise but not that it should be a big deal just something to consider or substract from your metrics.
 </summary>
    <dc:creator>Darryl Bell</dc:creator>
    <dc:date>2010-03-19T18:41:45Z</dc:date>
  </entry>
  <entry>
    <title>Agent Changing Not Ready to Not Ready</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1961977" />
    <author>
      <name>SEAN NILSEN</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1961977</id>
    <updated>2010-02-12T01:00:13Z</updated>
    <published>2010-02-12T01:00:13Z</published>
    <summary type="html">I am investigating a method of allowing an agent to transition from one Not Ready Reason Code to another without having to go into a Ready state first.
 
Has anyone done this work before? Just wondering if it's technically possible before I go heads down on development trying it out.
 
Thanks!</summary>
    <dc:creator>SEAN NILSEN</dc:creator>
    <dc:date>2010-02-12T01:00:13Z</dc:date>
  </entry>
</feed>

