@webex/calling 3.7.0-next.8 → 3.7.0-wxcc.1

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 (111) hide show
  1. package/dist/CallHistory/CallHistory.js +67 -195
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +108 -331
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallHistory/callHistoryFixtures.js +1 -25
  6. package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
  7. package/dist/CallHistory/constants.js +1 -4
  8. package/dist/CallHistory/constants.js.map +1 -1
  9. package/dist/CallHistory/types.js.map +1 -1
  10. package/dist/CallingClient/CallingClient.js +2 -2
  11. package/dist/CallingClient/CallingClient.js.map +1 -1
  12. package/dist/CallingClient/CallingClient.test.js +2 -2
  13. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  14. package/dist/CallingClient/calling/CallerId/index.js +5 -14
  15. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  16. package/dist/CallingClient/calling/CallerId/index.test.js +6 -6
  17. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  18. package/dist/CallingClient/calling/call.js +348 -434
  19. package/dist/CallingClient/calling/call.js.map +1 -1
  20. package/dist/CallingClient/calling/call.test.js +386 -516
  21. package/dist/CallingClient/calling/call.test.js.map +1 -1
  22. package/dist/CallingClient/calling/callManager.js +6 -6
  23. package/dist/CallingClient/calling/callManager.js.map +1 -1
  24. package/dist/CallingClient/calling/callManager.test.js +3 -3
  25. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  26. package/dist/CallingClient/calling/types.js +1 -6
  27. package/dist/CallingClient/calling/types.js.map +1 -1
  28. package/dist/CallingClient/constants.js +3 -2
  29. package/dist/CallingClient/constants.js.map +1 -1
  30. package/dist/CallingClient/line/index.js +7 -14
  31. package/dist/CallingClient/line/index.js.map +1 -1
  32. package/dist/CallingClient/line/line.test.js +22 -84
  33. package/dist/CallingClient/line/line.test.js.map +1 -1
  34. package/dist/CallingClient/line/types.js.map +1 -1
  35. package/dist/CallingClient/registration/register.js +59 -79
  36. package/dist/CallingClient/registration/register.js.map +1 -1
  37. package/dist/CallingClient/registration/register.test.js +1 -1
  38. package/dist/CallingClient/registration/register.test.js.map +1 -1
  39. package/dist/CallingClient/types.js.map +1 -1
  40. package/dist/Contacts/ContactsClient.js +14 -14
  41. package/dist/Contacts/ContactsClient.js.map +1 -1
  42. package/dist/Events/types.js +0 -2
  43. package/dist/Events/types.js.map +1 -1
  44. package/dist/common/Utils.js +13 -18
  45. package/dist/common/Utils.js.map +1 -1
  46. package/dist/common/Utils.test.js +0 -97
  47. package/dist/common/Utils.test.js.map +1 -1
  48. package/dist/common/constants.js +3 -4
  49. package/dist/common/constants.js.map +1 -1
  50. package/dist/common/types.js +0 -1
  51. package/dist/common/types.js.map +1 -1
  52. package/dist/index.js +12 -0
  53. package/dist/index.js.map +1 -1
  54. package/dist/module/CallHistory/CallHistory.js +2 -64
  55. package/dist/module/CallHistory/callHistoryFixtures.js +0 -24
  56. package/dist/module/CallHistory/constants.js +0 -3
  57. package/dist/module/CallingClient/CallingClient.js +1 -1
  58. package/dist/module/CallingClient/calling/CallerId/index.js +6 -6
  59. package/dist/module/CallingClient/calling/call.js +22 -66
  60. package/dist/module/CallingClient/calling/callManager.js +5 -5
  61. package/dist/module/CallingClient/calling/types.js +0 -5
  62. package/dist/module/CallingClient/constants.js +2 -1
  63. package/dist/module/CallingClient/line/index.js +8 -14
  64. package/dist/module/CallingClient/registration/register.js +4 -12
  65. package/dist/module/Contacts/ContactsClient.js +2 -2
  66. package/dist/module/Events/types.js +0 -2
  67. package/dist/module/common/Utils.js +5 -12
  68. package/dist/module/common/constants.js +2 -3
  69. package/dist/module/common/types.js +0 -1
  70. package/dist/module/index.js +1 -0
  71. package/dist/types/CallHistory/CallHistory.d.ts +2 -4
  72. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  73. package/dist/types/CallHistory/callHistoryFixtures.d.ts +2 -6
  74. package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
  75. package/dist/types/CallHistory/constants.d.ts +0 -3
  76. package/dist/types/CallHistory/constants.d.ts.map +1 -1
  77. package/dist/types/CallHistory/types.d.ts +0 -9
  78. package/dist/types/CallHistory/types.d.ts.map +1 -1
  79. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  80. package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
  81. package/dist/types/CallingClient/calling/call.d.ts +5 -7
  82. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  83. package/dist/types/CallingClient/calling/callManager.d.ts +1 -1
  84. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  85. package/dist/types/CallingClient/calling/types.d.ts +2 -6
  86. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  87. package/dist/types/CallingClient/constants.d.ts +2 -1
  88. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  89. package/dist/types/CallingClient/line/index.d.ts +2 -3
  90. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  91. package/dist/types/CallingClient/line/types.d.ts +1 -1
  92. package/dist/types/CallingClient/line/types.d.ts.map +1 -1
  93. package/dist/types/CallingClient/registration/register.d.ts +2 -4
  94. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  95. package/dist/types/CallingClient/types.d.ts +0 -1
  96. package/dist/types/CallingClient/types.d.ts.map +1 -1
  97. package/dist/types/Contacts/ContactsClient.d.ts +1 -1
  98. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  99. package/dist/types/Events/types.d.ts +2 -15
  100. package/dist/types/Events/types.d.ts.map +1 -1
  101. package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
  102. package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
  103. package/dist/types/common/Utils.d.ts +2 -2
  104. package/dist/types/common/Utils.d.ts.map +1 -1
  105. package/dist/types/common/constants.d.ts +0 -1
  106. package/dist/types/common/constants.d.ts.map +1 -1
  107. package/dist/types/common/types.d.ts +1 -2
  108. package/dist/types/common/types.d.ts.map +1 -1
  109. package/dist/types/index.d.ts +2 -0
  110. package/dist/types/index.d.ts.map +1 -1
  111. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","ALLOWED_SERVICES","exports","HTTP_METHODS","RegistrationStatus","CALLING_BACKEND","CallType","CallDirection","SORT","SORT_BY","ServiceIndicator","DecodeType"],"sources":["types.ts"],"sourcesContent":["import {SCIM_ENTERPRISE_USER, SCIM_WEBEXIDENTITY_USER} from './constants';\n\nexport type MobiusDeviceId = string;\nexport type MobiusDeviceUri = string;\nexport type SettingEnabled = boolean;\n\nexport enum ALLOWED_SERVICES {\n MOBIUS = 'mobius',\n JANUS = 'janus',\n}\nexport enum HTTP_METHODS {\n GET = 'GET',\n POST = 'POST',\n PATCH = 'PATCH',\n PUT = 'PUT',\n DELETE = 'DELETE',\n}\n\nexport enum RegistrationStatus {\n IDLE = 'IDLE',\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n}\n\nexport enum CALLING_BACKEND {\n WXC = 'WEBEX_CALLING',\n BWRKS = 'BROADWORKS_CALLING',\n UCM = 'UCM_CALLING',\n INVALID = 'Calling backend is currently not supported',\n}\n\nexport type DeviceList = unknown;\nexport type CallId = string; // guid;\nexport type CorrelationId = string;\nexport enum CallType {\n URI = 'uri',\n TEL = 'tel',\n}\nexport type CallDetails = {\n type: CallType;\n address: string; // sip address\n};\n\nexport type CallDestination = CallDetails;\nexport enum CallDirection {\n INBOUND = 'inbound',\n OUTBOUND = 'outbound',\n}\nexport type AvatarId = string;\nexport type DisplayName = string;\nexport type DisplayInformation = {\n avatarSrc: AvatarId | undefined;\n name: DisplayName | undefined;\n num: string | undefined;\n id: string | undefined;\n};\n\nexport type WebexRequestPayload = {\n method?: HTTP_METHODS;\n uri?: string;\n addAuthHeader?: boolean;\n headers?: {\n [key: string]: string | null;\n };\n body?: object;\n statusCode?: number;\n json?: boolean;\n service?: ALLOWED_SERVICES;\n};\n\nexport type ErrorCode = string;\n\nexport type Digit = string | number;\n\nexport type ServerInfo = {\n region: string;\n uris: string[];\n};\n\nexport type MobiusServers = {\n primary: ServerInfo;\n backup: ServerInfo;\n};\n\nexport type IpInfo = {\n ipv4: string;\n ipv6: string;\n};\n\nexport type DeviceType = {\n deviceId: string;\n uri: string;\n status: string;\n lastSeen: string;\n addresses: string[];\n clientDeviceUri: string;\n};\n\nexport type RegionInfo = {\n countryCode: string;\n clientRegion: string;\n};\n\nexport interface IDeviceInfo {\n userId?: string;\n errorCode?: number;\n\n device?: DeviceType;\n devices?: DeviceType[];\n keepaliveInterval?: number;\n callKeepaliveInterval?: number;\n voicePortalNumber?: number;\n voicePortalExtension?: number;\n // cSpell:disable\n rehomingIntervalMin?: number;\n rehomingIntervalMax?: number;\n /* cSpell:enable */\n}\n\nexport interface IMetaContext {\n file?: string;\n method?: string;\n}\n\nexport enum SORT {\n ASC = 'ASC',\n DESC = 'DESC',\n DEFAULT = 'DESC',\n}\n\nexport enum SORT_BY {\n END_TIME = 'endTime',\n DEFAULT = 'endTime',\n START_TIME = 'startTime',\n}\n\nexport enum ServiceIndicator {\n CALLING = 'calling',\n CONTACT_CENTER = 'contactcenter',\n GUEST_CALLING = 'guestcalling',\n}\n\nexport type ServiceData = {\n indicator: ServiceIndicator;\n domain?: string;\n};\n\nexport type PhoneNumber = {\n type: string;\n value: string;\n primary?: boolean;\n};\n\nexport type PersonInfo = {\n id: string;\n emails: string[];\n phoneNumbers: PhoneNumber[];\n displayName: string;\n nickName: string;\n firstName: string;\n lastName: string;\n avatar: string;\n orgId: string;\n created: string;\n lastModified: string;\n lastActivity: string;\n status: string;\n type: string;\n};\n\nexport type PeopleListResponse = {\n items: PersonInfo[];\n notFoundIds: string[];\n};\n\nexport enum DecodeType {\n PEOPLE = 'PEOPLE',\n ORGANIZATION = 'ORGANIZATION',\n}\n\nexport type ContactDetail = {\n type?: string;\n value: string;\n};\n\nexport interface URIAddress {\n value: string;\n type: string;\n primary?: boolean;\n}\n\nexport type KmsKey = {\n uri: string;\n userId: string;\n createDate: string;\n expirationDate: string;\n bindDate?: string;\n resourceUri?: string;\n};\n\nexport type KmsResourceObject = {\n uri: string;\n keyUris: string[];\n authorizationUris: string[];\n};\n\nexport interface Name {\n familyName: string;\n givenName: string;\n}\n\nexport interface Address {\n city?: string;\n country?: string;\n state?: string;\n street?: string;\n zipCode?: string;\n}\n\ninterface WebexIdentityMeta {\n organizationId: string;\n}\ninterface WebexIdentityUser {\n sipAddresses?: URIAddress[];\n meta?: WebexIdentityMeta;\n}\n\ninterface Manager {\n value: string;\n displayName: string;\n $ref: string;\n}\n\ninterface EnterpriseUser {\n department?: string;\n manager?: Manager;\n}\n\ninterface Resource {\n schemas: string[];\n id: string;\n userName: string;\n active?: boolean;\n name?: Name;\n displayName?: string;\n emails?: URIAddress[];\n userType: string;\n phoneNumbers?: PhoneNumber[];\n photos?: ContactDetail[];\n addresses?: Address[];\n [SCIM_WEBEXIDENTITY_USER]?: WebexIdentityUser;\n [SCIM_ENTERPRISE_USER]?: EnterpriseUser;\n}\n\nexport interface SCIMListResponse {\n schemas: string[];\n totalResults: number;\n itemsPerPage: number;\n startIndex: number;\n Resources: Resource[];\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAA0E,IAM9DC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA;AAAA,IAIhBE,YAAY,GAAAD,OAAA,CAAAC,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAAA,IAQZC,kBAAkB,GAAAF,OAAA,CAAAE,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAAA,IAMlBC,eAAe,GAAAH,OAAA,CAAAG,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA,OAQE;AAAA,IAEjBC,QAAQ,GAAAJ,OAAA,CAAAI,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAURC,aAAa,GAAAL,OAAA,CAAAK,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAA,IAgFbC,IAAI,GAAAN,OAAA,CAAAM,IAAA,0BAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAAA,IAMJC,OAAO,GAAAP,OAAA,CAAAO,OAAA,0BAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAA,OAAPA,OAAO;AAAA;AAAA,IAMPC,gBAAgB,GAAAR,OAAA,CAAAQ,gBAAA,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA;AAAA,IAuChBC,UAAU,GAAAT,OAAA,CAAAS,UAAA,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA"}
1
+ {"version":3,"names":["_constants","require","ALLOWED_SERVICES","exports","HTTP_METHODS","RegistrationStatus","CALLING_BACKEND","CallType","CallDirection","SORT","SORT_BY","ServiceIndicator","DecodeType"],"sources":["types.ts"],"sourcesContent":["import {SCIM_ENTERPRISE_USER, SCIM_WEBEXIDENTITY_USER} from './constants';\n\nexport type MobiusDeviceId = string;\nexport type MobiusDeviceUri = string;\nexport type SettingEnabled = boolean;\n\nexport enum ALLOWED_SERVICES {\n MOBIUS = 'mobius',\n JANUS = 'janus',\n}\nexport enum HTTP_METHODS {\n GET = 'GET',\n POST = 'POST',\n PATCH = 'PATCH',\n PUT = 'PUT',\n DELETE = 'DELETE',\n}\n\nexport enum RegistrationStatus {\n IDLE = 'IDLE',\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n}\n\nexport enum CALLING_BACKEND {\n WXC = 'WEBEX_CALLING',\n BWRKS = 'BROADWORKS_CALLING',\n UCM = 'UCM_CALLING',\n INVALID = 'Calling backend is currently not supported',\n}\n\nexport type DeviceList = unknown;\nexport type CallId = string; // guid;\nexport type CorrelationId = string;\nexport enum CallType {\n URI = 'uri',\n TEL = 'tel',\n}\nexport type CallDetails = {\n type: CallType;\n address: string; // sip address\n};\n\nexport type CallDestination = CallDetails;\nexport enum CallDirection {\n INBOUND = 'inbound',\n OUTBOUND = 'outbound',\n}\nexport type AvatarId = string;\nexport type DisplayName = string;\nexport type DisplayInformation = {\n avatarSrc: AvatarId | undefined;\n name: DisplayName | undefined;\n num: string | undefined;\n id: string | undefined;\n};\n\nexport type WebexRequestPayload = {\n method?: HTTP_METHODS;\n uri?: string;\n addAuthHeader?: boolean;\n headers?: {\n [key: string]: string | null;\n };\n body?: object;\n statusCode?: number;\n json?: boolean;\n service?: ALLOWED_SERVICES;\n};\n\nexport type ErrorCode = string;\n\nexport type Digit = string | number;\n\nexport type ServerInfo = {\n region: string;\n uris: string[];\n};\n\nexport type MobiusServers = {\n primary: ServerInfo;\n backup: ServerInfo;\n};\n\nexport type IpInfo = {\n ipv4: string;\n ipv6: string;\n};\n\nexport type DeviceType = {\n deviceId: string;\n uri: string;\n status: string;\n lastSeen: string;\n addresses: string[];\n clientDeviceUri: string;\n};\n\nexport type RegionInfo = {\n countryCode: string;\n clientRegion: string;\n};\n\nexport interface IDeviceInfo {\n userId?: string;\n errorCode?: number;\n\n device?: DeviceType;\n devices?: DeviceType[];\n keepaliveInterval?: number;\n callKeepaliveInterval?: number;\n voicePortalNumber?: number;\n voicePortalExtension?: number;\n // cSpell:disable\n rehomingIntervalMin?: number;\n rehomingIntervalMax?: number;\n /* cSpell:enable */\n}\n\nexport interface IMetaContext {\n file?: string;\n method?: string;\n}\n\nexport enum SORT {\n ASC = 'ASC',\n DESC = 'DESC',\n DEFAULT = 'DESC',\n}\n\nexport enum SORT_BY {\n END_TIME = 'endTime',\n DEFAULT = 'endTime',\n START_TIME = 'startTime',\n}\n\nexport enum ServiceIndicator {\n CALLING = 'calling',\n CONTACT_CENTER = 'contactcenter',\n}\n\nexport type ServiceData = {\n indicator: ServiceIndicator;\n domain?: string;\n};\n\nexport type PhoneNumber = {\n type: string;\n value: string;\n primary?: boolean;\n};\n\nexport type PersonInfo = {\n id: string;\n emails: string[];\n phoneNumbers: PhoneNumber[];\n displayName: string;\n nickName: string;\n firstName: string;\n lastName: string;\n avatar: string;\n orgId: string;\n created: string;\n lastModified: string;\n lastActivity: string;\n status: string;\n type: string;\n};\n\nexport type PeopleListResponse = {\n items: PersonInfo[];\n notFoundIds: string[];\n};\n\nexport enum DecodeType {\n PEOPLE = 'PEOPLE',\n ORGANIZATION = 'ORGANIZATION',\n}\n\nexport type ContactDetail = {\n type?: string;\n value: string;\n};\n\nexport interface URIAddress {\n value: string;\n type: string;\n primary?: boolean;\n}\n\nexport type KmsKey = {\n uri: string;\n userId: string;\n createDate: string;\n expirationDate: string;\n bindDate?: string;\n resourceUri?: string;\n};\n\nexport type KmsResourceObject = {\n uri: string;\n keyUris: string[];\n authorizationUris: string[];\n};\n\nexport interface Name {\n familyName: string;\n givenName: string;\n}\n\nexport interface Address {\n city?: string;\n country?: string;\n state?: string;\n street?: string;\n zipCode?: string;\n}\n\ninterface WebexIdentityMeta {\n organizationId: string;\n}\ninterface WebexIdentityUser {\n sipAddresses?: URIAddress[];\n meta?: WebexIdentityMeta;\n}\n\ninterface Manager {\n value: string;\n displayName: string;\n $ref: string;\n}\n\ninterface EnterpriseUser {\n department?: string;\n manager?: Manager;\n}\n\ninterface Resource {\n schemas: string[];\n id: string;\n userName: string;\n active?: boolean;\n name?: Name;\n displayName?: string;\n emails?: URIAddress[];\n userType: string;\n phoneNumbers?: PhoneNumber[];\n photos?: ContactDetail[];\n addresses?: Address[];\n [SCIM_WEBEXIDENTITY_USER]?: WebexIdentityUser;\n [SCIM_ENTERPRISE_USER]?: EnterpriseUser;\n}\n\nexport interface SCIMListResponse {\n schemas: string[];\n totalResults: number;\n itemsPerPage: number;\n startIndex: number;\n Resources: Resource[];\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAA0E,IAM9DC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA;AAAA,IAIhBE,YAAY,GAAAD,OAAA,CAAAC,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAAA,IAQZC,kBAAkB,GAAAF,OAAA,CAAAE,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAAA,IAMlBC,eAAe,GAAAH,OAAA,CAAAG,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA,OAQE;AAAA,IAEjBC,QAAQ,GAAAJ,OAAA,CAAAI,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAURC,aAAa,GAAAL,OAAA,CAAAK,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAA,IAgFbC,IAAI,GAAAN,OAAA,CAAAM,IAAA,0BAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAAA,IAMJC,OAAO,GAAAP,OAAA,CAAAO,OAAA,0BAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAPA,OAAO;EAAA,OAAPA,OAAO;AAAA;AAAA,IAMPC,gBAAgB,GAAAR,OAAA,CAAAQ,gBAAA,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA;AAAA,IAsChBC,UAAU,GAAAT,OAAA,CAAAS,UAAA,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA"}
package/dist/index.js CHANGED
@@ -71,6 +71,12 @@ _Object$defineProperty(exports, "CallerIdDisplay", {
71
71
  return _types8.CallerIdDisplay;
72
72
  }
73
73
  });
74
+ _Object$defineProperty(exports, "CallingClientConfig", {
75
+ enumerable: true,
76
+ get: function get() {
77
+ return _types2.CallingClientConfig;
78
+ }
79
+ });
74
80
  _Object$defineProperty(exports, "Contact", {
75
81
  enumerable: true,
76
82
  get: function get() {
@@ -215,6 +221,12 @@ _Object$defineProperty(exports, "SORT_BY", {
215
221
  return _types9.SORT_BY;
216
222
  }
217
223
  });
224
+ _Object$defineProperty(exports, "ServiceIndicator", {
225
+ enumerable: true,
226
+ get: function get() {
227
+ return _types9.ServiceIndicator;
228
+ }
229
+ });
218
230
  _Object$defineProperty(exports, "SummaryInfo", {
219
231
  enumerable: true,
220
232
  get: function get() {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_mediaHelpers","require","_CallSettings","_ContactsClient","_CallingClient","_CallHistory","_Voicemail","_Logger","_interopRequireDefault","_types","_types2","_types3","_types4","_types5","_types6","_types7","_types8","_types9","_Errors","_types10","_types11"],"sources":["index.ts"],"sourcesContent":["import {NoiseReductionEffect, createMicrophoneStream} from '@webex/media-helpers';\nimport {createCallSettingsClient} from './CallSettings/CallSettings';\nimport {createContactsClient} from './Contacts/ContactsClient';\nimport {createClient} from './CallingClient/CallingClient';\nimport {createCallHistoryClient} from './CallHistory/CallHistory';\nimport {createVoicemailClient} from './Voicemail/Voicemail';\nimport Logger from './Logger';\n\nexport {\n createClient,\n createCallHistoryClient,\n createCallSettingsClient,\n createContactsClient,\n createMicrophoneStream,\n createVoicemailClient,\n Logger,\n NoiseReductionEffect,\n};\n\nexport {ERROR_LAYER, ERROR_TYPE} from './Errors/types';\nexport {ICallingClient} from './CallingClient/types';\nexport {ICallHistory, JanusResponseEvent} from './CallHistory/types';\nexport {\n CallForwardSetting,\n CallForwardAlwaysSetting,\n CallSettingResponse,\n ICallSettings,\n ToggleSetting,\n VoicemailSetting,\n} from './CallSettings/types';\nexport {Contact, ContactResponse, GroupType, IContacts} from './Contacts/types';\nexport {IVoicemail, SummaryInfo, VoicemailResponseEvent} from './Voicemail/types';\nexport {ILine, LINE_EVENTS} from './CallingClient/line/types';\nexport {\n CALLING_CLIENT_EVENT_KEYS,\n CALL_EVENT_KEYS,\n CallerIdDisplay,\n Disposition,\n LINE_EVENT_KEYS,\n COMMON_EVENT_KEYS,\n UserSession,\n} from './Events/types';\nexport {\n CallDetails,\n CallDirection,\n CallType,\n DisplayInformation,\n SORT,\n SORT_BY,\n} from './common/types';\nexport {CallError, LineError} from './Errors';\nexport {ICall, TransferType} from './CallingClient/calling/types';\nexport {LOGGER} from './Logger/types';\nexport {LocalMicrophoneStream} from '@webex/media-helpers';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAC,sBAAA,CAAAP,OAAA;AAaA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAQA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,OAAA,GAAAf,OAAA;AASA,IAAAgB,OAAA,GAAAhB,OAAA;AAQA,IAAAiB,OAAA,GAAAjB,OAAA;AACA,IAAAkB,QAAA,GAAAlB,OAAA;AACA,IAAAmB,QAAA,GAAAnB,OAAA"}
1
+ {"version":3,"names":["_mediaHelpers","require","_CallSettings","_ContactsClient","_CallingClient","_CallHistory","_Voicemail","_Logger","_interopRequireDefault","_types","_types2","_types3","_types4","_types5","_types6","_types7","_types8","_types9","_Errors","_types10","_types11"],"sources":["index.ts"],"sourcesContent":["import {NoiseReductionEffect, createMicrophoneStream} from '@webex/media-helpers';\nimport {createCallSettingsClient} from './CallSettings/CallSettings';\nimport {createContactsClient} from './Contacts/ContactsClient';\nimport {createClient} from './CallingClient/CallingClient';\nimport {createCallHistoryClient} from './CallHistory/CallHistory';\nimport {createVoicemailClient} from './Voicemail/Voicemail';\nimport Logger from './Logger';\n\nexport {\n createClient,\n createCallHistoryClient,\n createCallSettingsClient,\n createContactsClient,\n createMicrophoneStream,\n createVoicemailClient,\n Logger,\n NoiseReductionEffect,\n};\n\nexport {ERROR_LAYER, ERROR_TYPE} from './Errors/types';\nexport {ICallingClient} from './CallingClient/types';\nexport {ICallHistory, JanusResponseEvent} from './CallHistory/types';\nexport {\n CallForwardSetting,\n CallForwardAlwaysSetting,\n CallSettingResponse,\n ICallSettings,\n ToggleSetting,\n VoicemailSetting,\n} from './CallSettings/types';\nexport {Contact, ContactResponse, GroupType, IContacts} from './Contacts/types';\nexport {IVoicemail, SummaryInfo, VoicemailResponseEvent} from './Voicemail/types';\nexport {ILine, LINE_EVENTS} from './CallingClient/line/types';\nexport {\n CALLING_CLIENT_EVENT_KEYS,\n CALL_EVENT_KEYS,\n CallerIdDisplay,\n Disposition,\n LINE_EVENT_KEYS,\n COMMON_EVENT_KEYS,\n UserSession,\n} from './Events/types';\nexport {\n CallDetails,\n CallDirection,\n CallType,\n DisplayInformation,\n SORT,\n SORT_BY,\n} from './common/types';\nexport {CallError, LineError} from './Errors';\nexport {ICall, TransferType} from './CallingClient/calling/types';\nexport {LOGGER} from './Logger/types';\nexport {LocalMicrophoneStream} from '@webex/media-helpers';\nexport {CallingClientConfig} from './CallingClient/types';\nexport {ServiceIndicator} from './common/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAC,sBAAA,CAAAP,OAAA;AAaA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAQA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,OAAA,GAAAf,OAAA;AASA,IAAAgB,OAAA,GAAAhB,OAAA;AAQA,IAAAiB,OAAA,GAAAjB,OAAA;AACA,IAAAkB,QAAA,GAAAlB,OAAA;AACA,IAAAmB,QAAA,GAAAnB,OAAA"}
@@ -2,8 +2,8 @@ import SDKConnector from '../SDKConnector';
2
2
  import { ALLOWED_SERVICES, HTTP_METHODS, SORT, SORT_BY, CALLING_BACKEND, } from '../common/types';
3
3
  import log from '../Logger';
4
4
  import { serviceErrorCodeHandler, getVgActionEndpoint, getCallingBackEnd } from '../common/Utils';
5
- import { APPLICATION_JSON, CALL_HISTORY_FILE, CONTENT_TYPE, FROM_DATE, HISTORY, LIMIT, NUMBER_OF_DAYS, UPDATE_MISSED_CALLS_ENDPOINT, SET_READ_STATE_SUCCESS_MESSAGE, VERSION_1, UNIFIED_COMMUNICATIONS, CONFIG, PEOPLE, LINES, ORG_ID, DELETE_CALL_HISTORY_RECORDS_ENDPOINT, SET_DELETE_CALL_RECORDS_SUCCESS_MESSAGE, SET_DELETE_CALL_RECORDS_INVALID_DATE_FORMAT_MESSAGE, } from './constants';
6
- import { FAILURE_MESSAGE, STATUS_CODE, SUCCESS_MESSAGE, USER_SESSIONS } from '../common/constants';
5
+ import { APPLICATION_JSON, CALL_HISTORY_FILE, CONTENT_TYPE, FROM_DATE, HISTORY, LIMIT, NUMBER_OF_DAYS, UPDATE_MISSED_CALLS_ENDPOINT, SET_READ_STATE_SUCCESS_MESSAGE, VERSION_1, UNIFIED_COMMUNICATIONS, CONFIG, PEOPLE, LINES, ORG_ID, } from './constants';
6
+ import { STATUS_CODE, SUCCESS_MESSAGE, USER_SESSIONS } from '../common/constants';
7
7
  import { COMMON_EVENT_KEYS, MOBIUS_EVENT_KEYS, } from '../Events/types';
8
8
  import { Eventing } from '../Events/impl';
9
9
  export class CallHistory extends Eventing {
@@ -168,62 +168,6 @@ export class CallHistory extends Eventing {
168
168
  return errorStatus;
169
169
  }
170
170
  }
171
- async deleteCallHistoryRecords(deleteSessionIds) {
172
- const loggerContext = {
173
- file: CALL_HISTORY_FILE,
174
- method: 'deleteCallHistoryRecords',
175
- };
176
- const invalidSessions = deleteSessionIds.filter((session) => Number.isNaN(new Date(session.endTime).getTime()));
177
- if (invalidSessions.length > 0) {
178
- const invalidSessionIds = invalidSessions.map((session) => session.sessionId).join(', ');
179
- log.info(`The provided date is malformed or invalid for session IDs: ${invalidSessionIds}`, loggerContext);
180
- return {
181
- statusCode: 400,
182
- data: {
183
- deleteStatusMessage: SET_DELETE_CALL_RECORDS_INVALID_DATE_FORMAT_MESSAGE,
184
- },
185
- message: FAILURE_MESSAGE,
186
- };
187
- }
188
- const santizedSessionIds = deleteSessionIds.map((session) => ({
189
- ...session,
190
- endTime: new Date(session.endTime).getTime(),
191
- }));
192
- const deleteRequestBody = {
193
- deleteSessionIds: santizedSessionIds,
194
- };
195
- try {
196
- const deleteCallHistoryRecordContentUrl = `${this.janusUrl}/${HISTORY}/${USER_SESSIONS}/${DELETE_CALL_HISTORY_RECORDS_ENDPOINT}`;
197
- const response = await fetch(deleteCallHistoryRecordContentUrl, {
198
- method: HTTP_METHODS.POST,
199
- headers: {
200
- [CONTENT_TYPE]: APPLICATION_JSON,
201
- Authorization: await this.webex.credentials.getUserToken(),
202
- },
203
- body: JSON.stringify(deleteRequestBody),
204
- });
205
- if (!response.ok) {
206
- throw new Error(`${response.status}`);
207
- }
208
- const data = await response.json();
209
- log.info(`Call history records are succesfully deleted by the user`, loggerContext);
210
- const responseDetails = {
211
- statusCode: data.statusCode,
212
- data: {
213
- deleteStatusMessage: SET_DELETE_CALL_RECORDS_SUCCESS_MESSAGE,
214
- },
215
- message: SUCCESS_MESSAGE,
216
- };
217
- return responseDetails;
218
- }
219
- catch (err) {
220
- const errorInfo = {
221
- statusCode: err instanceof Error ? Number(err.message) : '',
222
- };
223
- const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
224
- return errorStatus;
225
- }
226
- }
227
171
  handleSessionEvents = async (event) => {
228
172
  if (event && event.data.userSessions.userSessions) {
229
173
  this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSION_INFO, event);
@@ -234,16 +178,10 @@ export class CallHistory extends Eventing {
234
178
  this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_VIEWED_SESSIONS, event);
235
179
  }
236
180
  };
237
- handleUserSessionsDeletedEvents = async (event) => {
238
- if (event && event.data.deletedSessions) {
239
- this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSIONS_DELETED, event);
240
- }
241
- };
242
181
  registerSessionsListener() {
243
182
  this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, this.handleSessionEvents);
244
183
  this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_LEGACY, this.handleSessionEvents);
245
184
  this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_VIEWED, this.handleUserReadSessionEvents);
246
- this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_DELETED, this.handleUserSessionsDeletedEvents);
247
185
  }
248
186
  }
249
187
  export const createCallHistoryClient = (webex, logger) => new CallHistory(webex, logger);
@@ -563,15 +563,6 @@ export const MOCK_SESSION_EVENT_VIEWED = {
563
563
  timestamp: 12345,
564
564
  trackingId: 'tracking-id',
565
565
  };
566
- export const MOCK_SESSION_EVENT_DELETED = {
567
- id: 'id',
568
- data: {
569
- deletedSessions: ['123-456-789-99999-993939'],
570
- eventType: MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_DELETED,
571
- },
572
- timestamp: 12345,
573
- trackingId: 'tracking-id',
574
- };
575
566
  export const MOCK_UPDATE_MISSED_CALL_RESPONSE = {
576
567
  statusCode: 200,
577
568
  data: {
@@ -579,22 +570,7 @@ export const MOCK_UPDATE_MISSED_CALL_RESPONSE = {
579
570
  },
580
571
  message: 'SUCCESS',
581
572
  };
582
- export const MOCK_DELETE_CALL_HISTORY_RECORDS_RESPONSE = {
583
- statusCode: 200,
584
- data: {
585
- deleteStatusMessage: 'Call history records are deleted by the user.',
586
- },
587
- message: 'SUCCESS',
588
- };
589
- export const MOCK_DELETE_CALL_HISTORY_INVALID_DATE_RESPONSE = {
590
- statusCode: 400,
591
- data: {
592
- deleteStatusMessage: 'The provided date is malformed or invalid',
593
- },
594
- message: 'FAILURE',
595
- };
596
573
  export const janusSetReadStateUrl = 'https://janus-intb.ciscospark.com/janus/api/v1/history/userSessions/setReadState';
597
- export const janusMarkAsDeletedUrl = 'https://janus-intb.ciscospark.com/janus/api/v1/history/userSessions/markAsDeleted';
598
574
  export const ERROR_DETAILS_401 = {
599
575
  statusCode: 401,
600
576
  data: {
@@ -2,7 +2,6 @@ export const APPLICATION_JSON = 'application/json';
2
2
  export const CALL_HISTORY_FILE = 'CallHistory';
3
3
  export const CONTENT_TYPE = 'Content-Type';
4
4
  export const CONFIG = 'config';
5
- export const DELETE_CALL_HISTORY_RECORDS_ENDPOINT = 'markAsDeleted';
6
5
  export const FROM_DATE = '?from';
7
6
  export const HISTORY = 'history';
8
7
  export const LIMIT = 50;
@@ -12,8 +11,6 @@ export const ORG_ID = 'orgId';
12
11
  export const PEOPLE = 'people';
13
12
  export const RESPONSE_MESSAGE = 'responseMessage';
14
13
  export const SET_READ_STATE_SUCCESS_MESSAGE = 'Missed calls are read by the user.';
15
- export const SET_DELETE_CALL_RECORDS_SUCCESS_MESSAGE = 'Call history records are deleted by the user.';
16
- export const SET_DELETE_CALL_RECORDS_INVALID_DATE_FORMAT_MESSAGE = 'The provided date is malformed or invalid';
17
14
  export const SUCCESS_MESSAGE = 'SUCCESS';
18
15
  export const STATUS_CODE = 'statusCode';
19
16
  export const USER_SESSIONS = 'userSessions';
@@ -240,7 +240,7 @@ export class CallingClient extends Eventing {
240
240
  });
241
241
  }
242
242
  async createLine() {
243
- const line = new Line(this.webex.internal.device.userId, this.webex.internal.device.url, this.mutex, this.primaryMobiusUris, this.backupMobiusUris, this.getLoggingLevel(), this.sdkConfig?.serviceData, this.sdkConfig?.jwe);
243
+ const line = new Line(this.webex.internal.device.userId, this.webex.internal.device.url, this.mutex, this.primaryMobiusUris, this.backupMobiusUris, this.getLoggingLevel(), this.sdkConfig?.serviceData);
244
244
  this.lineDict[line.lineId] = line;
245
245
  }
246
246
  getLines() {
@@ -1,5 +1,5 @@
1
1
  import log from '../../../Logger/index';
2
- import { CALLER_ID_FILE, VALID_PHONE_REGEX } from '../../constants';
2
+ import { CALLER_ID_FILE, FETCH_NAME, VALID_PHONE } from '../../constants';
3
3
  import SDKConnector from '../../../SDKConnector';
4
4
  import { resolveCallerIdDisplay } from '../../../common';
5
5
  export class CallerId {
@@ -74,9 +74,11 @@ export class CallerId {
74
74
  }
75
75
  parseSipUri(paid) {
76
76
  const result = {};
77
- const nameMatch = paid.split('<')[0].replace(/"/g, '');
77
+ const data = paid.split('@')[0].replace(/"/g, '');
78
+ const nameMatch = FETCH_NAME.exec(data);
79
+ const num = data.substring(data.indexOf(':') + 1, data.length);
78
80
  if (nameMatch) {
79
- result.name = nameMatch.trim();
81
+ result.name = nameMatch[0].trimEnd();
80
82
  }
81
83
  else {
82
84
  log.warn(`Name field not found!`, {
@@ -84,9 +86,7 @@ export class CallerId {
84
86
  method: 'parseSipUri',
85
87
  });
86
88
  }
87
- const data = paid.split('@')[0].replace(/"/g, '');
88
- const num = data.substring(data.indexOf(':') + 1, data.length);
89
- const phoneMatch = num.match(VALID_PHONE_REGEX);
89
+ const phoneMatch = num.match(VALID_PHONE);
90
90
  if (phoneMatch && phoneMatch[0].length === num.length) {
91
91
  result.num = num;
92
92
  }
@@ -2,16 +2,15 @@ import { MediaConnectionEventNames, LocalStreamEventNames, RoapMediaConnection,
2
2
  import { createMachine, interpret } from 'xstate';
3
3
  import { v4 as uuid } from 'uuid';
4
4
  import { EffectEvent } from '@webex/web-media-effects';
5
- import { RtcMetrics } from '@webex/internal-plugin-metrics';
6
5
  import { ERROR_LAYER, ERROR_TYPE } from '../../Errors/types';
7
- import { handleCallErrors, parseMediaQualityStatistics, serviceErrorCodeHandler, } from '../../common/Utils';
6
+ import { handleCallErrors, parseMediaQualityStatistics } from '../../common/Utils';
8
7
  import { ALLOWED_SERVICES, CallDirection, HTTP_METHODS, } from '../../common/types';
9
8
  import { createCallError } from '../../Errors/catalog/CallError';
10
9
  import { CALL_ENDPOINT_RESOURCE, CALL_FILE, CALL_HOLD_SERVICE, CALL_STATUS_RESOURCE, CALL_TRANSFER_SERVICE, CALLING_USER_AGENT, CALLS_ENDPOINT_RESOURCE, CISCO_DEVICE_URL, DEFAULT_LOCAL_CALL_ID, DEFAULT_SESSION_TIMER, DEVICES_ENDPOINT_RESOURCE, HOLD_ENDPOINT, ICE_CANDIDATES_TIMEOUT, INITIAL_SEQ_NUMBER, MEDIA_ENDPOINT_RESOURCE, NOISE_REDUCTION_EFFECT, RESUME_ENDPOINT, SPARK_USER_AGENT, SUPPLEMENTARY_SERVICES_TIMEOUT, TRANSFER_ENDPOINT, } from '../constants';
11
10
  import SDKConnector from '../../SDKConnector';
12
11
  import { Eventing } from '../../Events/impl';
13
12
  import { CALL_EVENT_KEYS, MEDIA_CONNECTION_EVENT_KEYS, MOBIUS_MIDCALL_STATE, SUPPLEMENTARY_SERVICES, } from '../../Events/types';
14
- import { DisconnectCause, DisconnectCode, MidCallEventType, MobiusCallState, MUTE_TYPE, RoapScenario, TransferType, } from './types';
13
+ import { DisconnectCause, DisconnectCode, MidCallEventType, MobiusCallState, RoapScenario, TransferType, } from './types';
15
14
  import log from '../../Logger';
16
15
  import { createCallerId } from './CallerId';
17
16
  import { METRIC_TYPE, METRIC_EVENT, TRANSFER_ACTION } from '../../Metrics/types';
@@ -50,7 +49,6 @@ export class Call extends Eventing {
50
49
  mediaNegotiationCompleted;
51
50
  receivedRoapOKSeq;
52
51
  localAudioStream;
53
- rtcMetrics;
54
52
  isMuted() {
55
53
  return this.muted;
56
54
  }
@@ -60,7 +58,7 @@ export class Call extends Eventing {
60
58
  isHeld() {
61
59
  return this.held;
62
60
  }
63
- constructor(activeUrl, webex, direction, deviceId, lineId, deleteCb, indicator, destination) {
61
+ constructor(activeUrl, webex, destination, direction, deviceId, lineId, deleteCb, indicator) {
64
62
  super();
65
63
  this.destination = destination;
66
64
  this.direction = direction;
@@ -100,7 +98,6 @@ export class Call extends Eventing {
100
98
  });
101
99
  this.remoteRoapMessage = null;
102
100
  this.disconnectReason = { code: DisconnectCode.NORMAL, cause: DisconnectCause.NORMAL };
103
- this.rtcMetrics = new RtcMetrics(this.webex, { callId: this.callId }, this.correlationId);
104
101
  const callMachine = createMachine({
105
102
  schema: {
106
103
  context: {},
@@ -1222,23 +1219,6 @@ export class Call extends Eventing {
1222
1219
  this.mediaConnection.roapMessageReceived(message);
1223
1220
  }
1224
1221
  }
1225
- forceSendStatsReport = async ({ callFrom }) => {
1226
- const loggerContext = {
1227
- file: CALL_FILE,
1228
- method: this.forceSendStatsReport.name,
1229
- };
1230
- try {
1231
- await this.mediaConnection.forceRtcMetricsSend();
1232
- log.info(`Successfully uploaded available webrtc telemetry statistics`, loggerContext);
1233
- log.info(`callFrom: ${callFrom}`, loggerContext);
1234
- }
1235
- catch (error) {
1236
- const errorInfo = error;
1237
- const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);
1238
- const errorLog = new Error(`Failed to upload webrtc telemetry statistics. ${errorStatus}`);
1239
- log.error(errorLog, loggerContext);
1240
- }
1241
- };
1242
1222
  initMediaConnection(localAudioTrack, debugId) {
1243
1223
  const mediaConnection = new RoapMediaConnection({
1244
1224
  skipInactiveTransceivers: true,
@@ -1256,7 +1236,7 @@ export class Call extends Eventing {
1256
1236
  video: 'inactive',
1257
1237
  screenShareVideo: 'inactive',
1258
1238
  },
1259
- }, debugId || `WebexCallSDK-${this.correlationId}`, (data) => this.rtcMetrics.addMetrics(data), () => this.rtcMetrics.closeMetrics(), () => this.rtcMetrics.sendMetricsInQueue());
1239
+ }, debugId || `WebexCallSDK-${this.correlationId}`);
1260
1240
  this.mediaConnection = mediaConnection;
1261
1241
  }
1262
1242
  getDirection = () => this.direction;
@@ -1270,7 +1250,6 @@ export class Call extends Eventing {
1270
1250
  }
1271
1251
  setCallId = (callId) => {
1272
1252
  this.callId = callId;
1273
- this.rtcMetrics.updateCallId(callId);
1274
1253
  log.info(`Setting callId : ${this.callId} for correlationId: ${this.correlationId}`, {
1275
1254
  file: CALL_FILE,
1276
1255
  method: this.setCallId.name,
@@ -1346,16 +1325,6 @@ export class Call extends Eventing {
1346
1325
  }
1347
1326
  }
1348
1327
  post = async (roapMessage) => {
1349
- const basePayload = {
1350
- device: {
1351
- deviceId: this.deviceId,
1352
- correlationId: this.correlationId,
1353
- },
1354
- localMedia: {
1355
- roap: roapMessage,
1356
- mediaId: uuid(),
1357
- },
1358
- };
1359
1328
  return this.webex.request({
1360
1329
  uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALL_ENDPOINT_RESOURCE}`,
1361
1330
  method: HTTP_METHODS.POST,
@@ -1364,15 +1333,20 @@ export class Call extends Eventing {
1364
1333
  [CISCO_DEVICE_URL]: this.webex.internal.device.url,
1365
1334
  [SPARK_USER_AGENT]: CALLING_USER_AGENT,
1366
1335
  },
1367
- body: this.destination
1368
- ? {
1369
- ...basePayload,
1370
- callee: {
1371
- type: this.destination.type,
1372
- address: this.destination.address,
1373
- },
1374
- }
1375
- : basePayload,
1336
+ body: {
1337
+ device: {
1338
+ deviceId: this.deviceId,
1339
+ correlationId: this.correlationId,
1340
+ },
1341
+ callee: {
1342
+ type: this.destination.type,
1343
+ address: this.destination.address,
1344
+ },
1345
+ localMedia: {
1346
+ roap: roapMessage,
1347
+ mediaId: uuid(),
1348
+ },
1349
+ },
1376
1350
  });
1377
1351
  };
1378
1352
  async patch(state) {
@@ -1771,31 +1745,13 @@ export class Call extends Eventing {
1771
1745
  });
1772
1746
  }
1773
1747
  }
1774
- mute = (localAudioStream, muteType) => {
1775
- if (!localAudioStream) {
1776
- log.warn(`Did not find a local stream while muting the call ${this.getCorrelationId()}.`, {
1777
- file: CALL_FILE,
1778
- method: 'mute',
1779
- });
1780
- return;
1781
- }
1782
- if (muteType === MUTE_TYPE.SYSTEM) {
1783
- if (!localAudioStream.userMuted) {
1784
- this.muted = localAudioStream.systemMuted;
1785
- }
1786
- else {
1787
- log.info(`Call is muted by the user already - ${this.getCorrelationId()}.`, {
1788
- file: CALL_FILE,
1789
- method: 'mute',
1790
- });
1791
- }
1792
- }
1793
- else if (!localAudioStream.systemMuted) {
1748
+ mute = (localAudioStream) => {
1749
+ if (localAudioStream) {
1794
1750
  localAudioStream.setUserMuted(!this.muted);
1795
1751
  this.muted = !this.muted;
1796
1752
  }
1797
1753
  else {
1798
- log.info(`Call is muted on the system - ${this.getCorrelationId()}.`, {
1754
+ log.warn(`Did not find a local stream while muting the call ${this.getCorrelationId()}.`, {
1799
1755
  file: CALL_FILE,
1800
1756
  method: 'mute',
1801
1757
  });
@@ -1848,4 +1804,4 @@ export class Call extends Eventing {
1848
1804
  });
1849
1805
  }
1850
1806
  }
1851
- export const createCall = (activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest) => new Call(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest);
1807
+ export const createCall = (activeUrl, webex, dest, dir, deviceId, lineId, deleteCb, indicator) => new Call(activeUrl, webex, dest, dir, deviceId, lineId, deleteCb, indicator);
@@ -27,16 +27,16 @@ export class CallManager extends Eventing {
27
27
  this.activeMobiusUrl = '';
28
28
  this.listenForWsEvents();
29
29
  }
30
- createCall = (direction, deviceId, lineId, destination) => {
30
+ createCall = (destination, direction, deviceId, lineId) => {
31
31
  log.log('Creating call object', {});
32
- const newCall = createCall(this.activeMobiusUrl, this.webex, direction, deviceId, lineId, (correlationId) => {
32
+ const newCall = createCall(this.activeMobiusUrl, this.webex, destination, direction, deviceId, lineId, (correlationId) => {
33
33
  delete this.callCollection[correlationId];
34
34
  const activeCalls = Object.keys(this.getActiveCalls()).length;
35
35
  log.info(`DELETE:: Deleted corelationId: ${newCall.getCorrelationId()} from CallManager, Number of call records :- ${activeCalls}`, {});
36
36
  if (activeCalls === 0) {
37
37
  this.emit(CALLING_CLIENT_EVENT_KEYS.ALL_CALLS_CLEARED);
38
38
  }
39
- }, this.serviceIndicator, destination);
39
+ }, this.serviceIndicator);
40
40
  this.callCollection[newCall.getCorrelationId()] = newCall;
41
41
  log.log(`New call created with correlationId: ${newCall.getCorrelationId()}`, {});
42
42
  log.info(`ADD:: Added corelationId: ${newCall.getCorrelationId()} to CallManager , Number of call records now:- ${Object.keys(this.getActiveCalls()).length}`, {});
@@ -78,7 +78,7 @@ export class CallManager extends Eventing {
78
78
  let newCall;
79
79
  if (!newId) {
80
80
  const lineId = this.getLineId(mobiusEvent.data.deviceId);
81
- newCall = this.createCall(CallDirection.INBOUND, mobiusEvent.data.deviceId, lineId, {});
81
+ newCall = this.createCall({}, CallDirection.INBOUND, mobiusEvent.data.deviceId, lineId);
82
82
  log.log(`New incoming call created with correlationId from Call Setup message: ${newCall.getCorrelationId()}`, {
83
83
  file: CALL_MANAGER_FILE,
84
84
  method: 'dequeueWsEvents',
@@ -139,7 +139,7 @@ export class CallManager extends Eventing {
139
139
  }
140
140
  else {
141
141
  const lineId = this.getLineId(mobiusEvent.data.deviceId);
142
- activeCall = this.createCall(CallDirection.INBOUND, mobiusEvent.data.deviceId, lineId, {});
142
+ activeCall = this.createCall({}, CallDirection.INBOUND, mobiusEvent.data.deviceId, lineId);
143
143
  log.log(`New incoming call created with correlationId from ROAP Message: ${activeCall.getCorrelationId()}`, {
144
144
  file: CALL_MANAGER_FILE,
145
145
  method: 'dequeueWsEvents',
@@ -51,8 +51,3 @@ export var TransferType;
51
51
  TransferType["BLIND"] = "BLIND";
52
52
  TransferType["CONSULT"] = "CONSULT";
53
53
  })(TransferType || (TransferType = {}));
54
- export var MUTE_TYPE;
55
- (function (MUTE_TYPE) {
56
- MUTE_TYPE["USER"] = "user_mute";
57
- MUTE_TYPE["SYSTEM"] = "system_mute";
58
- })(MUTE_TYPE || (MUTE_TYPE = {}));
@@ -42,6 +42,7 @@ export const DUMMY_METRICS = {
42
42
  },
43
43
  };
44
44
  export const DUMMY_MOBIUS_URL = 'https://mobius.aintgen-a-1.int.infra.webex.com/api/v1';
45
+ export const FETCH_NAME = /^[a-zA-Z ]+/;
45
46
  export const IP_ENDPOINT = 'myip';
46
47
  export const INITIAL_SEQ_NUMBER = 1;
47
48
  export const MEDIA_ENDPOINT_RESOURCE = 'media';
@@ -56,7 +57,7 @@ export const REGISTER_RETRY_TIMEOUT = 10000;
56
57
  export const SUPPLEMENTARY_SERVICES_TIMEOUT = 10000;
57
58
  export const API_V1 = '/api/v1';
58
59
  export const URL_ENDPOINT = '/calling/web/';
59
- export const VALID_PHONE_REGEX = /[\d\s()*#+.-]+/;
60
+ export const VALID_PHONE = /[\d\s()*#+.-]+/;
60
61
  export const WEB_AGENT = '(web)';
61
62
  export const WEBEX = 'webex';
62
63
  export const WEBEX_WEB_CLIENT = 'webex-web-client';
@@ -1,7 +1,7 @@
1
1
  import { v4 as uuid } from 'uuid';
2
2
  import { CallDirection, RegistrationStatus, ServiceIndicator, } from '../../common/types';
3
3
  import { LINE_EVENTS } from './types';
4
- import { LINE_FILE, VALID_PHONE_REGEX } from '../constants';
4
+ import { LINE_FILE, VALID_PHONE } from '../constants';
5
5
  import log from '../../Logger';
6
6
  import { createRegistration } from '../registration';
7
7
  import { Eventing } from '../../Events/impl';
@@ -33,10 +33,9 @@ export default class Line extends Eventing {
33
33
  voicePortalNumber;
34
34
  voicePortalExtension;
35
35
  callManager;
36
- serviceData;
37
36
  #primaryMobiusUris;
38
37
  #backupMobiusUris;
39
- constructor(userId, clientDeviceUri, mutex, primaryMobiusUris, backupMobiusUris, logLevel, serviceDataConfig, jwe, phoneNumber, extension, voicemail) {
38
+ constructor(userId, clientDeviceUri, mutex, primaryMobiusUris, backupMobiusUris, logLevel, serviceDataConfig, phoneNumber, extension, voicemail) {
40
39
  super();
41
40
  this.lineId = uuid();
42
41
  this.userId = userId;
@@ -49,13 +48,13 @@ export default class Line extends Eventing {
49
48
  this.#mutex = mutex;
50
49
  this.#primaryMobiusUris = primaryMobiusUris;
51
50
  this.#backupMobiusUris = backupMobiusUris;
52
- this.serviceData = serviceDataConfig?.indicator
51
+ const serviceData = serviceDataConfig?.indicator
53
52
  ? serviceDataConfig
54
53
  : { indicator: ServiceIndicator.CALLING, domain: '' };
55
- validateServiceData(this.serviceData);
56
- this.registration = createRegistration(this.#webex, this.serviceData, this.#mutex, this.lineEmitter, logLevel, jwe);
54
+ validateServiceData(serviceData);
55
+ this.registration = createRegistration(this.#webex, serviceData, this.#mutex, this.lineEmitter, logLevel);
57
56
  log.setLogger(logLevel, LINE_FILE);
58
- this.callManager = getCallManager(this.#webex, this.serviceData.indicator);
57
+ this.callManager = getCallManager(this.#webex, serviceData.indicator);
59
58
  this.incomingCallListener();
60
59
  }
61
60
  async register() {
@@ -118,7 +117,7 @@ export default class Line extends Eventing {
118
117
  makeCall = (dest) => {
119
118
  let call;
120
119
  if (dest) {
121
- const match = dest.address.match(VALID_PHONE_REGEX);
120
+ const match = dest.address.match(VALID_PHONE);
122
121
  if (match && match[0].length === dest.address.length) {
123
122
  const sanitizedNumber = dest.address
124
123
  .replace(/[^[*+]\d#]/gi, '')
@@ -128,7 +127,7 @@ export default class Line extends Eventing {
128
127
  type: dest.type,
129
128
  address: `tel:${sanitizedNumber}`,
130
129
  };
131
- call = this.callManager.createCall(CallDirection.OUTBOUND, this.registration.getDeviceInfo().device?.deviceId, this.lineId, formattedDest);
130
+ call = this.callManager.createCall(formattedDest, CallDirection.OUTBOUND, this.registration.getDeviceInfo().device?.deviceId, this.lineId);
132
131
  log.log(`New call created, callId: ${call.getCallId()}`, {});
133
132
  }
134
133
  else {
@@ -138,11 +137,6 @@ export default class Line extends Eventing {
138
137
  }
139
138
  return call;
140
139
  }
141
- if (this.serviceData.indicator === ServiceIndicator.GUEST_CALLING) {
142
- call = this.callManager.createCall(CallDirection.OUTBOUND, this.registration.getDeviceInfo().device?.deviceId, this.lineId);
143
- log.log(`New guest call created, callId: ${call.getCallId()}`, {});
144
- return call;
145
- }
146
140
  return undefined;
147
141
  };
148
142
  incomingCallListener() {
@@ -30,11 +30,8 @@ export class Registration {
30
30
  backupMobiusUris;
31
31
  registerRetry = false;
32
32
  reconnectPending = false;
33
- jwe;
34
33
  isCCFlow = false;
35
- failoverImmediately = false;
36
- constructor(webex, serviceData, mutex, lineEmitter, logLevel, jwe) {
37
- this.jwe = jwe;
34
+ constructor(webex, serviceData, mutex, lineEmitter, logLevel) {
38
35
  this.sdkConnector = SDKConnector;
39
36
  this.serviceData = serviceData;
40
37
  this.isCCFlow = serviceData.indicator === ServiceIndicator.CONTACT_CENTER;
@@ -102,7 +99,7 @@ export class Registration {
102
99
  const deviceInfo = {
103
100
  userId: this.userId,
104
101
  clientDeviceUri: this.webex.internal.device.url,
105
- serviceData: this.jwe ? { ...this.serviceData, jwe: this.jwe } : this.serviceData,
102
+ serviceData: this.serviceData,
106
103
  };
107
104
  return this.webex.request({
108
105
  uri: `${url}device`,
@@ -160,7 +157,7 @@ export class Registration {
160
157
  interval -= excessVal;
161
158
  }
162
159
  let abort;
163
- if (interval > BASE_REG_RETRY_TIMER_VAL_IN_SEC && !this.failoverImmediately) {
160
+ if (interval > BASE_REG_RETRY_TIMER_VAL_IN_SEC) {
164
161
  const scheduledTime = Math.floor(Date.now() / 1000);
165
162
  setTimeout(async () => {
166
163
  await this.mutex.runExclusive(async () => {
@@ -175,7 +172,6 @@ export class Registration {
175
172
  }
176
173
  else if (this.backupMobiusUris.length) {
177
174
  log.log('Failing over to backup servers.', loggerContext);
178
- this.failoverImmediately = false;
179
175
  abort = await this.attemptRegistrationWithServers(this.startFailoverTimer.name, this.backupMobiusUris);
180
176
  if (!abort && !this.isDeviceRegistered()) {
181
177
  interval = this.getRegRetryInterval();
@@ -353,9 +349,6 @@ export class Registration {
353
349
  }
354
350
  async attemptRegistrationWithServers(caller, servers = this.primaryMobiusUris) {
355
351
  let abort = false;
356
- if (this.failoverImmediately) {
357
- return abort;
358
- }
359
352
  if (this.isDeviceRegistered()) {
360
353
  log.log(`[${caller}] : Device already registered with : ${this.activeMobiusUrl}`, {
361
354
  file: REGISTRATION_FILE,
@@ -448,7 +441,6 @@ export class Registration {
448
441
  this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION, REG_ACTION.KEEPALIVE_FAILURE, METRIC_TYPE.BEHAVIORAL, clientError);
449
442
  }, { method: this.startKeepaliveTimer.name, file: REGISTRATION_FILE });
450
443
  if (abort || keepAliveRetryCount >= RETRY_COUNT_THRESHOLD) {
451
- this.failoverImmediately = this.isCCFlow;
452
444
  this.setStatus(RegistrationStatus.INACTIVE);
453
445
  this.clearKeepaliveTimer();
454
446
  this.clearFailbackTimer();
@@ -526,4 +518,4 @@ export class Registration {
526
518
  }
527
519
  }
528
520
  }
529
- export const createRegistration = (webex, serviceData, mutex, lineEmitter, logLevel, jwe) => new Registration(webex, serviceData, mutex, lineEmitter, logLevel, jwe);
521
+ export const createRegistration = (webex, serviceData, mutex, lineEmitter, logLevel) => new Registration(webex, serviceData, mutex, lineEmitter, logLevel);