cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
158
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Basudeb Acharyya on 14-06-2013 02:30:48 PM
Hello,
I  would like to know whether CTIOS(7.5) SDK, will allows us to create multiple agents in a single ctisession in agent mode. If not,then how we can handle more than one agents in a single exe in agent mode?
Please treat it as urgent

Subject: RE: New Message from Basudeb Acharyya in Computer Telephony Integration Obj
Replied by: David Lender on 14-06-2013 02:32:41 PM
Agent mode is for one agent only.  You will have to create an agent mode session for each agent.

Subject: RE: New Message from Basudeb Acharyya in Computer Telephony Integration Obj
Replied by: Basudeb Acharyya on 14-06-2013 04:51:22 PM
David Thank you for this quick reply.
My intension is  to use the .NET CIL  in C# and create a Session and Agent for every agent connecting  to my  Standalone  C#  application(will be working as server). My plan is create an object that encapsulates the Session, Agent, and IGenericEvents in one object called the CTIOSOBJ. Then as new agents connect in, we will instantiate a new instance of CTIOSOBJ for that agent. In the constructor for the CTIOSOBJ we can create a new Session and Agent object, and set up the event listener using the reference to the newly created CTIOSOBJ as the event listener (i.e. CTIOSOBJ implements IGenericEvent interface). So all events are then handled by the CTIOSOBJ instance for that particular agent.

Question:

Now my question is whether we need to create  each and every CTIOSOBJ in a a separate thread for each new incoming Agent  or we can  handle it in the main thread.

Subject: RE: New Message from Basudeb Acharyya in Computer Telephony Integration Obj
Replied by: David Lender on 17-06-2013 08:12:41 AM
I believe you want to create each of your CTIOSOBJ in a separate thread but is a design question that I cannot answer.  You may wish to engage the Contact Center Custom Engineering team who can assist you with the design of a multi-threaded CTIOS Agent mode application.  You can contact that team at Custom-Application-Request@cisco.com<mailto:Custom-Application-Request@cisco.com>   There is a fee for this service.

Subject: RE: New Message from Basudeb Acharyya in Computer Telephony Integration Obj
Replied by: Artem Repko on 17-06-2013 01:04:44 PM
Basudeb Acharyya,

I have the same task, but I have no result. I've tried to use different threads for each object instance. I've even tried to use different .NET domains to isolate sessions from each other. The result is - only the last created session object receives events. Only one way to solve problem - to create each session in separate processes. But it's very bad solution for me. If you solve the problem in other way - please, tell how.

Subject: RE: New Message from Artem Repko in Computer Telephony Integration Object S
Replied by: GEOFFREY THOMPSON on 17-06-2013 03:37:19 PM
X
>>>>>>>Only one way to solve problem - to create each session in separate processes. But it's very bad solution for me.

What, may I ask, is wrong with the individual processes per agent? I had to do something similar for a home-grown Agent Greeting solution that we built years before Cisco introduced their Agent Greeting solution with CVP 8.5.

I have a single process working in monitor mode which runs continuously. I call this the Launcher.

When I detect an agent “login” I insert them into hash table and launch a process dedicated to that agent. I call this the Console.

I pass on the command line the data the Console needs to work on behalf of that particular agent. When the agent logs out, the Cosnole terminates itself, and the Launcher deletes the agent from the hash table.

I put “login” in double quotes, because there is no “login” event in ICM. When the Launcher hears an event (like Not Ready, Talking, Ready) it checks the hash table. If the agent is not there, it adds the agent and fires off the Console. Normally, this is a Not Ready event because of a login.

But it also works if the Launcher is started after the agent has logged in. Launcher does not really need the agent to log in to start Console for that agent – any state transition can kick it off. I have had over 125 Console applications running on 1 server.

Regards,
Geoff

Subject: RE: New Message from Basudeb Acharyya in Computer Telephony Integration Obj
Replied by: Basudeb Acharyya on 17-06-2013 10:51:08 PM
My purpose is to also to control the agent state. As per your statement, you also tried in different thread but it didn't work. It appears to me that the problem  is because
 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.
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. You have to  overrided the connect() method to set the thread name to a unique value before calling the CTIOS connect method and it works.
Before CTIOS 7.5, CTIOS server was not checking that the clientID was unique. 

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);
}
}

Just replace SetAgent function of CtiOsSession in order to set the thread name.

If it works for you then please send me the code for me.

Subject: RE: New Message from Artem Repko in Computer Telephony Integration Object S
Replied by: Artem Repko on 18-06-2013 12:12:24 AM
GEOFFREY THOMPSON:

What, may I ask, is wrong with the individual processes per agent?
Instances need to communicate with main process (host) program. So I also need to use something like named pipes or wcf communication. It's too complicated solution for this task.

Subject: RE: New Message from Basudeb Acharyya in Computer Telephony Integration Obj
Replied by: Artem Repko on 18-06-2013 02:09:17 AM
Basudeb Acharyya:
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. 

It's amazing! You are absolutely right! Thank you very very much!!!
Only one thing that I've changed - set the name for each thread. Now it works!

Test project attached.

Subject: RE: Multi Agents in a single session in agent mode
Replied by: Artem Repko on 18-06-2013 04:05:08 AM
More exactly enough to run in a separate named thread only calling SetAgent ().

Subject: RE: New Message from Basudeb Acharyya in Computer Telephony Integration Obj
Replied by: GEOFFREY THOMPSON on 18-06-2013 07:25:41 AM
>>>> You have to  overrided the connect() method to set the thread name to a unique value before calling the CTIOS connect method and it works.

Brilliant!

Regards,
Geoff
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links