@webex/calling 3.12.0-next.109 → 3.12.0-next.110

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.
Files changed (56) hide show
  1. package/dist/CallingClient/CallingClient.js +2 -2
  2. package/dist/CallingClient/CallingClient.js.map +1 -1
  3. package/dist/CallingClient/calling/call.js +13 -6
  4. package/dist/CallingClient/calling/call.js.map +1 -1
  5. package/dist/CallingClient/calling/call.test.js +573 -533
  6. package/dist/CallingClient/calling/call.test.js.map +1 -1
  7. package/dist/CallingClient/constants.js +3 -2
  8. package/dist/CallingClient/constants.js.map +1 -1
  9. package/dist/CallingClient/line/index.js +19 -2
  10. package/dist/CallingClient/line/index.js.map +1 -1
  11. package/dist/CallingClient/line/line.test.js +40 -7
  12. package/dist/CallingClient/line/line.test.js.map +1 -1
  13. package/dist/CallingClient/registration/register.js +4 -2
  14. package/dist/CallingClient/registration/register.js.map +1 -1
  15. package/dist/CallingClient/registration/register.test.js +10 -2
  16. package/dist/CallingClient/registration/register.test.js.map +1 -1
  17. package/dist/CallingClient/types.js.map +1 -1
  18. package/dist/common/Utils.js +0 -56
  19. package/dist/common/Utils.js.map +1 -1
  20. package/dist/common/Utils.test.js +0 -48
  21. package/dist/common/Utils.test.js.map +1 -1
  22. package/dist/common/callUtils.js +187 -0
  23. package/dist/common/callUtils.js.map +1 -0
  24. package/dist/common/callUtils.test.js +313 -0
  25. package/dist/common/callUtils.test.js.map +1 -0
  26. package/dist/common/constants.js +18 -1
  27. package/dist/common/constants.js.map +1 -1
  28. package/dist/common/index.js +11 -0
  29. package/dist/common/index.js.map +1 -1
  30. package/dist/module/CallingClient/CallingClient.js +1 -1
  31. package/dist/module/CallingClient/calling/call.js +6 -1
  32. package/dist/module/CallingClient/constants.js +1 -0
  33. package/dist/module/CallingClient/line/index.js +7 -1
  34. package/dist/module/CallingClient/registration/register.js +4 -2
  35. package/dist/module/common/Utils.js +0 -37
  36. package/dist/module/common/callUtils.js +90 -0
  37. package/dist/module/common/constants.js +5 -0
  38. package/dist/module/common/index.js +1 -0
  39. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  40. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  41. package/dist/types/CallingClient/constants.d.ts +1 -0
  42. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  43. package/dist/types/CallingClient/line/index.d.ts +2 -1
  44. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  45. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  46. package/dist/types/CallingClient/types.d.ts +2 -0
  47. package/dist/types/CallingClient/types.d.ts.map +1 -1
  48. package/dist/types/common/Utils.d.ts +0 -1
  49. package/dist/types/common/Utils.d.ts.map +1 -1
  50. package/dist/types/common/callUtils.d.ts +6 -0
  51. package/dist/types/common/callUtils.d.ts.map +1 -0
  52. package/dist/types/common/constants.d.ts +5 -0
  53. package/dist/types/common/constants.d.ts.map +1 -1
  54. package/dist/types/common/index.d.ts +1 -0
  55. package/dist/types/common/index.d.ts.map +1 -1
  56. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require"],"sources":["types.ts"],"sourcesContent":["import * as Media from '@webex/internal-media-core';\nimport {LOGGER} from '../Logger/types';\nimport {ISDKConnector} from '../SDKConnector/types';\nimport {Eventing} from '../Events/impl';\nimport {CallingClientEventTypes} from '../Events/types';\nimport {DeviceType, ServiceData} from '../common/types';\nimport {ICall, IceGatheringConfig} from './calling/types';\nimport {CallingClientError} from '../Errors';\nimport {ILine} from './line/types';\n\nexport interface LoggerConfig {\n level: LOGGER;\n}\n\ninterface DiscoveryConfig {\n country: string;\n region: string;\n}\n\nexport {IceGatheringConfig};\n\nexport interface CallingClientConfig {\n logger?: LoggerConfig;\n discovery?: DiscoveryConfig;\n serviceData?: ServiceData;\n jwe?: string;\n\n /**\n * Optional configuration to tune ICE candidate gathering during media negotiation.\n */\n iceGathering?: IceGatheringConfig;\n}\n\nexport type CallingClientErrorEmitterCallback = (\n err: CallingClientError,\n finalError?: boolean\n) => void;\n\n/**\n * An interface for the `CallingClient` module.\n * The `CallingClient` module is designed to provide a set of APIs related to line registration and calling functionalities within the SDK.\n *\n * @example\n * ```javascript\n * const callingClient = createClient(webex, callingConfig);\n * ```\n */\nexport interface ICallingClient extends Eventing<CallingClientEventTypes> {\n /**\n * Represents the `mediaEngine for managing media-related operations within the CallingClient.\n * The media engine provides access to audio and video devices such as cameras, microphones, and speakers within the media layer.\n *\n * @public\n * @example\n * ```\n * const microphones = await callingClient.mediaEngine.Media.getMicrophones();\n * const speakers = await callingClient.mediaEngine.Media.getSpeakers();\n * const cameras = await callingClient.mediaEngine.Media.getCameras();\n * ```\n */\n mediaEngine: typeof Media;\n\n /**\n * @ignore\n */\n getSDKConnector(): ISDKConnector;\n\n /**\n * @ignore\n */\n getLoggingLevel(): LOGGER;\n\n /**\n * Retrieves details of the line object(s) belonging to a user.\n *\n * This method gathers all the {@link ILine} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ILine} objects registered with\n * the `callingClient`\n *\n * @example\n * ```typescript\n * const lines = callingClient.getLines();\n * ```\n * The `lines` response object will have `lineId` as its key and\n * a list {@link ILine} objects as it's value.\n * ```\n * {\n * 'lineId1': lineObj1,\n * 'lineId2': lineObj2,\n * }\n * ```\n */\n getLines(): Record<string, ILine>;\n\n /**\n * Retrieves the list of devices registered for the given userId from Mobius.\n * @param userId - The user identifier whose devices should be fetched.\n * @returns List of devices associated with the user.\n */\n getDevices(userId?: string): Promise<DeviceType[]>;\n\n /**\n * Retrieves a dictionary of active calls grouped by `lineId`.\n *\n * This method gathers active {@link ICall} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ICall} objects of active calls associated\n * with each line.\n *\n * @example\n * ```typescript\n * const activeCalls = callingClient.getActiveCalls();\n * ```\n * The `activeCalls` response object will have `lineId` as its key and\n * a list {@link ICall} objects as it's value.\n *\n * ```\n * {\n * 'line1': [call1, call2],\n * 'line2': [call3],\n * }\n * ```\n */\n getActiveCalls(): Record<string, ICall[]>;\n\n /**\n * Retrieves the {@link ICall} object for the currently connected call in the client.\n *\n * This method iterates through active call objects and returns the call\n * that is currently connected (not on hold).\n *\n * @example\n * ```typescript\n * const connectedCall : ICall = callingClient.getConnectedCall();\n * ```\n * The `connectedCall` object will be the Call object of the connected call with the client\n */\n getConnectedCall(): ICall | undefined;\n\n /**\n * Indicates whether the Mobius WebSocket transport is currently connected.\n *\n * The `callingClient:mobius_socket_connected` event is emitted during client\n * initialization, so consumers that subscribe afterwards may miss it. This method\n * lets them reconcile the current connection state right after subscribing. Returns\n * `false` when the WebSocket transport is not in use.\n *\n * @example\n * ```typescript\n * callingClient.on(CALLING_CLIENT_EVENT_KEYS.MOBIUS_SOCKET_CONNECTED, onConnected);\n * if (callingClient.isMobiusSocketConnected()) {\n * onConnected();\n * }\n * ```\n */\n isMobiusSocketConnected(): boolean;\n}\n"],"mappings":";;;;;;;;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_types","require"],"sources":["types.ts"],"sourcesContent":["import * as Media from '@webex/internal-media-core';\nimport {LocalMicrophoneStream} from '@webex/internal-media-core';\nimport {LOGGER} from '../Logger/types';\nimport {ISDKConnector} from '../SDKConnector/types';\nimport {Eventing} from '../Events/impl';\nimport {CallingClientEventTypes} from '../Events/types';\nimport {DeviceType, ServiceData} from '../common/types';\nimport {ICall, IceGatheringConfig} from './calling/types';\nimport {CallingClientError} from '../Errors';\nimport {ILine} from './line/types';\n\nexport interface LoggerConfig {\n level: LOGGER;\n}\n\ninterface DiscoveryConfig {\n country: string;\n region: string;\n}\n\nexport {IceGatheringConfig};\n\nexport interface CallingClientConfig {\n logger?: LoggerConfig;\n discovery?: DiscoveryConfig;\n serviceData?: ServiceData;\n jwe?: string;\n\n /**\n * Optional configuration to tune ICE candidate gathering during media negotiation.\n */\n iceGathering?: IceGatheringConfig;\n\n /**\n * Microphone stream to discover the host ip addresses of this client with during\n * initialization, which are then reported to Mobius on registration. Leave it out to skip that\n * discovery: without a stream the browser withholds the addresses, so there is nothing to\n * report.\n */\n localAudioStream?: LocalMicrophoneStream;\n}\n\nexport type CallingClientErrorEmitterCallback = (\n err: CallingClientError,\n finalError?: boolean\n) => void;\n\n/**\n * An interface for the `CallingClient` module.\n * The `CallingClient` module is designed to provide a set of APIs related to line registration and calling functionalities within the SDK.\n *\n * @example\n * ```javascript\n * const callingClient = createClient(webex, callingConfig);\n * ```\n */\nexport interface ICallingClient extends Eventing<CallingClientEventTypes> {\n /**\n * Represents the `mediaEngine for managing media-related operations within the CallingClient.\n * The media engine provides access to audio and video devices such as cameras, microphones, and speakers within the media layer.\n *\n * @public\n * @example\n * ```\n * const microphones = await callingClient.mediaEngine.Media.getMicrophones();\n * const speakers = await callingClient.mediaEngine.Media.getSpeakers();\n * const cameras = await callingClient.mediaEngine.Media.getCameras();\n * ```\n */\n mediaEngine: typeof Media;\n\n /**\n * @ignore\n */\n getSDKConnector(): ISDKConnector;\n\n /**\n * @ignore\n */\n getLoggingLevel(): LOGGER;\n\n /**\n * Retrieves details of the line object(s) belonging to a user.\n *\n * This method gathers all the {@link ILine} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ILine} objects registered with\n * the `callingClient`\n *\n * @example\n * ```typescript\n * const lines = callingClient.getLines();\n * ```\n * The `lines` response object will have `lineId` as its key and\n * a list {@link ILine} objects as it's value.\n * ```\n * {\n * 'lineId1': lineObj1,\n * 'lineId2': lineObj2,\n * }\n * ```\n */\n getLines(): Record<string, ILine>;\n\n /**\n * Retrieves the list of devices registered for the given userId from Mobius.\n * @param userId - The user identifier whose devices should be fetched.\n * @returns List of devices associated with the user.\n */\n getDevices(userId?: string): Promise<DeviceType[]>;\n\n /**\n * Retrieves a dictionary of active calls grouped by `lineId`.\n *\n * This method gathers active {@link ICall} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ICall} objects of active calls associated\n * with each line.\n *\n * @example\n * ```typescript\n * const activeCalls = callingClient.getActiveCalls();\n * ```\n * The `activeCalls` response object will have `lineId` as its key and\n * a list {@link ICall} objects as it's value.\n *\n * ```\n * {\n * 'line1': [call1, call2],\n * 'line2': [call3],\n * }\n * ```\n */\n getActiveCalls(): Record<string, ICall[]>;\n\n /**\n * Retrieves the {@link ICall} object for the currently connected call in the client.\n *\n * This method iterates through active call objects and returns the call\n * that is currently connected (not on hold).\n *\n * @example\n * ```typescript\n * const connectedCall : ICall = callingClient.getConnectedCall();\n * ```\n * The `connectedCall` object will be the Call object of the connected call with the client\n */\n getConnectedCall(): ICall | undefined;\n\n /**\n * Indicates whether the Mobius WebSocket transport is currently connected.\n *\n * The `callingClient:mobius_socket_connected` event is emitted during client\n * initialization, so consumers that subscribe afterwards may miss it. This method\n * lets them reconcile the current connection state right after subscribing. Returns\n * `false` when the WebSocket transport is not in use.\n *\n * @example\n * ```typescript\n * callingClient.on(CALLING_CLIENT_EVENT_KEYS.MOBIUS_SOCKET_CONNECTED, onConnected);\n * if (callingClient.isMobiusSocketConnected()) {\n * onConnected();\n * }\n * ```\n */\n isMobiusSocketConnected(): boolean;\n}\n"],"mappings":";;;;;;;;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
@@ -28,7 +28,6 @@ exports.handleCallingClientErrors = handleCallingClientErrors;
28
28
  exports.handleRegistrationErrors = handleRegistrationErrors;
29
29
  exports.inferIdFromUuid = inferIdFromUuid;
30
30
  exports.isValidServiceDomain = isValidServiceDomain;
31
- exports.modifySdpForIPv4 = modifySdpForIPv4;
32
31
  exports.normalizeMobiusUris = normalizeMobiusUris;
33
32
  exports.parseMediaQualityStatistics = parseMediaQualityStatistics;
34
33
  exports.resolveCallerIdByName = resolveCallerIdByName;
@@ -46,7 +45,6 @@ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/objec
46
45
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
47
46
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
48
47
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
49
- var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-int"));
50
48
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
51
49
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
52
50
  var platform = _interopRequireWildcard(require("platform"));
@@ -1470,60 +1468,6 @@ function validateServiceData(serviceData) {
1470
1468
  }
1471
1469
  }
1472
1470
 
1473
- /**
1474
- * Modifies SDP to replace IPv6 "c=" lines with IPv4.And adds an IPv4 candidate if none exists.
1475
- *
1476
- * @param sdp - Session Description Protocol string.
1477
- * @returns Modified SDP string.
1478
- */
1479
- function modifySdpForIPv4(sdp) {
1480
- try {
1481
- // Normalize line endings to avoid issues
1482
- sdp = sdp.replace(/\r\n|\r/g, '\n');
1483
-
1484
- // Ensure consistent spacing without removing intentional indentation
1485
- sdp = sdp.replace(/^[ \t]+/gm, '');
1486
-
1487
- // Check if at least one IPv6 "c=" line is present
1488
- var ipv6CLineMatches = sdp.match(/c=IN IP6 [\da-f:.]+/gi) || [];
1489
- var hasIPv6CLine = ipv6CLineMatches.length > 0;
1490
- if (hasIPv6CLine) {
1491
- _Logger.default.info('Modifying SDP for IPv4 compatibility', {
1492
- file: _constants.UTILS_FILE,
1493
- method: 'modifySdpForIPv4'
1494
- });
1495
-
1496
- // Extract an existing IPv4 candidate's IP, if available
1497
- var ipv4CandidateMatch = sdp.match(/a=candidate:\d+ \d+ \w+ \d+ ([\d.]+) \d+ typ \w+/);
1498
- var ipv4Address = (ipv4CandidateMatch === null || ipv4CandidateMatch === void 0 ? void 0 : ipv4CandidateMatch[1]) || '192.1.1.1'; // Default fallback
1499
-
1500
- // Replace all IPv6 "c=" lines with IPv4 using the extracted IP (or default)
1501
- sdp = sdp.replace(/c=IN IP6 [\da-f:.]+/gi, "c=IN IP4 ".concat(ipv4Address));
1502
-
1503
- // Ensure newline separation between candidate lines
1504
- if (!ipv4CandidateMatch) {
1505
- var ipv4CandidateAdded = false;
1506
- sdp = sdp.replace(/(a=candidate:(\d+) (\d+) (\w+) (\d+) ([\da-f:.]+) (\d+) typ (\w+)[^\n]*)/g, function (match, full, foundation, componentId, transport, priority, connectionAddress, port, candidateType) {
1507
- if (!ipv4CandidateAdded && connectionAddress.includes(':')) {
1508
- // Ensure it's IPv6 and only add once
1509
- ipv4CandidateAdded = true;
1510
- var newFoundation = ((0, _parseInt2.default)(foundation, 10) + 1).toString();
1511
- return "".concat(full, "\n") + "a=candidate:".concat(newFoundation, " ").concat(componentId, " ").concat(transport, " ").concat(priority, " ").concat(ipv4Address, " ").concat(port, " typ ").concat(candidateType, " generation 0 network-id 1 network-cost 10");
1512
- }
1513
- return match;
1514
- });
1515
- }
1516
- }
1517
- return sdp;
1518
- } catch (error) {
1519
- _Logger.default.warn("Error modifying SDP for IPv4 compatibility: ".concat(error), {
1520
- file: _constants.UTILS_FILE,
1521
- method: 'modifySdpForIPv4'
1522
- });
1523
- return sdp; // Return original SDP in case of an error
1524
- }
1525
- }
1526
-
1527
1471
  /**
1528
1472
  * Uploads logs to backend.
1529
1473
  *