cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1442
Views
0
Helpful
4
Replies

Agent State Event, Float Tag not correct,and skill is always null

kazspinsci
Level 1
Level 1

Hi, Guys,

I have problem to parse the Agent State Event(MessageType = 30)

the first problem is there are float tag that not match the document.

after I read all the fix part, according to the document, the first float tag should be CtiClientSignature which is 3, but actually it is a unkown tag -12, so I have to read a float field of tag = -12 then start float field of tag = 3

and there are more problem in the float fields that the float tag is not as same as what the document show, they are

documented tag/real tag

duration(150)/-20

nextAgentState(123)/-19

callDirection(244)/-18

Another problem exists in this event is that the numFltSkillGroups is always 0 while I can get a correct data in QueryAgentStateConfMessage, can you give me some help?

4 Replies 4

hemajosh
Level 4
Level 4

Here is what i think could be the cause of the issues you are facing :

For #1

Here it looks like some issue specific to your parsing logic while reading the floating fields.

As you are able to parse the fixed fields and the issue is coming up only with the floating fields ( which contains tags ). so you need to revisit your parsing logic once again.

Each data element in the floating field is preceded with tag value that uniquely identifies the type of following data .

For example: The CTIClientSignature data element with value "ctios" has to be encoded as :
<CLIENT_SIGNATURE_TAG=3><length=6><'c'><'t'><'i'><'o'><'s'><'\0'>

If possible, please upload the area of code where you are performing the parsing logic.

For your #2 , the numFltSkillGroups field is only associated with AGENT_STATE_EVENT. There is no such field in QUERY_AGENT_STATE_CONF.

For the numFltSkillGroups , If information for more than one skill group is passed this should be non-zero and indicate the number of floating FltSkillGroupNumber, FltSkillGroupID, FltSkillGroupPriority, and FltSkillGroupState floating fields present in the floating part of the message (up to 99). If 0, a single set of those entities is specified in the fixed part of the message.

The QUERY_AGENT_STATE_CONF event only contains NumSkillGroups which is number of Skill Groups that the agent is currently associated with, up to a maximum of 20.

So these two are different.

Hi, Hemant,

thank you for your reply.

I will post the code at here to show what the problem I encountered.

here is the parsing of AgentStateEventMessage, it have problem of the float fields

  protected ResponseMessage doParse() {

  AgentStateEventMessage message = new AgentStateEventMessage();

// private long monitorID;

  message.setMonitorID(readUint());

// private long peripheralID;

  message.setPeripheralID(readUint());

// private long sessionID;

  message.setSessionID(readUint());

// private PeripheralType peripheralType;

  message.setPeripheralType(PeripheralType.valueOf(readUshort()));

// private AgentState skillGroupState;

  message.setSkillGroupState(AgentState.valueOf(readUshort()));

// private long stateDuration;

  message.setStateDuration(readUint());

// private long skillGroupNumber;

  message.setSkillGroupNumber(readUint());

// private long skillGroupID;

  message.setSkillGroupID(readUint());

// private int skillGroupPriority;

  message.setSkillGroupPriority(readUshort());

// private AgentState agentState;

  message.setAgentState(AgentState.valueOf(readUshort()));

// private int eventReasonCode;

  message.setEventReasonCode(readUshort());

// private int mrdid;

  message.setMrdid(readInt());

// private long numTasks;

  message.setNumTasks(readUint());

// private AgentMode agentMode;

  message.setAgentMode(AgentMode.valueOf(readUshort()));

// private long maxTaskLimit;

  message.setMaxTaskLimit(readUint());

// private long icmAgentID;

  message.setIcmAgentID(readInt());

// private long agentAvailabilityStatus;

  message.setAgentAvailabilityStatus(readUint());

// private int numFltSkillGroups;

  message.setNumFltSkillGroups(readUshort());

  //TODO what's this

  readStringF(-12);

  //float

// private String ctiClientSignature;3?

  message.setCtiClientSignature(readStringF(3));

  message.setAgentID(readStringF(5));

  //AgentExtension

  message.setAgentExtension(readStringF(4));

  //AgentInstrument

  message.setAgentInstrument(readStringF(6));

// private long duration;150/-20?

  message.setDuration(readUshortF(-20));

// private AgentState nextAgentState;123/-19?

  message.setNextAgentState(AgentState.valueOf(readUshortF(-19)));

// private CallDirection callDirection;244/-18?

  message.setCallDirection(CallDirection.valueOf((int)readUintF(-18)));

// System.out.println("current:" + JacksonUtils.toJsonString(msg));

  //iterate

  for (int i = 0 ; i < message.getNumFltSkillGroups() ; i++){

  SkillGroupData sd = new SkillGroupData();

  //SkillGroup Number

  sd.setNumber(readIntF(62));

  //SkillGroupID

  sd.setId(readUintF(63));

  //SkillGroup Priority

  sd.setPriority(readUshortF(64));

  //SkillGroupState

  sd.setState(readUshortF(65));

  message.getSkills().add(sd);

  }

  return message;

  }

and here is what I do parse the QueryAgentStateConfMessage, it works fine.

  protected ResponseMessage doParse() {

  QueryAgentStateConfMessage msg = new QueryAgentStateConfMessage();

  msg.setInvokeId(readUint());

  msg.setAgentState(AgentState.valueOf(readUshort()));

  msg.setNumSkillGroups(readUshort());

  msg.setMrdid(readInt());

  msg.setNumTasks(readUint());

  msg.setAgentMode(readUshort());

  msg.setMaxTaskLimit(readUint());

  msg.setIcmAgentID(readInt());

  msg.setAgentAvailabilityStatus(readUint());

  //float

  //AgentID

  msg.setAgentID(readStringF(5));

  //AgentExtension

  msg.setAgentExtension(readStringF(4));

  //AgentInstrument

  msg.setAgentInstrument(readStringF(6));

// System.out.println("current:" + JacksonUtils.toJsonString(msg));

  //iterate

  for (int i = 0 ; i < msg.getNumSkillGroups() ; i++){

  SkillGroupData sd = new SkillGroupData();

  //SkillGroup Number

  sd.setNumber(readUintF(62));

  //SkillGroupID

  sd.setId(readUintF(63));

  //SkillGroup Priority

  sd.setPriority(readUshortF(64));

  //SkillGroupState

  sd.setState(readUshortF(65));

  msg.getSkills().add(sd);

  }

  return msg;

  }

I don't have method defintions of your set and read methods but below are set of points which you can quickly check in your code

++ Are you handling the null character. You need to add space for null character in case of string. Below screenshot reflects details about the floating field used with CTI events

FloatingField_CTI.png

++ You need to use the readUInt for duration as the datatype as this field is UINT TAG.

Hemant, thank you for reply

yes, my code have the terminal null for the string, I have no problem of the string field.

for the duration field, I know the document is saying it should be uint, but when I testing, I found it actually is a ushort.

Getting Started

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: