API Docs for:
Show:

EndpointExtension Class

Module: user

Abstraction of an extension endpoint.

It can throw exceptions.

Constructor

EndpointExtension

(
  • identifier
  • data
)
Object

Parameters:

  • identifier String

    The extension identifier

  • data Object
    • type String

      The type of the extension ("physical" | "webrtc" | "webrtc_mobile")

    • [web_user] String optional

      The username of the physical phone to be used to invoke HTTP apis

    • [web_password] String optional

      The password of the physical phone to be used to invoke HTTP apis

    • [username] String optional

      The username of the sip extension. It is present with webrtc type

    • [password] String optional

      The password of the sip extension. It is present with webrtc type

Returns:

Object:

The extension endpoint object.

Methods

getId

() String

Return the extension identifier.

Returns:

String:

The extension identifier

getSipPassword

() String

Return the sip phone password.

Returns:

String:

The sip phone password.

getSipUser

() String

Return the sip phone username.

Returns:

String:

The sip phone username.

getWebApiPassword

() String

Return the phone password to be used to invoke HTTP apis.

Returns:

String:

The phone password to be used to invoke HTTP apis.

getWebApiUser

() String

Return the phone username to be used to invoke HTTP apis.

Returns:

String:

The phone username to be used to invoke HTTP apis.

isWebrtc

() String

Check if the extension is of webrtc or webrtc_mobile type.

Returns:

String:

True if the phone is of webrtc or webrtc_mobile type.

toJSON

() Object

Returns the JSON representation of the object. If the extension type is of WebRTC type, it returns also the sip extension secret.

{
    "id": "214",
    "type": "physical"
}

{
    "id": "214",
    "type": "webrtc",
    "secret": "sip password",
    "username": "sip username"
}

{
    "id": "214",
    "type": "webrtc_mobile",
    "secret": "sip password",
    "username": "sip username"
}

Returns:

Object:

The JSON representation of the object.

toString

() String

Return the readable string of the extension endpoint.

Returns:

String:

The readable description of the extension endpoint.

Properties

id

String private

The extension identifier.

sipPassword

String private

The password of the sip phone used to register extension into asterisk. Usually used by clients to register WebRTC phone.

sipUser

String private

The username of the sip phone used to register extension into asterisk. Usually used by clients to register WebRTC phone.

type

String private

The extension type.

webApiPassword

String private

The password of the physical phone to be used to invoke HTTP apis.

webApiUser

String private

The username of the physical phone to be used to invoke HTTP apis.