Core REST Recording API

Introduction

Anywhere365 introduces a Representational State Transfer (REST) Recording service, which can be used by a payment system to control the recording state. This feature enables you to be PCI compliant.

 

Prerequisites

 

Get Recording state

When an audio call is in progress this command will allow for the recorder to be controlled.

Recording states are;

  • Uninitialized = 0,

  • Started = 1,

  • Stopped = 2,

  • Paused = 3

Marking states are;

  • None = 0,

  • Mark = 1,

  • Unmark = 2

Saving states are;

  • None = 0,

  • Save = 1,

  • Delete = 2

 

Request

GET http://localhost/attendantservice/api/recording/uccname/1d6c6a58-6739-4f0c-98ff-0968292c8c30 HTTP/1.1

Accept: application/json

 

Response (session found)

{

"CorrelationId": "a3e52018-0a0e-4af1-a7e0-a80332dc4109",

"RecordingState": 0,

"MarkingState": 1,

"SavingState": 1,

"ErrorMessage": null,

"UCCName": "uccname"

}

 

Response (session not found)

{

"CorrelationId": "1d6c6a58-6739-4f0c-98ff-0968292c8c30",

"RecordingState": 0,

"MarkingState": 0,

"SavingState": 0,

"ErrorMessage": {

"ErrorType": 2,

"Message": "No Audio session with correlation Id:'1d6c6a58-6739-4f0c-98ff-0968292c8c30' was found."

},

"UCCName": "uccname"

}

 

Change recorder state

Actions that modify the state are;

  • Start = 1,

  • Stop = 2,

  • Pause = 3,

  • Save = 4,

  • Delete = 5,

  • Mark = 6,

  • UnMark = 7

 

Request with action id

POST http://localhost/attendantservice/api/recording/set HTTP/1.1

Accept: application/json

Content-Type: application/json

{

"Action": 1,

"RequesterSipUri": "sipThe Session Initiation Protocol (SIP) is a protocol to make multimedia communication (audio, video and other data communication) possible and it is also used for Voice over IP (VoIP). SIP has similarities with other Internet protocols such as HTTP and SMTP.:agent@domain.com",

"CorrelationId": "1d6c6a58-6739-4f0c-98ff-0968292c8c30",

"UCCName": "uccname"

}

 

Request with action name

POST http://localhost/attendantservice/api/recording/set HTTP/1.1

Accept: application/json

Content-Type: application/json

{

"Action": "Mark",

"RequesterSipUri": "sip:agent@domain.com",

"CorrelationId": "1d6c6a58-6739-4f0c-98ff-0968292c8c30",

"UCCName": "uccname"

}

 

Recording capabilities

In order for the change recorder state command to work the UCC must be set to allow AgentCanEditRecordings, with this command you can verify the setting.

Request

GET http://localhost:1149/api/recording/capabilities/uccname HTTP/1.1

Accept: application/json

 

Response

{

"AgentCanEditRecordings": true,

"ErrorMessage": null,

"UCCName": "ucc_nick"

}

 

Response (ucc not found)

{

"AgentCanEditRecordings": false,

"ErrorMessage": {

"ErrorType": 2,

"Message": "Ucc with name:'uccname' not found."

},

"UCCName": "uccname"

}

 

Recording events

SignalR hub can be listened to the RecordingStateChangedEvent which holds UccName, CorrelationId and StateAction. StateAction is the type of action that changed the state of the audiorecorder;

  • Start = 1,

  • Stop = 2,

  • Pause = 3,

  • Save = 4,

  • Delete = 5,

  • Mark = 6,

  • UnMark = 7

 

Error Messages

Each recording command response can hold a ErrorMessage body.

ErrorMessage will be null when the message is successful, otherwise it will hold the following;

"ErrorMessage": {

"ErrorType": 1,

"Message": "string"

}

The error types that can be returned are;

  • Configuration = 1,

  • Validation = 2,

  • Processing = 3