API Docs for: 2.6
Show:

plugin_rest_histcallswitch Class

Module: plugins_rest
Parent Module: com_history_rest

REST plugin that provides switchboard history functions through the following REST API:

GET requests

  1. histcallswitch/day/:day
  2. histcallswitch/day/:day/:filter
  3. histcallswitch/interval/:from/:to
  4. histcallswitch/interval/:from/:to/:filter

histcallswitch/day/:day

Returns the switchboard history call of the day "day" of all endpoints. Date must be expressed in YYYYMMDD format. If an error occurs an HTTP 500 response is returned.

Example JSON response:

[
    {
       date: "02/01/2014"
       time: "08:32:57"
       channel: "SIP/2001-00000000"
       dstchannel: "SIP/303-0000000b"
       uniqueid: "1388647977.5182"
       duration: 29
       billsec: 21
       disposition: "ANSWERED"
       dcontext: "ext-local"
       recordingfile: ""
       src: "0721123432"
       dst: "vms201"
       clid: ""CHIU: USER" <1233312>"
    }
]

histcallswitch/day/:day/:filter

Returns the switchboard history call of the day "day" of all endpoints filtering by "filter". Date must be expressed in YYYYMMDD format. If an error occurs an HTTP 500 response is returned.

Example JSON response:

[
    {
       date: "02/01/2014"
       time: "08:32:57"
       channel: "SIP/2001-00000000"
       dstchannel: "SIP/303-0000000b"
       uniqueid: "1388647977.5182"
       duration: 29
       billsec: 21
       disposition: "ANSWERED"
       dcontext: "ext-local"
       recordingfile: ""
       src: "0721123432"
       dst: "vms201"
       clid: ""CHIU: USER" <1233312>"
    }
]

histcallswitch/interval/:from/:to

Returns the switchboard history call between "from" date to "to" date of all endpoints. Dates must be expressed in YYYYMMDD format. If an error occurs an HTTP 500 response is returned.

Example JSON response:

[
    {
       date: "02/01/2014"
       time: "08:32:57"
       channel: "SIP/2001-00000000"
       dstchannel: "SIP/303-0000000b"
       uniqueid: "1388647977.5182"
       duration: 29
       billsec: 21
       disposition: "ANSWERED"
       dcontext: "ext-local"
       recordingfile: ""
       src: "0721123432"
       dst: "vms201"
       clid: ""CHIU: USER" <1233312>"
    }
]

histcallswitch/interval/:from/:to/:filter

Returns the switchboard history call between "from" date to "to" date of all endpoints filtering by "filter". Date must be expressed in YYYYMMDD format. If an error occurs an HTTP 500 response is returned.

Example JSON response:

[
    {
       date: "02/01/2014"
       time: "08:32:57"
       channel: "SIP/2001-00000000"
       dstchannel: "SIP/303-0000000b"
       uniqueid: "1388647977.5182"
       duration: 29
       billsec: 21
       disposition: "ANSWERED"
       dcontext: "ext-local"
       recordingfile: ""
       src: "0721123432"
       dst: "vms201"
       clid: ""CHIU: USER" <1233312>"
    }
]

Methods

day

(
  • req
  • res
  • next
)

Search the switchboard history call for the specified day and optional filter by the following REST api:

day/:day
day/:day/:filter

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

    It uses interval function.

interval

(
  • req
  • res
  • next
)

Search the history call of all endpoints for the specified interval and optional filter by the following REST api:

interval/:from/:to
interval/:from/:to/:filter

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

setCompAuthorization

(
  • ca
)

Set authorization architect component used by history functions.

Parameters:

  • ca Object

    The authorization architect component.

setCompHistory

(
  • ch
)

Set history architect component used by history functions.

Parameters:

  • ch Object

    The history architect component.

setCompUtil

(
  • comp
)

Sets the utility architect component.

Parameters:

  • comp Object

    The utility 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.

setPrivacy

(
  • str
)

Sets the string to be used to hide last digits of phone numbers in privacy mode.

Parameters:

  • str Object

    The string used to hide last digits of phone numbers.

Properties

compAuthorization

Object private

The architect component to be used for authorization.

compHistory

Object private

The history architect component used for history functions.

compUtil

Object private

The utility architect component.

get

Array

REST API to be requested using HTTP GET request.

Sub-properties:

  • day/:day String

    To get the history call of the day. The date must be expressed in YYYYMMDD format

  • day/:day/:filter String

    To get the history call of the day filtering by filter. The date must be expressed in YYYYMMDD format

  • interval/:from/:to String

    To get the history call between "from" date to "to" date. The date must be expressed in YYYYMMDD format

  • interval/:from/:to/:filter String

    To get the history call between "from" date to "to" date filtering by filter. The date must be expressed in YYYYMMDD format

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/histcallswitch]

logger

Object private

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

Default: console

privacyStrReplace

String private

The string used to hide phone numbers in privacy mode.

Default: "xxx"