如何使用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 .