API Docs for: 2.6
Show:

controller_streaming Class

Module: streaming

Provides the streaming functionalities.

Methods

config

(
  • path
)

It reads the configuration file and creates new Streaming objects. The file must use the JSON syntax.

The method can throw an Exception.

Parameters:

  • path String

    The path of the configuration file

getAllSourcesJSON

() Object

Returns all the streaming sources in JSON format or an empty object in case of error.

Returns:

Object:

All the streaming sources in JSON format.

getSourceJSONByExten

(
  • extenId
)
Object

Returns the streaming source in JSON format or an empty object in error case.

Parameters:

  • extenId String

    The extension endpoint identifier

Returns:

Object:

The streaming source in JSON format.

isExtenStreamingSource

(
  • extenId
)
Boolean

Check if the endpoint extension is a streaming source.

Parameters:

  • extenId String

    The extension endpoint identifier

Returns:

Boolean:

True if the extension endpoint is a steraming source.

open

(
  • streamId
  • callerid
  • fromExten
  • cb
)

Executes the command associated with the streaming source to open the associated device, e.g. a door.

Parameters:

  • streamId String

    The streaming source identifier

  • callerid String

    The caller identifier

  • fromExten String

    The extension identifier from which the command has to be sent

  • cb Function

    The callback function

setCompAstProxy

(
  • ap
)

Sets the asterisk proxy component used for asterisk functions.

Parameters:

  • ap Object

    The asterisk proxy 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

compAstProxy

Object private

The asterisk proxy component used for asterisk functions.

IDLOG

String private final

The module identifier used by the logger.

Default: [controller_streaming]

logger

Object private

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

Default: console

streamings

Object private

The streaming objects. The keys are the streaming identifiers and the values are the Streaming objects. It is initialiazed by the config function.

Default: {}