终端管理(Endpoint Manager)
Endpoint Manager 提供 IP 电话零 touch 自动配置(Zero-Touch Provisioning)。
1. 启用
[proxy]
addons = ["endpoint-manager"]
数据库要求:自动创建 endpoint_devices 表。支持 SQLite / MySQL / PostgreSQL。
2. 支持的品牌
| 品牌 | 配置格式 | 型号示例 |
|---|---|---|
| Yealink | 纯文本 | T42S, T46S, T54S, VP530 |
| Fanvil | XML | X3S, X4S, X5S, X6S |
3. 设备管理
3.1 添加设备
控制台 → Endpoint Manager → 添加设备:
| 字段 | 说明 | 示例 |
|---|---|---|
| MAC 地址 | 话机 MAC | 80:5E:C0:12:34:56 |
| 品牌/型号 | 话机型号 | Yealink T46S |
| 标签 | 显示名称 | 张三分机 1001 |
| 用户名 | SIP 注册用户名 | 1001 |
| 密码 | SIP 注册密码 | ******** |
| 服务器地址 | SIP 服务器 | 203.0.113.10:5060 |
3.2 自动配置流程
话机上电
│
▼
DHCP 获取 IP + Option 66/160 (Provision URL)
│
▼
话机请求配置
GET /provision/{mac}
│
▼
Endpoint Manager 查找设备
│
├── 找到 → 生成对应品牌/型号的配置文件 → 返回
└── 未找到 → 返回 404
3.3 DHCP 配置
在 DHCP 服务器中配置:
# ISC DHCP
option option-66 "http://203.0.113.10:8080/provision";
# 或 Option 160 (部分品牌)
option option-160 "http://203.0.113.10:8080/provision";
3.4 配置生成
Endpoint Manager 根据品牌自动生成配置:
Yealink 示例:
#!version:1.0.0.1
account.1.enable = 1
account.1.label = 1001
account.1.display_name = 1001
account.1.auth_name = 1001
account.1.user_name = 1001
account.1.password = ********
account.1.sip_server_host = 203.0.113.10
account.1.sip_server_port = 5060
Fanvil 示例:
<config>
<sip_account>
<enable>1</enable>
<display_name>1001</display_name>
<auth_name>1001</auth_name>
<user_name>1001</user_name>
<password>********</password>
<sip_server>203.0.113.10</sip_server>
<sip_port>5060</sip_port>
</sip_account>
</config>
4. 远程重启
通过 SIP NOTIFY 触发话机重启:
POST /console/endpoint-manager/devices/{mac}/reboot
5. 配置
config/endpoint_manager.toml:
provision_url_base = "http://203.0.113.10:8080/provision"
6. API
| 操作 | 端点 |
|---|---|
| 设备列表 | GET /console/endpoint-manager/devices |
| 添加设备 | POST /console/endpoint-manager/devices |
| 编辑设备 | POST /console/endpoint-manager/devices/{mac}/edit |
| 删除设备 | POST /console/endpoint-manager/devices/{mac}/delete |
| 重启设备 | POST /console/endpoint-manager/devices/{mac}/reboot |
| 自动配置 | GET /provision/{mac} |
| 设置 | GET /console/endpoint-manager/settings |