« Back to CTIOS Toolkit Questions

RE: New Message from Arthur Shats in Computer Telephony Integration Object

Combination View Flat View Tree View
Threads [ Previous | Next ]
Showing 21 - 40 of 87 results.
of 5
David, according to documentation, when setting EnableSkillGroupStatistics for an Agent application, I don't need to specify any arguments, not skillGroupNumber, nor periferalID and I would still be able to get the stats for all the groups under periferalID that I logged in with. I suppose you don't have to answer the question #2 from my post from 9/10/12 5:04pm. However, I would still like to know the answers to my other questions from that post about what TimerInterval is and how if possible to write data that's shown in the Log Window, the stats data for example, into a file.
Thanks.

1. The interval is specified in the CTIOS Server configuration see the CTIOS System Manager’s Guide

2. If there is an error in how your arguments array for the SkillGroupNumber is defined you will get all skillgroups. From the Developers guide section on EnableSkillGroupStatistics”
An optional input parameter containing a pointer or a reference to an Arguments array containing a

member that is a nested Arguments array with the keyword SkillGroupNumbers. Within this array,

each member has a string key of an integer starting with 1 and an integer value that is a skill group

number to be enabled. If the parameter is NULL or missing, statistics are enabled for all skill groups

to which the agent belongs.

3. The C++ CIL creates a client log. See Appendix B of the CTIOS Developers Guide

David, but when I did set SkillGroupNumber in the Arguments array for EnableSkillGroupStatistics call, I still got the stats for all groups, not just for the one I set in the Arguments array.

In C++Phone sample agent desktop application, I am having a problem figuring out how to access the elements of the Arguments array that are returned in OnSkillGroupStatisticsUpdated event. This is what I have:
void CEventSink:emoticonnSkillGroupStatisticsUpdated(Arguments &rArguments) {
string id=rArguments.GetValueString(CTIOS_UNIQUEOBJECTID);
string grNum=rArguments.GetValueString(CTIOS_SKILLGROUPNUMBER);
m_pDialog->AddLogMessage((char *) grNum.c_str());
m_pDialog->AddLogMessage((char *) id.c_str()).
}
The above works. But but what if I want to access AgentsLoggedOn for a particular skillGroupNumber? How would I do that?
Thanks.

You check to see if the argument array’s SkillGroupNumber is the skillgroupnumber you are interested in. Then you access the Statistics arguments array.

GetValue(“Statistics”)

Which returns the arguments array of statistics values:

StatisticsemoticonHdlCallsTdy:0 HdlCallsTlkTimeTdy:0 AGsLogdOn:1 AGsNotRdy:1 AGsRdy:0 AGsTlkgIn:0 AGsTlkgOut:0 AGsTlkgOthr:0 AGsWorkNotRdy:0 AGsWorkRdy:0 AGsBusyOthr:0 AGsRsvd:0 AGsHld:0 RCallsQNow:0 LngstRCallQNow:0)

AgentsLoggedOn is AGsLogdOn

So get the value

GetValue(“AGsLogdOn”)

David, I don't mean to question your authority on ths subject, but I tried many variations of the above GetValue calls, and it didn't even compile. I might be doing something wrong ofcourse, but when I tried this, it did compile and if I print it out it does give me the correct number:
rArguments.GetValueArray("Statistics").GetValueString("AgentsLoggedOn");
Am I doing it write?
Thanks.

I did not code the entire statement for the GetValue calls.

I don’t think you can combine the GetValueArray and GetValueString in 1 statement and the value you are getting should be AGsLogdOn not AgentsLoggedOn.


Try getting the Statistics array first and print it out using dumpargs. Just use GetValue(“statistics”) and use IsValid first before you attempt to extract the Statistics arguments array.

For working with GetValue helper methods, see the section on Helper Classes in the CTIOS Developers Guide.

Actually you DO need to use AgentsLoggedOn.

Here is my event handler in VB.NET

Private Sub m_session_OnSkillGroupStatisticsUpdated(ByVal pIArguments As Cisco.CTIOSCLIENTLib.Arguments) Handles m_session.OnSkillGroupStatisticsUpdated
Dim statArgs As New Cisco.CTIOSCLIENTLib.Arguments
Dim numAgents As Integer
Dim strAgents As String

LogEvent("OnSkillGroupStatisticsUpdated", pIArguments)
Log("Stats: " + pIArguments.GetValue("Statistics").DumpArg())
Log("Test1")
statArgs = pIArguments.GetValueArray("Statistics")
Log("Test2")
Log("Statargs:" + statArgs.DumpArgs())
If statArgs.IsValid("AgentsLoggedOn") Then
Log("Valid")
Else
Log("NotValid")
End If
Log("numAgents: " + Str(statArgs.GetValueInt("AgentsLoggedOn")))
numAgents = statArgs.GetValueInt("AgentsLoggedOn")
Log("numAgents: " + Str(numAgents))

End Sub

David, when you do statArgs.IsValid("AgentsLoggedOn") , you are checking if AgentsLoggedOn element of Statistics array is valid, right? Why is it important to check for validity of an element? Is it just good practice or there could be some garbage in that element? What could be an example of invalid AgentsLoggedOn?
Thanks.

isValid just checks whether or not the key exists in the arguments array. It does not validate the data. It is considered good practice because GetValue will fail if used with a key that does not exist.

So, I can only see two ways the key may not exist: either I misstyped it or later versions of the CTI OS would change/remove the key. Is there any other reason why the key may not exist?

You can configure certain items on CTIOS Server that can affect whether or not a key exisits. See the CTIOS System Manager’s Guide for more information.

Per Chapter 11 of the CTIOS Developer;s Guide

Not all the statistics values listed in Table 11-1 are present in every system configuration. Whether a
particular statistic value is available depends on both the protocol version of CTI Server with which CTI
OS connects and on the peripheral on which the agent resides.The statistics listed in Table 11-2 are
available in Protocol Version 8 of CTI Server.

So you will have to check to see if the statistic exists.

David what's the correlation between "AgentsLoggedOn", S_AGENTSLOGGEDON and CTIOS_AGENTSLOGGEDON ?

They all mean the same thing.

To enable skillgroup statistics for a single skill only, specify the skillgroupnumber and skillgroup priority like this:

Private Sub Enable_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enable.Click
Dim myskillArgs, skillArgs As New Cisco.CTIOSCLIENTLib.Arguments

Log("Sending EnableSkillGroupStatistics")
skillArgs.AddItem("1", 1) ' 1 is skillgroupnumber
skillArgs.AddItem("2", 0) ' 0 is skillgroup priority
myskillArgs.AddItem("SkillGroupNumbers", skillArgs)
m_Agent.EnableSkillGroupStatistics(myskillArgs)

End Sub

David,
I think I've cleared up my confusion that I mentioned in my post above. So, please disregard my post above. What I'd still like to confirm is that OnSkillGroupStatistiscsUpdated event is triggered for each SkillGroup. That's what I see happening in the Log Window --- the print statement that I put in OnSkillGroupStatisticsUpdated function is printed once for each SkillGroup. So if I have 5 SkillGroups, I see OnSkillGroupStatisticsUpdated being executed 5 times (ones for each group), then it waits for 10 seconds (that's my time interval) and then it executes 5 times again and so on. Is that how it's supposed to work: OnSkillGroupStatisticsUpdated event is triggered for each SkillGroup?
Thanks.

What you described sounds like it is working as expected.

After
modifying C++Phone sample program to receive skillGroupStatistics, I see that
when .exe runs, the memory usage keeps increasing suggesting there is a memory
leak somewhere. If I remove all code in OnSkillGroupStatisticsUpdated(Arguments
& rArguments) { //nothing here }, I don’t see the memory usage increase,
but when I add code to access elements from rArguments object, I see memory
usage keeps increasing and never decrease. For example, I added the following:


Arguments &stats =
Arguments::CreateInstance(); 

stats = rArguments.GetValueArray("Statistics"); 

int agentsLoggedIn = stats.GetValueInt("AgentsLoggedOn");



And running the program with above
code, makes memory increase every time OnSkillGroupStatisticsUpdated event is
executed. I understand it may do some memory manipulations so memory usage
would increase, but once the event finished executing, it should clear the
memory and I should see memory usage decrease. However, I only see memory
increasing. I am using toolkit version 7.5.1. Is there a bug or am I doing
something wrong?
Thanks.
 

The Release method decrements the reference count for the data item. It is necessary to call Release when
you are finished with a data item that had its reference count incremented via CreateInstance or AddRef;
otherwise, a memory leak occurs.

Showing 21 - 40 of 87 results.
of 5
David Lender (467)
Shannon McCoy (91)
Arthur Shats (57)
Christopher Nagel (47)
GEOFFREY THOMPSON (38)