on
01-24-2014
02:16 PM
- edited on
09-27-2018
12:35 PM
by
Gagandeep Kaur
This document was generated from CDN thread
Created by: Raphael Buquet on 24-05-2011 11:21:06 AM
Hi all,
I'm using JavaCIL.jar 8.0.1 with java 1.6 to follow the JavaPhoneFrame example on a step by step basis (starting from scratch on a Windows Vista workstation).
I'm implementing function by function to see how ctios communication works.
If I launch the official and complete JavaPhoneFrame sample it works great :
connection is ok and Login is OK on first try.
So I've followed the example for the gui and I have problems as far as the Connecting and Login are concerned.
I have a simple window with the connect button (gui and buttons are working fine). I enter ctios servers A and B and connect. The connection seem successfull from serverside, except that I am never receiving Events on client (the mouse click is ok, the handling event isn't working).
When I connect the request sends back CIL_OK but the confirmation event never comes.
The ctisession.Connect(rArgs) is successful and returns 1.
However the code contained in (EventSink.java) OnEvent, OnConnection, OnConnectionFailed, OnConnectionRejected... is never executed so I can't be sure I am connected.
There is some NAT between my network and the network containing the Ctios servers, but the official sample JavaPhoneFrame is working great with my setup, and any telnet is ok.
I must be missing
something (I'm not used to developing in Java), it may be a simple thing but I can't figure out what. Any help would be really appreciated.
Thanks
Raphael
Subject: RE: New Message from Raphael Buquet in Computer Telephony Integration Objec
Replied by: David Lender on 24-05-2011 02:43:39 PM
Do you have code like this in your constructor?
// Create an instance of our class to handle CTI events
m_eventSink = new EventSink(this);
// Subscribe our EventSink object to the Session "All Events" list
if (m_ctiSession.AddEventListener(m_eventSink, eAllInOneList) < 0)
{
m_Log.Trace(Logger.TRACE_MASK_CRITICAL,
"JavaPhoneFrame.constructor: Failed to add "+
"subscriber for AllInOne events.");
System.exit(1);
}
Subject: RE: ctios java client not receiving any events
Replied by: Raphael Buquet on 25-05-2011 03:45:34 AM
Hi,
Yes the code is present.
Would you mind looking at the code ? Here are the files :
BandeauGRCPerso (=JavaPhoneFrame) :
EventSink
I really don't understand what' happening.
Maybe it is a threading problem, the confirmation send by ctios servers are just received by the listener or do we have to setup other elements ?
Many thanks
Raphael
Subject: RE: New Message from Raphael Buquet in Computer Telephony Integration Objec
Replied by: David Lender on 25-05-2011 11:05:39 AM
Your constructor looks right to me, but you might try
Instead of:
public EventSink (BandeauGRCPerso monBandeauGRCPerso)
{
// Initialise needed objects
//monBandeauGRCPerso.afficheMessage("Debut de l'initialisation CTIOS");
monAppli = monBandeauGRCPerso;
maSessionCtiOs = monAppli.GetCtiOsSession();
monAppli.afficheMessage("Fin du constructeur EventSink");
} // Constructor
Should maybe be
public EventSink(BandeauGRCPerso monBandeauGRCPerso)
{
// Initialize the object we're going to use for thread synchronization
maSessionCtiOs = monBandeauGRCPerso.GetCtiosSession();
monAppli= monBandeaurGRCPerso
} // Constructor
Do you receive any errors when you run your code? Like ¿JavaPhoneFrame.constructor: Failed to add "+
"subscriber for AllInOne events."?
Subject: RE: ctios java client not receiving any events
Replied by: Raphael Buquet on 25-05-2011 11:44:25 AM
Hello David,
I don't get any error during the addListener(). In fact I don't get any error at all.
If I modify the source code following what you told me the result is exactly the same.
I've been studying the example JavaPhoneFrame for 2 days without finding the problem.
All what I got from the console is :
#######################################################
WHEN I START THE GUI
LogWrapper::CreateFile : file .\Log\bandeaugrcperso.052511.17.29.35.log was created successfully.
m_ExpireMonitorTread is started !
WHEN I CLICK CONNECTION
05/25/2011 17:30:14.905 CtiOsSession(27770641).CtiOsSession()
Version Information:
Product: CTI OS Java CIL 8.0.1 0, 11518
Date: février 17, 2010 23:08:00
Copyright (c) 2000 - 2010, Cisco Systems, Inc., All rights reserved.
05/25/2011 17:30:14.927 NetPort(5538765).Open, Waiting for Socket to connect...
05/25/2011 17:30:14.960 CtiOsSession(27770641).NotifyConnectionRestored, Adding system event eSysCTIOSServerOnline
WHEN I CLICK LOGIN (event if not notified that I am connected)
05/25/2011 17:31:15.501 CtiOsSession(27770641).MakeRequest(eIdentifyClientRequest)
05/25/2011 17:31:15.504 CtiOsSession(27770641).MakeRequest, (ClientPassword
null) CILClientID:Raphael-PC_AWT-EventQueue-0_3621036244836637436)
05/25/2011 17:31:15.510 CtiOsSession(27770641).MakeRequest(eSetSessionModeRequest)
05/25/2011 17:31:15.514 CtiOsSession(27770641).MakeRequest, (PeripheralID:5009 PeripheralType:0 AgentState:eUnknown AgentExtension
null) AgentID:604366 AgentInstrument:604366 AgentPassword
null) SkillGroups
) UniqueObjectID
null) ClientAgentTemporaryID:agent.1306337375 ClassIdentifier:1 IsSupervisor:0 LastError
AWT-EventQueue-0:0) ConnectionMode:1 AutoLogin:1 SavedAgentState:9 WaitingforRecovery:0 SavedLoginInfo
) CurrentProfile
null) IsAgentTeamMember:0 SavedAgentId:604366 SilentMonitorTargetAgentUID
null) SilentMonitorCallUID
null))
05/25/2011 17:31:15.525 CtiOsSession(27770641).OnIdentifyClientConf()
05/25/2011 17:31:15.541 [agent.5009.604366].OnSetAgentModeEvent(eSetAgentModeEvent)
05/25/2011 17:31:15.546 [agent.5009.604366].OnQueryAgentStateConf(eLogout)(eQueryAgentStateConf)
#########################################################
FROM THE GUI WINDOW (at start) :
Bandeau GRC Perso version 0.1
CTI OS Java CIL8.0.1 0 Build 11518
Pour demarrer vous devez vous connecter
Fin du constructeur EventSink
Retour Ctios :1
It mean the constructor of EventSink is executed and the ctiOsSession.AddEventListener() returns 1 (retour CTIOS)
#############################################################
IF I RUN THE OFFICIAL (AND WORKING) JavaPhoneFrame example I GET IN THE GUI :
To start please connect
Connecting...
Offline
OnConnection Event received
You can Login now!
Calling Session->SetAgent
Offline
Offline
OnSetAgentModeEvent Event received
(PeripheralID:5009
PeripheralType:0
AgentState:eUnknown
AgentExtension
null)
AgentID:604366
AgentInstrument:604366
AgentPassword
null)
SkillGroups
)
UniqueObjectID:agent.5009.604366
MessageID:eSetAgentModeEvent
ClientAgentTemporaryID:agent.1306337908
ClassIdentifier:1
IsSupervisor:0
LastError
AWT-EventQueue-0:0)
ConnectionMode:1
Filter:filtertarget
=
agent.5009.604366
CILConnectionID:30
AutoLogin:1
SavedAgentState:9
WaitingforRecovery:0
SavedLoginInfo
)
StatusSystem
StatusCTIServer:true
StatusCtiServerDriver:true
StatusCentralController:true
StatusPeripherals
5009:true))
CurrentProfile
null)
IsAgentTeamMember:0
SavedAgentId:604366
OriginatingClientID:Raphael-PC_AWT-EventQueue-0_2508680866942048246
BlockAllEvents:true
SilentMonitorTargetAgentUID
null)
SilentMonitorCallUID
null))
OnQueryAgentStateConf Event received
(PeripheralID:5009
AgentState:eLogout
NumSkillGroups:2
MRDID:1
ICMAgentID:5034
AgentMode:0
MaxTaskLimit:1
NumTasks:0
AgentExtension
null)
AgentID:604366
AgentInstrument
null)
EnablementMask:0x1000000
UniqueObjectID:agent.5009.604366
MessageID:eQueryAgentStateConf
IncomingWrapupStrings
string0:Insert
incoming
wrapup
string
0
here.
string1:Insert
incoming
wrapup
string
1
here.
string2:Insert
incoming
wrapup
string
2
here.
string3:Insert
incoming
wrapup
string
3
here.)
NotReadyReasonCodes
Insert
not
ready
reason
code
1
here.:1
Insert
not
ready
reason
code
2
here.:2
Insert
not
ready
reason
code
3
here.:3
Insert
not
ready
reason
code
4
here.:4)
LogoutReasonCodes
Insert
logout
reason
code
1
here.:1
Insert
logout
reason
code
2
here.:2
Insert
logout
reason
code
3
here.:3
Insert
logout
reason
code
4
here.:4)
NotReadyReasonRequired:true
LogoutReasonRequired:false
AgentAvailabilityStatus:0
IsAuthenticated:false
SkillGroup[1]
SkillGroupNumber:28466
SkillGroupID:5032
SkillGroupPriority:0
SkillGroupState:1)
SkillGroup[2]
SkillGroupNumber:0
SkillGroupID:5033
SkillGroupPriority:0
SkillGroupState:1))
OnButtonEnablementChange Event received
(EnablementMask:0x1000000
UniqueObjectID:agent.5009.604366
MessageID:eQueryAgentStateConf)
OnQueryAgentStateConf Event received
(PeripheralID:5009
AgentState:eNotReady
NumSkillGroups:2
MRDID:1
ICMAgentID:5034
AgentMode:1
MaxTaskLimit:1
NumTasks:0
AgentExtension:604366
AgentID:604366
AgentInstrument:604366
EnablementMask:0xA1B0010
UniqueObjectID:agent.5009.604366
MessageID:eQueryAgentStateConf
IncomingWrapupStrings
string0:Insert
incoming
wrapup
string
0
here.
string1:Insert
incoming
wrapup
string
1
here.
string2:Insert
incoming
wrapup
string
2
here.
string3:Insert
incoming
wrapup
string
3
here.)
NotReadyReasonCodes
Insert
not
ready
reason
code
1
here.:1
Insert
not
ready
reason
code
2
here.:2
Insert
not
ready
reason
code
3
here.:3
Insert
not
ready
reason
code
4
here.:4)
LogoutReasonCodes
Insert
logout
reason
code
1
here.:1
Insert
logout
reason
code
2
here.:2
Insert
logout
reason
code
3
here.:3
Insert
logout
reason
code
4
here.:4)
NotReadyReasonRequired:true
LogoutReasonRequired:false
AgentAvailabilityStatus:0
IsAuthenticated:true
SkillGroup[1]
SkillGroupNumber:28466
SkillGroupID:5032
SkillGroupPriority:0
SkillGroupState:2)
SkillGroup[2]
SkillGroupNumber:0
SkillGroupID:5033
SkillGroupPriority:0
SkillGroupState:2))
OnButtonEnablementChange Event received
(EnablementMask:0xA1B0010
UniqueObjectID:agent.5009.604366
MessageID:eQueryAgentStateConf)
(EnablementMask:0xA1B0010
UniqueObjectID:agent.5009.604366
MessageID:eAgentDeskSettingsConf)
######################################################
AND CORRESPONDING OUTPUT FROM LOG FILE :
05/25/2011 17:38:28.0290 CtiOsSession(783148).CtiOsSession()
Version Information:
Product: CTI OS Java CIL 8.0.1 0, 11518
Date: février 17, 2010 23:08:00
Copyright (c) 2000 - 2010, Cisco Systems, Inc., All rights reserved.
05/25/2011 17:38:52.0539 Connecting to CTIOS Server...
05/25/2011 17:38:52.0558 NetPort(11108810).Open, Waiting for Socket to connect...
05/25/2011 17:38:52.0591 Connecting...
05/25/2011 17:38:52.0598 CtiOsSession(783148).NotifyConnectionRestored, Adding system event eSysCTIOSServerOnline
05/25/2011 17:38:58.0433 Requesting Login
05/25/2011 17:38:58.0435 Calling Session->SetAgent
05/25/2011 17:38:58.0466 CtiOsSession(783148).MakeRequest(eIdentifyClientRequest)
05/25/2011 17:38:58.0467 CtiOsSession(783148).MakeRequest, (ClientPassword
null) CILClientID:Raphael-PC_AWT-EventQueue-0_2508680866942048246)
05/25/2011 17:38:58.0473 CtiOsSession(783148).MakeRequest(eSetSessionModeRequest)
05/25/2011 17:38:58.0477 CtiOsSession(783148).MakeRequest, (PeripheralID:5009 PeripheralType:0 AgentState:eUnknown AgentExtension
null) AgentID:604366 AgentInstrument:604366 AgentPassword
null) SkillGroups
) UniqueObjectID
null) ClientAgentTemporaryID:agent.1306337908 ClassIdentifier:1 IsSupervisor:0 LastError
AWT-EventQueue-0:0) ConnectionMode:1 AutoLogin:1 SavedAgentState:9 WaitingforRecovery:0 SavedLoginInfo
) CurrentProfile
null) IsAgentTeamMember:0 SavedAgentId:604366 SilentMonitorTargetAgentUID
null) SilentMonitorCallUID
null))
05/25/2011 17:38:58.0488 CtiOsSession(783148).OnIdentifyClientConf()
05/25/2011 17:38:58.0499 [agent.5009.604366].OnSetAgentModeEvent(eSetAgentModeEvent)
05/25/2011 17:38:58.0527 [agent.5009.604366].Login()
05/25/2011 17:38:58.0529 [agent.5009.604366].SetAgentState( eLogin )
05/25/2011 17:38:58.0531 CtiOsSession(783148).MakeRequest(eSetAgentStateRequest)
05/25/2011 17:38:58.0534 CtiOsSession(783148).MakeRequest, (PeripheralID:5009 AgentState:eLogin AgentExtension
null) AgentID:604366 AgentInstrument:604366 AgentPassword
null) UniqueObjectID:agent.5009.604366 ClientAgentTemporaryID:agent.1306337908 ClassIdentifier:1 AutoLogin:1)
05/25/2011 17:38:58.0539 [agent.5009.604366].OnQueryAgentStateConf(eLogout)(eQueryAgentStateConf)
05/25/2011 17:38:58.0580 [agent.5009.604366].OnAgentInfoEvent(eAgentInfoEvent)
05/25/2011 17:38:58.0632 CtiOsSession(783148).CCtiOsSession:
nEvent, Event eAgentStateEvent is blocked.
05/25/2011 17:38:58.0635 CtiOsSession(783148).CCtiOsSession:
nEvent, Event eAgentStateEvent is blocked.
05/25/2011 17:38:58.0639 CtiOsSession(783148).CCtiOsSession:
nEvent, Event eAgentStateEvent is blocked.
05/25/2011 17:38:58.0645 [agent.5009.604366].OnQueryAgentStateConf(eNotReady)(eQueryAgentStateConf)
05/25/2011 17:38:58.0688 [agent.5009.604366].OnAgentDeskSettingsConf(eAgentDeskSettingsConf)
05/25/2011 17:39:00.0933 CtiOsSession(783148).OnSnapshotDeviceConf()
05/25/2011 17:39:00.0935 CtiOsSession(783148).OnSnapshotDeviceConf( NumCalls = 0)(eSnapshotDeviceConf)
Sorry for monstruous post
Raphael
Subject: RE: ctios java client not receiving any events
Replied by: Raphael Buquet on 26-05-2011 08:23:27 AM
Ok my mistake I just made a big error :
I initialized the CtiOsSession during the constructor, then the constructor of EventSink was run and just before I made the connection to CtiOs server I initialized a second time the session ...
Sorry for the time you spend and thanks for helping !
Raphaël
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: