« Back to CTIOS Toolkit Questions

Agent Changing Not Ready to Not Ready

Combination View Flat View Tree View
Threads [ Previous | Next ]
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!

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.
 

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

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

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


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

RE: Agent Changing Not Ready to Not Ready
sdk ctios cti java
Answer
7/13/10 11:35 AM as a reply to David Lender.
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

 
 
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

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.

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

 
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
 
<pre> // This method demonstrates a pattern for making thread-safe
// calls on a Windows Forms control.
//
// If the calling thread is different from the thread that
// created the TextBox control, this method creates a
// SetTextCallback and calls itself asynchronously using the
// Invoke method.
//
// If the calling thread is the same as the thread that created
// the TextBox control, the Text property is set directly.

private void SetText(string text)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.textBox1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.textBox1.Text = text;
}
}



</pre>

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 & (long)ButtonEnablement.ENABLE_NOTREADY) >0)
EnableCtlState(btnNotReady, true);
else if ((mask & (long)ButtonEnablement.ENABLE_NOTREADY_WITH_REASON) >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.

David Lender (474)
Shannon McCoy (91)
Arthur Shats (57)
Christopher Nagel (47)
GEOFFREY THOMPSON (40)