Voicemail

Overview

Manages the archive of voice messages placed in the box of the number of a specific SIP account attached to the authorized user.

The archive is a data store collection duplicating voice messages serviced by the vmail microservice.
UUIDs are used as identifiers, and the original voice message identifiers are contained in the 'nativeId' field.
Archive operations do not affect the operation of the voicemail service and MWI indicators.

The voicemail box has the same number as the account it belongs to.
Access to it is provided by the "Voicemail" script component.
To leave a voicemail message, the feature code 'voicemail_send' is used; when calling its number, the number must be supplemented with the box number.
As an alternative, an IVR script with a 10-20 second pause before answering can be created that places voicemail (by itself or by transferring to the feature code number with an extension) and assigned as a parallel number.

Voicemail management (listening, deletion) is possible via IVR scripts and the feature code 'voicemail'.
When listening to messages via a telephone using the feature code, the message state automatically changes from 'new' to 'listened'.
The archive reflects these changes.

The full-path collection is available to users for subscription to changes via websocket subscr, as well as CRUD operations via websocket rest.

Requests

HTTP verb Endpoint Description

GET

/rest/v1/user/sip/accounts/<AccountID>/archive_voicemail_messages

Getting the list of voicemail messages from the archive

GET

/rest/v1/user/sip/accounts/<AccountID>/archive_voicemail_messages/<Date>

Getting the list of voicemail messages from the archive

CLEAR

/rest/v1/user/sip/accounts/<AccountID>/archive_voicemail_messages

Clearing the voicemail archive

GET

/rest/v1/user/sip/accounts/<AccountID>/archive_voicemail_messages/<Date>/<Id>

Getting voice message metadata from the archive

PATCH

/rest/v1/user/sip/accounts/<AccountID>/archive_voicemail_messages/<Date>/<Id>

Setting the 'error' status on an archived voice message

DELETE

/rest/v1/user/sip/accounts/<AccountID>/archive_voicemail_messages/<Date>/<Id>

Deleting a voice message from the archive

GET

/rest/v1/user/sip/accounts/<AccountID>/archive_voicemail_messages/<Date>/<Id>/recording

Getting the voice message recording file from the archive

For all requests:
Domain type: worker

Getting the list of voicemail messages from the archive

Returns the list of all voice messages from the box of the SIP account specified by identifier and attached to the authorized user.

The list contains all specified messages for the time interval, bound to the subscriber number.
If the endpoint with a date is used, the initial set is all messages for that date.
Otherwise the 'interval' GET parameter must be specified.

Request

Example request
GET /rest/v1/user/sip/accounts/c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9/archive_voicemail_messages?inteval=["2022-10-28","2022-10-29"] HTTP/1.1

GET /rest/v1/user/sip/accounts/c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9/archive_voicemail_messages/2022-10-28 HTTP/1.1

Response

Example response
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "id": "c2043c10-0184-1ec8-cb0b-7cd30a921f58",
    "nativeId": "20221028-161946505-13.wav",
    "dateTime": "2022-10-28T16:19:46.505Z",
    "from": "9274137274",
    "messageState": "new",
    "statusText": null,
    "listenedDateTime": null,
    "archivedDateTime": null,
    "recording": {
      "author_id": "",
      "hasha": "md5;1A55FB50B63CF31DBEFE5FC680D0798C",
      "link": "fs://00000000-0000-0000-0000-000000000000/attachments_auto/test.incoplax.com/telephony/VoicemailMessages/2022-10-28/c2/04/3c/10-0184-1ec8-cb0b-7cd30a921f58/recording/content",
      "mtime": "2022-10-28T13:19:46Z",
      "name": "20221028-162946505-13.wav",
      "size": 21804
    },
    "size": 21804
  },
  {
    "id": "21d27ce0-0184-1ec7-cf64-7cd30a921f58",
    "nativeId": "20221028-162842083-13.wav",
    "dateTime": "2022-10-28T16:28:42.083Z",
    "from": "13",
    "messageState": "archived",
    "statusText": null,
    "listenedDateTime": null,
    "archivedDateTime": "2022-10-28T13:29:21Z",
    "recording": {
      "author_id": "",
      "hasha": "md5;242335DB1542623B292E594F018079FA",
      "link": "fs://00000000-0000-0000-0000-000000000000/attachments_auto/test.incoplax.com/telephony/VoicemailMessages/2022-10-28/21/d2/7c/e0-0184-1ec7-cf64-7cd30a921f58/recording/content",
      "mtime": "2022-10-28T13:28:42Z",
      "name": "20221028-162842083-13.wav",
      "size": 388442
    },
    "size": 388442
  }
]

Clearing the voicemail archive

Deletes all voice messages from the archive.
Belonging to the box of the SIP account specified by identifier and attached to the authorized user.

Messages are deleted from the archive using a 3-year interval.
If earlier messages are present in the archive, they can be cleared through individual deletions, by detaching the DB partition and dated directories in the file storage, or by the administrator fully clearing the 'telephony/VoicemailMessages' collection.

Deletion of messages not moved to the 'archived' state via the feature code or the "Voicemail" IVR script component.

Request

Example request
CLEAR /rest/v1/user/sip/accounts/c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9/archive_voicemail_messages HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Getting voice message metadata from the archive

Request

Example request
GET /rest/v1/user/sip/accounts/c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9/archive_voicemail_messages/2022-10-28/21d27ce0-0184-1ec7-cf64-7cd30a921f58 HTTP/1.1

Response

Example response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "21d27ce0-0184-1ec7-cf64-7cd30a921f58",
  "nativeId": "20221028-162842083-13.wav",
  "dateTime": "2022-10-28T16:28:42.083Z",
  "from": "13",
  "messageState": "archived",
  "statusText": null,
  "listenedDateTime": null,
  "archivedDateTime": "2022-10-28T13:29:21Z",
  "recording": {
    "author_id": "",
    "hasha": "md5;242335DB1542623B292E594F018079FA",
    "link": "fs://00000000-0000-0000-0000-000000000000/attachments_auto/test.incoplax.com/telephony/VoicemailMessages/2022-10-28/21/d2/7c/e0-0184-1ec7-cf64-7cd30a921f58/recording/content",
    "mtime": "2022-10-28T13:28:42Z",
    "name": "20221028-162842083-13.wav",
    "size": 388442
  },
  "size": 388442
}

Setting the 'error' status on an archived voice message

Sets the 'error' status and optionally the error description text in the 'statusText' field.

The error status is final. No further change is provided.

Request

Example request
PATCH /rest/v1/user/sip/accounts/c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9/archive_voicemail_messages/2022-10-28/21d27ce0-0184-1ec7-cf64-7cd30a921f58 HTTP/1.1
Content-Type: application/json

{
  "messageState": "error",
  "statusText": "Some error description"
}

Response

Example response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "20221011-135436307-13",
  "dt": "2022-10-11T13:54:36.307Z",
  "from_number": "13",
  "status": "listened"
}

Deleting a voice message from the archive

Deletes the specified voice message.
Does not affect the voicemail service and MWI.
If the original voice message has not been deleted by the time it is removed from the archive, access to it remains via the script component and the 'voicemail' feature code.

Request

Example request
DELETE /rest/v1/user/sip/accounts/c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9/archive_voicemail_messages/2022-10-28/21d27ce0-0184-1ec7-cf64-7cd30a921f58 HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Getting the voice message recording file from the archive

Recordings of archived, new, and already listened messages can be downloaded.
Does not affect the voicemail service and MWI, and does not move the original voice message from the new box to the listened box.

Request

Example request
GET /rest/v1/user/sip/accounts/c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9/archive_voicemail_messages/2022-10-28/21d27ce0-0184-1ec7-cf64-7cd30a921f58/recording HTTP/1.1

Response

Example response
HTTP/1.1 200 OK
Content-Type: media/x-wav

BINARY BODY OF RECORING