@16x/webphone-sdk 3.1.4 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.1.5 - 2026-09-23
4
+
5
+ - 新增 `dial({ destination, userdata })`:自定义参数原样写进 INVITE 的 `X-User-Data` 头,由平台/服务端从 SIP
6
+ 报文里读 —— 就是旧版脚本 SDK 的 `userdata`,头名与含义都没变,平台侧不用改。未传、空串、纯空白=不带头
7
+ (与旧行为逐字一致);`dial({ destination, userdata: '' })` 也不会多出任何头。
8
+ - 只接受可见 ASCII:换行/制表能伪造出新的 SIP 头,中文等非 ASCII 不合规(中间设备可能吞掉或改写),
9
+ 两者都抛 `CALL_INVALID_USERDATA`(`category: 'call'`、`retryable: false`,处置建议放在 `cause` 里)。
10
+ 要传中文或 JSON 请调用方先 `encodeURIComponent` / base64,再在平台侧解回来。
11
+ - 校验在建通话之前完成:非法值不占并发额度、也不留 pending —— 否则同号紧接着再拨会撞 `CALL_ALREADY_EXISTS`。
12
+ - 注意:SDK 不暴露 SIP 头,页面侧读不到这个值(`call.incoming` 只给 `callId` / `from`);它是对平台/服务端说的,
13
+ 页面上要排障只能像演示页那样打开 JsSIP 的 debug 抓 console 原文。
14
+
15
+
3
16
  ## 3.1.4 - 2026-09-22
4
17
 
5
18
  - **移动端形态(`platform: 'mobile-web'`)可以接来电了**:能不能接听改由会话策略 `policy.mobileIncomingEnabled` 决定