<?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>A problem with CTIOS Toolkit</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=3901715" />
  <subtitle>A problem with CTIOS Toolkit</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=3901715</id>
  <updated>2013-05-24T02:26:46Z</updated>
  <dc:date>2013-05-24T02:26:46Z</dc:date>
  <entry>
    <title>RE: A problem with CTIOS Toolkit</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7488092" />
    <author>
      <name>AARNE KYLAKALLIO</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7488092</id>
    <updated>2012-10-10T10:49:35Z</updated>
    <published>2012-10-10T10:49:35Z</published>
    <summary type="html">Big Thanks for the code sample.
I had to modify it a bit (code below), since the thread name was already set where I called Set_Agent for the first time. I found out that the latest point where current.thread.name was not set in my code was just before connect method.
Also I had to create a new property, AgentPeripheralNumber, that I can set later in the code where I know what it is.
Is there any (easy) way to see if this fixes the issue other than installing the new client to 600 workstations.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
&lt;font size="2"&gt;
 
&lt;/font&gt;
public class CtiOsSessionWithAgentID : CtiOsSession

{
&lt;font size="2"&gt;
 
&lt;/font&gt;
private string _agentID;&lt;font size="2"&gt;
 
&lt;/font&gt;
public string sAgentPeripheralNumber
{
&lt;font size="2"&gt;
 
&lt;/font&gt;
get
{
&lt;font size="2"&gt;
 
&lt;/font&gt;
return _agentID;
}
&lt;font size="2"&gt;
 
&lt;/font&gt;
set
{
&lt;font size="2"&gt;
_agentID = 
&lt;/font&gt;
value;
}
}
&lt;font size="2"&gt;
 
&lt;/font&gt;
public CtiOsSessionWithAgentID(string pAgentID)
{
_agentID = pAgentID;
}
&lt;font size="2"&gt;
 
&lt;/font&gt;
new public CilError SetAgent(Agent NewAgent)
{
&lt;font size="2"&gt;
 
&lt;/font&gt;
// could not set thread name here, since it was alraedy set
&lt;font size="2"&gt;
 
&lt;/font&gt;
return base.SetAgent(NewAgent);
}
&lt;font size="2"&gt;
 
&lt;/font&gt;
new public CilError Connect(Arguments rArgs)
{
&lt;font size="2"&gt;
 
&lt;/font&gt;
if (Thread.CurrentThread.Name != null)
{
&lt;font size="2"&gt;
 
&lt;/font&gt;
// cant't set the thread name since it is set already

}
&lt;font size="2"&gt;
 
&lt;/font&gt;
else

{
&lt;font size="2"&gt;
 
&lt;/font&gt;
Thread.CurrentThread.Name = _agentID;
}
&lt;font size="2"&gt;
 
&lt;/font&gt;
return base.Connect(rArgs);
}
 
}</summary>
    <dc:creator>AARNE KYLAKALLIO</dc:creator>
    <dc:date>2012-10-10T10:49:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: New Message from AARNE KYLAKALLIO in Computer Telephony Integration Obj</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7448695" />
    <author>
      <name>David Lender</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7448695</id>
    <updated>2012-10-09T14:40:12Z</updated>
    <published>2012-10-09T14:40:12Z</published>
    <summary type="html">A previous customer used this workaround:

Here is an example of code:

public class CtiOsSessionWithAgentID : CtiOsSession
{
    private string _agentID;

    public CtiOsSessionWithAgentID(string pAgentID)
    {
        _agentID = pAgentID;
    }

    new public CilError SetAgent(Agent NewAgent)
    {
       Thread.CurrentThread.Name = pAgentID;
       return base.SetAgent(NewAgent);
    }
}

We just replaced SetAgent function of CtiOsSession in order to set the
thread name.</summary>
    <dc:creator>David Lender</dc:creator>
    <dc:date>2012-10-09T14:40:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: A problem with CTIOS Toolkit</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7443115" />
    <author>
      <name>AARNE KYLAKALLIO</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7443115</id>
    <updated>2012-10-09T10:58:15Z</updated>
    <published>2012-10-09T10:58:15Z</published>
    <summary type="html">We are hitting this same problem.
Is there a way to verify from ctios server logs that the threadname is set correctly, since othervise it is hard to see if this is fixed.
Also, would you like to share the new connect method.</summary>
    <dc:creator>AARNE KYLAKALLIO</dc:creator>
    <dc:date>2012-10-09T10:58:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: A problem with CTIOS Toolkit</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4840101" />
    <author>
      <name>Jean-Marc Lacoste</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4840101</id>
    <updated>2011-12-04T08:39:07Z</updated>
    <published>2011-12-04T08:39:07Z</published>
    <summary type="html">We have found the solution for this issue. 

The clientID that identifies the CTIOS connection is built on the machine name, the process ID and the thread name. The issue is that the thread name is not initialized by default, so we have to do it in the code. We have overrided the connect() method to set the thread name to a unique value before calling the CTIOS connect method and it works.

Our understanding is that, before CTIOS 7.5, CTIOS server was not checking that the clientID was unique.

Best regards,

jmlacoste &amp; dostvald</summary>
    <dc:creator>Jean-Marc Lacoste</dc:creator>
    <dc:date>2011-12-04T08:39:07Z</dc:date>
  </entry>
  <entry>
    <title>RE: A problem with CTIOS Toolkit</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4803599" />
    <author>
      <name>Jean-Marc Lacoste</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4803599</id>
    <updated>2011-11-26T16:18:56Z</updated>
    <published>2011-11-26T16:18:56Z</published>
    <summary type="html">Hello,

We are facing the same issue. We have developped two years ago a third party server application for CTIOS that provides an IP Phone XML interface to manage multiple agents, based on Net CIL 7.0.2. The application handles multiple agents. This application has run on production for two years on CTIOS 7.1.5. 

However, on CTIOS 7.5 with the previous CIL client or after recompiling with CIL 7.5.9 client, we have found that when login another agent from the application the first one does not receive event but can still control by sending commands. 

CTIOS Server is mixing the two CTIOS connections. The CtiOsSession is different but the ClientID is the same, it is actually the Windows Process ID

First CTIOS connection
CTIOS Client : 17:59:28.2942 CtiOsSession(11203942).MakeRequest, (ClientPassword:(null) CILClientID:.1504)

CTIOS Server : 17:59:27 CTIOS1-ctios Trace: ClientMgr[1]::IdentifyClientRequest, Client[00226]: Changing ClientID ["00226"-&gt;".1504"]. 

Second CTIOS connection
CTIOS Client : 18:01:36.2005 CtiOsSession(28068188).MakeRequest, (ClientPassword:(null) CILClientID:.1504)

CTIOS Server : 18:01:35 CTIOS1-ctios Trace: ClientMgr[1]::IdentifyClientRequest, Client[00227]: Changing ClientID ["00227"-&gt;".1504"]. 
18:01:35 CTIOS1-ctios Trace: CServiceBroker::OnEvent(). 
18:01:35 CTIOS1-ctios Trace: ClientMgr[1]::AddToClientIDMap[2112], Found Duplicate Client ID: .1504,
	 PreviousClient[226, 0x42f2008], NewClient[227, 0x4172800] 



Afterward, when login the second agent the first one (902420) is logged out.

18:01:35 CTIOS1-ctios Trace: [agent.5006.902420]::HandleOnLastSessionClosedEvent(): state [eAvailable]
	 forcing logout. 
18:01:35 CTIOS1-ctios Trace: [agent.5006.902420] SET_AGENT_STATE_REQ ( eLogout ) : (PeripheralID:5006
	 AgentState:eLogout NumSkillGroups:0 EventReasonCode:255 AgentWorkMode:0
	 AgentID:902420 AgentInstrument:81110) 

	 
How could we force the server to consider the second CTIOS Connection as a new one ? 
Is it fixed on more recent CTIOS version ?

jmlacoste</summary>
    <dc:creator>Jean-Marc Lacoste</dc:creator>
    <dc:date>2011-11-26T16:18:56Z</dc:date>
  </entry>
  <entry>
    <title>A problem with CTIOS Toolkit</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=3901714" />
    <author>
      <name>Piotr Zielinski</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=3901714</id>
    <updated>2011-05-18T14:59:39Z</updated>
    <published>2011-05-18T14:59:39Z</published>
    <summary type="html">Hi all!
I have an issue with CTIOS Toolkit 7.5. Once a day, in random conditions, two agents log in. The first agent logs in correctly and his statistics are correctly shown in supervisor application. The second agent logs in, can make/answer calls, change his state and so on, but supervisor sees him as logged out.
I checked server logs and discovered this part:
 

09:01:47:941
CTIOS1-ctios Trace: ,--&gt; RCV CLIENT[00110]: []:REQ: eIdentifyClientRequest(
               
 .2800dotNET_Sess(31914638)_EvtThd(4) ) 
09:01:47:941
CTIOS1-ctios Trace: ClientMgr[1]::AddToClientIDMap[1776], Found Duplicate
Client ID:
               
 .2800dotNET_Sess(31914638)_EvtThd(4), PreviousClient[96, 0x454ef80],
               
 NewClient[110, 0x45b69e8] 
09:01:47:941
CTIOS1-ctios Trace: ClientMgr[1]::AddToClientIDMap[ThreadId:1776], Client
objects in the map were
               
 NOT the same object, ClientID[.2800dotNET_Sess(31914638)_EvtThd(4)],
               
 PreviousClient[96, 0x0454EF80], NewClient[110, 0x045B69E8]. 
09:01:47:941
CTIOS1-ctios Trace: XXX RCV CLIENT[.2800dotNET_Sess(31914638)_EvtThd(4)]:
eOnConnectionClosed 
09:01:47:941
CTIOS1-ctios Trace: ClientMgr[1]::OnConnectionClosed,
               
 Client[0x0454EF80][.2800dotNET_Sess(31914638)_EvtThd(4)] 
09:01:47:941
CTIOS1-ctios Trace: &lt;-- SND CLIENT[.2800dotNET_Sess(31914638)_EvtThd(4)]:
[]:EVT:
               
 eIdentifyClientConf, EnablementMask(0x0) 
09:01:47:941
CTIOS1-ctios Trace:
Client[.2800dotNET_Sess(31914638)_EvtThd(4)]::HandleReadHeaderComplete, READ 0
               
 BYTES: Requested(2), Closing Connection 
09:01:47:941
CTIOS1-ctios Trace: XXX RCV CLIENT[.2800dotNET_Sess(31914638)_EvtThd(4)]:
eOnConnectionClosed 
09:01:47:941
CTIOS1-ctios Trace: ClientMgr[1]::OnConnectionClosed,
               
 Client[0x045B69E8][.2800dotNET_Sess(31914638)_EvtThd(4)]
 
In visual studio, when debugging the toolkit, I discovered threads running and ending with names similar to this one: 
dotNET_Sess(31914638)_EvtThd(4)
When I pass wrong host A and host B address or take the ethernet cable out while running the application, this thread is not running.
For me, it looks like two agents try to log in with the same session identifier, but I'm not sure.
I must say, that I have no idea of what is hapening or how to fix this issue, so all tips are welcome.
Thanks in advance,
Piotrek</summary>
    <dc:creator>Piotr Zielinski</dc:creator>
    <dc:date>2011-05-18T14:59:39Z</dc:date>
  </entry>
</feed>

