Updated on 2023-10-12 GMT+08:00

config (Configuration)

Interface Description

This interface is invoked to configure the OpenEyeCall running parameters.

Notes

The WebSocket connection with the OpenEyeCall is set up.

Method Definition

TUPCall.prototype.config = function(params, callbacks)

Parameter Description

Table 1 Parameter description

Parameter

Type

Mandatory/Optional

Description

params

Params

Mandatory

Configuration parameter.

callbacks

Callback

Optional

Callback method.

Table 2 Params

Parameter

Type

Mandatory/Optional

Description

log_path

String

Optional

Path for storing SIP message logs. Absolute path or relative path of the OpenEye installation directory.

For example, set this parameter to C:/log or ./log.

You can also use D:\\tup\\log.

If the path does not exist, the system automatically creates one.

If an absolute path is used, ensure that each client has a specified drive letter. Therefore, a relative path is recommended.

call

Call

Mandatory

Call service.

network

Network

Mandatory

Network.

media

Media

Mandatory

Media.

audio

Audio

Mandatory

Audio.

account

Account

Mandatory

Account password type.

Table 3 Call

Parameter

Type

Mandatory/Optional

Description

call_ipcall_enable

Number

Mandatory

Enable the IP address-based call function.

Set this parameter to 0.

Table 4 NetworkInfo

Parameter

Type

Mandatory/Optional

Description

serverAddr

String

Mandatory

SIP server IP address.

sipServerPort

Number

Mandatory

SIP server port number. The default UDP port number is 5060, and the default TLS port number is 5061.

sipTransportMode

Number

Mandatory

SIP signaling transmission mode. The value 0 indicates UDP, and the value 1 indicates TLS.

httpPort

Number

Mandatory

Generally, the value is 0.

Table 5 Sip

Parameter

Type

Mandatory/Optional

Description

user_type

Number

Mandatory

User terminal type.

Set this parameter to 0.

tls_anonymous_enable

Number

Mandatory

Whether to enable TLS anonymous authentication. Anonymous authentication has security risks. Exercise caution when enabling this function. This function is disabled by default. The options are 0 (no) and 1 (yes).

tls_rootcertpath

String

Optional

Full path of the root certificate. The root certificate must be configured when TLS is used for transmission.

For example, set this parameter to F:/test/cert/root_cert_huawei.pem.

trans_mode

Number

Mandatory

SIP transmission protocol.

  • 0: UDP (default value)
  • 1: TLS
  • 2: TCP
Table 6 Media

Parameter

Type

Mandatory/Optional

Description

trans_mode

Number

Mandatory

Media stream encryption mode.

Set this parameter to 1, indicating that RTP (no encryption) and SRTP (encryption) are supported.

Table 7 Audio

Parameter

Type

Mandatory/Optional

Description

audio_codec

String

Mandatory

Audio codec priority and supported audio codec modes, for example, 112,98,18,9,8,0.

  • 112: OPUS
  • 98: iLBC
  • 18: G729
  • 9: G722
  • 8: G711a
  • 0: G711u

dtmf_mode

Number

Optional

Dual-tone multi-frequency (DTMF) mode, that is, transmission mode of the key sound and data.

  • 0: in-band transparent transmission mode (default value)
  • 1: RFC2833 auto-negotiation
  • 2: forcible use of the RFC2833 protocol
  • 4: Info mode
  • 5: H245

audio_anr

Number

Optional

Noise suppression. The value ranges from 0 to 4. The value 0 indicates that noise suppression is disabled. A larger value indicates greater noise suppression strength. By default, this function is disabled.

audio_aec

Number

Optional

Echo cancellation. The value 0 indicates that echo cancellation is disabled, and the value 1 indicates that echo cancellation is enabled. The default value is 0. It is recommended that this function be enabled.

audio_agc

Number

Optional

Automatic gain. The value 0 indicates that automatic gain is disabled, and the value 1 indicates that automatic gain is enabled. By default, this function is disabled.

Table 8 Account

Parameter

Type

Mandatory/Optional

Description

account_pwd_type

Number

Mandatory

Account password type.

Set this parameter to 0.

Table 9 Callback

Parameter

Type

Mandatory/Optional

Description

callbacks

function

Optional

Callback method.

Table 10 Input parameters of the callback method

Parameter

Type

Description

description

String

Description of the current request.

local_ip

String

Local IP address.

The value is an IPv4 address, for example, 192.168.10.100.

result

Number

Query result. The value 0 indicates success and other values indicate failure.

rsp

Number

Internal message ID.

Examples

function sipBasicCfg() {
    global_cloudIPCC_SDK.tupCall.config({
        networkInfo: {
            serverAddr: "example.com",
            sipServerPort: 5060,
            sipTransportMode: "10.175.1.61",
            httpPort: 5060
        }
    },{response: configResponse});
}

function configResponse(data) {
    if (data.result == 0) {
        console.info("Config Success");
    } else {
        console.error("Config Failed");
        console.error(data);
    }
}