@webex/calling 3.5.0-next.2 → 3.5.0-next.21

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 (62) hide show
  1. package/dist/CallingClient/CallingClient.js +2 -2
  2. package/dist/CallingClient/CallingClient.js.map +1 -1
  3. package/dist/CallingClient/CallingClient.test.js +1 -1
  4. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  5. package/dist/CallingClient/calling/call.js +434 -348
  6. package/dist/CallingClient/calling/call.js.map +1 -1
  7. package/dist/CallingClient/calling/call.test.js +516 -386
  8. package/dist/CallingClient/calling/call.test.js.map +1 -1
  9. package/dist/CallingClient/calling/callManager.js +6 -6
  10. package/dist/CallingClient/calling/callManager.js.map +1 -1
  11. package/dist/CallingClient/calling/callManager.test.js +3 -3
  12. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  13. package/dist/CallingClient/calling/types.js +6 -1
  14. package/dist/CallingClient/calling/types.js.map +1 -1
  15. package/dist/CallingClient/line/index.js +13 -6
  16. package/dist/CallingClient/line/index.js.map +1 -1
  17. package/dist/CallingClient/line/line.test.js +84 -22
  18. package/dist/CallingClient/line/line.test.js.map +1 -1
  19. package/dist/CallingClient/line/types.js.map +1 -1
  20. package/dist/CallingClient/registration/register.js +79 -59
  21. package/dist/CallingClient/registration/register.js.map +1 -1
  22. package/dist/CallingClient/registration/register.test.js +1 -1
  23. package/dist/CallingClient/registration/register.test.js.map +1 -1
  24. package/dist/CallingClient/types.js.map +1 -1
  25. package/dist/common/Utils.js +18 -13
  26. package/dist/common/Utils.js.map +1 -1
  27. package/dist/common/Utils.test.js +97 -0
  28. package/dist/common/Utils.test.js.map +1 -1
  29. package/dist/common/constants.js +2 -1
  30. package/dist/common/constants.js.map +1 -1
  31. package/dist/common/types.js +1 -0
  32. package/dist/common/types.js.map +1 -1
  33. package/dist/module/CallingClient/CallingClient.js +1 -1
  34. package/dist/module/CallingClient/calling/call.js +66 -22
  35. package/dist/module/CallingClient/calling/callManager.js +5 -5
  36. package/dist/module/CallingClient/calling/types.js +5 -0
  37. package/dist/module/CallingClient/line/index.js +12 -6
  38. package/dist/module/CallingClient/registration/register.js +12 -4
  39. package/dist/module/common/Utils.js +12 -5
  40. package/dist/module/common/constants.js +1 -0
  41. package/dist/module/common/types.js +1 -0
  42. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  43. package/dist/types/CallingClient/calling/call.d.ts +7 -5
  44. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  45. package/dist/types/CallingClient/calling/callManager.d.ts +1 -1
  46. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  47. package/dist/types/CallingClient/calling/types.d.ts +6 -2
  48. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  49. package/dist/types/CallingClient/line/index.d.ts +3 -2
  50. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  51. package/dist/types/CallingClient/line/types.d.ts +1 -1
  52. package/dist/types/CallingClient/line/types.d.ts.map +1 -1
  53. package/dist/types/CallingClient/registration/register.d.ts +4 -2
  54. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  55. package/dist/types/CallingClient/types.d.ts +1 -0
  56. package/dist/types/CallingClient/types.d.ts.map +1 -1
  57. package/dist/types/common/Utils.d.ts.map +1 -1
  58. package/dist/types/common/constants.d.ts +1 -0
  59. package/dist/types/common/constants.d.ts.map +1 -1
  60. package/dist/types/common/types.d.ts +2 -1
  61. package/dist/types/common/types.d.ts.map +1 -1
  62. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"names":["_uuid","require","_types","_types2","_constants","_Logger","_interopRequireDefault","_registration","_impl","_LineError","_common","_SDKConnector","_types3","_callManager","_types4","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","_classPrivateFieldInitSpec","obj","privateMap","value","_checkPrivateRedeclaration","set","privateCollection","has","TypeError","_webex","_weakMap","_mutex","_sdkConnector","_primaryMobiusUris","_backupMobiusUris","Line","exports","_Eventing","_inherits2","_super","userId","clientDeviceUri","mutex","primaryMobiusUris","backupMobiusUris","logLevel","serviceDataConfig","phoneNumber","extension","voicemail","_this","_classCallCheck2","_assertThisInitialized2","writable","_defineProperty2","event","deviceInfo","lineError","LINE_EVENTS","REGISTERED","normalizeLine","emit","UNREGISTERED","RECONNECTED","RECONNECTING","ERROR","registration","getStatus","_this$registration$ge","getDeviceInfo","device","deviceId","dest","match","address","VALID_PHONE","length","_this$registration$ge2","sanitizedNumber","replace","formattedDest","type","concat","callManager","createCall","CallDirection","OUTBOUND","lineId","log","getCallId","warn","err","LineError","ERROR_TYPE","CALL_ERROR","RegistrationStatus","ACTIVE","undefined","correlationId","getCall","uuid","_classPrivateFieldSet2","SDKConnector","_classPrivateFieldGet2","getWebex","serviceData","indicator","ServiceIndicator","CALLING","domain","validateServiceData","createRegistration","lineEmitter","setLogger","LINE_FILE","getCallManager","incomingCallListener","_createClass2","key","_register","_asyncToGenerator2","_regenerator","mark","_callee2","_this2","wrap","_callee2$","_context2","prev","next","runExclusive","_callee","_callee$","_context","CONNECTING","setMobiusServers","triggerRegistration","stop","mobiusDeviceId","updateLine","register","_deregister","_callee3","_callee3$","_context3","deregister","setStatus","IDLE","_device$addresses","keepaliveInterval","callKeepaliveInterval","rehomingIntervalMin","rehomingIntervalMax","voicePortalNumber","voicePortalExtension","mobiusUri","uri","lastSeen","sipAddresses","addresses","getLoggingLevel","getLogLevel","getActiveMobiusUrl","_this3","logContext","file","method","name","on","LINE_EVENT_KEYS","INCOMING_CALL","callObj","Eventing"],"sources":["index.ts"],"sourcesContent":["import {Mutex} from 'async-mutex';\nimport {v4 as uuid} from 'uuid';\nimport {\n CallDetails,\n CallDirection,\n CorrelationId,\n IDeviceInfo,\n MobiusDeviceId,\n RegistrationStatus,\n ServiceIndicator,\n} from '../../common/types';\nimport {ILine, LINE_EVENTS} from './types';\nimport {LINE_FILE, VALID_PHONE} from '../constants';\nimport log from '../../Logger';\nimport {IRegistration} from '../registration/types';\nimport {createRegistration} from '../registration';\nimport {ISDKConnector, WebexSDK} from '../../SDKConnector/types';\nimport {CallingClientConfig} from '../types';\nimport {Eventing} from '../../Events/impl';\nimport {LineError} from '../../Errors/catalog/LineError';\nimport {LOGGER} from '../../Logger/types';\nimport {validateServiceData} from '../../common';\nimport SDKConnector from '../../SDKConnector';\nimport {LINE_EVENT_KEYS, LineEventTypes} from '../../Events/types';\nimport {ICall, ICallManager} from '../calling/types';\nimport {getCallManager} from '../calling/callManager';\nimport {ERROR_TYPE} from '../../Errors/types';\n\nexport default class Line extends Eventing<LineEventTypes> implements ILine {\n #webex: WebexSDK;\n\n #mutex: Mutex;\n\n #sdkConnector: ISDKConnector;\n\n public registration: IRegistration;\n\n public userId: string;\n\n public clientDeviceUri: string;\n\n public lineId: string;\n\n public mobiusDeviceId?: string;\n\n private mobiusUri?: string;\n\n public phoneNumber?: string;\n\n public extension?: string;\n\n public sipAddresses: string[] = [];\n\n public voicemail?: string;\n\n public lastSeen?: string;\n\n public keepaliveInterval?: number;\n\n public callKeepaliveInterval?: number;\n\n public rehomingIntervalMin?: number;\n\n public rehomingIntervalMax?: number;\n\n public voicePortalNumber?: number;\n\n public voicePortalExtension?: number;\n\n private callManager: ICallManager;\n\n #primaryMobiusUris: string[];\n\n #backupMobiusUris: string[];\n\n constructor(\n userId: string,\n clientDeviceUri: string,\n mutex: Mutex,\n primaryMobiusUris: string[],\n backupMobiusUris: string[],\n logLevel: LOGGER,\n serviceDataConfig?: CallingClientConfig['serviceData'],\n phoneNumber?: string,\n extension?: string,\n voicemail?: string\n ) {\n super();\n this.lineId = uuid();\n this.userId = userId;\n this.clientDeviceUri = clientDeviceUri;\n this.phoneNumber = phoneNumber;\n this.extension = extension;\n this.voicemail = voicemail;\n\n this.#sdkConnector = SDKConnector;\n this.#webex = this.#sdkConnector.getWebex();\n this.#mutex = mutex;\n\n this.#primaryMobiusUris = primaryMobiusUris;\n this.#backupMobiusUris = backupMobiusUris;\n\n const serviceData = serviceDataConfig?.indicator\n ? serviceDataConfig\n : {indicator: ServiceIndicator.CALLING, domain: ''};\n\n validateServiceData(serviceData);\n\n this.registration = createRegistration(\n this.#webex,\n serviceData,\n this.#mutex,\n this.lineEmitter,\n logLevel\n );\n\n log.setLogger(logLevel, LINE_FILE);\n\n this.callManager = getCallManager(this.#webex, serviceData.indicator);\n\n this.incomingCallListener();\n }\n\n /**\n * Wrapper to for device registration.\n */\n public async register() {\n await this.#mutex.runExclusive(async () => {\n this.emit(LINE_EVENTS.CONNECTING);\n\n this.registration.setMobiusServers(this.#primaryMobiusUris, this.#backupMobiusUris);\n await this.registration.triggerRegistration();\n });\n if (this.mobiusDeviceId) {\n this.callManager.updateLine(this.mobiusDeviceId, this);\n }\n }\n\n /**\n * Wrapper to for device deregister.\n */\n public async deregister() {\n await this.registration.deregister();\n this.registration.setStatus(RegistrationStatus.IDLE);\n }\n\n /**\n * To normalize line class with Mobius response\n */\n private normalizeLine(deviceInfo: IDeviceInfo) {\n const {\n device,\n keepaliveInterval,\n callKeepaliveInterval,\n rehomingIntervalMin,\n rehomingIntervalMax,\n voicePortalNumber,\n voicePortalExtension,\n } = deviceInfo;\n\n this.mobiusDeviceId = device?.deviceId;\n this.mobiusUri = device?.uri;\n this.lastSeen = device?.lastSeen;\n this.sipAddresses = device?.addresses ?? [];\n this.keepaliveInterval = keepaliveInterval;\n this.callKeepaliveInterval = callKeepaliveInterval;\n this.rehomingIntervalMin = rehomingIntervalMin;\n this.rehomingIntervalMax = rehomingIntervalMax;\n this.voicePortalNumber = voicePortalNumber;\n this.voicePortalExtension = voicePortalExtension;\n }\n\n /**\n * Line events emitter\n */\n public lineEmitter = (event: LINE_EVENTS, deviceInfo?: IDeviceInfo, lineError?: LineError) => {\n switch (event) {\n case LINE_EVENTS.REGISTERED:\n if (deviceInfo) {\n this.normalizeLine(deviceInfo);\n this.emit(event, this);\n }\n break;\n case LINE_EVENTS.UNREGISTERED:\n case LINE_EVENTS.RECONNECTED:\n case LINE_EVENTS.RECONNECTING:\n this.emit(event);\n break;\n case LINE_EVENTS.ERROR:\n if (lineError) {\n this.emit(event, lineError);\n }\n break;\n default:\n break;\n }\n };\n\n /**\n * To get the current log Level.\n */\n public getLoggingLevel(): LOGGER {\n return log.getLogLevel();\n }\n\n /**\n * To get active url of Mobius.\n */\n public getActiveMobiusUrl(): string {\n return this.registration.getActiveMobiusUrl();\n }\n\n /**\n * Gets registration status\n */\n public getStatus = (): RegistrationStatus => this.registration.getStatus();\n\n /**\n * Gets device id\n */\n public getDeviceId = (): MobiusDeviceId | undefined =>\n this.registration.getDeviceInfo().device?.deviceId;\n\n /**\n * Initiates a call to the specified destination.\n * @param dest - The call details including destination information.\n */\n public makeCall = (dest: CallDetails): ICall | undefined => {\n let call;\n\n if (dest) {\n const match = dest.address.match(VALID_PHONE);\n\n if (match && match[0].length === dest.address.length) {\n const sanitizedNumber = dest.address\n .replace(/[^[*+]\\d#]/gi, '')\n .replace(/\\s+/gi, '')\n .replace(/-/gi, '');\n const formattedDest = {\n type: dest.type,\n address: `tel:${sanitizedNumber}`,\n };\n\n call = this.callManager.createCall(\n formattedDest,\n CallDirection.OUTBOUND,\n this.registration.getDeviceInfo().device?.deviceId as string,\n this.lineId\n );\n log.log(`New call created, callId: ${call.getCallId()}`, {});\n } else {\n log.warn('Invalid phone number detected', {});\n\n const err = new LineError(\n 'An invalid phone number was detected. Check the number and try again.',\n {},\n ERROR_TYPE.CALL_ERROR,\n RegistrationStatus.ACTIVE\n );\n\n this.emit(LINE_EVENTS.ERROR, err);\n }\n\n return call;\n }\n\n return undefined;\n };\n\n /**\n * An Incoming Call listener.\n */\n private incomingCallListener() {\n const logContext = {\n file: LINE_FILE,\n method: this.incomingCallListener.name,\n };\n log.log('Listening for incoming calls... ', logContext);\n this.callManager.on(LINE_EVENT_KEYS.INCOMING_CALL, (callObj: ICall) => {\n this.emit(LINE_EVENTS.INCOMING_CALL, callObj);\n });\n }\n\n /**\n * @param callId -.\n * @param correlationId -.\n */\n public getCall = (correlationId: CorrelationId): ICall => {\n return this.callManager.getCall(correlationId);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,aAAA,GAAAN,OAAA;AAGA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAEA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAL,sBAAA,CAAAL,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAEA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAA8C,SAAAc,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA;AAAA,SAAAC,2BAAAC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C;MACvD,IAAI,CAACjF,WAAW,CAACqF,EAAE,CAACC,uBAAe,CAACC,aAAa,EAAE,UAACC,OAAc,EAAK;QACrER,MAAI,CAACtG,IAAI,CAACH,mBAAW,CAACgH,aAAa,EAAEC,OAAO,CAAC;MAC/C,CAAC,CAAC;IACJ;EAAC;EAAA,OAAAxI,IAAA;AAAA,EA7P+ByI,cAAQ"}
1
+ {"version":3,"names":["_uuid","require","_types","_types2","_constants","_Logger","_interopRequireDefault","_registration","_impl","_LineError","_common","_SDKConnector","_types3","_callManager","_types4","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","_classPrivateFieldInitSpec","obj","privateMap","value","_checkPrivateRedeclaration","set","privateCollection","has","TypeError","_webex","_weakMap","_mutex","_sdkConnector","_primaryMobiusUris","_backupMobiusUris","Line","exports","_Eventing","_inherits2","_super","userId","clientDeviceUri","mutex","primaryMobiusUris","backupMobiusUris","logLevel","serviceDataConfig","jwe","phoneNumber","extension","voicemail","_this","_classCallCheck2","_assertThisInitialized2","writable","_defineProperty2","event","deviceInfo","lineError","LINE_EVENTS","REGISTERED","normalizeLine","emit","UNREGISTERED","RECONNECTED","RECONNECTING","ERROR","registration","getStatus","_this$registration$ge","getDeviceInfo","device","deviceId","dest","match","address","VALID_PHONE","length","_this$registration$ge2","sanitizedNumber","replace","formattedDest","type","concat","callManager","createCall","CallDirection","OUTBOUND","lineId","log","getCallId","warn","err","LineError","ERROR_TYPE","CALL_ERROR","RegistrationStatus","ACTIVE","serviceData","indicator","ServiceIndicator","GUEST_CALLING","_this$registration$ge3","undefined","correlationId","getCall","uuid","_classPrivateFieldSet2","SDKConnector","_classPrivateFieldGet2","getWebex","CALLING","domain","validateServiceData","createRegistration","lineEmitter","setLogger","LINE_FILE","getCallManager","incomingCallListener","_createClass2","key","_register","_asyncToGenerator2","_regenerator","mark","_callee2","_this2","wrap","_callee2$","_context2","prev","next","runExclusive","_callee","_callee$","_context","CONNECTING","setMobiusServers","triggerRegistration","stop","mobiusDeviceId","updateLine","register","_deregister","_callee3","_callee3$","_context3","deregister","setStatus","IDLE","_device$addresses","keepaliveInterval","callKeepaliveInterval","rehomingIntervalMin","rehomingIntervalMax","voicePortalNumber","voicePortalExtension","mobiusUri","uri","lastSeen","sipAddresses","addresses","getLoggingLevel","getLogLevel","getActiveMobiusUrl","_this3","logContext","file","method","name","on","LINE_EVENT_KEYS","INCOMING_CALL","callObj","Eventing"],"sources":["index.ts"],"sourcesContent":["import {Mutex} from 'async-mutex';\nimport {v4 as uuid} from 'uuid';\nimport {\n CallDetails,\n CallDirection,\n CorrelationId,\n IDeviceInfo,\n MobiusDeviceId,\n RegistrationStatus,\n ServiceData,\n ServiceIndicator,\n} from '../../common/types';\nimport {ILine, LINE_EVENTS} from './types';\nimport {LINE_FILE, VALID_PHONE} from '../constants';\nimport log from '../../Logger';\nimport {IRegistration} from '../registration/types';\nimport {createRegistration} from '../registration';\nimport {ISDKConnector, WebexSDK} from '../../SDKConnector/types';\nimport {CallingClientConfig} from '../types';\nimport {Eventing} from '../../Events/impl';\nimport {LineError} from '../../Errors/catalog/LineError';\nimport {LOGGER} from '../../Logger/types';\nimport {validateServiceData} from '../../common';\nimport SDKConnector from '../../SDKConnector';\nimport {LINE_EVENT_KEYS, LineEventTypes} from '../../Events/types';\nimport {ICall, ICallManager} from '../calling/types';\nimport {getCallManager} from '../calling/callManager';\nimport {ERROR_TYPE} from '../../Errors/types';\n\nexport default class Line extends Eventing<LineEventTypes> implements ILine {\n #webex: WebexSDK;\n\n #mutex: Mutex;\n\n #sdkConnector: ISDKConnector;\n\n public registration: IRegistration;\n\n public userId: string;\n\n public clientDeviceUri: string;\n\n public lineId: string;\n\n public mobiusDeviceId?: string;\n\n private mobiusUri?: string;\n\n public phoneNumber?: string;\n\n public extension?: string;\n\n public sipAddresses: string[] = [];\n\n public voicemail?: string;\n\n public lastSeen?: string;\n\n public keepaliveInterval?: number;\n\n public callKeepaliveInterval?: number;\n\n public rehomingIntervalMin?: number;\n\n public rehomingIntervalMax?: number;\n\n public voicePortalNumber?: number;\n\n public voicePortalExtension?: number;\n\n private callManager: ICallManager;\n\n private serviceData: ServiceData;\n\n #primaryMobiusUris: string[];\n\n #backupMobiusUris: string[];\n\n constructor(\n userId: string,\n clientDeviceUri: string,\n mutex: Mutex,\n primaryMobiusUris: string[],\n backupMobiusUris: string[],\n logLevel: LOGGER,\n serviceDataConfig?: CallingClientConfig['serviceData'],\n jwe?: string,\n phoneNumber?: string,\n extension?: string,\n voicemail?: string\n ) {\n super();\n this.lineId = uuid();\n this.userId = userId;\n this.clientDeviceUri = clientDeviceUri;\n this.phoneNumber = phoneNumber;\n this.extension = extension;\n this.voicemail = voicemail;\n\n this.#sdkConnector = SDKConnector;\n this.#webex = this.#sdkConnector.getWebex();\n this.#mutex = mutex;\n\n this.#primaryMobiusUris = primaryMobiusUris;\n this.#backupMobiusUris = backupMobiusUris;\n\n this.serviceData = serviceDataConfig?.indicator\n ? serviceDataConfig\n : {indicator: ServiceIndicator.CALLING, domain: ''};\n\n validateServiceData(this.serviceData);\n\n this.registration = createRegistration(\n this.#webex,\n this.serviceData,\n this.#mutex,\n this.lineEmitter,\n logLevel,\n jwe\n );\n\n log.setLogger(logLevel, LINE_FILE);\n\n this.callManager = getCallManager(this.#webex, this.serviceData.indicator);\n\n this.incomingCallListener();\n }\n\n /**\n * Wrapper to for device registration.\n */\n public async register() {\n await this.#mutex.runExclusive(async () => {\n this.emit(LINE_EVENTS.CONNECTING);\n\n this.registration.setMobiusServers(this.#primaryMobiusUris, this.#backupMobiusUris);\n await this.registration.triggerRegistration();\n });\n if (this.mobiusDeviceId) {\n this.callManager.updateLine(this.mobiusDeviceId, this);\n }\n }\n\n /**\n * Wrapper to for device deregister.\n */\n public async deregister() {\n await this.registration.deregister();\n this.registration.setStatus(RegistrationStatus.IDLE);\n }\n\n /**\n * To normalize line class with Mobius response\n */\n private normalizeLine(deviceInfo: IDeviceInfo) {\n const {\n device,\n keepaliveInterval,\n callKeepaliveInterval,\n rehomingIntervalMin,\n rehomingIntervalMax,\n voicePortalNumber,\n voicePortalExtension,\n } = deviceInfo;\n\n this.mobiusDeviceId = device?.deviceId;\n this.mobiusUri = device?.uri;\n this.lastSeen = device?.lastSeen;\n this.sipAddresses = device?.addresses ?? [];\n this.keepaliveInterval = keepaliveInterval;\n this.callKeepaliveInterval = callKeepaliveInterval;\n this.rehomingIntervalMin = rehomingIntervalMin;\n this.rehomingIntervalMax = rehomingIntervalMax;\n this.voicePortalNumber = voicePortalNumber;\n this.voicePortalExtension = voicePortalExtension;\n }\n\n /**\n * Line events emitter\n */\n public lineEmitter = (event: LINE_EVENTS, deviceInfo?: IDeviceInfo, lineError?: LineError) => {\n switch (event) {\n case LINE_EVENTS.REGISTERED:\n if (deviceInfo) {\n this.normalizeLine(deviceInfo);\n this.emit(event, this);\n }\n break;\n case LINE_EVENTS.UNREGISTERED:\n case LINE_EVENTS.RECONNECTED:\n case LINE_EVENTS.RECONNECTING:\n this.emit(event);\n break;\n case LINE_EVENTS.ERROR:\n if (lineError) {\n this.emit(event, lineError);\n }\n break;\n default:\n break;\n }\n };\n\n /**\n * To get the current log Level.\n */\n public getLoggingLevel(): LOGGER {\n return log.getLogLevel();\n }\n\n /**\n * To get active url of Mobius.\n */\n public getActiveMobiusUrl(): string {\n return this.registration.getActiveMobiusUrl();\n }\n\n /**\n * Gets registration status\n */\n public getStatus = (): RegistrationStatus => this.registration.getStatus();\n\n /**\n * Gets device id\n */\n public getDeviceId = (): MobiusDeviceId | undefined =>\n this.registration.getDeviceInfo().device?.deviceId;\n\n /**\n * Initiates a call to the specified destination.\n * @param dest - The call details including destination information.\n */\n public makeCall = (dest?: CallDetails): ICall | undefined => {\n let call;\n\n if (dest) {\n const match = dest.address.match(VALID_PHONE);\n\n if (match && match[0].length === dest.address.length) {\n const sanitizedNumber = dest.address\n .replace(/[^[*+]\\d#]/gi, '')\n .replace(/\\s+/gi, '')\n .replace(/-/gi, '');\n const formattedDest = {\n type: dest.type,\n address: `tel:${sanitizedNumber}`,\n };\n\n call = this.callManager.createCall(\n CallDirection.OUTBOUND,\n this.registration.getDeviceInfo().device?.deviceId as string,\n this.lineId,\n formattedDest\n );\n log.log(`New call created, callId: ${call.getCallId()}`, {});\n } else {\n log.warn('Invalid phone number detected', {});\n\n const err = new LineError(\n 'An invalid phone number was detected. Check the number and try again.',\n {},\n ERROR_TYPE.CALL_ERROR,\n RegistrationStatus.ACTIVE\n );\n\n this.emit(LINE_EVENTS.ERROR, err);\n }\n\n return call;\n }\n if (this.serviceData.indicator === ServiceIndicator.GUEST_CALLING) {\n call = this.callManager.createCall(\n CallDirection.OUTBOUND,\n this.registration.getDeviceInfo().device?.deviceId as string,\n this.lineId\n );\n log.log(`New guest call created, callId: ${call.getCallId()}`, {});\n\n return call;\n }\n\n return undefined;\n };\n\n /**\n * An Incoming Call listener.\n */\n private incomingCallListener() {\n const logContext = {\n file: LINE_FILE,\n method: this.incomingCallListener.name,\n };\n log.log('Listening for incoming calls... ', logContext);\n this.callManager.on(LINE_EVENT_KEYS.INCOMING_CALL, (callObj: ICall) => {\n this.emit(LINE_EVENTS.INCOMING_CALL, callObj);\n });\n }\n\n /**\n * @param callId -.\n * @param correlationId -.\n */\n public getCall = (correlationId: CorrelationId): ICall => {\n return this.callManager.getCall(correlationId);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,aAAA,GAAAN,OAAA;AAGA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAA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AA;MAC7B,IAAMC,UAAU,GAAG;QACjBC,IAAI,EAAEnD,oBAAS;QACfoD,MAAM,EAAE,IAAI,CAAClD,oBAAoB,CAACmD;MACpC,CAAC;MACDjF,eAAG,CAACA,GAAG,CAAC,kCAAkC,EAAE8E,UAAU,CAAC;MACvD,IAAI,CAACnF,WAAW,CAACuF,EAAE,CAACC,uBAAe,CAACC,aAAa,EAAE,UAACC,OAAc,EAAK;QACrER,MAAI,CAACxG,IAAI,CAACH,mBAAW,CAACkH,aAAa,EAAEC,OAAO,CAAC;MAC/C,CAAC,CAAC;IACJ;EAAC;EAAA,OAAA3I,IAAA;AAAA,EA3Q+B4I,cAAQ"}
@@ -47,6 +47,12 @@ describe('Line Tests', function () {
47
47
  });
48
48
  var userId = webex.internal.device.userId;
49
49
  var clientDeviceUri = webex.internal.device.url;
50
+ var mockJwe = 'mockJwe';
51
+ var guestServiceData = {
52
+ indicator: _types.ServiceIndicator.GUEST_CALLING,
53
+ domain: '',
54
+ guestName: 'testUser'
55
+ };
50
56
  var handleErrorSpy = jest.spyOn(utils, 'handleRegistrationErrors');
51
57
  jest.clearAllMocks();
52
58
  describe('Line Registration tests', function () {
@@ -73,7 +79,7 @@ describe('Line Tests', function () {
73
79
  case 0:
74
80
  jest.useFakeTimers();
75
81
  webex.request.mockReturnValue(registrationPayload);
76
- expect(createRegistrationSpy).toBeCalledOnceWith(webex, defaultServiceData, expect.any(_asyncMutex.Mutex), expect.anything(), _types3.LOGGER.INFO);
82
+ expect(createRegistrationSpy).toBeCalledOnceWith(webex, defaultServiceData, expect.any(_asyncMutex.Mutex), expect.anything(), _types3.LOGGER.INFO, undefined);
77
83
  expect(line.getStatus()).toEqual(_types.RegistrationStatus.IDLE);
78
84
  _context.next = 6;
79
85
  return line.register();
@@ -108,9 +114,55 @@ describe('Line Tests', function () {
108
114
  }
109
115
  }, _callee);
110
116
  })));
111
- it('verify failure Registration cases all requests fail ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
117
+ it('verify successful Registration cases and keepalive for a guest user', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
118
+ var guestLine;
112
119
  return _regenerator.default.wrap(function _callee2$(_context2) {
113
120
  while (1) switch (_context2.prev = _context2.next) {
121
+ case 0:
122
+ createRegistrationSpy.mockClear();
123
+ guestLine = new _.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types3.LOGGER.INFO, guestServiceData, mockJwe);
124
+ jest.useFakeTimers();
125
+ webex.request.mockReturnValue(registrationPayload);
126
+ expect(createRegistrationSpy).toBeCalledOnceWith(webex, guestServiceData, expect.any(_asyncMutex.Mutex), expect.anything(), _types3.LOGGER.INFO, mockJwe);
127
+ expect(guestLine.getStatus()).toEqual(_types.RegistrationStatus.IDLE);
128
+ _context2.next = 8;
129
+ return guestLine.register();
130
+ case 8:
131
+ expect(webex.request).toBeCalledOnceWith(_objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
132
+ body: {
133
+ userId: userId,
134
+ clientDeviceUri: clientDeviceUri,
135
+ serviceData: _objectSpread(_objectSpread({}, guestServiceData), {}, {
136
+ jwe: mockJwe
137
+ })
138
+ },
139
+ uri: "".concat(primaryUrl, "device"),
140
+ method: 'POST'
141
+ }));
142
+ expect(handleErrorSpy).not.toBeCalled();
143
+ expect(guestLine.getStatus()).toEqual(_types.RegistrationStatus.ACTIVE);
144
+ expect(guestLine.getActiveMobiusUrl()).toEqual(primaryUrl);
145
+ expect(guestLine.getLoggingLevel()).toEqual(_types3.LOGGER.INFO);
146
+ expect(guestLine.getDeviceId()).toEqual(mockRegistrationBody.device.deviceId);
147
+ webex.request.mockClear();
148
+ jest.advanceTimersByTime(30 * 1000);
149
+ _context2.next = 18;
150
+ return _promise.default.resolve();
151
+ case 18:
152
+ expect(webex.request).toBeCalledOnceWith(_objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
153
+ uri: "".concat(mockRegistrationBody.device.uri, "/status"),
154
+ method: 'POST'
155
+ }));
156
+ jest.useRealTimers();
157
+ case 20:
158
+ case "end":
159
+ return _context2.stop();
160
+ }
161
+ }, _callee2);
162
+ })));
163
+ it('verify failure Registration cases all requests fail ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
164
+ return _regenerator.default.wrap(function _callee3$(_context3) {
165
+ while (1) switch (_context3.prev = _context3.next) {
114
166
  case 0:
115
167
  line.removeAllListeners(_types2.LINE_EVENTS.ERROR);
116
168
  webex.request.mockRejectedValue({
@@ -121,7 +173,7 @@ describe('Line Tests', function () {
121
173
  });
122
174
  expect(line.getStatus()).toBe(_types.RegistrationStatus.IDLE);
123
175
  line.register();
124
- _context2.next = 7;
176
+ _context3.next = 7;
125
177
  return utils.waitForMsecs(20);
126
178
  case 7:
127
179
  expect(line.getStatus()).toBe(_types.RegistrationStatus.INACTIVE);
@@ -131,29 +183,29 @@ describe('Line Tests', function () {
131
183
  }, expect.anything());
132
184
  case 9:
133
185
  case "end":
134
- return _context2.stop();
186
+ return _context3.stop();
135
187
  }
136
- }, _callee2);
188
+ }, _callee3);
137
189
  })));
138
- it('verify successful de-registration cases', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
139
- return _regenerator.default.wrap(function _callee3$(_context3) {
140
- while (1) switch (_context3.prev = _context3.next) {
190
+ it('verify successful de-registration cases', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
191
+ return _regenerator.default.wrap(function _callee4$(_context4) {
192
+ while (1) switch (_context4.prev = _context4.next) {
141
193
  case 0:
142
194
  webex.request.mockReturnValueOnce(registrationPayload);
143
195
  expect(line.getStatus()).toEqual(_types.RegistrationStatus.IDLE);
144
- _context3.next = 4;
196
+ _context4.next = 4;
145
197
  return line.register();
146
198
  case 4:
147
199
  expect(line.getStatus()).toEqual(_types.RegistrationStatus.ACTIVE);
148
- _context3.next = 7;
200
+ _context4.next = 7;
149
201
  return line.deregister();
150
202
  case 7:
151
203
  expect(line.getStatus()).toEqual(_types.RegistrationStatus.IDLE);
152
204
  case 8:
153
205
  case "end":
154
- return _context3.stop();
206
+ return _context4.stop();
155
207
  }
156
- }, _callee3);
208
+ }, _callee4);
157
209
  })));
158
210
  });
159
211
  describe('Line calling tests', function () {
@@ -173,10 +225,10 @@ describe('Line Tests', function () {
173
225
  address: '5003',
174
226
  type: _types.CallType.URI
175
227
  });
176
- expect(createCallSpy).toBeCalledOnceWith({
228
+ expect(createCallSpy).toBeCalledOnceWith(_types.CallDirection.OUTBOUND, undefined, line.lineId, {
177
229
  address: 'tel:5003',
178
230
  type: 'uri'
179
- }, _types.CallDirection.OUTBOUND, undefined, line.lineId);
231
+ });
180
232
  expect(call).toBeTruthy();
181
233
  expect(line.getCall(call ? call.getCorrelationId() : '')).toBe(call);
182
234
  expect(call ? call.direction : undefined).toStrictEqual(_types.CallDirection.OUTBOUND);
@@ -188,10 +240,10 @@ describe('Line Tests', function () {
188
240
  address: '*25',
189
241
  type: _types.CallType.URI
190
242
  });
191
- expect(createCallSpy).toBeCalledOnceWith({
243
+ expect(createCallSpy).toBeCalledOnceWith(_types.CallDirection.OUTBOUND, undefined, line.lineId, {
192
244
  address: 'tel:*25',
193
245
  type: 'uri'
194
- }, _types.CallDirection.OUTBOUND, undefined, line.lineId);
246
+ });
195
247
  expect(call).toBeTruthy();
196
248
  expect(call ? call.direction : undefined).toStrictEqual(_types.CallDirection.OUTBOUND);
197
249
  call === null || call === void 0 ? void 0 : call.end();
@@ -202,10 +254,10 @@ describe('Line Tests', function () {
202
254
  address: '+91 123 456 7890',
203
255
  type: _types.CallType.URI
204
256
  });
205
- expect(createCallSpy).toBeCalledOnceWith({
257
+ expect(createCallSpy).toBeCalledOnceWith(_types.CallDirection.OUTBOUND, undefined, line.lineId, {
206
258
  address: 'tel:+911234567890',
207
259
  type: 'uri'
208
- }, _types.CallDirection.OUTBOUND, undefined, line.lineId);
260
+ });
209
261
  expect(call).toBeTruthy();
210
262
  expect(call ? call.direction : undefined).toStrictEqual(_types.CallDirection.OUTBOUND);
211
263
  expect(call ? call.destination.address : undefined).toStrictEqual('tel:+911234567890');
@@ -217,10 +269,10 @@ describe('Line Tests', function () {
217
269
  address: '123-456-7890',
218
270
  type: _types.CallType.URI
219
271
  });
220
- expect(createCallSpy).toBeCalledOnceWith({
272
+ expect(createCallSpy).toBeCalledOnceWith(_types.CallDirection.OUTBOUND, undefined, line.lineId, {
221
273
  address: 'tel:1234567890',
222
274
  type: 'uri'
223
- }, _types.CallDirection.OUTBOUND, undefined, line.lineId);
275
+ });
224
276
  expect(call).toBeTruthy();
225
277
  expect(call ? call.direction : undefined).toStrictEqual(_types.CallDirection.OUTBOUND);
226
278
  expect(call ? call.destination.address : undefined).toStrictEqual('tel:1234567890');
@@ -247,8 +299,6 @@ describe('Line Tests', function () {
247
299
  });
248
300
  it('attempt to create call with incorrect number format 2', function (done) {
249
301
  expect.assertions(4);
250
- // There may be other listeners , which may create race
251
- line.removeAllListeners(_types2.LINE_EVENTS.ERROR);
252
302
  var createCallSpy = jest.spyOn(line.callManager, 'createCall');
253
303
  line.on(_types2.LINE_EVENTS.ERROR, function (error) {
254
304
  expect(error.message).toBe('An invalid phone number was detected. Check the number and try again.');
@@ -265,6 +315,18 @@ describe('Line Tests', function () {
265
315
  done(error);
266
316
  }
267
317
  });
318
+ it('attempt to create call with guest calling service indicator', function () {
319
+ expect.assertions(2);
320
+ var createCallSpy = jest.spyOn(line.callManager, 'createCall');
321
+
322
+ // Mocking the serviceData to have GUEST_CALLING indicator
323
+ line = new _.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types3.LOGGER.INFO, {
324
+ indicator: _types.ServiceIndicator.GUEST_CALLING
325
+ });
326
+ var call = line.makeCall();
327
+ expect(call).toBeTruthy();
328
+ expect(createCallSpy).toBeCalledWith(_types.CallDirection.OUTBOUND, undefined, expect.any(String));
329
+ });
268
330
  });
269
331
  });
270
332
  //# sourceMappingURL=line.test.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_asyncMutex","require","_testUtil","_registerFixtures","_common","_types","_types2","_","_interopRequireDefault","utils","_interopRequireWildcard","_SDKConnector","_constants","_types3","regUtils","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","ownKeys","_Object$keys","_Object$getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","_Object$getOwnPropertyDescriptors","_Object$defineProperties","describe","mutex","Mutex","webex","getTestUtilsWebex","SDKConnector","setWebex","defaultServiceData","indicator","ServiceIndicator","CALLING","domain","createRegistrationSpy","jest","spyOn","mobiusUris","filterMobiusUris","getMobiusDiscoveryResponse","URL","primaryMobiusUris","fn","primary","backupMobiusUris","backup","userId","internal","device","clientDeviceUri","url","handleErrorSpy","clearAllMocks","line","mockRegistrationBody","getMockDeviceInfo","discoveryBody","primaryUrl","concat","uris","registrationPayload","statusCode","body","beforeEach","Line","LOGGER","INFO","afterEach","clearAllTimers","useRealTimers","removeAllListeners","it","_asyncToGenerator2","_regenerator","mark","_callee","wrap","_callee$","_context","prev","next","useFakeTimers","request","mockReturnValue","expect","toBeCalledOnceWith","any","anything","getStatus","toEqual","RegistrationStatus","IDLE","register","getMockRequestTemplate","serviceData","uri","method","not","toBeCalled","ACTIVE","getActiveMobiusUrl","getLoggingLevel","getDeviceId","deviceId","mockClear","advanceTimersByTime","_promise","resolve","stop","_callee2","_callee2$","_context2","LINE_EVENTS","ERROR","mockRejectedValue","on","error","message","toBe","waitForMsecs","INACTIVE","file","REGISTRATION_FILE","_callee3","_callee3$","_context3","mockReturnValueOnce","deregister","createCallSpy","callManager","makeCall","address","type","CallType","URI","CallDirection","OUTBOUND","undefined","lineId","toBeTruthy","getCall","getCorrelationId","direction","toStrictEqual","end","destination","done","toBeUndefined","assertions"],"sources":["line.test.ts"],"sourcesContent":["import {Mutex} from 'async-mutex';\nimport {\n getMobiusDiscoveryResponse,\n getMockDeviceInfo,\n getMockRequestTemplate,\n getTestUtilsWebex,\n} from '../../common/testUtil';\nimport {URL} from '../registration/registerFixtures';\nimport {filterMobiusUris} from '../../common';\nimport {\n CallDirection,\n CallType,\n MobiusServers,\n RegistrationStatus,\n ServiceIndicator,\n WebexRequestPayload,\n} from '../../common/types';\nimport {LINE_EVENTS} from './types';\nimport Line from '.';\nimport * as utils from '../../common/Utils';\nimport SDKConnector from '../../SDKConnector';\nimport {REGISTRATION_FILE} from '../constants';\nimport {LOGGER} from '../../Logger/types';\nimport * as regUtils from '../registration/register';\n\ndescribe('Line Tests', () => {\n const mutex = new Mutex();\n const webex = getTestUtilsWebex();\n SDKConnector.setWebex(webex);\n\n const defaultServiceData = {indicator: ServiceIndicator.CALLING, domain: ''};\n const createRegistrationSpy = jest.spyOn(regUtils, 'createRegistration');\n\n const mobiusUris = filterMobiusUris(getMobiusDiscoveryResponse(), URL);\n const primaryMobiusUris = jest.fn(() => mobiusUris.primary);\n const backupMobiusUris = jest.fn(() => mobiusUris.backup);\n const userId = webex.internal.device.userId;\n const clientDeviceUri = webex.internal.device.url;\n\n const handleErrorSpy = jest.spyOn(utils, 'handleRegistrationErrors');\n\n jest.clearAllMocks();\n\n describe('Line Registration tests', () => {\n let line;\n const mockRegistrationBody = getMockDeviceInfo();\n\n const discoveryBody: MobiusServers = getMobiusDiscoveryResponse();\n const primaryUrl = `${discoveryBody.primary.uris[0]}/calling/web/`;\n\n const registrationPayload = <WebexRequestPayload>(<unknown>{\n statusCode: 200,\n body: mockRegistrationBody,\n });\n\n beforeEach(() => {\n line = new Line(\n userId,\n clientDeviceUri,\n mutex,\n primaryMobiusUris(),\n backupMobiusUris(),\n LOGGER.INFO\n );\n });\n\n afterEach(() => {\n jest.clearAllTimers();\n jest.clearAllMocks();\n jest.useRealTimers();\n line.removeAllListeners();\n });\n\n it('verify successful Registration cases and keepalive', async () => {\n jest.useFakeTimers();\n webex.request.mockReturnValue(registrationPayload);\n\n expect(createRegistrationSpy).toBeCalledOnceWith(\n webex,\n defaultServiceData,\n expect.any(Mutex),\n expect.anything(),\n LOGGER.INFO\n );\n expect(line.getStatus()).toEqual(RegistrationStatus.IDLE);\n await line.register();\n\n expect(webex.request).toBeCalledOnceWith({\n ...getMockRequestTemplate(),\n body: {\n userId,\n clientDeviceUri,\n serviceData: defaultServiceData,\n },\n uri: `${primaryUrl}device`,\n method: 'POST',\n });\n expect(handleErrorSpy).not.toBeCalled();\n\n expect(line.getStatus()).toEqual(RegistrationStatus.ACTIVE);\n expect(line.getActiveMobiusUrl()).toEqual(primaryUrl);\n expect(line.getLoggingLevel()).toEqual(LOGGER.INFO);\n expect(line.getDeviceId()).toEqual(mockRegistrationBody.device.deviceId);\n\n webex.request.mockClear();\n\n jest.advanceTimersByTime(30 * 1000);\n await Promise.resolve();\n\n expect(webex.request).toBeCalledOnceWith({\n ...getMockRequestTemplate(),\n uri: `${mockRegistrationBody.device.uri}/status`,\n method: 'POST',\n });\n jest.useRealTimers();\n });\n\n it('verify failure Registration cases all requests fail ', async () => {\n line.removeAllListeners(LINE_EVENTS.ERROR);\n\n webex.request.mockRejectedValue({\n statusCode: 401,\n });\n\n line.on(LINE_EVENTS.ERROR, (error) => {\n expect(error.message).toBe(\n 'User is unauthorized due to an expired token. Sign out, then sign back in.'\n );\n });\n\n expect(line.getStatus()).toBe(RegistrationStatus.IDLE);\n line.register();\n await utils.waitForMsecs(20);\n\n expect(line.getStatus()).toBe(RegistrationStatus.INACTIVE);\n expect(handleErrorSpy).toBeCalledOnceWith(\n expect.anything(),\n expect.anything(),\n {\n file: REGISTRATION_FILE,\n method: 'attemptRegistrationWithServers',\n },\n expect.anything()\n );\n });\n\n it('verify successful de-registration cases', async () => {\n webex.request.mockReturnValueOnce(registrationPayload);\n\n expect(line.getStatus()).toEqual(RegistrationStatus.IDLE);\n await line.register();\n expect(line.getStatus()).toEqual(RegistrationStatus.ACTIVE);\n\n await line.deregister();\n expect(line.getStatus()).toEqual(RegistrationStatus.IDLE);\n });\n });\n\n describe('Line calling tests', () => {\n let line;\n\n beforeEach(() => {\n line = new Line(\n userId,\n clientDeviceUri,\n mutex,\n primaryMobiusUris(),\n backupMobiusUris(),\n LOGGER.INFO\n );\n });\n\n afterEach(() => {\n jest.clearAllTimers();\n jest.clearAllMocks();\n jest.useRealTimers();\n line.removeAllListeners();\n });\n it('Return a successful call object while making call', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '5003', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(\n {address: 'tel:5003', type: 'uri'},\n CallDirection.OUTBOUND,\n undefined,\n line.lineId\n );\n expect(call).toBeTruthy();\n expect(line.getCall(call ? call.getCorrelationId() : '')).toBe(call);\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n call?.end();\n });\n\n it('Return a successful call object while making call to FAC codes', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '*25', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(\n {address: 'tel:*25', type: 'uri'},\n CallDirection.OUTBOUND,\n undefined,\n line.lineId\n );\n expect(call).toBeTruthy();\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n call?.end();\n });\n\n it('Remove spaces from dialled number while making call', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '+91 123 456 7890', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(\n {address: 'tel:+911234567890', type: 'uri'},\n CallDirection.OUTBOUND,\n undefined,\n line.lineId\n );\n expect(call).toBeTruthy();\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n expect(call ? call.destination.address : undefined).toStrictEqual('tel:+911234567890');\n call?.end();\n });\n\n it('Remove hyphen from dialled number while making call', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '123-456-7890', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(\n {address: 'tel:1234567890', type: 'uri'},\n CallDirection.OUTBOUND,\n undefined,\n line.lineId\n );\n expect(call).toBeTruthy();\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n expect(call ? call.destination.address : undefined).toStrictEqual('tel:1234567890');\n call?.end();\n });\n\n it('attempt to create call with incorrect number format 1', (done) => {\n // There may be other listeners , which may create race\n line.removeAllListeners(LINE_EVENTS.ERROR);\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n\n line.on(LINE_EVENTS.ERROR, (error) => {\n expect(error.message).toBe(\n 'An invalid phone number was detected. Check the number and try again.'\n );\n done();\n });\n try {\n const call = line.makeCall({address: 'select#$@^^', type: CallType.URI});\n\n expect(call).toBeUndefined();\n expect(createCallSpy).not.toBeCalledOnceWith({});\n } catch (error) {\n done(error);\n }\n });\n\n it('attempt to create call with incorrect number format 2', (done) => {\n expect.assertions(4);\n // There may be other listeners , which may create race\n line.removeAllListeners(LINE_EVENTS.ERROR);\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n\n line.on(LINE_EVENTS.ERROR, (error) => {\n expect(error.message).toBe(\n 'An invalid phone number was detected. Check the number and try again.'\n );\n done();\n });\n\n try {\n const call = line.makeCall({address: '+1@8883332505', type: CallType.URI});\n\n expect(call).toBeUndefined();\n expect(createCallSpy).not.toBeCalledOnceWith({});\n } catch (error) {\n done(error);\n }\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAMA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OA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CAAC;MAClD,CAAC,CAAC,OAAO+B,KAAK,EAAE;QACd8B,IAAI,CAAC9B,KAAK,CAAC;MACb;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_asyncMutex","require","_testUtil","_registerFixtures","_common","_types","_types2","_","_interopRequireDefault","utils","_interopRequireWildcard","_SDKConnector","_constants","_types3","regUtils","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","ownKeys","_Object$keys","_Object$getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","_Object$getOwnPropertyDescriptors","_Object$defineProperties","describe","mutex","Mutex","webex","getTestUtilsWebex","SDKConnector","setWebex","defaultServiceData","indicator","ServiceIndicator","CALLING","domain","createRegistrationSpy","jest","spyOn","mobiusUris","filterMobiusUris","getMobiusDiscoveryResponse","URL","primaryMobiusUris","fn","primary","backupMobiusUris","backup","userId","internal","device","clientDeviceUri","url","mockJwe","guestServiceData","GUEST_CALLING","guestName","handleErrorSpy","clearAllMocks","line","mockRegistrationBody","getMockDeviceInfo","discoveryBody","primaryUrl","concat","uris","registrationPayload","statusCode","body","beforeEach","Line","LOGGER","INFO","afterEach","clearAllTimers","useRealTimers","removeAllListeners","it","_asyncToGenerator2","_regenerator","mark","_callee","wrap","_callee$","_context","prev","next","useFakeTimers","request","mockReturnValue","expect","toBeCalledOnceWith","any","anything","undefined","getStatus","toEqual","RegistrationStatus","IDLE","register","getMockRequestTemplate","serviceData","uri","method","not","toBeCalled","ACTIVE","getActiveMobiusUrl","getLoggingLevel","getDeviceId","deviceId","mockClear","advanceTimersByTime","_promise","resolve","stop","_callee2","guestLine","_callee2$","_context2","jwe","_callee3","_callee3$","_context3","LINE_EVENTS","ERROR","mockRejectedValue","on","error","message","toBe","waitForMsecs","INACTIVE","file","REGISTRATION_FILE","_callee4","_callee4$","_context4","mockReturnValueOnce","deregister","createCallSpy","callManager","makeCall","address","type","CallType","URI","CallDirection","OUTBOUND","lineId","toBeTruthy","getCall","getCorrelationId","direction","toStrictEqual","end","destination","done","toBeUndefined","assertions","toBeCalledWith","String"],"sources":["line.test.ts"],"sourcesContent":["import {Mutex} from 'async-mutex';\nimport {\n getMobiusDiscoveryResponse,\n getMockDeviceInfo,\n getMockRequestTemplate,\n getTestUtilsWebex,\n} from '../../common/testUtil';\nimport {URL} from '../registration/registerFixtures';\nimport {filterMobiusUris} from '../../common';\nimport {\n CallDirection,\n CallType,\n MobiusServers,\n RegistrationStatus,\n ServiceIndicator,\n WebexRequestPayload,\n} from '../../common/types';\nimport {LINE_EVENTS} from './types';\nimport Line from '.';\nimport * as utils from '../../common/Utils';\nimport SDKConnector from '../../SDKConnector';\nimport {REGISTRATION_FILE} from '../constants';\nimport {LOGGER} from '../../Logger/types';\nimport * as regUtils from '../registration/register';\n\ndescribe('Line Tests', () => {\n const mutex = new Mutex();\n const webex = getTestUtilsWebex();\n SDKConnector.setWebex(webex);\n\n const defaultServiceData = {indicator: ServiceIndicator.CALLING, domain: ''};\n const createRegistrationSpy = jest.spyOn(regUtils, 'createRegistration');\n\n const mobiusUris = filterMobiusUris(getMobiusDiscoveryResponse(), URL);\n const primaryMobiusUris = jest.fn(() => mobiusUris.primary);\n const backupMobiusUris = jest.fn(() => mobiusUris.backup);\n const userId = webex.internal.device.userId;\n const clientDeviceUri = webex.internal.device.url;\n const mockJwe = 'mockJwe';\n const guestServiceData = {\n indicator: ServiceIndicator.GUEST_CALLING,\n domain: '',\n guestName: 'testUser',\n };\n\n const handleErrorSpy = jest.spyOn(utils, 'handleRegistrationErrors');\n\n jest.clearAllMocks();\n\n describe('Line Registration tests', () => {\n let line;\n const mockRegistrationBody = getMockDeviceInfo();\n\n const discoveryBody: MobiusServers = getMobiusDiscoveryResponse();\n const primaryUrl = `${discoveryBody.primary.uris[0]}/calling/web/`;\n\n const registrationPayload = <WebexRequestPayload>(<unknown>{\n statusCode: 200,\n body: mockRegistrationBody,\n });\n\n beforeEach(() => {\n line = new Line(\n userId,\n clientDeviceUri,\n mutex,\n primaryMobiusUris(),\n backupMobiusUris(),\n LOGGER.INFO\n );\n });\n\n afterEach(() => {\n jest.clearAllTimers();\n jest.clearAllMocks();\n jest.useRealTimers();\n line.removeAllListeners();\n });\n\n it('verify successful Registration cases and keepalive', async () => {\n jest.useFakeTimers();\n webex.request.mockReturnValue(registrationPayload);\n\n expect(createRegistrationSpy).toBeCalledOnceWith(\n webex,\n defaultServiceData,\n expect.any(Mutex),\n expect.anything(),\n LOGGER.INFO,\n undefined\n );\n expect(line.getStatus()).toEqual(RegistrationStatus.IDLE);\n await line.register();\n\n expect(webex.request).toBeCalledOnceWith({\n ...getMockRequestTemplate(),\n body: {\n userId,\n clientDeviceUri,\n serviceData: defaultServiceData,\n },\n uri: `${primaryUrl}device`,\n method: 'POST',\n });\n expect(handleErrorSpy).not.toBeCalled();\n\n expect(line.getStatus()).toEqual(RegistrationStatus.ACTIVE);\n expect(line.getActiveMobiusUrl()).toEqual(primaryUrl);\n expect(line.getLoggingLevel()).toEqual(LOGGER.INFO);\n expect(line.getDeviceId()).toEqual(mockRegistrationBody.device.deviceId);\n\n webex.request.mockClear();\n\n jest.advanceTimersByTime(30 * 1000);\n await Promise.resolve();\n\n expect(webex.request).toBeCalledOnceWith({\n ...getMockRequestTemplate(),\n uri: `${mockRegistrationBody.device.uri}/status`,\n method: 'POST',\n });\n jest.useRealTimers();\n });\n\n it('verify successful Registration cases and keepalive for a guest user', async () => {\n createRegistrationSpy.mockClear();\n const guestLine = new Line(\n userId,\n clientDeviceUri,\n mutex,\n primaryMobiusUris(),\n backupMobiusUris(),\n LOGGER.INFO,\n guestServiceData,\n mockJwe\n );\n jest.useFakeTimers();\n webex.request.mockReturnValue(registrationPayload);\n\n expect(createRegistrationSpy).toBeCalledOnceWith(\n webex,\n guestServiceData,\n expect.any(Mutex),\n expect.anything(),\n LOGGER.INFO,\n mockJwe\n );\n expect(guestLine.getStatus()).toEqual(RegistrationStatus.IDLE);\n await guestLine.register();\n\n expect(webex.request).toBeCalledOnceWith({\n ...getMockRequestTemplate(),\n body: {\n userId,\n clientDeviceUri,\n serviceData: {...guestServiceData, jwe: mockJwe},\n },\n uri: `${primaryUrl}device`,\n method: 'POST',\n });\n expect(handleErrorSpy).not.toBeCalled();\n\n expect(guestLine.getStatus()).toEqual(RegistrationStatus.ACTIVE);\n expect(guestLine.getActiveMobiusUrl()).toEqual(primaryUrl);\n expect(guestLine.getLoggingLevel()).toEqual(LOGGER.INFO);\n expect(guestLine.getDeviceId()).toEqual(mockRegistrationBody.device.deviceId);\n\n webex.request.mockClear();\n\n jest.advanceTimersByTime(30 * 1000);\n await Promise.resolve();\n\n expect(webex.request).toBeCalledOnceWith({\n ...getMockRequestTemplate(),\n uri: `${mockRegistrationBody.device.uri}/status`,\n method: 'POST',\n });\n jest.useRealTimers();\n });\n\n it('verify failure Registration cases all requests fail ', async () => {\n line.removeAllListeners(LINE_EVENTS.ERROR);\n\n webex.request.mockRejectedValue({\n statusCode: 401,\n });\n\n line.on(LINE_EVENTS.ERROR, (error) => {\n expect(error.message).toBe(\n 'User is unauthorized due to an expired token. Sign out, then sign back in.'\n );\n });\n\n expect(line.getStatus()).toBe(RegistrationStatus.IDLE);\n line.register();\n await utils.waitForMsecs(20);\n\n expect(line.getStatus()).toBe(RegistrationStatus.INACTIVE);\n expect(handleErrorSpy).toBeCalledOnceWith(\n expect.anything(),\n expect.anything(),\n {\n file: REGISTRATION_FILE,\n method: 'attemptRegistrationWithServers',\n },\n expect.anything()\n );\n });\n\n it('verify successful de-registration cases', async () => {\n webex.request.mockReturnValueOnce(registrationPayload);\n\n expect(line.getStatus()).toEqual(RegistrationStatus.IDLE);\n await line.register();\n expect(line.getStatus()).toEqual(RegistrationStatus.ACTIVE);\n\n await line.deregister();\n expect(line.getStatus()).toEqual(RegistrationStatus.IDLE);\n });\n });\n\n describe('Line calling tests', () => {\n let line;\n\n beforeEach(() => {\n line = new Line(\n userId,\n clientDeviceUri,\n mutex,\n primaryMobiusUris(),\n backupMobiusUris(),\n LOGGER.INFO\n );\n });\n\n afterEach(() => {\n jest.clearAllTimers();\n jest.clearAllMocks();\n jest.useRealTimers();\n line.removeAllListeners();\n });\n it('Return a successful call object while making call', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '5003', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(CallDirection.OUTBOUND, undefined, line.lineId, {\n address: 'tel:5003',\n type: 'uri',\n });\n expect(call).toBeTruthy();\n expect(line.getCall(call ? call.getCorrelationId() : '')).toBe(call);\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n call?.end();\n });\n\n it('Return a successful call object while making call to FAC codes', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '*25', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(CallDirection.OUTBOUND, undefined, line.lineId, {\n address: 'tel:*25',\n type: 'uri',\n });\n expect(call).toBeTruthy();\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n call?.end();\n });\n\n it('Remove spaces from dialled number while making call', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '+91 123 456 7890', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(CallDirection.OUTBOUND, undefined, line.lineId, {\n address: 'tel:+911234567890',\n type: 'uri',\n });\n expect(call).toBeTruthy();\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n expect(call ? call.destination.address : undefined).toStrictEqual('tel:+911234567890');\n call?.end();\n });\n\n it('Remove hyphen from dialled number while making call', () => {\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n const call = line.makeCall({address: '123-456-7890', type: CallType.URI});\n\n expect(createCallSpy).toBeCalledOnceWith(CallDirection.OUTBOUND, undefined, line.lineId, {\n address: 'tel:1234567890',\n type: 'uri',\n });\n expect(call).toBeTruthy();\n expect(call ? call.direction : undefined).toStrictEqual(CallDirection.OUTBOUND);\n expect(call ? call.destination.address : undefined).toStrictEqual('tel:1234567890');\n call?.end();\n });\n\n it('attempt to create call with incorrect number format 1', (done) => {\n // There may be other listeners , which may create race\n line.removeAllListeners(LINE_EVENTS.ERROR);\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n\n line.on(LINE_EVENTS.ERROR, (error) => {\n expect(error.message).toBe(\n 'An invalid phone number was detected. Check the number and try again.'\n );\n done();\n });\n try {\n const call = line.makeCall({address: 'select#$@^^', type: CallType.URI});\n\n expect(call).toBeUndefined();\n expect(createCallSpy).not.toBeCalledOnceWith({});\n } catch (error) {\n done(error);\n }\n });\n\n it('attempt to create call with incorrect number format 2', (done) => {\n expect.assertions(4);\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n\n line.on(LINE_EVENTS.ERROR, (error) => {\n expect(error.message).toBe(\n 'An invalid phone number was detected. Check the number and try again.'\n );\n done();\n });\n\n try {\n const call = line.makeCall({address: '+1@8883332505', type: CallType.URI});\n\n expect(call).toBeUndefined();\n expect(createCallSpy).not.toBeCalledOnceWith({});\n } catch (error) {\n done(error);\n }\n });\n\n it('attempt to create call with guest calling service indicator', () => {\n expect.assertions(2);\n const createCallSpy = jest.spyOn(line.callManager, 'createCall');\n\n // Mocking the serviceData to have GUEST_CALLING indicator\n line = new Line(\n userId,\n clientDeviceUri,\n mutex,\n primaryMobiusUris(),\n backupMobiusUris(),\n LOGGER.INFO,\n {indicator: ServiceIndicator.GUEST_CALLING}\n );\n const call = line.makeCall();\n\n expect(call).toBeTruthy();\n expect(createCallSpy).toBeCalledWith(CallDirection.OUTBOUND, undefined, expect.any(String));\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OA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AE,eAAe;UAAEC,IAAI,EAAEC,eAAQ,CAACC;QAAG,CAAC,CAAC;QAE1ExD,MAAM,CAACpF,IAAI,CAAC,CAACwJ,aAAa,CAAC,CAAC;QAC5BpE,MAAM,CAACkD,aAAa,CAAC,CAACpC,GAAG,CAACb,kBAAkB,CAAC,CAAC,CAAC,CAAC;MAClD,CAAC,CAAC,OAAOqC,KAAK,EAAE;QACd6B,IAAI,CAAC7B,KAAK,CAAC;MACb;IACF,CAAC,CAAC;IAEFnD,EAAE,CAAC,6DAA6D,EAAE,YAAM;MACtEa,MAAM,CAACqE,UAAU,CAAC,CAAC,CAAC;MACpB,IAAMnB,aAAa,GAAGvG,IAAI,CAACC,KAAK,CAACqB,IAAI,CAACkF,WAAW,EAAE,YAAY,CAAC;;MAEhE;MACAlF,IAAI,GAAG,IAAIW,SAAI,CACbtB,MAAM,EACNG,eAAe,EACf1B,KAAK,EACLkB,iBAAiB,CAAC,CAAC,EACnBG,gBAAgB,CAAC,CAAC,EAClByB,cAAM,CAACC,IAAI,EACX;QAACxC,SAAS,EAAEC,uBAAgB,CAACsB;MAAa,CAC5C,CAAC;MACD,IAAMjD,IAAI,GAAGqD,IAAI,CAACmF,QAAQ,CAAC,CAAC;MAE5BpD,MAAM,CAACpF,IAAI,CAAC,CAACgJ,UAAU,CAAC,CAAC;MACzB5D,MAAM,CAACkD,aAAa,CAAC,CAACoB,cAAc,CAACb,oBAAa,CAACC,QAAQ,EAAEtD,SAAS,EAAEJ,MAAM,CAACE,GAAG,CAACqE,MAAM,CAAC,CAAC;IAC7F,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["LINE_EVENTS","exports"],"sources":["types.ts"],"sourcesContent":["import {LineEventTypes} from '../../Events/types';\nimport {Eventing} from '../../Events/impl';\nimport {IRegistration} from '../registration/types';\nimport {LineError} from '../../Errors/catalog/LineError';\nimport {\n CallDetails,\n CorrelationId,\n IDeviceInfo,\n MobiusDeviceId,\n RegistrationStatus,\n} from '../../common/types';\nimport {ICall} from '../calling/types';\n\nexport enum LINE_EVENTS {\n CONNECTING = 'connecting',\n ERROR = 'error',\n RECONNECTED = 'reconnected',\n RECONNECTING = 'reconnecting',\n REGISTERED = 'registered',\n UNREGISTERED = 'unregistered',\n INCOMING_CALL = 'line:incoming_call',\n}\n\n/**\n * Represents an interface for managing a telephony line.\n */\nexport interface ILine extends Eventing<LineEventTypes> {\n /**\n * The unique identifier of the user associated with the line.\n */\n userId: string;\n\n /**\n * The URI of the client device associated with the line.\n */\n clientDeviceUri: string;\n\n /**\n * The unique identifier of the line.\n */\n lineId: string;\n\n /**\n * The optional Mobius device identifier associated with the line.\n */\n mobiusDeviceId?: string;\n\n /**\n * The phone number associated with the line.\n */\n phoneNumber?: string;\n\n /**\n * The extension number associated with the line.\n */\n extension?: string;\n\n /**\n * An array of SIP addresses associated with the line.\n */\n sipAddresses?: string[];\n\n /**\n * The voicemail number associated with the line.\n */\n voicemail?: string;\n\n /**\n * The timestamp when the line was last seen.\n */\n lastSeen?: string;\n\n /**\n * The interval for sending keep-alive messages for the line.\n */\n keepaliveInterval?: number;\n\n /**\n * The interval for sending call keep-alive messages for the line.\n */\n callKeepaliveInterval?: number;\n\n /**\n * The minimum rehoming interval for the line.\n */\n rehomingIntervalMin?: number;\n\n /**\n * The maximum rehoming interval for the line.\n */\n rehomingIntervalMax?: number;\n\n /**\n * The voice portal number associated with the line.\n */\n voicePortalNumber?: number;\n\n /**\n * The voice portal extension associated with the line.\n */\n voicePortalExtension?: number;\n\n /**\n * The registration information for the line as {@link IRegistration}.\n */\n registration: IRegistration;\n\n /**\n * Registers the line.\n */\n register(): void;\n\n /**\n * Deregisters the line.\n */\n deregister(): void;\n\n /**\n * Retrieves the active Mobius server URL associated with the line.\n *\n */\n getActiveMobiusUrl(): string;\n\n /**\n * Retrieves the registration status of the line as {@link MobiusStatus}.\n *\n */\n getStatus(): RegistrationStatus;\n\n /**\n * Retrieves the device identifier associated with the line as {@link MobiusDeviceId},\n * or `undefined` if no device is associated.\n *\n */\n getDeviceId(): MobiusDeviceId | undefined;\n\n /**\n * Emits line-related events.\n *\n * @param event - The line event to emit.\n * @param deviceInfo - Additional device information (optional).\n * @param lineError - Information about line-related errors (optional).\n *\n * @example\n * ```typescript\n * line.lineEmitter(LINE_EVENTS.UNREGISTERED);\n * ```\n * @ignore\n */\n lineEmitter: (event: LINE_EVENTS, deviceInfo?: IDeviceInfo, lineError?: LineError) => void;\n\n /**\n * Initiates a call to the specified destination.\n *\n * @param dest - The call details including destination information.\n *\n * @example\n * ```typescript\n * const callDetails : CallDetails = {type: 'uri', address: 'example@webex.com'};\n * const callObj: ICall = line.makeCall(callDetails);\n * ```\n */\n makeCall(dest: CallDetails): ICall | undefined;\n\n /**\n * Retrieves a call object based on the provided correlation identifier.\n *\n * @param correlationId - The correlation identifier of the call.\n * @example\n * ```typescript\n * const callObj: ICall = line.getCall(correlationId);\n * ```\n */\n getCall(correlationId: CorrelationId): ICall;\n}\n\nexport type LineEmitterCallback = (\n event: LINE_EVENTS,\n deviceInfo?: IDeviceInfo,\n clientError?: LineError\n) => void;\n\nexport type LineErrorEmitterCallback = (err: LineError, finalError?: boolean) => void;\n"],"mappings":";;;;;;;IAaYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAUvB;AACA;AACA"}
1
+ {"version":3,"names":["LINE_EVENTS","exports"],"sources":["types.ts"],"sourcesContent":["import {LineEventTypes} from '../../Events/types';\nimport {Eventing} from '../../Events/impl';\nimport {IRegistration} from '../registration/types';\nimport {LineError} from '../../Errors/catalog/LineError';\nimport {\n CallDetails,\n CorrelationId,\n IDeviceInfo,\n MobiusDeviceId,\n RegistrationStatus,\n} from '../../common/types';\nimport {ICall} from '../calling/types';\n\nexport enum LINE_EVENTS {\n CONNECTING = 'connecting',\n ERROR = 'error',\n RECONNECTED = 'reconnected',\n RECONNECTING = 'reconnecting',\n REGISTERED = 'registered',\n UNREGISTERED = 'unregistered',\n INCOMING_CALL = 'line:incoming_call',\n}\n\n/**\n * Represents an interface for managing a telephony line.\n */\nexport interface ILine extends Eventing<LineEventTypes> {\n /**\n * The unique identifier of the user associated with the line.\n */\n userId: string;\n\n /**\n * The URI of the client device associated with the line.\n */\n clientDeviceUri: string;\n\n /**\n * The unique identifier of the line.\n */\n lineId: string;\n\n /**\n * The optional Mobius device identifier associated with the line.\n */\n mobiusDeviceId?: string;\n\n /**\n * The phone number associated with the line.\n */\n phoneNumber?: string;\n\n /**\n * The extension number associated with the line.\n */\n extension?: string;\n\n /**\n * An array of SIP addresses associated with the line.\n */\n sipAddresses?: string[];\n\n /**\n * The voicemail number associated with the line.\n */\n voicemail?: string;\n\n /**\n * The timestamp when the line was last seen.\n */\n lastSeen?: string;\n\n /**\n * The interval for sending keep-alive messages for the line.\n */\n keepaliveInterval?: number;\n\n /**\n * The interval for sending call keep-alive messages for the line.\n */\n callKeepaliveInterval?: number;\n\n /**\n * The minimum rehoming interval for the line.\n */\n rehomingIntervalMin?: number;\n\n /**\n * The maximum rehoming interval for the line.\n */\n rehomingIntervalMax?: number;\n\n /**\n * The voice portal number associated with the line.\n */\n voicePortalNumber?: number;\n\n /**\n * The voice portal extension associated with the line.\n */\n voicePortalExtension?: number;\n\n /**\n * The registration information for the line as {@link IRegistration}.\n */\n registration: IRegistration;\n\n /**\n * Registers the line.\n */\n register(): void;\n\n /**\n * Deregisters the line.\n */\n deregister(): void;\n\n /**\n * Retrieves the active Mobius server URL associated with the line.\n *\n */\n getActiveMobiusUrl(): string;\n\n /**\n * Retrieves the registration status of the line as {@link MobiusStatus}.\n *\n */\n getStatus(): RegistrationStatus;\n\n /**\n * Retrieves the device identifier associated with the line as {@link MobiusDeviceId},\n * or `undefined` if no device is associated.\n *\n */\n getDeviceId(): MobiusDeviceId | undefined;\n\n /**\n * Emits line-related events.\n *\n * @param event - The line event to emit.\n * @param deviceInfo - Additional device information (optional).\n * @param lineError - Information about line-related errors (optional).\n *\n * @example\n * ```typescript\n * line.lineEmitter(LINE_EVENTS.UNREGISTERED);\n * ```\n * @ignore\n */\n lineEmitter: (event: LINE_EVENTS, deviceInfo?: IDeviceInfo, lineError?: LineError) => void;\n\n /**\n * Initiates a call to the specified destination.\n *\n * @param dest - The call details including destination information.\n *\n * @example\n * ```typescript\n * const callDetails : CallDetails = {type: 'uri', address: 'example@webex.com'};\n * const callObj: ICall = line.makeCall(callDetails);\n * ```\n */\n makeCall(dest?: CallDetails): ICall | undefined;\n\n /**\n * Retrieves a call object based on the provided correlation identifier.\n *\n * @param correlationId - The correlation identifier of the call.\n * @example\n * ```typescript\n * const callObj: ICall = line.getCall(correlationId);\n * ```\n */\n getCall(correlationId: CorrelationId): ICall;\n}\n\nexport type LineEmitterCallback = (\n event: LINE_EVENTS,\n deviceInfo?: IDeviceInfo,\n clientError?: LineError\n) => void;\n\nexport type LineErrorEmitterCallback = (err: LineError, finalError?: boolean) => void;\n"],"mappings":";;;;;;;IAaYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAUvB;AACA;AACA"}