" /> [RESOLVED] Function state.CallData CCPulse - Genesys CTI User Forum

Author Topic: [RESOLVED] Function state.CallData CCPulse  (Read 7313 times)

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
[RESOLVED] Function state.CallData CCPulse
« on: February 04, 2016, 10:29:23 AM »
Advertisement
I'm using the below script in CCPulse 8.0.200 to get ANI that works normally:
result.Text = state.type == "AgentState" ? ANI() : "n/a";
function ANI()
{
          var r = ""
          for(var i = 0; i < state.CallData.Count; i++)
          {
                  var cd = state.CallData.Value(i);
                  r = cd.ANI
          }
          return r;
}
Someone knows if changed this functionality in version 8.1.100 ? Because I did the upgrade to this version and stopped work.
« Last Edit: February 05, 2016, 10:53:03 PM by thmuche »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Function state.CallData CCPulse
« Reply #1 on: February 04, 2016, 12:26:46 PM »
Will work only if ANI is part of attached data, not the ANI attribute itself. Meaning that you need to do something on your strategy first, grab Ani and attach as UserData

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
Re: Function state.CallData CCPulse
« Reply #2 on: February 04, 2016, 12:41:00 PM »
I didn't have ANI in attachdata and works in version 8.0.200, I can get also DNIS information with this function:

result.Text = state.type == "AgentState" ? DNIS() : "n/a";
function DNIS()
{
var r = ""
for(var i = 0; i < state.CallData.Count; i++)
{
var cd = state.CallData.Value(i);
r = cd.DNIS
}
return r;
}

To get the attachs I use another function (this function keep working in version 8.1.100):

result.Text = state.type == "AgentState" ? Attachs() : "n/a";
function Attachs()
{
var r = "";
for(var e= new Enumerator(state.CallData.Filter("")); !e.atEnd(); e.moveNext())
{
r += e.item().Key + "-" + e.item().Value + " | ";
}
return r;
}

I know that I can put the ANI information in attachdata and use script above, but is more simple if just I get the attribute information like in version 8.0.200. To bad if took off this function at new version.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Function state.CallData CCPulse
« Reply #3 on: February 04, 2016, 01:52:32 PM »
Weird...
You are testing with external calls, right? ANI is not present on internal calls for example

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
Re: Function state.CallData CCPulse
« Reply #4 on: February 04, 2016, 04:03:02 PM »
Yes... Call type is Inbound. I will try attach a print.


Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Function state.CallData CCPulse
« Reply #5 on: February 04, 2016, 05:41:36 PM »
Enable CCPulse logs, maybe there is something usefull there

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
Re: Function state.CallData CCPulse
« Reply #6 on: February 05, 2016, 10:21:28 AM »
I will try this! in console inside CCPulse don't show nothing...

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
Re: Function state.CallData CCPulse
« Reply #7 on: February 05, 2016, 11:34:11 AM »
I configured the log and in CCPulse 8.1.100 the information about ANI and DNIS is really comming null:

action[1]:StateDNAction{
action:LoggedIn(2)
startTime:2016-02-05 08:04:35
data:DataCall{
connID:0000000000000000
DNIS:{NULL}
ANI:{NULL}

In CCpulse 8.0.200 this information doesn't even appear in logs, but works  ;D. Something is wrong in version 8.1.100 :/, I will look the statserver logs to find the start of statistic and see if have something different.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Function state.CallData CCPulse
« Reply #8 on: February 05, 2016, 01:08:34 PM »
Why would there be an ANI/DNIS on a LoggedIn event?
You sure that is shown on a call monitoring?

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
Re: Function state.CallData CCPulse
« Reply #9 on: February 05, 2016, 01:30:56 PM »
Ops.. my mistake. You are right.. I looked just the first status of agent, in Inbound status the ANI is showing:

action[3]:StateDNAction{
action:CallInbound(22)
startTime:2016-02-05 10:18:52
data:DataCall{
connID:XXXXXXXXXXXXXXX
DNIS:70XXX
ANI:11XXXXXXX
userData:TKVList{
XXXXXXXXXXXXXX}}}

But now is more confuse... :/

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Function state.CallData CCPulse
« Reply #10 on: February 05, 2016, 01:51:02 PM »
Try something...using the same script you have, write each value of the state.CallData.Value to a text file. I suspect there might be a coding issue and not a value one.
Write them to a TXT file for example

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
Re: Function state.CallData CCPulse
« Reply #11 on: February 05, 2016, 06:36:29 PM »
After some hours trying...  ;D Follow the script that works in this version:

result.Text = state.type == "AgentState" ? ANI() : "n/a";
function ANI()
{
var r = "";
for(var e = new Enumerator(state.CallData); !e.atEnd(); e.moveNext())
{
var arrItems = e.item().toString().split(",");
for (item_ in arrItems) {
var kvp = arrItems[item_].split("=");
if (kvp[0].toUpperCase() === "ANI") {
return kvp[1];
}
}
}
return r;
}

For some reason the properties of CallData really stopped works in this version...

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Function state.CallData CCPulse
« Reply #12 on: February 05, 2016, 07:24:37 PM »
Nice! Thanks for sharing
Just for curiosity can you post a screenshot on how this is displayed?
Thanks

Offline thmuche

  • Newbie
  • *
  • Posts: 17
  • Karma: 3
Re: Function state.CallData CCPulse
« Reply #13 on: February 05, 2016, 10:46:27 PM »
I had to hide sensitive informations...

[img width=640 height=348]http://s21.postimg.org/vkgfwlf5z/teste.png[/img]
« Last Edit: February 05, 2016, 10:49:56 PM by thmuche »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: [RESOLVED] Function state.CallData CCPulse
« Reply #14 on: February 06, 2016, 04:31:28 PM »
Awesome! Thanks a lot! I am sure this will help a lot of guys :D