@softtynet/zca-js 2.2.4 → 2.2.6

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.
@@ -1,6 +1,6 @@
1
1
  export declare enum CallType {
2
2
  Audio = 1,
3
- Video = 2
3
+ Video = 3
4
4
  }
5
5
  export type SendVoiceCallOptions = {
6
6
  callType?: CallType;
@@ -3,7 +3,7 @@ import { apiFactory, resolveResponse } from "../utils.js";
3
3
  export var CallType;
4
4
  (function (CallType) {
5
5
  CallType[CallType["Audio"] = 1] = "Audio";
6
- CallType[CallType["Video"] = 2] = "Video";
6
+ CallType[CallType["Video"] = 3] = "Video";
7
7
  })(CallType || (CallType = {}));
8
8
  function parseServerEndpoint(addr) {
9
9
  if (!addr)
@@ -65,7 +65,14 @@ export const sendVoiceCallFactory = apiFactory()((api, ctx, utils) => {
65
65
  const sessId = (_p = serverInfo === null || serverInfo === void 0 ? void 0 : serverInfo.sessId) !== null && _p !== void 0 ? _p : `${normalizedCalleeId}_${callId}_401`;
66
66
  const resolvedCodec = (_q = serverInfo === null || serverInfo === void 0 ? void 0 : serverInfo.codec) !== null && _q !== void 0 ? _q : codec;
67
67
  // Step 2: Send ringing signaling request (/api/voicecall/request, command 11301)
68
+ const isVideo = callType === CallType.Video;
68
69
  const extendData = JSON.stringify({
70
+ callType: isVideo ? 1 : 0,
71
+ video: {
72
+ codec: isVideo ? [{ name: "h264", payload: 97 }] : [],
73
+ },
74
+ newZrtc: 1,
75
+ platform: 5,
69
76
  rtcpDiff: 0,
70
77
  rtcp: [{ ip: rtcp.ip, port: rtcp.port }],
71
78
  rtp: [{ ip: rtp.ip, port: rtp.port }],
@@ -6,7 +6,7 @@ var utils = require('../utils.cjs');
6
6
  exports.CallType = void 0;
7
7
  (function (CallType) {
8
8
  CallType[CallType["Audio"] = 1] = "Audio";
9
- CallType[CallType["Video"] = 2] = "Video";
9
+ CallType[CallType["Video"] = 3] = "Video";
10
10
  })(exports.CallType || (exports.CallType = {}));
11
11
  function parseServerEndpoint(addr) {
12
12
  if (!addr)
@@ -68,7 +68,14 @@ const sendVoiceCallFactory = utils.apiFactory()((api, ctx, utils$1) => {
68
68
  const sessId = (_p = serverInfo === null || serverInfo === void 0 ? void 0 : serverInfo.sessId) !== null && _p !== void 0 ? _p : `${normalizedCalleeId}_${callId}_401`;
69
69
  const resolvedCodec = (_q = serverInfo === null || serverInfo === void 0 ? void 0 : serverInfo.codec) !== null && _q !== void 0 ? _q : codec;
70
70
  // Step 2: Send ringing signaling request (/api/voicecall/request, command 11301)
71
+ const isVideo = callType === exports.CallType.Video;
71
72
  const extendData = JSON.stringify({
73
+ callType: isVideo ? 1 : 0,
74
+ video: {
75
+ codec: isVideo ? [{ name: "h264", payload: 97 }] : [],
76
+ },
77
+ newZrtc: 1,
78
+ platform: 5,
72
79
  rtcpDiff: 0,
73
80
  rtcp: [{ ip: rtcp.ip, port: rtcp.port }],
74
81
  rtp: [{ ip: rtp.ip, port: rtp.port }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softtynet/zca-js",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "Unofficial Zalo API for JavaScript",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",