cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
141
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Sergei Berezovich on 15-09-2009 01:31:30 PM
Hi, to all
I have a problem
I try login to server but I can't set agent to session
my steps
1. I create session and agent object
2. I set session connection parameters and call Session.Connect()
        var SessArguments = new ActiveXObject('CtiOsComArguments.ComArguments');
        SessArguments.SetValue('CtiosA', '10.192.10.121');
        SessArguments.SetValue('CtiosB', '10.192.10.121');
        SessArguments.SetValue('PortA', '42028');
        SessArguments.SetValue('PortB', '42028');
        SessArguments.SetValue('Heartbeat', 60);
        this.Session.Connect(SessArguments);
3. when coming OnConnection mesage I try set agent  Session.SetAgent(Agent)
        var ComArguments = new ActiveXObject('CtiOsComArguments.ComArguments');
        ComArguments.AddItem("DesktopType", 0);
        this.Session.RequestDesktopSettings(ComArguments);
        var AgentID = this.GetSettingByCode('Login');
        var Password = this.GetSettingByCode('Password');
        var Instrument = this.GetSettingByCode('Instrument');
        this.Agent.SetValue('AgentID', AgentID);
        this.Agent.SetValue('AgentInstrument', Instrument);
        this.Agent.SetValue('AgentPassword', Password);
        this.Agent.SetValue('PeripheralID', 5004);
        var Res = this.Session.SetAgent(this.Agent);
 
but I catch error mesage OnCtiOsFailure
Error: "SYSTEM ERROR: Can't process request eSetSessionModeRequest. Object [] was not found and unable to create object."
 

Subject: RE: New Message from Sergei Berezovich in Computer Telephony Integration Ob
Replied by: David Lender on 15-09-2009 02:53:48 PM
How are you creating the Agent object?

Subject: RE: New Message from Sergei Berezovich in Computer Telephony Integration Ob
Replied by: Brandy Totten on 02-03-2010 09:33:48 PM
I am having a similar error.
Here is what I am doing... 

private Agent m_ctiAgent;
CilError status = CilError.CIL_FAIL;

then in the ProcessOnConnection function...
 
 m_ctiAgent = new Agent ();
int autoLogin = 0;
m_ctiSession.GetValueInt(Enum_CtiOs.CTIOS_AUTOLOGIN, out autoLogin);
m_ctiAgent.SetValue(Enum_CtiOs.CTIOS_AUTOLOGIN, autoLogin);
status = m_ctiSession.SetAgent(m_ctiAgent);
 
 and I recieve the error...
CTIOSFailureEvent code 8
System Error: Can't process request  eSetSessionModeRequest. Object was not found and unable to creat object

 

Subject: RE: SetAgent failure
Replied by: Sergei Berezovich on 03-03-2010 01:45:07 PM
problem in this line
this.Agent.SetValue('PeripheralID', 5004);
 
in documentation PeripheralID is Integer
but in realy PeripheralID is string
 
this.Agent.SetValue('PeripheralID', '5004');
this line is correct
 

Subject: RE: SetAgent failure
Replied by: Brandy Totten on 03-03-2010 04:12:09 PM
Okay, so I figured out though I am getting the same error message. I don't have the same problem, maybe I should repost a different question?
 
Anyway, My SetAgent comes back with CIL_OK. It is when I try to log on an agent is when I get the error.
 
Here's what my login code looks like:
 
m_loginArgs = new Arguments();
m_loginArgs.SetValue(Enum_CtiOs.CTIOS_AGENTID, "5000");
m_loginArgs.SetValue(Enum_CtiOs.CTIOS_AGENTINSTRUMENT, "5000");
status = m_ctiAgent.Login(m_loginArgs);
 
I guess that I should add that I am using the serversim with the default config file

Subject: RE: SetAgent failure
Replied by: Brandy Totten on 03-03-2010 04:25:06 PM
Oh and thanks Sergei for the update on your original problem 

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: David Lender on 03-03-2010 06:42:58 PM
There are several places in the developers guide that shows peripheralid
is a string, especially in login exampled.   All arguments are string
value pairs and you should be using GetValueInt to retreive into an
integer and SetValue to take an integer and turn it into a (string)
argument.

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: David Lender on 03-03-2010 06:46:58 PM
In which handler are you attempting to login?  In the onsetagentmode
event?  You might want to open a SR and provide a CIL log.

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: Brandy Totten on 03-03-2010 07:27:25 PM
OKay, so i was wrong it isn't in the agent log in, it is in the setagent. The onsetagentmode never happens. I just get the CTIOSFailure event that was described before ...Can't process request  eSetSessionModeRequest.....
 
So here is the code:
 
private void connect()
        {
            // create a session instance -if there isn't one already
            if (m_ctiSession == null)
            {
                m_ctiSession = new CtiOsSession();
            }
            // set an event listener & subscribe to events
            statusAddListener = m_ctiSession.AddEventListener(this, SubscriberList.eAllInOneList);
            //set connection parameters
            Arguments args = new Arguments();
            args.SetValue(Enum_CtiOs.CTIOS_CTIOSA, "localhost");
            args.SetValue(Enum_CtiOs.CTIOS_PORTA, "42028");
            args.SetValue(Enum_CtiOs.CTIOS_CTIOSB, "localhost");
            args.SetValue(Enum_CtiOs.CTIOS_PORTB, "42028");
            args.SetValue(Enum_CtiOs.CTIOS_HEARTBEAT, 3);
            statusConnect = m_ctiSession.Connect(args);
            if (statusConnect != CilError.CIL_OK)
            {
                // Connection Failed
                // Unsubscribe to events
                m_ctiSession.RemoveEventListener(this, SubscriberList.eAllInOneList);
                label1.Text = "Connection Error";
                string msg = string.Format("Session Connect failed with CilError {0}.", statusConnect.ToString());
                MessageBox.Show(this, msg, "Connection failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 
 
        private void ProcessOnConnection(Arguments args)
        {
            CilError status = CilError.CIL_FAIL;
            m_ctiAgent = new Agent();
            int autoLogin = 0;
            m_ctiSession.GetValueInt(Enum_CtiOs.CTIOS_AUTOLOGIN, out autoLogin);
            m_ctiAgent.SetValue(Enum_CtiOs.CTIOS_AUTOLOGIN, autoLogin);
            status = m_ctiSession.SetAgent(m_ctiAgent);
       }

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: David Lender on 03-03-2010 08:21:58 PM
So are you using the Java Cil?

Take a look at the sample JavaPhone specifically JavaPhoneFrame.java

You can't just create a new session using New in a method  that would
create it on the stack.
You need to create in in the constructor for your object or app.


anyway, I think your other problem is port number should be an integer.

args.SetValue(Enum_CtiOs.CTIOS_PORTA, "42028");

should be

args.SetValue(Enum_CtiOs.CTIOS_PORTA, 42028);

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: Brandy Totten on 03-03-2010 09:13:07 PM
I am actually coding in C# and using the .net stuff, but I went ahead and looked at the JavaPhoneFrame and it looked to me that they just set it to null in the constructor and then just "new"-ed it right before they did the setAgent stuff. But maybe I am missing something.
 
I looked in the CTIOSSoftphoneCSharp example and they did the "new"-ing a bit differently. Right before the SetAgent they used:
  m_ctiAgent = new Agent(m_ctiSession, m_loginArgs);
I tried it both of those ways (in the constructor and using the way from the cSharp example) and still had no luck.
 
oh and I also changed the int vs string problem with my port which also made no difference.
I am not sure how it connected successfully like that.
 
 

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: David Lender on 04-03-2010 01:52:04 PM
yes, the new is ok in the handler as long as the variable m_ctiagent is defined in the class:
 
in Java:
protected Agent        m_ctiAgent;                     // Reference to object for our Agent
protected CtiOsSession m_ctiSession;                   // Reference to CTI OS Session
 
in C#
/// <summary>Reference to the session that owns this object</summary>
        private CtiOsSession    m_ctiSession;

        /// <summary>Reference to the agent that is used to set the AgentMode of
        /// the session. </summary>
        private Agent            m_ctiAgent;
 
 
so you are using the COM Cil in C#?
 
At this point you are probably better off capturing your COM Cil client logs and CTIOS Server logs demonstrating the issue you are
having and opening a Service Request using your CDN Subscription in your CCO
profile.  Be sure to specify Other for Technology and Developer Services -
Contact Center Applications for SubTechnology when you open the Service
Request.
 

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: Brandy Totten on 08-03-2010 08:58:52 PM
I am caught up in some red tape here at the moment on submitting a service request.
But i did think of something more that I should put up here that might help.
 
Here is the whole error code. Several of the things are listed as null. So I figure that might be a problem.

 CTIOS Failure: code = (PeripheralID:0 PeripheralType:0 AgentState:eUnknown FailureCode:8 AgentExtension: 5000 AgentID:5000 AgentInstrument:5000 AgentPassword: (null) SkillGroups: () UniqueObjectID: (null) MessageID:eCTIOSFailureEvent ClientAgentTemporaryID:agent.1268063501 ClassIdentifier:1 IsSupervisor:0 LastError: (1:0) ConnectionMode:1 ErrorMessage:SYSTEM ERROR: Can't process request eSetSessionModeRequest. Object [] was not found and unable to create object. CILConnectionID:2 AutoLogin:0 SavedAgentState:9 WaitingforRecovery:0 SavedLoginInfo: () CurrentProfile: (null) IsAgentTeamMember:0 SavedAgentId:5000 OriginatingClientID:.2020 SilentMonitorTargetAgentUID: (null) SilentMonitorCallUID: (null))
 
I was trying to log in to the simserver with the first account listed in the config file

Subject: RE: New Message from Brandy Totten in Computer Telephony Integration Object
Replied by: Brandy Totten on 09-03-2010 01:34:49 PM
Got it. I forgot to set the perpherial id
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