API Docs for: 2.6
Show:

plugin_rest_voicemail Class

Module: plugins_rest
Parent Module: com_voicemail_rest

REST plugin that provides voicemail functions through the following REST API:

GET requests

  1. voicemail/list
  2. voicemail/listen/:id
  3. voicemail/new_counters
  4. voicemail/download/:id

voicemail/list

Returns the list of all voicemail messages of the user.

Example JSON response:

{
    "609": {
         "old": [],
         "new": [
             {
                 "origtime": 1402502282000,
                 "duration": "00:13",
                 "id": 7,
                 "dir": "/var/spool/asterisk/voicemail/default/609/INBOX",
                 "callerid": "\"alessandro\" <614>",
                 "mailboxuser": "609"
             }
         ]
    }
}

voicemail/listen/:id

The user can listen the voice message of the user. The id must be the identifier of the voice message in the database.


voicemail/new_counters

Returns the number of the new voice messages of all voicemails.

Example JSON response:

{
    "602": {
         "newMessageCount": "0"
    },
    "605": {
         "newMessageCount": "0"
    },
    "608": {
         "newMessageCount": "0"
    },
    "609": {
         "newMessageCount": "1"
    },
    "614": {
         "newMessageCount": "0"
    },
    "615": {
         "newMessageCount": "0"
    }
}

voicemail/download/:id

The user can download the voice message of the user. The id must be the identifier of the voice message in the database..


POST requests

  1. voicemail/delete

voicemail/delete

Delete the specified voicemail message. The request must contains the following parameters:

  • id: the voice message identifier of the database

Example JSON request parameters:

{ "id": "74" }

Methods

delete

(
  • req
  • res
  • next
)

Gets the list of all voicemail messages of the user with the following REST API:

delete

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

download

(
  • req
  • res
  • next
)

Download the voice message of the user with the following REST API:

download

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

list

(
  • req
  • res
  • next
)

Gets the list of all voicemail messages of the user with the following REST API:

list

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

listen

(
  • req
  • res
  • next
)

Listen the voicemail message of the user with the following REST API:

listen

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

new_counters

(
  • req
  • res
  • next
)

Gets the number of new voice messages of all voicemails with the following REST API:

new_counters

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

setCompAuthorization

(
  • comp
)
static

Sets the authorization architect component.

Parameters:

  • comp Object

    The architect authorization component

setCompStatic

(
  • comp
)

Set static http architecht component used by history functions.

Parameters:

  • comp Object

    The http static architect component.

setCompUser

(
  • comp
)
static

Set the user architect component.

Parameters:

  • comp Object

    The architect user component

setCompUtil

(
  • comp
)

Sets the utility architect component.

Parameters:

  • comp Object

    The utility architect component.

setCompVoicemail

(
  • cp
)

Set voicemail architect component used by voicemail functions.

Parameters:

  • cp Object

    The voicemail architect component.

setLogger

(
  • log
)
static

Set the logger to be used.

Parameters:

  • log Object

    The logger object. It must have at least three methods: info, warn and error as console object.

Properties

compAuthorization

Object private

The architect component to be used for authorization.

compStaticHttp

Object private

The http static module.

compUser

Object private

The architect component to be used for user.

compUtil

Object private

The utility architect component.

compVoicemail

Object private

The voicemail architect component used for voicemail functions.

get

Array

REST API to be requested using HTTP GET request.

Sub-properties:

  • list String

    To get the list of all voicemail messages of the user

  • listen/:id String

    To listen the voicemail message of the user

  • download/:id String

    To download the voicemail message of the user

  • new_counters String

    To get the number of new voice messages of all voicemails

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/voicemail]

logger

Object private

The logger. It must have at least three methods: info, warn and error.

Default: console

post

Array

REST API to be requested using HTTP POST request.

Sub-properties:

  • delete String

    To delete a voicemail messages of the user