Genesys CTI User Forum
Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: kashok on June 10, 2009, 06:49:34 PM
-
Hi,
I'm new to Genesys.I'm trying to build a simple tool which gets events for a particular Queue to do some processing based on the events received . Right now i'm registering queue and all the DNs that belongs to that Queue to get all the events. But I'm facing the following issues.Please if someone faced this issue advise me :
1> I loop through the DN and invoke Register for each DN.But i get EventRegistered for only 60 % of the DNs(I register around 2000 DNs).But if I introduce a time gap of 5 seconds in between each registration I get 90 % Registration. But still 10 % missing and also it takes time to register all DNs due to the timegap.
2> Missing few Events even for the DNs for which i got EventRegistered.I noticed this by comparing the Tserver logs
Instead of registering for each DN,is there a way to just register for a Queue and get all events related with that Queue including it's DNs. I'm using Java/TLib to implements this.
Thanks & Regards
Ashok
-
Genesys reports events based on their types.
Event messages on DN are different from Queue DN.
For Queue type, messages are EventQueued, EventAbandoned and EventDiverted. (Of course, EventRegistered, EventUnregisterd and etc are common to all DNs types).
Depending on your application, events generated for Queue DN may not have all info you need.
For missing event message issue, it seems that you have a "data overrun" problem.
(I had the problem before when new to Genesys/CTI)
It is mostly caused by your program when receiving and processing Genesys events.
The receiving and processing should be 'threaded', with some internal memory to buffer large number of incoming messages.
Example for Tlib, using MS C/C++
****** Tlib was not supported by Genesys *****
- at least 2 threads: one for the main and the other for receiving events.
- the main thread should
1. create T-server connection
- use Genesys Mask functions to STOP T-server sending specific unwanted events
This helps a lot when registering 2,000 DNs
2. create client thread to receive incoming event
3. registers DNs
4. loop: wait for Incoming message (window get message / peek message)
- read incoming message
- process message
- FREE the [dynamic memory]
end:
- client thread
- in Tlib, there is function to "wait" on event and dispatch to user-defined function
- read incoming message from the T-server connection
- ALLOCATE [dynamic memory] and copy (using Tlib function!) the incoming message to it
- PostMessage to main thread with the [dynamic memory] copy
if PostMessage fails, FREE the [dynamic memory]
(tried several time....failed to upload / attach example program.......)
-
bcky thanks for such a clear explanation. What you said make lot of sense. Masking will greatly help my issue. I will try that tomorrow and post you the result.
And for creating separate threads ,I guess i use Java APi which creates a new thread and invokes the callback method on that Thread when there is an event for that DN. So i guess I'm covered in that respect. I will try running multiple instance of my application so that each application just needs to listen for events from few hundred DNs instead of thousands.
One more doubt,one my colleague was suggesting me that Number of license for Tserver also matters. So say if i have 100 license then i can only register for 100 DNs at a time right. If so is there a way to query a Tserevr for number of license available before i start registering ?
-
Genesys T-server DN license is controlled license file via Flexlm service.
Validation is performed at startup (and runtime!) at T-server.
Once DNs are registered by T-server, mulitple clients can monitor/control them concurrently without much restriction. Of course, you won't 'control' a DN by multiple agents!
Some DNs are monitor-only; e.g., Queue and RP (if already controlled by URS)
If you have 2,000 DNs defined in Genesys CME but only have 100 DN license,
the first 100 DNs will be monitored by T-server and 1,900 DNs are not.
You will get alerts in SCI and error messages in T-server log.
When attempting to register those 1,900 DNs in runtime,
EventError of "No More License" will be reported.
In short, if you have 2000 DNs "in use" in production (i.e., already defined in CME and validated by T-server), just register them all! Multiple program instances of 2000 DNs monitoring are allowed; one of the power of T-server Framework.
-
Great ....I was worried that license includes the clients registering with the T server. bcyk sorry for bothering you again,I'm not able to find way to Mask the events. There is method call setEventMask in TeleLine class(I'm using desktop Toolkit 7.2 for Java) But it's taking values in Byte Array.So not sure how to specify which are all events to mask using that method. Can you help me out on this .
And also i see an attributed called "register_interval" in Tserver Config. Is it the interval Tserver uses to register for DN with switch or its the registration interval for client registering dn with Tserver.
Thanks again!
Ashok
-
hi Ashok,
I don't have constant definitions for Java; in fact, I don't program Java.
Below code segment is Tlib C code that I find from old program.
In normal caes, Genesys defines constants in consistent manner; hope it help.
BTW, these constants are from Genesys 5.1 Tlib; there may have several new messages types not listed in 7.2; they are deifned in header file in tlib.
regards
-------------------------------------------------------------
// assumed that all events are enabled at the beginning
// now, start to disable unnecessary events one by one!
// tmask is the pre-defined variable for this purpose
// i.e., tmask = TMask[ T_MASK_LENGTH ]
// where T_MASK_LENGTH = 64
//
/*
For setting and clearing the user-defined input mask, use:
TMaskSetAll
TMaskClearAll
TMaskSet
TMaskClear
For checking the server capabilities mask returned by TQueryServer, use TMaskIsSet. Please refer
to Chapter Three, "Feature Requests," for further information.
Syntax
#define T_MASK_LENGTH 64;
typedef unsigned char TMask[T_MASK_LENGTH];
#define TMaskSetAll(M) memset((M), 0xff, T_MASK_LENGTH)
#define TMaskClearAll(M) memset((M), 0, T_MASK_LENGTH)
#define TMaskSet(E, M) ((M)[(E) / 8] |= (1 << ((E) % 8)))
#define TMaskClear(E, M) ((M)[(E) / 8] &= ~(1 << ((E) % 8)))
#define TMaskIsSet(E, M) ((M)[(E) / 8] & (1 << ((E) % 8)))
*/
void usr_configure_events( TMask tmask)
{
TMaskSet( EventError, tmask);
// TMaskSet( EventReleased, tmask); // re-enabled for phase 2
/*
TMaskClear( EventQueued, tmask);
TMaskClear( EventDiverted, tmask);
TMaskClear( EventAbandoned, tmask);
TMaskClear( EventDNDOn, tmask);
TMaskClear( EventDNDOff, tmask);
TMaskClear( EventRouteRequest, tmask); // enabled for improving CTI-transfer; 12/Dec/2000 (BK)
TMaskClear( EventRouteUsed, tmask);
TMaskClear( EventOffHook, tmask);
TMaskClear( EventOnHook, tmask);
TMaskClear( RequestAgentLogin, tmask);
TMaskClear( RequestAgentLogout, tmask);
TMaskClear( RequestAgentReady, tmask);
TMaskClear( RequestAgentNotReady, tmask);
TMaskClear( EventAgentAfterCallWork, tmask);
TMaskClear( EventNetworkReached, tmask);
TMaskClear( EventTreatmentApplied, tmask);
TMaskClear( EventTreatmentNotApplied, tmask);
TMaskClear( EventTreatmentEnd, tmask);
TMaskClear( EventTreatmentRequired, tmask);
TMaskClear( EventDialing, tmask); // re-enabled for phase 2
TMaskClear( EventDestinationBusy, tmask); // re-enabled for phase 2
// TMaskClear( EventEstablished, tmask);
// TMaskClear( EventReleased, tmask); // re-enabled for phase 2
TMaskClear( EventHeld, tmask); // re-enabled for phase 2
TMaskClear( EventRetrieved, tmask);
TMaskClear( EventRemoteConnectionSuccess, tmask);
TMaskClear( EventRemoteConnectionFailed, tmask);
TMaskClear( EventAttachedDataChanged, tmask); // disabled for phase 2
*/
// copy & paste the follow events if they are identified as unnecessary event messages
/*
TMaskClear( RequestRegisterClient, tmask);
TMaskClear( RequestQueryServer, tmask);
TMaskClear( RequestQueryAddress, tmask);
TMaskClear( RequestRegisterAddress, tmask);
TMaskClear( RequestUnregisterAddress, tmask);
TMaskClear( RequestSetInputMask, tmask);
TMaskClear( RequestAttachUserData, tmask);
TMaskClear( RequestUpdateUserData, tmask);
TMaskClear( RequestDeleteUserData, tmask);
TMaskClear( RequestDeletePair, tmask);
TMaskClear( RequestDistributeUserEvent, tmask);
TMaskClear( RequestDistributeEvent, tmask);
TMaskClear( EventServerConnected, tmask);
TMaskClear( EventServerDisconnected, tmask);
TMaskClear( EventError, tmask);
TMaskClear( EventRegistered, tmask);
TMaskClear( EventUnregistered, tmask);
TMaskClear( EventRegisteredAll, tmask);
TMaskClear( EventUnregisteredAll, tmask);
TMaskClear( EventRinging, tmask);
TMaskClear( EventPartyChanged, tmask);
TMaskClear( EventPartyAdded, tmask);
TMaskClear( EventPartyDeleted, tmask);
TMaskClear( EventAttachedDataChanged, tmask);
TMaskClear( EventAddressInfo, tmask);
TMaskClear( EventServerInfo, tmask);
TMaskClear( EventLinkDisconnected, tmask);
TMaskClear( EventLinkConnected, tmask);
TMaskClear( EventUserEvent, tmask);
TMaskClear( EventResourceAllocated, tmask);
TMaskClear( EventResourceFreed, tmask);
TMaskClear( RequestListenDisconnect, tmask);
TMaskClear( RequestListenReconnect, tmask);
TMaskClear( EventListenDisconnected, tmask);
TMaskClear( EventListenReconnected, tmask);
TMaskClear( RequestQueryCall, tmask);
TMaskClear( EventPartyInfo, tmask);
TMaskClear( RequestClearCall, tmask);
TMaskClear( RequestSetCallInfo, tmask);
TMaskClear( EventCallInfoChanged, tmask);
TMaskClear( EventHardwareError, tmask);
TMaskClear( RequestQuerySwitch, tmask);
TMaskClear( EventSwitchInfo, tmask);
TMaskClear( EventRestoreConnection, tmask);
TMaskClear( EventPrimaryChanged, tmask);
TMaskClear( RequestLostBackupConnection, tmask);
TMaskClear( RequestSetDNInfo, tmask);
TMaskClear( RequestQueryLocation, tmask);
TMaskClear( EventLocationInfo, tmask);
TMaskClear( EventACK, tmask);
TMaskClear( RequestAgentLogin, tmask);
TMaskClear( RequestAgentLogout, tmask);
TMaskClear( RequestAgentReady, tmask);
TMaskClear( RequestAgentNotReady, tmask);
TMaskClear( RequestSetDNDOn, tmask);
TMaskClear( RequestSetDNDOff, tmask);
TMaskClear( RequestMakeCall, tmask);
TMaskClear( RequestMakePredictiveCall, tmask);
TMaskClear( RequestAnswerCall, tmask);
TMaskClear( RequestReleaseCall, tmask);
TMaskClear( RequestHoldCall, tmask);
TMaskClear( RequestRetrieveCall, tmask);
TMaskClear( RequestMuteTransfer, tmask);
TMaskClear( RequestSingleStepTransfer, tmask);
TMaskClear( RequestCompleteTransfer, tmask);
TMaskClear( RequestReconnectCall, tmask);
TMaskClear( EventDialing, tmask);
TMaskClear( EventQueued, tmask);
TMaskClear( EventDiverted, tmask);
TMaskClear( EventAbandoned, tmask);
TMaskClear( EventNetworkReached, tmask);
TMaskClear( EventDestinationBusy, tmask);
TMaskClear( EventEstablished, tmask);
TMaskClear( EventReleased, tmask);
TMaskClear( EventHeld, tmask);
TMaskClear( EventRetrieved, tmask);
TMaskClear( EventAgentLogin, tmask);
TMaskClear( EventAgentLogout, tmask);
TMaskClear( EventAgentReady, tmask);
TMaskClear( EventAgentNotReady, tmask);
TMaskClear( EventDNDOn, tmask);
TMaskClear( EventDNDOff, tmask);
TMaskClear( EventRouteRequest, tmask);
TMaskClear( EventRouteUsed, tmask);
TMaskClear( EventOffHook, tmask);
TMaskClear( EventOnHook, tmask);
TMaskClear( EventRemoteConnectionSuccess, tmask);
TMaskClear( EventRemoteConnectionFailed, tmask);
TMaskClear( RequestRedirectCall, tmask);
TMaskClear( EventAgentAfterCallWork, tmask);
TMaskClear( RequestReserveAgent, tmask);
TMaskClear( EventAgentReserved, tmask);
// 12/Jan/2001 (BK), templated added for treatment related functions
TMaskClear( RequestApplyTreatment, tmask);
TMaskClear( EventTreatmentApplied, tmask);
TMaskClear( EventTreatmentNotApplied, tmask);
TMaskClear( EventTreatmentEnd, tmask);
TMaskClear( EventHardwareError, tmask);
TMaskClear( EventAgentAfterCallWork, tmask);
TMaskClear( EventTreatmentRequired, tmask);
*/
-
Sorry .... miss another query "register_interval" in Tserver Config
What switch type you are using?
T-server program and manual are switch dependent!
You may find it in the T-server manual for your switch type