Phone API Reference - Extended Classes - Auth
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.  | None | auth.showLoginScreen  var authObj = require('auth').Auth;
 Â
var auth = new authObj();
if (!auth.isLoggedIn()) {
    return auth.showLoginScreen({
        'callback' : callbackFunction,
    });
} |
Â