Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Desk Phone API features described in this section are deprecated and supported only on the following models: D40, d45, d50, d60, d62, d65, d70

Auth

Used primarily to interact with the PBX when the phone is used with a server running either Switchvox or the Desk Phone Module for Asterisk (DPMA). The auth object holds the user's account id, extension, password, and the address of the server.

Require Extended Library: 

var Auth = require('auth').Auth; //access the Auth property which is the Auth constructor.

Class Constructor

new Auth()

Create a new Auth Object.

var authObj = new Auth(parameters);

Initialization Parameters

Name

Required

Type

Default

Description

account_id

Yes

integer

Unique ID of the account.

username

Yes

Username that will be used when making requests with the auth object. For pbx requests, this is the account's extension.

password

Yes

string

Password to use with requests using the auth object. For requests made with the pbx library, this is the account's web password.

appserver

Yes

string

Address to which requests using the auth object will be directed. 

lang

Yes

object

Language object instance.

The functionality of this object is included in the  app extended library . It is recommended you use the app library if you wish to use this feature. 

Methods

Name 

Description 

Parameters

Examples

showLoginScreen

Displays a login screen on which a user can enter a server, extension, and password.
Calls back after the user successfully logs in from the login screen. Used with a Switchvox configuration server environment.

None

auth.showLoginScreen

var authObj = require('auth').Auth;
  
var auth = new authObj();
if (!auth.isLoggedIn()) {
    return auth.showLoginScreen({
        'callback' : callbackFunction,
    });
}

  • No labels