Amethyst 2 AEM Integration API

We are busy preparing a Github repository to host the documentation for this facility. A link to the report will be posted here once it is available.

API Endpoints

1. Get Recording Information

GET /webservice/recording

Request Parameters

Parameter Type Required Description
extension string Yes The extension number to query

Response Format

{
  "recordingReference": "string",
  "extension": "string",
  "number": "string",
  "direction": "string",
  "linkId": "string",
  "recordingDateTime": "string"
}

2. Update Recording Reference

PUT /webservice/recording/reference

Request Body

{
  "recordingReference": "string",
  "reference": "string"
}

3. Update Recording Subject

PUT /webservice/recording/subject

Request Body

{
  "recordingReference": "string",
  "subject": "string"
}

4. Update Recording Comment

PUT /webservice/recording/comment

Request Body

{
  "recordingReference": "string",
  "comment": "string"
}

AEM Field Mapping

Key Fields Extracted

From the AEM record, the following fields are captured:

  • Recording Reference (e.g., A241029-000002)
  • Extension (e.g., 185)
  • Number (e.g., 0215924277)
  • Direction (e.g., I,O)
  • LinkID
  • Recording date/time (e.g., 20241030123922185 (yyyymmddHHMMSSzzz))

AEM Record Format

The AEM system provides records in the following format:

[Recording start]|[Recording date/time]|[Server]|[Server IP]|DEVSTART|[Device IP]|[Device Type]|[Recording References]|[EXTENSION]|[Trunk]|[Number]|[Duration]|[Direction]|[Destination]|[LinkID]|[Physical Extension]|[Unique ID]|[PABX IP]|
PBX|TAPI|START|185|1|0215924277|

[Reocrding Updated]|[Recording date/time]|[Server]|[Server IP]|PBXSTART|[Device IP]|[Device Type]|[Recording References]|[EXTENSION]|[Trunk]|[Number]|[Duration]|[Direction]|[Destination]|[LinkID]|[Physical Extension]|[Unique ID]|[PABX IP]|
PBX|TAPI|STOP|R:185|0215924033||0:00:10||2024-10-30 12:00:00||1|O||

[Reocrding Updated]|[Recording date/time]|[Server]|[Server IP]|DEVSTOP|[Device IP]|[Device Type]|[Recording References]|[EXTENSION]|[Trunk]|[Number]|[Duration]|[Direction]|[Destination]|[LinkID]|[Physical Extension]|[Unique ID]|[PABX IP]|
[Reocrding Updated]|[Recording date/time]|[Server]|[Server IP]|PBXSTOP|[Device IP]|[Device Type]|[Recording References]|[EXTENSION]|[Trunk]|[Number]|[Duration]|[Direction]|[Destination]|[LinkID]|[Physical Extension]|[Unique ID]|[PABX IP]|
[Reocrding Stopped]|[Recording date/time]|[Server]|[Server IP]|FINALIZED|[Device IP]|[Device Type]|[Recording References]|[EXTENSION]|[Trunk]|[Number]|[Duration]|[Direction]|[Destination]|[LinkID]|[Physical Extension]|[Unique ID]|[PABX IP]|

Example AEM Record

RBE|20241030123922185|SERVER,IT Place (Pty) Ltd,|101.203.105.213|DEVSTART|192.168.15.50|T|A241029-000002||1||00:00:00|U||0E87D5F0-5297-EF11-9B7E-50568144B||||
PBX|TAPI|START|185|1|0215924277|
RUP|20241030123922185|SERVER,IT Place (Pty) Ltd,|101.203.105.213|PBXSTART|192.168.15.50|T|A241029-000002|185|1|0215924277|00:00:02|U||0E87D5F0-5297-EF11-9B7E-50568144B||||
PBX|TAPI|STOP|R:185|0215924033||0:00:10||2024-10-30 12:00:00||1|O||
RUP|20241030123922185|SERVER,IT Place (Pty) Ltd,|101.203.105.213|DEVSTOP|192.168.15.50|T|A241029-000002|185|1|0215924277|00:00:50|U||0E87D5F0-5297-EF11-9B7E-50568144B||||
RUP|20241030123923197|SERVER,IT Place (Pty) Ltd,|101.203.105.213|PBXSTOP|192.168.15.50|T|A241029-000002|185|1|0215924277|00:00:50|O||0E87D5F0-5297-EF11-9B7E-50568144B||||
REN|20241030123923197|SERVER,IT Place (Pty) Ltd,|101.203.105.213|FINALIZED|192.168.15.50|T|A241029-000002|185|1|0215924277|00:00:50|O||0E87D5F0-5297-EF11-9B7E-50568144B||||

Implementation Notes

Field Parsing

The API extracts the following fields from AEM records:

  1. Recording Reference: Position 8 in the pipe-delimited string
  2. Extension: Position 9 in the pipe-delimited string
  3. Number: Position 11 in the pipe-delimited string
  4. Direction: Position 13 in the pipe-delimited string
  5. LinkID: Position 15 in the pipe-delimited string
  6. Recording date/time: Position 2 in the pipe-delimited string

Example Usage

Get Recording Status

curl -X GET "https://example.com/webservice/recording?extension=185"

Example Response:

{
  "recordingReference": "A241029-000002",
  "extension": "185",
  "number": "0215924277",
  "direction": "O",
  "linkId": "12345",
  "recordingDateTime": "20241030123922185"
}

Update Recording Reference

curl -X PUT "https://example-domain/webservice/recording/reference" \
  -H "Content-Type: application/json" \
  -d '{
    "recordingReference": "A241029-000002",
    "reference": "1234"
  }'

Update Recording Subject

curl -X PUT "https://example-domain/webservice/recording/subject" \
  -H "Content-Type: application/json" \
  -d '{
    "recordingReference": "A241029-000002",
    "subject": "Example subject over here"
  }'

Update Recording Comment

curl -X PUT "https://example-domain/webservice/recording/comment" \
  -H "Content-Type: application/json" \
  -d '{
    "recordingReference": "A241029-000002",
    "comment": "Example comment over here"
  }'

Service Configuration

The service requires the following configuration:

  • AEM service connection details (host, port)
  • API port
  • Sweeper Folder location
  • Authentication settings
{
    "aemHost": "127.0.0.1",
    "aemPort": 27007,
    "restPort": 3004,
    "sweeperFolder": "/opt/datatex/amtsorter/incoming",
    "users": [
        {
            "username":"user1",
            "password":"user1"
        }
    ]
}