cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

No call events after agent logs back in

15
Views
0
Helpful
0
Comments
This document was generated from CDN thread

Created by: Camelia Suciu on 09-12-2009 10:28:34 AM
Hi,
 
In my application I have implemented a "break with
reason" function, which is essentially a logout with a reason code. At the
end of the "break" the agent is logged back in automatically.
After the agent logs back in after a break, the CTI
application does not receive any more call related events on the agent session.
I receive agent state events, but nothing related to calls.
The agent can initiate outbound calls, but it will not be able to control the
call from the application because session.GetCurrentCall() returns NULL while
there is an active call for that agent.
CTIOS version 7.0, application implemented using the C++
SDK.
Any idea what the problem could be?
Many thanks.

Subject: RE: New Message from Camelia Suciu in Computer Telephony Integration Object
Replied by: David Lender on 09-12-2009 11:17:59 AM
You need to set the current call.  See the onCallBegin event handler in
the EventSink.cpp code of the CTIOS Toolkit Win32  CTI Toolkit C++Phone

it includes:

void CEventSink:nCallBegin(Arguments & rArguments)
{
m_pDialog->LogEvent("OnBeginCall", rArguments);

string tmp;

tmp = "";

// Check if CV1 is present in the message
if (rArguments.IsValid(CTIOS_CALLVARIABLE1) == TRUE)
{
  // Get CallID from message
  tmp = rArguments.GetValueString(CTIOS_CALLVARIABLE1);
}

// Display Call Variable1 on dialog
m_pDialog->m_edtCallVariable1.SetWindowText(tmp.c_str());

// Check for UniqueObjectID presense in message
if (rArguments.IsValid(CTIOS_UNIQUEOBJECTID) == TRUE)
{
  // Get CallID from message
  tmp = rArguments.GetValueString(CTIOS_UNIQUEOBJECTID);

  // Display CallID on dialog
  m_pDialog->m_edtCallID.SetWindowText(tmp.c_str());
}


  string uoid = rArguments.GetValueString(CTIOS_UNIQUEOBJECTID);

  string key = "UniqueObjectID=" + uoid;
 
  // Get Call ptr from Session object

  CILRefArg & rCArg = (CILRefArg &) m_pCtiSession->GetValue(key);
  CCall *pCall = (CCall *) rCArg.GetValue();

  m_pCtiSession->SetCurrentCall(pCall);

  pCall->Release();

  rCArg.Release();

}

.

Subject: RE: New Message from Camelia Suciu in Computer Telephony Integration Object
Replied by: Camelia Suciu on 09-12-2009 12:06:06 PM
Hi David,
 
The problem is I don't get the Call Begin (or any other call related events) on the agent session after the agent is logged back in.
Allow me to explain again.
I have an agent mode session. When the agent session is first open I get all call related events (call begin, established, etc). At some point I use set agent state to eLogout with reason code for the agent. The session remains open. I then log the agent back in (using the Login method).
From this point on I only get agent state change events and NO call events. If I call the make call method for the agent, the call is dialled, but I do not get any call related events for that call.
 
Hope this makes more sense. Would it help if I send over some CTIOS logs?
 
Many thanks,
Camelia

Subject: RE: New Message from Camelia Suciu in Computer Telephony Integration Object
Replied by: David Lender on 09-12-2009 01:18:57 PM
You could open a Service Request and attach logs.  Also, have you tried
removing the agent from the session and then performing a new setagent
before logging in?  If you do open a SR please provide both client and
ctios server logs.

.

Subject: RE: New Message from Camelia Suciu in Computer Telephony Integration Object
Replied by: Voiceops SSC on 09-12-2009 02:51:05 PM
Hi,
 
Something similar happened to me. I work with CTIOS version 6.0 and followed one the VB samples that comes with the toolkit. The sample, when converted to .net, has something like this at the end of the Login method:
 
             if (!_agentSet)
            {
                _session.SetAgent(_agent);
                _agentSet = true;
            }
            else
            {
                //Agent alreay set so log in agent
                // ...Load agent aguments here...
                _agent.Login(args);
            }
 
The "else" part is what logs the agent back in after logs out. No need to call SetAgent because agent is already set.
 
But it did not work for me. Agents did not receive calls after logging back in following a logout. I changed the code to call SetAgent metjod always and made sure I set agent to null on logout.
 
That did the trick for me.

As I said, I work with version 6.0 and I haven't seen the samples for version 7.0, but since my issue was similar I hope your solution is similar too.
 
 

Subject: RE: New Message from Camelia Suciu in Computer Telephony Integration Object
Replied by: Camelia Suciu on 09-12-2009 04:38:42 PM
Thanks for the suggestion. I will try that but it doesn't sound right to have to call SetAgent again.
Also, as I said, I still get the agent state change event after the login, but not the call events.
 
I'll report back if I find a good workaround.

Subject: RE: New Message from Camelia Suciu in Computer Telephony Integration Object
Replied by: Voiceops SSC on 09-12-2009 07:13:07 PM
David,
 
Can I just destroy the agent object in OnPostLogout event and wait until the agent logs back in to re-create it in Login method? Will it make any difference?
 
Thanks.

Subject: RE: New Message from Camelia Suciu in Computer Telephony Integration Object
Replied by: David Lender on 09-12-2009 06:12:58 PM
Recommend you destroy the agent object and create a new one and then
call SetAgent.  Otherwise you get unexpected results.

Per the C++ sample:

// CTIOS CIL Sends this event after the agent has successfully
// logout. This is a good time to cleanup the prevously used
// agent object
//
void CEventSink:nPostLogout(Arguments & rArguments)
{
  m_pDialog->LogEvent("OnPostLogoutEvent", rArguments); 

  //Makes sure the previouis agent object is disposed
  //and a new agent object is created for a future login
  m_pCtiAgent = m_pDialog->CreateNewAgent();
}



CAgent * CExercise2Dlg::CreateNewAgent()
{
    //if there was a previos instance, release the object
if(NULL != m_ctiAgent)
{
  m_ctiAgent->Release();
  m_ctiAgent = NULL;
}
//Create a new agent instance
   m_ctiAgent = new CAgent();

return m_ctiAgent;
}
.

Subject: RE: New Message from Voiceops SSC in Computer Telephony Integration Object
Replied by: David Lender on 09-12-2009 07:30:59 PM
I think that would be fine.  You just need to create the agent object,
invoke the session.setagent, and then invoke agent.login in the
OnSetAgentModeEvent.  As long as the agent object is released from the
session and a new one is created it should work.

Subject: RE: New Message from Voiceops SSC in Computer Telephony Integration Object
Replied by: Voiceops SSC on 09-12-2009 09:00:33 PM
Great. Thanks.
CreatePlease to create content