Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The "data" property carries any request, response, or event specific information that is needed to perform the requested action or describe the event.  The "context" property is optional for all messages and serves as a tool for debugging protocol implementations.  Under normal circumstances "context" should not be present.  Below is an example that shows the context of a telephony conversation:

Code Block
languagejson
"context":

...


{

...


  "conversation":

...

{


  {
    "id": "<conversation-id>",

...


    "interaction":

...

{


    {
      "id": "<interaction-id>",

...


      "type": "Telephony",

...


      "modeltype": "TELEPHONY",

...


      "channel":

...

{


      {
        "id": "<channel-id>",

...


        "name": "<channel-name>",

...


        "type": "TELEPHONY",

...


        "modeltype": "TELEPHONY",

...


        "session":

...

{


        {
          "id": "<session-id>"

...

}

}

}

}


        }
      }
    }
  }
}

Session Management Requests and Responses

...

The client sends this session management request immediately after it has bound the session resource.  Any other request sent prior to this message will generate an error response.  The interaction processor begins the session initialization process once this message is received.  The extension property is optional and is only used by the Avaya Processor at this time.

Request

Code Block

{

languagejson
{
  "command": "session.start",

...


  "target": "<session-id>",

...


  "data":

...

{


  {
    "extension": "<telephony channel extension>"

...


  }

...


}

Success Response

{

Code Block
languagejson
{
  "command": "session.start",

...


  "target": "<session-id>",

...


  "result": "success"

...


}

Failure Response

{

Code Block
languagejson
{
  "command": "session.start",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

During session initialization, the interaction processor determines the agent's current state within the underlying CTI platform.  If the agent already has active channels, interactions, or conversations, those objects will be created within the session resource and events about their current state will be sent to the client.  Regardless of any additional events generated during initialization, the session.initialized event will always be generated when the process is complete.

...

The client sends this session management request to indicate that the session should end and all associated objects should be released.  The interaction processor should not respond to this request until the logout process has completed.

Request

{

Code Block
languagejson
{
  "command": "session.logout",

...


  "target": "<session-id>",

...


  "data": {}

...


}

Success Response

Code Block

{

languagejson
{
  "command": "session.logout",

...


  "target": "<session-id>",

...


  "result": "success"

...


}

Failure Response

Code Block
languagejson
{

...


  "command": "session.logout",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>"

...

,
    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

Logging out of a session should not generate any secondary events.  The session should be completely inert once the process is complete and a success is returned.

...

Adds a standalone channel to this agent session.  The type of channel to be added is provided in the "data" property.  The endpoint (i.e. extension for telephony) for the channel is also included in the "data" property.

Request

Code Block

{

languagejson
{
  "command": "session.addchannel",

...


  "target": "<session-id>",

...


  "data":

...

{


  {
    "channel":

...

{


    {
      "endpoint": "<CTI-channel-identifier>",

...


      "type": "Telephony | Chat | Email"

...

}

}


    }
  }
}

Success Response

Code Block

{

languagejson
{
  "command": "session.addchannel",

...


  "target": "<session-id>",

...


  "result": "success",

...


  "data":

...

{

<Same data contents as original request>

}


  {
    <Same data contents as original request>
  }
}

Failure Response

Code Block

{

languagejson
{
  "command": "session.addchannel",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

Several secondary events might occur during initialization of a channel.  However, if the channel is successfully added, the client will always receive the following events:·      

  • channel.created

...

  • state.updated (channel state event)

...

  • channel.initialized

session.removechannel

Removes a previously added standalone channel from this agent session.  The channel will automatically be deactivated if it is still active.  A failure is generated if the channel has an active interaction or cannot be deactivated before being removed from the session.

Request

{

Code Block
languagejson
{
  "command": "session.removechannel",

...


  "target": "<session-id>",

...


  "data":

...

{


  {
    "channel":

...

{


    {
      "id": "<channel-identifier>"

...

}

}


    }
  }
}

Success Response

Code Block
languagejson
{

...


  "command": "session.removechannel",

...


  "target": "<session-id>",

...


  "result": "success",

...


  "data":

...

{

<Same data contents as original request>

}


  {
    <Same data contents as original request>
  }
}

Failure Response

Code Block

{

languagejson
{
  "command": "session.removechannel",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

Removing a channel will generate the following secondary events:·      

  • channel.infochanged (If still active)

...

  • state.updated (channel state event, if still active)

...

  • channel.disposed

session.addchannelgroup

Adds a channel group to this agent session.  All channels associated with the given group will then be added to the group during the initialization phase.  The channel group to add is identified in the "data" property of the request.

Request

{

.

Request

Code Block
languagejson
{
  "command": "session.addchannelgroup",

...


  "target": "<session-id>",

...


  "data":

...

{


  {
    "channelgroup":

...

{


    {
      "name": "<CTI-channel-group-identifier>",

...


      "chat": true | false,

...


      "email": true | false,

...


      "callback": true | false

...

}

}


    }
  }
}

Success Response

Code Block
languagejson
{

...


  "command": "session.addchannelgroup",

...


  "target": "<session-id>",

...


  "result": "success",

...


  "data":

...

{

<Same data contents as original request>

}


  {
    <Same data contents as original request>
  }
}

Failure Response

{

Code Block
languagejson
{
  "command": "session.addchannelgroup",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

Several secondary events might occur during initialization of a channel group and its associated channels.  However, if the channel group is successfully added, the client will always receive the following events:·      

  • channelgroup.created

...

  • state.updated (channel group state event)

...

  • channel.created (for each associated channel)

...

  • state.updated (channel state event)

...

  • channel.initialized

...

  • channelgroup.initialized

session.removechannelgroup

Removes a previously added channel group and its associated channels from this agent session.  Associated channels will automatically be deactivated if they are still active.  A failure is generated if an associated channel has an active interaction or cannot be deactivated before being removed from the group.

Request

Code Block

{

languagejson
{
  "command": "session.removechannelgroup",

...


  "target": "<session-id>",

...


  "data":

...

{


  {
    "channel":

...

{


    {
      "id": "<channel-group-identifier>"

...

}

}

}

Success Response

{


    }
  }
}

Success Response

Code Block
languagejson
{
  "command": "session.removechannelgroup",

...


  "target": "<session-id>,

...


  "result": "success",

...


  "data":

...

{

<Same data contents as original request>

}


  {
    <Same data contents as original request>
  }
}

Failure Response

Code Block

{

languagejson
{
  "command": "session.removechannelgroup",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

Removing a channel group will generate the following secondary events:·      

  • channel.infochanged (for each associated channel If still active)

...

  • state.updated (channel state event, if still active)

...

  • channel.disposed

...

  • state.updated (channel group state event)

...

  • channelgruop.disposed

session.request.getdirectory

Retrieves a directory listing of quick dial entries directly from the switch.  These entries are added to the static entries available from Config Server.

Request

{

Code Block
languagejson
{
  "command": "session.request.getdirectory",

...


  "target": "<session-id>",

...


  "data":

...

{

}


  {
  }
}

Success Response

Code Block

{

languagejson
{
  "command": " session.request.getdirectory ",

...


  "target": "<session-id>,

...


  "result": "success",

...


  "data":

...

{

}


  {
  }
}

Failure Response

Code Block
{

...


  "command": " session.request.getdirectory ",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

Requesting the directory does not generate any secondary events.

...

Requests the list of not ready reason codes available to this agent.  If supported by the CTI platform, the list should come directly from the platform.

Request

Code Block

{

languagejson
{
  "command": "session.request.externalnotredyreasons",

...


  "target": "<session-id>",

...


  "data":

...

{

}


  {
  }
}

Success Response

{

Code Block
languagejson
{
  "command": "session.request.externalnotreadyreasons",

...


  "target": "<session-id>",

...


  "result": "success",

...


  "data":

...

{

}


  {
  }
}

Failure Response

{

Code Block
languagejson
{
  "command": "session.request.externalnotreadyreasons",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

If this request is supported, a session.externalnotreadyreasons.updated event is generated that contains the list of not ready reason codes available to the agent.

...

Requests the list of logout reason codes available to this agent.  If supported by the CTI platform, the list should come directly from the platform.

Request

{

.

Request

Code Block
languagejson
{
  "command": "session.request.externallogoutreasons",

...


  "target": "<session-id>",

...


  "data":

...

{

}


  {
  }
}

Success Response

Code Block

{

languagejson
{
  "command": "session.request.externallogoutreasons",

...


  "target": "<session-id>",

...


  "result": "success",

...


  "data":

...

{

}


  {
  }
}

Failure Response

{

Code Block
languagejson
{
  "command": "session.request.externallogoutreasons",

...


  "target": "<session-id>",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original request JSON structure>


  {
    <Contains the original request JSON structure>
  }
}

Secondary Events

If this request is supported, a session.externallogoutreasons.updated event is generated that contains the list of logout reason codes available to the agent.

...