register (Registration)
Interface Description
This interface is invoked to register a SIP account.
Notes
- The WebSocket connection with the OpenEyeCall is set up.
- The registration parameters are set.
Method Definition
OpenEyeCall.prototype.register = function(sip_num, sip_name, sip_pwd, sip_mode, callbacks)
Parameter Description
Parameter |
Type |
Mandatory/Optional |
Description |
---|---|---|---|
sip_num |
String |
Mandatory |
Subscriber number. The value can contain a maximum of 255 characters. Example: 70942@example.com |
sip_name |
String |
Mandatory |
Username. The value can contain a maximum of 255 characters. |
sip_pwd |
String |
Mandatory |
Password. The value can contain a maximum of 255 characters in plaintext. |
sip_mode |
Int |
Mandatory |
Networking mode. The options are 4 (UAP networking) and 5 (UAP pool networking). |
callbacks |
Mandatory |
Callback method. |
Parameter |
Type |
Mandatory/Optional |
Description |
---|---|---|---|
response |
function |
Mandatory |
Callback method of the registration result. For details about the input parameters of the callback method, see Table 3. |
onRegStatusUpdate |
function |
Mandatory |
For details about the input parameters of the callback method, see Table 3onRegStatusUpdate (Reporting the Registration Status). |
onForceUnReg |
function |
Mandatory |
For details about the input parameters of the callback method, see Table 3. |
Parameter |
Type |
Description |
---|---|---|
description |
String |
Description of the current request. |
result |
Number |
Query result. The value 0 indicates success and other values indicate failure. |
rsp |
Number |
Internal message ID. |
If the callback interface is successfully invoked, the registration is not necessarily successful. You need to determine whether the registration is successful based on onRegStatusUpdate (Reporting the Registration Status).
The following is an example of input parameters of the callback method:
{ "description" : "tsdk_login", "result" : 0, "rsp" : 65537 }
Examples
function register() { global_openEye_SDK.openEyeCall.register("70942@example.com", "70942@example.com", "1qaz@WSX", 4, { onRegStatusUpdate: onRegStatusUpdate, onForceUnReg: onForceUnRegInfo, response: registerResponse }); } function onRegStatusUpdate(data){ console.info(data); } function onForceUnReg(data){ console.info(data); } function registerResponse(data) { if (data.result == 0) { console.info("Register Operation Success"); } else { console.error("Register Operation Failed"); } }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot