如何使用HTTP API配置设备参数?

    介绍

    概述

    本指南说明如何通过 HTTP API 配置设备参数,包括 SIP 服务器设置、SIP 账号注册信息、DSS 键参数以及其他设备选项。设备作为 HTTP 服务器,客户端发送特定的 HTTP 请求来应用配置更改,如下图所示。

HTTP API 连接架构

    在本示例中,使用 Postman 来模拟发送到设备的 HTTP 请求。

    适用型号

    我们产品线中所有当前可用的电话型号。

    前提条件

    ① 一台 BHP-SOS11V 门口机设备,已升级到最新的固件版本并连接到 PoE 交换机。
② 一台安装了 Postman 的配置用 PC,连接到同一台交换机,并确认网络通信正常。

    电话与 PC 连接示意图

电话与 PC 连接示意图

    使用 Postman 模拟 HTTP 请求

    下载并安装 Postman

    从以下地址下载 Postman:
https://www.postman.com/downloads/
然后按照安装说明完成设置。

    配置 Postman

    点击 FileNew,然后选择 HTTP Request

配置 Postman

    在新请求窗口中,选择 POST 方法,并按以下格式输入设备 HTTP URL:

http://ip/xmlservice

    请注意 URL 区分大小写。将 ip 替换为实际的设备 IP 地址,如下所示。

配置 HTTP POST URL

    然后配置所需的 HTTP 请求参数:

    认证方式:Basic Auth
请求头:Content-Type: xml/text

配置 HTTP 认证和请求头

    配置 HTTP 请求体

    点击 Body,选择 raw,然后在消息体中输入 XML 内容。下面是一个示例格式。

输入 XML 主体内容

    结构如下:


这是 XML 声明头,每个请求中都需要包含。



这定义了 XML 命令结构。cmd 属性可以是 get(获取当前参数)或 set(写入新参数)。

sip.
这指定了实际的配置项。在本示例中,请求从设备获取 SIP 线路相关参数。

    在实际使用中,必须根据实际要查询或配置的参数来调整以下部分:


sip.

    如何获取支持的参数列表

    不同型号可能支持不同的 HTTP API 参数。您可以使用以下任一方法获取特定设备支持的参数列表。

方法 1: 在设备 WEB 界面中,进入 SystemSystem Configuration,然后导出 nc 类型的配置文件。

从系统配置页面导出 nc 配置文件

    您可以右键保存文件,或左键直接查看配置。常见参数将在下一节中列出。

方法 2: 有些型号的网页界面中没有直接提供 nc 配置文件链接。在这种情况下,您可以在浏览器地址栏中输入相应的 URL 来手动获取 nc 配置文件。

从浏览器获取 nc 配置文件

    注意:此方法可能需要更长的响应时间。

    常见参数

    本节列出几个常见参数供参考。未来更新中可能会增加更多参数。

    SIP 线路参数

    SIP 线路参数示例(来自 i30 门禁设备):

sip.line.1.PhoneNumber = 112
sip.line.1.DisplayName = 112
sip.line.1.SipName =
sip.line.1.RegAddr = 172.18.1.45
sip.line.1.RegPort = 2066
sip.line.1.RegUser = 112
sip.line.1.RegPswd = abc123
sip.line.1.RegTTL = 3600
sip.line.1.RegEnabled = 0

sip.line.1. 表示这些参数属于 SIP 线路 1。

PhoneNumber 对应网页界面中的电话号码字段。
DisplayName 对应显示名称。
RegAddr 是 SIP 代理服务器地址。
RegPort 是 SIP 代理服务器端口。
RegUser 是认证用户名,通常与电话号码相同。
RegPswd 是密码。
RegTTL 是注册过期时间,默认值为 3600 秒。
RegEnabled 定义线路是否启用:0 表示禁用,1 表示启用。

    DSS 键参数

    i30 的 DSS 键参数示例:

dss.page.1.key.1.Type=1
dss.page.1.key.1.Value=125@1/f
dss.page.1.key.1.Title=

    建议先在网页界面中配置 DSS 键,然后使用带 get 命令的 HTTP API 读回相应的参数值,以确认确切的映射关系。

Type=1 表示对于 i30 或 i12 等设备,DSS 键类型为 Hotkey。对于其他型号,请使用上述推荐方法验证实际的类型值。

Value=125@1/f 的含义是:
125 = 目标号码
@1 = 线路 1
/f = 子类型:快速拨号

    网络参数

    i30 和 i12 等设备的网络参数示例:

net.WANMode=DHCP
net.static.IP=172.18.8.7
net.static.SubnetMask=255.255.255.0
net.static.Gateway=172.18.8.1
net.static.PrimaryDNS=202.96.134.133
net.static.SecondaryDNS=202.96.128.86
net.static.DomainName=
net.dhcp.Enabled=1

WANMode 指示网络模式,可以是 DHCPstatic。此参数不能直接使用 set 命令写入。它会根据 dhcp.Enabled 的值自动更改。

static.IP 是静态 IP 地址。仅在设备处于静态模式时有效。在 DHCP 模式下,仍可使用 get 命令获取当前 IP 地址。
static.SubnetMask 是子网掩码。
static.Gateway 是默认网关。
static.PrimaryDNS 是主 DNS 服务器。
static.SecondaryDNS 是备 DNS 服务器。
dhcp.Enabled 定义是否启用 DHCP:1 表示 DHCP 模式生效,0 表示使用静态 IP 模式。

    音量参数

    BHP-SOS11V 的音量参数示例:

phone.volume.HandFreeVol=9
phone.volume.HandFreeRingVol=3
phone.volume.HandFreeToneVol=3

phone.volume.HandFreeVol 是免提通话音量。范围是 1-99 为最高音量。
phone.volume.HandFreeRingVol 是来电铃声音量。范围是 1-99 为最高音量。
phone.volume.HandFreeToneVol 是提示音(如警报和通知音)的音量。范围是 1-99 为最高音量。

    系统信息参数

    系统信息参数是只读的,这意味着只能使用 get 命令查询。

    示例:

info.

    此参数返回所有系统信息。如果只需要特定项目,请将参数路径扩展到下一个节点层级。

    例如,获取设备 MAC 地址:

info.dev.mac

目录
客服 电话
We use cookie to improve your online experience. By continuing to browse this website, you agree to our use of cookie.

Cookies

This Cookie Policy explains how we use cookies and similar technologies when you access or use our website and related services. Please read this Policy together with our Terms and Conditions and Privacy Policy so that you understand how we collect, use, and protect information.

By continuing to access or use our Services, you acknowledge that cookies and similar technologies may be used as described in this Policy, subject to applicable law and your available choices.

Updates to This Cookie Policy

We may revise this Cookie Policy from time to time to reflect changes in legal requirements, technology, or our business practices. When we make updates, the revised version will be posted on this page and will become effective from the date of publication unless otherwise required by law.

Where required, we will provide additional notice or request your consent before applying material changes that affect your rights or choices.

What Are Cookies?

Cookies are small text files placed on your device when you visit a website or interact with certain online content. They help websites recognize your browser or device, remember your preferences, support essential functionality, and improve the overall user experience.

In this Cookie Policy, the term “cookies” also includes similar technologies such as pixels, tags, web beacons, and other tracking tools that perform comparable functions.

Why We Use Cookies

We use cookies to help our website function properly, remember user preferences, enhance website performance, understand how visitors interact with our pages, and support security, analytics, and marketing activities where permitted by law.

We use cookies to keep our website functional, secure, efficient, and more relevant to your browsing experience.

Categories of Cookies We Use

Strictly Necessary Cookies

These cookies are essential for the operation of the website and cannot be disabled in our systems where they are required to provide the service you request. They are typically set in response to actions such as setting privacy preferences, signing in, or submitting forms.

Without these cookies, certain parts of the website may not function correctly.

Functional Cookies

Functional cookies enable enhanced features and personalization, such as remembering your preferences, language settings, or previously selected options. These cookies may be set by us or by third-party providers whose services are integrated into our website.

If you disable these cookies, some services or features may not work as intended.

Performance and Analytics Cookies

These cookies help us understand how visitors use our website by collecting information such as traffic sources, page visits, navigation behavior, and general interaction patterns. In many cases, this information is aggregated and does not directly identify individual users.

We use this information to improve website performance, usability, and content relevance.

Targeting and Advertising Cookies

These cookies may be placed by our advertising or marketing partners to help deliver more relevant ads and measure the effectiveness of campaigns. They may use information about your browsing activity across different websites and services to build a profile of your interests.

These cookies generally do not store directly identifying personal information, but they may identify your browser or device.

First-Party and Third-Party Cookies

Some cookies are set directly by our website and are referred to as first-party cookies. Other cookies are set by third-party services, such as analytics providers, embedded content providers, or advertising partners, and are referred to as third-party cookies.

Third-party providers may use their own cookies in accordance with their own privacy and cookie policies.

Information Collected Through Cookies

Depending on the type of cookie used, the information collected may include browser type, device type, IP address, referring website, pages viewed, time spent on pages, clickstream behavior, and general usage patterns.

This information helps us maintain the website, improve performance, enhance security, and provide a better user experience.

Your Cookie Choices

You can control or disable cookies through your browser settings and, where available, through our cookie consent or preference management tools. Depending on your location, you may also have the right to accept or reject certain categories of cookies, especially those used for analytics, personalization, or advertising purposes.

Please note that blocking or deleting certain cookies may affect the availability, functionality, or performance of some parts of the website.

Restricting cookies may limit certain features and reduce the quality of your experience on the website.

Cookies in Mobile Applications

Where our mobile applications use cookie-like technologies, they are generally limited to those required for core functionality, security, and service delivery. Disabling these essential technologies may affect the normal operation of the application.

We do not use essential mobile application cookies to store unnecessary personal information.

How to Manage Cookies

Most web browsers allow you to manage cookies through browser settings. You can usually choose to block, delete, or receive alerts before cookies are stored. Because browser controls vary, please refer to your browser provider’s support documentation for details on how to manage cookie settings.

Contact Us

If you have any questions about this Cookie Policy or our use of cookies and similar technologies, please contact us at support@becke.cc .