@telegenta/webclient 2.0.12 → 3.0.0

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 (104) hide show
  1. package/README.md +102 -81
  2. package/demos/add_phone_number.html +8 -7
  3. package/demos/calldata_available.html +5 -5
  4. package/demos/embedded_config.html +3 -3
  5. package/demos/event_client.html +4 -4
  6. package/demos/phone_client.html +16 -10
  7. package/demos/styles.css +0 -0
  8. package/dist/telegenta.js +3627 -0
  9. package/dist/telegenta.min.js +1 -0
  10. package/docs/EventClient.html +3 -1093
  11. package/docs/InvalidMediaDevice.html +3 -0
  12. package/docs/InvalidOptions.html +3 -0
  13. package/docs/InvalidParameter.html +3 -0
  14. package/docs/LogHandler.html +7 -0
  15. package/docs/MediaNotPrepared.html +3 -0
  16. package/docs/NoActiveSession.html +3 -0
  17. package/docs/NotAllowed.html +3 -0
  18. package/docs/NotReady.html +3 -0
  19. package/docs/Phone.html +4 -2837
  20. package/docs/Request.html +3 -0
  21. package/docs/Requestor.html +3 -0
  22. package/docs/Session.html +3 -2599
  23. package/docs/UnableToConnect.html +3 -0
  24. package/docs/data/search.json +1 -0
  25. package/docs/event-client.js.html +346 -0
  26. package/docs/exceptions.js.html +94 -0
  27. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  28. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  29. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  30. package/docs/global.html +5 -4950
  31. package/docs/index.html +3 -66
  32. package/docs/logger.js.html +106 -0
  33. package/docs/phone-client.js.html +2155 -0
  34. package/docs/requestor.js.html +223 -0
  35. package/docs/scripts/core.js +726 -0
  36. package/docs/scripts/core.min.js +23 -0
  37. package/docs/scripts/resize.js +90 -0
  38. package/docs/scripts/search.js +265 -0
  39. package/docs/scripts/search.min.js +6 -0
  40. package/docs/scripts/{prettify → third-party}/Apache-License-2.0.txt +202 -202
  41. package/docs/scripts/third-party/fuse.js +9 -0
  42. package/docs/scripts/third-party/hljs-line-num-original.js +369 -0
  43. package/docs/scripts/third-party/hljs-line-num.js +1 -0
  44. package/docs/scripts/third-party/hljs-original.js +5171 -0
  45. package/docs/scripts/third-party/hljs.js +1 -0
  46. package/docs/scripts/third-party/popper.js +5 -0
  47. package/docs/scripts/third-party/tippy.js +1 -0
  48. package/docs/scripts/third-party/tocbot.js +672 -0
  49. package/docs/scripts/third-party/tocbot.min.js +1 -0
  50. package/docs/styles/clean-jsdoc-theme-base.css +1159 -0
  51. package/docs/styles/clean-jsdoc-theme-dark.css +412 -0
  52. package/docs/styles/clean-jsdoc-theme-light.css +482 -0
  53. package/docs/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  54. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  55. package/docs/styles/clean-jsdoc-theme.min.css +1 -0
  56. package/package.json +46 -34
  57. package/babel.config.js +0 -16
  58. package/browser/telegenta.min.js +0 -1
  59. package/demos/telegenta.min.js +0 -1
  60. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  61. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  62. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  63. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  64. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  65. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  66. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  67. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  68. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  69. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  70. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  71. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  72. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  73. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  74. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  75. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  76. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  77. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  78. package/docs/fonts/OpenSans-Semibold-webfont.eot +0 -0
  79. package/docs/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  80. package/docs/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  81. package/docs/fonts/OpenSans-Semibold-webfont.woff +0 -0
  82. package/docs/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  83. package/docs/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  84. package/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  85. package/docs/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  86. package/docs/scripts/linenumber.js +0 -25
  87. package/docs/scripts/prettify/lang-css.js +0 -2
  88. package/docs/scripts/prettify/prettify.js +0 -28
  89. package/docs/styles/jsdoc-default.css +0 -692
  90. package/docs/styles/prettify-jsdoc.css +0 -111
  91. package/docs/styles/prettify-tomorrow.css +0 -132
  92. package/embedded_client/embedded_phone.js +0 -325
  93. package/embedded_client/index.html +0 -201
  94. package/embedded_client/server.php +0 -28
  95. package/embedded_client/styles.css +0 -310
  96. package/embedded_client/tiny_rest_client.php +0 -73
  97. package/embedded_client/webphone_sprites.png +0 -0
  98. package/es5/event-client.js +0 -277
  99. package/es5/index.js +0 -44
  100. package/es5/phone-client.js +0 -1336
  101. package/src/event-client.js +0 -1
  102. package/src/index.js +0 -10
  103. package/src/phone-client.js +0 -1
  104. package/webpack.config.js +0 -39
@@ -1,1336 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Session = exports.Phone = void 0;
7
-
8
- var _events = _interopRequireDefault(require("events"));
9
-
10
- var _jssip = _interopRequireDefault(require("jssip"));
11
-
12
- var _common = require("@telegenta/common");
13
-
14
- var _eventClient = require("./event-client");
15
-
16
- var _camelcaseKeys = _interopRequireDefault(require("camelcase-keys"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- const a0_0x35184d = a0_0x2d29;
21
-
22
- (function (_0x1a3c78, _0x1542f9) {
23
- const _0x2ebe6c = a0_0x2d29,
24
- _0x53f287 = _0x1a3c78();
25
-
26
- while (!![]) {
27
- try {
28
- const _0xfed1c5 = -parseInt(_0x2ebe6c(0x206)) / 0x1 + -parseInt(_0x2ebe6c(0xf5)) / 0x2 + -parseInt(_0x2ebe6c(0x182)) / 0x3 + parseInt(_0x2ebe6c(0x1f3)) / 0x4 + -parseInt(_0x2ebe6c(0x23c)) / 0x5 + -parseInt(_0x2ebe6c(0x1a6)) / 0x6 * (-parseInt(_0x2ebe6c(0x269)) / 0x7) + parseInt(_0x2ebe6c(0xdf)) / 0x8 * (parseInt(_0x2ebe6c(0xe2)) / 0x9);
29
-
30
- if (_0xfed1c5 === _0x1542f9) break;else _0x53f287['push'](_0x53f287['shift']());
31
- } catch (_0x566ab1) {
32
- _0x53f287['push'](_0x53f287['shift']());
33
- }
34
- }
35
- })(a0_0x29ff, 0x44d7e);
36
-
37
- function a0_0x2d29(_0x3cab44, _0x4a422b) {
38
- const _0x29ff42 = a0_0x29ff();
39
-
40
- return a0_0x2d29 = function a0_0x2d29(_0x2d29a8, _0x31a60e) {
41
- _0x2d29a8 = _0x2d29a8 - 0xc4;
42
- let _0x1624f7 = _0x29ff42[_0x2d29a8];
43
- return _0x1624f7;
44
- }, a0_0x2d29(_0x3cab44, _0x4a422b);
45
- }
46
-
47
- const options = {
48
- 'wssServer': a0_0x35184d(0x272),
49
- 'eventServer': a0_0x35184d(0x11b),
50
- 'provisionToken': null,
51
- 'authorizationUsername': null,
52
- 'password': null,
53
- 'callToken': null,
54
- 'register': !![],
55
- 'iceGatherTimeout': 0xbb8,
56
- 'playSignalTones': !![],
57
- 'logger': null,
58
- 'logLevel': 0x3,
59
- 'connectEventService': ![],
60
- 'useCallDataInfoEvent': ![],
61
- 'toneVolume': 0.3,
62
- 'autoBusyIncoming': !![],
63
- 'autoRemoveSessionTime': 0xbb8,
64
- 'playRingOnIncoming': !![],
65
- 'playCallInitializedTone': ![]
66
- },
67
- DTMF_FREQUENCY_TABLE = {
68
- '1': [0x4b9, 0x2b9],
69
- '2': [0x538, 0x2b9],
70
- '3': [0x5c5, 0x2b9],
71
- 'a': [0x661, 0x2b9],
72
- '4': [0x4b9, 0x302],
73
- '5': [0x538, 0x302],
74
- '6': [0x5c5, 0x302],
75
- 'b': [0x661, 0x302],
76
- '7': [0x4b9, 0x354],
77
- '8': [0x538, 0x354],
78
- '9': [0x5c5, 0x354],
79
- 'c': [0x661, 0x354],
80
- '*': [0x4b9, 0x3ad],
81
- '0': [0x538, 0x3ad],
82
- '#': [0x5c5, 0x3ad],
83
- 'd': [0x661, 0x3ad]
84
- },
85
- ST_TEMP_UNAVAIL = [{
86
- 'd': 0xfa,
87
- 'f1': 0x1a9,
88
- 'f2': 0x0,
89
- 'g': 0xfa
90
- }],
91
- ST_BUSY = [{
92
- 'd': 0x1f4,
93
- 'f1': 0x1a9,
94
- 'f2': 0x0,
95
- 'g': 0x1f4
96
- }],
97
- ST_INVALID_NUMBER = [{
98
- 'd': 0x14d,
99
- 'f1': 0x3b6,
100
- 'f2': 0x0,
101
- 'g': 0x0
102
- }, {
103
- 'd': 0x14d,
104
- 'f1': 0x578,
105
- 'f2': 0x0,
106
- 'g': 0x0
107
- }, {
108
- 'd': 0x14d,
109
- 'f1': 0x708,
110
- 'f2': 0x0,
111
- 'g': 0x3e8
112
- }],
113
- ST_CALLINIT = [{
114
- 'd': 0xc8,
115
- 'f1': 0x1f4,
116
- 'f2': 0x0,
117
- 'g': 0x0
118
- }, {
119
- 'd': 0xc8,
120
- 'f1': 0x2bc,
121
- 'f2': 0x0,
122
- 'g': 0x1388
123
- }],
124
- ST_RINGBACK = [{
125
- 'd': 0x3e8,
126
- 'f1': 0x1a9,
127
- 'f2': 0x0,
128
- 'g': 0xfa0
129
- }],
130
- ST_INCOMING = [{
131
- 'd': 0x96,
132
- 'f1': 0x190,
133
- 'f2': 0x0,
134
- 'g': 0x0
135
- }, {
136
- 'd': 0x96,
137
- 'f1': 0x258,
138
- 'f2': 0x0,
139
- 'g': 0x0
140
- }, {
141
- 'd': 0x96,
142
- 'f1': 0x190,
143
- 'f2': 0x0,
144
- 'g': 0x0
145
- }, {
146
- 'd': 0x96,
147
- 'f1': 0x258,
148
- 'f2': 0x0,
149
- 'g': 0x0
150
- }, {
151
- 'd': 0x96,
152
- 'f1': 0x190,
153
- 'f2': 0x0,
154
- 'g': 0x0
155
- }, {
156
- 'd': 0x96,
157
- 'f1': 0x258,
158
- 'f2': 0x0,
159
- 'g': 0xbb8
160
- }];
161
-
162
- function a0_0x29ff() {
163
- const _0x1775a6 = ['X-Record:\x20', 'activeDuration', 'Session\x20state:\x20', 'Exception\x20in\x20call\x20quality\x20report\x20update\x20event:\x20', 'Subscribe\x20failed:\x20', 'requestFailed', 'isOnHold', 'length', '_sessionCounter', 'jitter', 'Call\x20is\x20not\x20correct\x20type\x20(listen)', 'getStats', 'value', '450824ffeZKc', 'X-MS', 'Audio\x20API\x20not\x20supported\x20by\x20this\x20browser', 'remoteAudioElement', 'ontrack', 'stream', 'cause', 'Error\x20starting\x20call:', 'replace', 'incomingCall', 'connected', 'inboundJitter', 'Error', 'stopTone', '_webRTCSession', 'muted', '_toneAudioElement', '_fireWhisperModeChangeEvent', 'newInfo', '\x20on\x20media\x20switch\x20', 'Call\x20is\x20being\x20prerecorded', '\x20for\x20', 'NORMAL', 'INVALID_NUMBER', 'requestSucceeded', 'now', 'Exception\x20in\x20callEnded\x20event:\x20', 'Hanging\x20up\x20call\x20with\x20disposition\x20', 'wssServer', '_toneTimer', 'explicitShortCallerId', 'Starting\x20phone', 'extraHeaders', 'toString', 'inboundPacketsLost', 'Call\x20direction\x20is\x20INBOUND', 'mute', 'We\x20now\x20have\x20', 'options', 'effectiveLatency', 'outbound-rtp', 'response', '_callEndTime', 'muteMic', 'ICE\x20Timeout\x20(', 'Playing\x20repeated\x20tone,\x20pos\x20=\x20', '_answerCallTimer', 'answer', 'authorizationUsername', 'answerCallTimeout', 'UNKNOWN', 'reason_phrase', 'X-RMS:\x20', 'Other\x20sessions\x20exist\x20but\x20media\x20switch\x20address\x20is\x20invalid', '1786330oxpWBa', '_fireHoldStateEvent', 'Subscription\x20successful\x20ID\x20=\x20', '_toneStreamNode', 'succeeded', 'BARRED', 'OUTBOUND', 'isMuted', 'DISCONNECTED', 'Not\x20Found', '\x20days', 'error', 'Setting\x20answer\x20call\x20timeout\x20to:\x20', 'sessionStateChange', 'message', 'hasMediaPermissionError', 'sessions', 'Exception\x20in\x20recordingStateChange\x20event:\x20', '_fireMuteStateEvent', 'dtmf', 'warning', 'CONNECTING', 'createMediaStreamDestination', 'from', 'recordings', '_fireCallEndedEvent', 'update', 'session', 'info', 'keys', 'No\x20active\x20session,\x20ignoring\x20answer\x20call\x20timeout', 'toggleHold', 'Request\x20stop\x20recording', '_manualDisposition', 'autoRemoveSessionTime', 'browserSupported', 'NO_ANSWER', 'display_name', 'No\x20call\x20recording\x20started\x20yet', 'once', 'sendDTMF', 'UNREGISTERED', 'InvalidParameter', '_currentReport', 'Exception\x20in\x20hold\x20state\x20change\x20event:\x20', '687813QgNwDG', 'createUUID', 'substr', 'prepareMedia', 'outgoing', 'Unable\x20to\x20connect\x20phone\x20websocket:\x20', 'unmuteMic', 'WebSocketInterface', 'playback', 'wss://api.telegenta.com/sip/', '_connection', 'call', 'rFactor', 'register', 'log', 'remote', 'Bad', 'accepted', 'Mute\x20mic\x20while\x20sending\x20DTMF', 'answerDurationStr', 'Hanging\x20up\x20call', 'ON_HOLD', '_startRTCPStatsUpdateTimer', 'Exception\x20in\x20sessionCreated\x20event:\x20', 'createGain', 'Transfer\x20completed\x20successfully', 'debug', 'Rejecting\x20call', '_originName', 'start', 'destinationNumber', 'Missing\x20call\x20token', '_repeatToneActive', 'createOscillator', '_callFinished', 'state', 'Exception\x20in\x20whisper\x20mode\x20change\x20event:\x20', '_oscillator1', 'disconnected', 'Hold\x20call', 'autoBusyIncoming', 'X-RMS:\x20sip:', '7042632aiJmIA', 'remote-inbound-rtp', 'Start\x20media\x20output\x20(track):', '9SdzhHl', 'terminate', 'Repeating\x20tone\x20sequence\x20started', '_endRepeatTone', 'playSignalTones', 'call_command', 'roundTripTime', 'Rejected', 'outboundPacketLossPct', 'srcObject', '_iceCandidateTimer', 'ruri', 'outboundBytesSent', '_callBeginTime', 'packetsReceived', '_sessionTerminated', 'ready', 'getHeader', 'MediaNotPrepared', '536998hPsqqu', 'unmute', 'activeDurationStr', 'REGISTRATION_FAILED', 'srflx', 'bind', '_answerCallTimeout', 'X-P-UUID', 'push', '_checkForConnectingCalls', 'createElement', 'outboundPacketsSent', '_request', 'callDataInfo', 'ACTIVE', 'ended', '__containerId', 'Unable\x20to\x20disconnect\x20event\x20client', 'Exception\x20in\x20connectionStateChange\x20event:\x20', 'uuid', 'split', 'unregistered', '_initWebRTCSession', 'hasOwnProperty', 'Exception\x20in\x20incomingCall\x20event:\x20', 'PROGRESS', '_calcReportMetrics', 'inbound-rtp', 'PLAYBACK', '_mediaSwitch', 'INFO', 'Connection\x20state:\x20', 'Got\x20ICE\x20candidate:\x20', '_durationUpdTimerObj', '_isRecording', 'Record:\x20off', 'reinvite', 'setWhisperMode', 'wss://api.telegenta.com/es/', 'Setting\x20destination\x20number\x20to:\x20', 'WebRTCSession\x20object:', 'user', 'Missing\x20username', '_recordingError', 'Received\x20remote\x20call\x20data\x20info', 'bytesSent', 'bytesReceived', 'Accepting\x20ICE\x20candidate:\x20', 'sessionRemoved', 'direction', 'event_server', 'Fair', '_activeSessions', '_checkMediaPermission', '_isOnHold', 'sip:', 'answerDuration', 'iceGatherTimeout', '_callAnswerTime', 'qualityString', 'Phone\x20is\x20not\x20started', 'parse', 'local', '_originatingNumber', 'Event\x20service\x20not\x20enabled', '_repeatToneSequence', 'toISOString', 'subscribe', 'Exception\x20in\x20sessionRemoved\x20event:\x20', 'listen', 'Poor', '_sessionState', 'relatedAddress', 'Created\x20new\x20outbound\x20session\x20to:\x20', '\x20sessions:', '_fireIncomingCallEvent', 'Holding\x20all\x20active\x20sessions', 'toneVolume', 'mos', '\x20because\x20there\x20is\x20already\x20active\x20calls', 'candidate', '_oscillator2', '\x20ms)\x20reached', '_initToneGenerator', 'Unable\x20to\x20make\x20new\x20calls\x20while\x20others\x20are\x20connecting', '_callUUID', 'password', 'NotReady', 'Requesting\x20call\x20grouping\x20on\x20media\x20switch\x20', 'registered', 'Exception\x20in\x20sessionStateChange\x20event:', 'inboundBytesReceived', 'CONNECTED', 'request', 'status_code', '_options', 'Recording\x20stopped\x20failed:\x20', 'connectionStateChange', '_startRepeatTone', 'playTone', '_repeatToneSequencePos', '\x20=>\x20', 'values', 'getUserMedia', 'sessionCreated', '_UA', '_mediaPermission', 'stopRecording', 'failed', 'X-P-UUID:\x20', 'transfer', 'wss_token', 'Media\x20switch\x20handling\x20call:\x20', 'LOGLVL', 'stun:stun.l.google.com:19302', 'Successfully\x20started\x20phone', 'UnableToConnect', 'Good', 'createDurationString', 'startRecording', 'NotAllowed', '_toneGainProcessor', 'Unavailable', 'disable', '_phone', 'Record\x20parameter\x20must\x20be\x20a\x20number', 'newRTCSession', 'mediaSwitchURI', 'holdAllCalls', 'Transferring\x20', '_fireRecordingStateEvent', 'Transfer\x20failed:\x20', 'level', 'autoplay', '@telegenta.com', 'LogHandler', 'Using\x20provisioning\x20token\x20authorization', '_addSession', 'assign', 'packetsSent', 'application/info', '847404PyNCDH', 'TERMINATED', '_fireCallDataInfoEvent', 'unhold', 'Session\x20reinvite', 'reject', 'inboundPacketLossPct', '_removeSession', 'Session\x20update', 'Phone\x20already\x20started,\x20stopping\x20first', 'TEMP_UNAVAIL', '_eventClient', 'calldata_available', '_connectionState', 'Session\x20', 'wss_server', 'INCOMING', 'incoming', 'InvalidOptions', 'X-Max-cost:\x20', 'newInboundSession', 'Exception\x20in\x20call\x20duration\x20update\x20event:\x20', 'Getusermedia\x20failed', 'newOutboundSession', 'outboundPacketsLost', 'Rejected\x20call', 'Phone\x20client\x20successfully\x20stopped', 'Mic\x20already\x20muted,\x20just\x20sending\x20DTMF', 'inboundPacketsReceived', 'FAILED', 'X-DID-NAME', 'useCallDataInfoEvent', 'maximumCallCost', '_rtcpStatsTimer', 'duration', 'then', '24jmuncy', '\x20/\x20', 'wss_password', 'callEnded', 'Canceled', 'getusermediafailed', 'connectEventService', 'getSessionByUUID', 'removeAllListeners', 'emit', 'icecandidate', '_whisperMode', 'fireEvent', 'Using\x20manual\x20specified\x20credentials', 'record', 'Request\x20start\x20recording', 'Invalid\x20DTMF\x20code', 'Repeating\x20tone\x20stopped', 'frequency', '_setConnectionState', 'callToken', 'stop', '_setAnswerCallTimeout', 'X-Call-token:\x20', '_localNumberName', 'Sending\x20DTMF:\x20', 'whisperModeChange', 'outboundJitter', 'recordingStateChange', 'callQualityReportUpdate', 'Busy', '\x20ms', '_destinationNumber', 'hold', '_isStarted', 'callDurationUpdate', 'browserIsChrome', 'connection', '_handleRemoteAudio', 'localNumberName', '_doRepeatTone', 'muteStateChange', 'INBOUND', 'disconnect', '\x20seconds', '_callDisposition', '_startDurationUpdateTimer', 'LISTEN', 'Connected\x20to\x20event\x20server', 'AUDIO', 'getOtherSessions', 'Unknown\x20call\x20direction:\x20', 'hangup', 'New\x20RTCSession', 'gain', '_isMuted', 'Recording\x20enabled\x20and\x20kept\x20for\x20', 'JsSIP:*', 'originator', '_setSessionState', 'explicitCallerId', 'isRecording', 'packetsLost', 'sendInfo', 'mediaDevices', 'X-Meta-Info:\x20', '_mediaPermissionError', 'Transfer\x20rejected:\x20', 'provisionToken', 'connect', '_isListenCall', 'Mute\x20microphone', 'Event\x20callback\x20failed:\x20', 'Calling\x20number:\x20', 'CALLING', 'Requesting\x20specific\x20media\x20switch\x20', 'Unable\x20to\x20connect\x20to\x20event\x20server:\x20', '1470696hdTPTM', 'Unmute\x20microphone', 'Answer\x20call\x20timeout\x20after\x20', 'Exception\x20in\x20mute\x20state\x20change\x20event:\x20', '_remoteAudioElement', 'streams'];
164
-
165
- a0_0x29ff = function a0_0x29ff() {
166
- return _0x1775a6;
167
- };
168
-
169
- return a0_0x29ff();
170
- }
171
-
172
- class Phone extends _events.default {
173
- constructor() {
174
- let _0xb08040 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
175
-
176
- const _0x3cbff1 = a0_0x35184d;
177
- super(), this[_0x3cbff1(0x15f)] = ![], this[_0x3cbff1(0x1e8)] = ![], this[_0x3cbff1(0x15e)] = null, this[_0x3cbff1(0x18f)] = null, this[_0x3cbff1(0x1c8)] = ![], this['_eventClient'] = null, this[_0x3cbff1(0x154)] = null, this[_0x3cbff1(0x201)] = 0x0, this[_0x3cbff1(0x129)] = {}, this['_remoteAudioElement'] = document['createElement'](_0x3cbff1(0x1d7)), this[_0x3cbff1(0x1f7)][_0x3cbff1(0x17a)] = !![], this[_0x3cbff1(0x216)] = document[_0x3cbff1(0xff)]('AUDIO'), this[_0x3cbff1(0x216)]['autoplay'] = !![], this[_0x3cbff1(0x223)] = null, this['_repeatToneActive'] = ![], this[_0x3cbff1(0x136)] = [], this[_0x3cbff1(0x159)] = 0x0, this[_0x3cbff1(0x16e)] = null, this[_0x3cbff1(0xda)] = null, this[_0x3cbff1(0x146)] = null, this[_0x3cbff1(0x277)] = _0xb08040 ? _0xb08040 : new _common.Logger[_0x3cbff1(0x17c)](_common.Logger[_0x3cbff1(0x166)][_0x3cbff1(0x113)]), this[_0x3cbff1(0x277)][_0x3cbff1(0x179)] === _common.Logger[_0x3cbff1(0x166)]['DEBUG'] ? _jssip.default['debug'][_0x3cbff1(0x170)](_0x3cbff1(0x1df)) : _jssip.default[_0x3cbff1(0xcf)][_0x3cbff1(0x170)](_0x3cbff1(0x1df));
178
- }
179
-
180
- [a0_0x35184d(0x26c)]() {
181
- const _0x38669a = a0_0x35184d;
182
-
183
- this[_0x38669a(0x277)]['info']('Get\x20media\x20permission');
184
-
185
- const _0x47ad25 = this,
186
- _0x4bad14 = {
187
- 'audio': !![],
188
- 'video': ![]
189
- };
190
-
191
- return new Promise(function (_0x444a23, _0x113cb4) {
192
- const _0x5113c5 = _0x38669a;
193
-
194
- navigator[_0x5113c5(0x1e6)][_0x5113c5(0x15c)](_0x4bad14)[_0x5113c5(0x1a5)](() => {
195
- const _0x21627b = _0x5113c5;
196
- _0x47ad25[_0x21627b(0x15f)] = !![], _0x47ad25[_0x21627b(0x1e8)] = ![], _0x47ad25[_0x21627b(0x277)][_0x21627b(0x258)]('Media\x20permission\x20granted'), _0x444a23();
197
- }, _0x1dca8f => {
198
- const _0x465e28 = _0x5113c5;
199
- _0x47ad25['_mediaPermission'] = ![], _0x47ad25[_0x465e28(0x1e8)] = !![], _0x47ad25['log']['error']('Denied\x20media\x20permission:\x20' + _0x1dca8f), _0x113cb4(_0x1dca8f);
200
- });
201
- });
202
- }
203
-
204
- [a0_0x35184d(0xd2)](_0x2c9d9e) {
205
- const _0x3e19bf = a0_0x35184d;
206
-
207
- this[_0x3e19bf(0x12a)]();
208
-
209
- this['_isStarted'] && (this[_0x3e19bf(0x277)][_0x3e19bf(0x250)](_0x3e19bf(0x18b)), this['stop']());
210
- this['_options'] = Object['assign'](options, _0x2c9d9e), this['_initToneGenerator']();
211
-
212
- if (this[_0x3e19bf(0x154)][_0x3e19bf(0x1ea)]) {
213
- let _0x424c81 = null;
214
-
215
- try {
216
- _0x424c81 = JSON[_0x3e19bf(0x132)](atob(this[_0x3e19bf(0x154)][_0x3e19bf(0x1ea)]));
217
- } catch (_0x103359) {
218
- throw new _common.Exceptions[_0x3e19bf(0x194)](_0x3e19bf(0x1ea), 'Invalid\x20token');
219
- }
220
-
221
- this[_0x3e19bf(0x277)][_0x3e19bf(0x258)](_0x3e19bf(0x17d)), this[_0x3e19bf(0x154)][_0x3e19bf(0x222)] = _0x424c81[_0x3e19bf(0x191)], this[_0x3e19bf(0x154)]['eventServer'] = _0x424c81[_0x3e19bf(0x127)], this[_0x3e19bf(0x154)][_0x3e19bf(0x236)] = _0x424c81['wss_username'], this[_0x3e19bf(0x154)][_0x3e19bf(0x14b)] = _0x424c81[_0x3e19bf(0x1a8)], this[_0x3e19bf(0x154)]['callToken'] = _0x424c81[_0x3e19bf(0x164)];
222
- } else {
223
- this['log'][_0x3e19bf(0x258)](_0x3e19bf(0x1b3));
224
-
225
- if (!this[_0x3e19bf(0x154)][_0x3e19bf(0x236)]) throw new _common.Exceptions[_0x3e19bf(0x194)](_0x3e19bf(0x236), _0x3e19bf(0x11f));
226
- if (!this[_0x3e19bf(0x154)][_0x3e19bf(0x14b)]) throw new _common.Exceptions[_0x3e19bf(0x194)]('password', 'Missing\x20password');
227
- if (!this['_options'][_0x3e19bf(0x1ba)]) throw new _common.Exceptions[_0x3e19bf(0x194)]('callToken', _0x3e19bf(0xd4));
228
- }
229
-
230
- this[_0x3e19bf(0x154)]['useCallDataInfoEvent'] && !this[_0x3e19bf(0x154)]['connectEventService'] && (this[_0x3e19bf(0x277)][_0x3e19bf(0x258)]('Enabled\x20event\x20service\x20because\x20\x27useCallDataInfoEvent\x27\x20is\x20enabled'), this[_0x3e19bf(0x154)]['connectEventService'] = !![]);
231
- this[_0x3e19bf(0x154)][_0x3e19bf(0x1ac)] && (this[_0x3e19bf(0x18d)] = new _eventClient.EventClient(this[_0x3e19bf(0x277)]), this[_0x3e19bf(0x18d)][_0x3e19bf(0x1eb)](this[_0x3e19bf(0x154)]['eventServer'])['then'](() => {
232
- const _0x47dad1 = _0x3e19bf;
233
-
234
- this['log'][_0x47dad1(0x258)](_0x47dad1(0x1d6));
235
-
236
- if (this[_0x47dad1(0x154)][_0x47dad1(0x1a1)]) {
237
- let _0x2ecd0c = {
238
- 'event_name': _0x47dad1(0x18e),
239
- 'call_token': this[_0x47dad1(0x154)][_0x47dad1(0x1ba)]
240
- };
241
-
242
- this[_0x47dad1(0x18d)][_0x47dad1(0x138)](_0x2ecd0c, _0x314bc4 => {
243
- const _0x16d66a = _0x47dad1;
244
-
245
- try {
246
- this['log']['debug'](_0x16d66a(0x121)), this[_0x16d66a(0x277)][_0x16d66a(0xcf)](_0x314bc4), this['_fireCallDataInfoEvent'](_0x314bc4);
247
- } catch (_0x5d3bda) {
248
- this[_0x16d66a(0x277)]['error'](_0x16d66a(0x1ee) + _0x5d3bda);
249
- }
250
- })[_0x47dad1(0x1a5)](_0x58f97d => {
251
- const _0x2295a7 = _0x47dad1;
252
-
253
- this['log'][_0x2295a7(0x258)](_0x2295a7(0x23e) + _0x58f97d);
254
- }, _0x14ce53 => {
255
- const _0x4f46ae = _0x47dad1;
256
-
257
- this[_0x4f46ae(0x277)][_0x4f46ae(0x247)](_0x4f46ae(0x1fd) + _0x14ce53);
258
- });
259
- }
260
- }, _0x278fa6 => {
261
- const _0x4db0c2 = _0x3e19bf;
262
-
263
- this[_0x4db0c2(0x277)][_0x4db0c2(0x247)](_0x4db0c2(0x1f2) + _0x278fa6);
264
- }));
265
- let _0x504113 = null;
266
-
267
- try {
268
- _0x504113 = new _jssip.default[_0x3e19bf(0x270)](this[_0x3e19bf(0x154)]['wssServer']);
269
- } catch (_0x55dea5) {
270
- throw new _common.Exceptions[_0x3e19bf(0x169)](_0x3e19bf(0x26e) + _0x55dea5);
271
- }
272
-
273
- this[_0x3e19bf(0x277)][_0x3e19bf(0x258)](_0x3e19bf(0x225)), this[_0x3e19bf(0x277)][_0x3e19bf(0xcf)](this[_0x3e19bf(0x154)]), this['_UA'] = new _jssip.default['UA']({
274
- 'sockets': [_0x504113],
275
- 'authorization_user': this['_options'][_0x3e19bf(0x236)],
276
- 'password': this['_options'][_0x3e19bf(0x14b)],
277
- 'register': this[_0x3e19bf(0x154)][_0x3e19bf(0x276)],
278
- 'display_name': this[_0x3e19bf(0x154)][_0x3e19bf(0x236)],
279
- 'uri': this[_0x3e19bf(0x154)][_0x3e19bf(0x236)] + _0x3e19bf(0x17b),
280
- 'session_timers': ![]
281
- });
282
-
283
- const _0x48b7b2 = this;
284
-
285
- this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0x173), function (_0x42f2f5) {
286
- const _0x404c8b = _0x3e19bf;
287
-
288
- _0x48b7b2[_0x404c8b(0x277)]['debug'](_0x404c8b(0x1db));
289
-
290
- if (_0x42f2f5[_0x404c8b(0x1e0)] === _0x404c8b(0xc4)) {
291
- const _0x5e4924 = new Session(_0x48b7b2);
292
-
293
- _0x5e4924[_0x404c8b(0x196)](_0x42f2f5);
294
-
295
- _0x48b7b2[_0x404c8b(0x154)]['playRingOnIncoming'] && _0x48b7b2[_0x404c8b(0x157)](ST_INCOMING);
296
-
297
- if (_0x48b7b2[_0x404c8b(0x154)][_0x404c8b(0xdd)]) {
298
- if (Object[_0x404c8b(0x259)](_0x48b7b2[_0x404c8b(0x129)])['length'] > 0x0) {
299
- _0x48b7b2[_0x404c8b(0x277)][_0x404c8b(0x258)]('Autorejecting\x20incoming\x20call\x20' + _0x5e4924[_0x404c8b(0x108)] + _0x404c8b(0x144)), _0x5e4924[_0x404c8b(0x187)](0x1e6, 'Busy');
300
- return;
301
- } else _0x48b7b2['log']['debug']('There\x20are\x20no\x20other\x20sessions,\x20adding\x20incoming\x20call');
302
- }
303
-
304
- _0x48b7b2[_0x404c8b(0x17e)](_0x5e4924), _0x5e4924[_0x404c8b(0x1e1)](_0x404c8b(0x192)), _0x48b7b2[_0x404c8b(0x140)](_0x5e4924);
305
- }
306
- }), this[_0x3e19bf(0x15e)]['on']('connecting', function () {
307
- const _0x4e3946 = _0x3e19bf;
308
-
309
- _0x48b7b2[_0x4e3946(0x1b9)](_0x4e3946(0x251));
310
- }), this['_UA']['on'](_0x3e19bf(0x210), function () {
311
- const _0x90aac = _0x3e19bf;
312
-
313
- _0x48b7b2[_0x90aac(0x1b9)](_0x90aac(0x151));
314
- }), this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0xdb), function () {
315
- const _0x38734c = _0x3e19bf;
316
-
317
- _0x48b7b2[_0x38734c(0x1b9)](_0x38734c(0x244));
318
- }), this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0x14e), function () {
319
- _0x48b7b2['_setConnectionState']('REGISTERED');
320
- }), this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0x10a), function () {
321
- const _0x41d417 = _0x3e19bf;
322
-
323
- _0x48b7b2[_0x41d417(0x1b9)](_0x41d417(0x265));
324
- }), this['_UA']['on']('registrationFailed', function () {
325
- const _0x42aab0 = _0x3e19bf;
326
-
327
- _0x48b7b2[_0x42aab0(0x1b9)](_0x42aab0(0xf8));
328
- }), this[_0x3e19bf(0x15e)]['start'](), this['_isStarted'] = !![], this['log'][_0x3e19bf(0x258)](_0x3e19bf(0x168));
329
- }
330
-
331
- [a0_0x35184d(0x1bb)]() {
332
- const _0x5f53d7 = a0_0x35184d;
333
- if (!this[_0x5f53d7(0x1c8)]) throw new _common.Exceptions[_0x5f53d7(0x14c)]('Phone\x20is\x20not\x20started');
334
- this['_UA'][_0x5f53d7(0x1ae)](), this[_0x5f53d7(0x15e)][_0x5f53d7(0x1bb)](), delete this[_0x5f53d7(0x15e)];
335
-
336
- if (!this[_0x5f53d7(0x18d)]) {
337
- this[_0x5f53d7(0x277)][_0x5f53d7(0xcf)]('Event\x20client\x20not\x20running,\x20not\x20stopping');
338
-
339
- return;
340
- }
341
-
342
- try {
343
- this[_0x5f53d7(0x18d)][_0x5f53d7(0x1d1)](), delete this[_0x5f53d7(0x18d)];
344
- } catch (_0x2f9732) {
345
- this[_0x5f53d7(0x277)][_0x5f53d7(0x250)](_0x5f53d7(0x106));
346
- }
347
-
348
- this[_0x5f53d7(0x1c8)] = ![], this[_0x5f53d7(0x277)][_0x5f53d7(0x258)](_0x5f53d7(0x19c));
349
- }
350
-
351
- [a0_0x35184d(0x274)](_0x3c9f9f) {
352
- let _0x290d21 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
353
-
354
- const _0x4acb00 = a0_0x35184d;
355
- if (!this['_isStarted']) throw new _common.Exceptions[_0x4acb00(0x14c)](_0x4acb00(0x131));
356
- if (this['_checkForConnectingCalls']()) throw _common.Exceptions['NotAllowed'](_0x4acb00(0x149));
357
-
358
- this[_0x4acb00(0x175)]();
359
-
360
- const _0x1e0866 = Object[_0x4acb00(0x17f)]({
361
- 'record': ![],
362
- 'maximumCallCost': 0x0,
363
- 'answerCallTimeout': 0x0,
364
- 'explicitCallerId': null,
365
- 'explicitShortCallerId': null,
366
- 'metaInfo': null,
367
- '_isListenCall': ![]
368
- }, _0x290d21);
369
-
370
- _0x3c9f9f = _0x3c9f9f['trim']()[_0x4acb00(0x20e)](/ |\(|\)/g, ''), this['log'][_0x4acb00(0x258)](_0x4acb00(0x1ef) + _0x3c9f9f);
371
-
372
- let _0x7def15 = new Session(this);
373
-
374
- return _0x7def15[_0x4acb00(0x199)](_0x3c9f9f, _0x1e0866), this[_0x4acb00(0x17e)](_0x7def15), _0x7def15;
375
- }
376
-
377
- [a0_0x35184d(0x13a)](_0x522c08) {
378
- const _0x162aa5 = a0_0x35184d,
379
- _0x1b67e0 = _0x522c08[_0x162aa5(0x109)]('@');
380
-
381
- let _0x55ec63 = _0x1b67e0[0x0],
382
- _0x133dda = 'sip:' + _0x1b67e0[0x1];
383
-
384
- return this['log'][_0x162aa5(0xcf)]('Initiating\x20listen\x20to\x20call\x20with\x20uuid\x20' + _0x55ec63 + _0x162aa5(0x219) + _0x133dda), this[_0x162aa5(0x274)]('listen-' + _0x55ec63, {
385
- 'mediaSwitchURI': _0x133dda,
386
- '_isListenCall': !![]
387
- });
388
- }
389
-
390
- [a0_0x35184d(0x1ad)](_0x505885) {
391
- const _0x2921e4 = a0_0x35184d;
392
-
393
- for (let _0x1ae5f5 in this[_0x2921e4(0x129)]) {
394
- if (this[_0x2921e4(0x129)][_0x2921e4(0x10c)](_0x1ae5f5)) {
395
- if (this[_0x2921e4(0x129)][_0x1ae5f5][_0x2921e4(0x108)] === _0x505885) return this[_0x2921e4(0x129)][_0x1ae5f5];
396
- }
397
- }
398
-
399
- return null;
400
- }
401
-
402
- get [a0_0x35184d(0x22c)]() {
403
- const _0x4d58db = a0_0x35184d;
404
- return this[_0x4d58db(0x154)];
405
- }
406
-
407
- get [a0_0x35184d(0x24c)]() {
408
- const _0x9589bf = a0_0x35184d;
409
- let _0x379812 = [];
410
-
411
- for (let _0x2a145d in this['_activeSessions']) {
412
- this[_0x9589bf(0x129)]['hasOwnProperty'](_0x2a145d) && _0x379812[_0x9589bf(0xfd)](this[_0x9589bf(0x129)][_0x2a145d]);
413
- }
414
-
415
- return _0x379812;
416
- }
417
-
418
- get ['hasMediaPermission']() {
419
- return this['_mediaPermission'];
420
- }
421
-
422
- get [a0_0x35184d(0x24b)]() {
423
- const _0x1c346b = a0_0x35184d;
424
- return this[_0x1c346b(0x1e8)];
425
- }
426
-
427
- get ['isStarted']() {
428
- const _0x564d34 = a0_0x35184d;
429
- return this[_0x564d34(0x1c8)];
430
- }
431
-
432
- get [a0_0x35184d(0x25f)]() {
433
- const _0x4cd77b = a0_0x35184d;
434
- return _common.Tools[_0x4cd77b(0x1ca)]() || _common.Tools['browserIsFirefox']() || _common.Tools['browserIsOpera']() || _common.Tools['browserIsSafari']();
435
- }
436
-
437
- get [a0_0x35184d(0x209)]() {
438
- const _0x2bf85b = a0_0x35184d;
439
- return this[_0x2bf85b(0x1f7)];
440
- }
441
-
442
- [a0_0x35184d(0x158)](_0x1bd8e5, _0x2fc88c) {
443
- let _0x990bef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0x0;
444
-
445
- let _0x2eeacb = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
446
-
447
- const _0x13df61 = a0_0x35184d;
448
- this[_0x13df61(0x277)][_0x13df61(0xcf)]('Playing\x20tone\x20' + _0x2fc88c + _0x13df61(0x1a7) + _0x990bef + _0x13df61(0x21b) + _0x1bd8e5 + _0x13df61(0x1c5)), this['_oscillator1'][_0x13df61(0x1b8)][_0x13df61(0x205)] = _0x2fc88c, this[_0x13df61(0x146)]['frequency'][_0x13df61(0x205)] = _0x990bef, this[_0x13df61(0x16e)][_0x13df61(0x1dc)][_0x13df61(0x205)] = this[_0x13df61(0x154)][_0x13df61(0x142)];
449
-
450
- const _0x531960 = this;
451
-
452
- this[_0x13df61(0x223)] = setTimeout(function () {
453
- const _0x5271f8 = _0x13df61;
454
- _0x531960[_0x5271f8(0x213)](), _0x2eeacb && _0x2eeacb();
455
- }, _0x1bd8e5);
456
- }
457
-
458
- [a0_0x35184d(0x213)]() {
459
- const _0x512f0e = a0_0x35184d;
460
- this[_0x512f0e(0xda)][_0x512f0e(0x1b8)][_0x512f0e(0x205)] = 0x0, this['_oscillator2']['frequency'][_0x512f0e(0x205)] = 0x0, this[_0x512f0e(0x16e)][_0x512f0e(0x1dc)][_0x512f0e(0x205)] = 0x0, clearTimeout(this[_0x512f0e(0x223)]);
461
- }
462
-
463
- ['_startRepeatTone'](_0x5138b6) {
464
- const _0x31991c = a0_0x35184d;
465
- this[_0x31991c(0x277)][_0x31991c(0x258)](_0x31991c(0xe4)), this[_0x31991c(0x277)]['debug'](_0x5138b6), this[_0x31991c(0x136)] = _0x5138b6, this[_0x31991c(0x159)] = 0x0, this[_0x31991c(0xd5)] = !![], this[_0x31991c(0x1ce)]();
466
- }
467
-
468
- [a0_0x35184d(0x1ce)]() {
469
- const _0x551500 = a0_0x35184d;
470
-
471
- if (this[_0x551500(0xd5)]) {
472
- this[_0x551500(0x277)][_0x551500(0xcf)](_0x551500(0x233) + this[_0x551500(0x159)]);
473
-
474
- let _0xa278a7 = this[_0x551500(0x136)][this[_0x551500(0x159)]];
475
-
476
- this[_0x551500(0x159)]++;
477
- this[_0x551500(0x159)] === this[_0x551500(0x136)][_0x551500(0x200)] && (this[_0x551500(0x159)] = 0x0);
478
-
479
- const _0x581b1f = this;
480
-
481
- this[_0x551500(0x158)](_0xa278a7['d'], _0xa278a7['f1'], _0xa278a7['f2'], function () {
482
- const _0x1496f8 = _0x551500;
483
- setTimeout(_0x581b1f[_0x1496f8(0x1ce)][_0x1496f8(0xfa)](_0x581b1f), _0xa278a7['g']);
484
- });
485
- }
486
- }
487
-
488
- [a0_0x35184d(0xe5)]() {
489
- const _0x4ab483 = a0_0x35184d;
490
- this[_0x4ab483(0xd5)] && (this[_0x4ab483(0x277)][_0x4ab483(0x258)](_0x4ab483(0x1b7)), this[_0x4ab483(0xd5)] = ![], this[_0x4ab483(0x213)]());
491
- }
492
-
493
- [a0_0x35184d(0x148)]() {
494
- const _0x12e171 = a0_0x35184d,
495
- _0x2400c2 = window['AudioContext'] || window['webkitAudioContext'] || ![];
496
-
497
- if (!_0x2400c2) throw new _common.Exceptions[_0x12e171(0x16d)](_0x12e171(0x208));
498
-
499
- const _0x4083df = new _0x2400c2();
500
-
501
- this['_toneStreamNode'] = _0x4083df[_0x12e171(0x252)](), this[_0x12e171(0x216)]['srcObject'] = this[_0x12e171(0x23f)][_0x12e171(0x20b)], this[_0x12e171(0x16e)] = _0x4083df[_0x12e171(0xcd)](), this[_0x12e171(0x16e)][_0x12e171(0x1dc)][_0x12e171(0x205)] = 0x0, this[_0x12e171(0x16e)]['connect'](this[_0x12e171(0x23f)]), this[_0x12e171(0xda)] = _0x4083df[_0x12e171(0xd6)](), this[_0x12e171(0xda)][_0x12e171(0x1eb)](this[_0x12e171(0x16e)]), this[_0x12e171(0xda)][_0x12e171(0x1b8)][_0x12e171(0x205)] = 0x0, this[_0x12e171(0xda)][_0x12e171(0xd2)](), this['_oscillator2'] = _0x4083df[_0x12e171(0xd6)](), this['_oscillator2'][_0x12e171(0x1eb)](this[_0x12e171(0x16e)]), this[_0x12e171(0x146)][_0x12e171(0x1b8)][_0x12e171(0x205)] = 0x0, this[_0x12e171(0x146)][_0x12e171(0xd2)]();
502
- }
503
-
504
- [a0_0x35184d(0x175)]() {
505
- const _0x422c16 = a0_0x35184d;
506
-
507
- this['log'][_0x422c16(0x258)](_0x422c16(0x141));
508
-
509
- if (this[_0x422c16(0xfe)]()) throw _common.Exceptions[_0x422c16(0x16d)]('A\x20session\x20is\x20currently\x20connecting');
510
-
511
- for (let _0x4da42e in this[_0x422c16(0x129)]) {
512
- if (this[_0x422c16(0x129)][_0x422c16(0x10c)](_0x4da42e)) {
513
- let _0x38e2b6 = this['_activeSessions'][_0x4da42e];
514
- _0x38e2b6[_0x422c16(0xd8)] === _0x422c16(0x103) && _0x38e2b6[_0x422c16(0x1c7)]();
515
- }
516
- }
517
- }
518
-
519
- [a0_0x35184d(0x17e)](_0x2fbd93) {
520
- const _0x145d82 = a0_0x35184d;
521
- this[_0x145d82(0x201)]++, _0x2fbd93['__containerId'] = this[_0x145d82(0x201)], this['log'][_0x145d82(0x258)]('Adding\x20new\x20session\x20' + _0x2fbd93[_0x145d82(0x105)] + ':\x20' + _0x2fbd93[_0x145d82(0x108)]), this[_0x145d82(0x129)][_0x2fbd93[_0x145d82(0x105)]] = _0x2fbd93, this[_0x145d82(0x277)][_0x145d82(0xcf)](_0x145d82(0x22b) + Object['keys'](this[_0x145d82(0x129)])[_0x145d82(0x200)] + _0x145d82(0x13f)), this[_0x145d82(0x277)][_0x145d82(0xcf)](this[_0x145d82(0x129)]);
522
-
523
- try {
524
- this[_0x145d82(0x1af)](_0x145d82(0x15d), {
525
- 'session': _0x2fbd93
526
- });
527
- } catch (_0x295d5d) {
528
- this[_0x145d82(0x277)][_0x145d82(0x247)](_0x145d82(0xcc) + _0x295d5d);
529
- }
530
- }
531
-
532
- [a0_0x35184d(0x189)](_0x264167) {
533
- const _0x157e01 = a0_0x35184d;
534
-
535
- this[_0x157e01(0x277)][_0x157e01(0x258)]('Removing\x20session\x20' + _0x264167[_0x157e01(0x105)] + ':\x20' + _0x264167[_0x157e01(0x108)]);
536
-
537
- try {
538
- this[_0x157e01(0x1af)](_0x157e01(0x125), {
539
- 'session': _0x264167
540
- });
541
- } catch (_0x26e238) {
542
- this[_0x157e01(0x277)][_0x157e01(0x247)](_0x157e01(0x139) + _0x26e238);
543
- }
544
-
545
- delete this[_0x157e01(0x129)][_0x264167[_0x157e01(0x105)]], this[_0x157e01(0x277)][_0x157e01(0xcf)]('We\x20now\x20have\x20' + Object[_0x157e01(0x259)](this[_0x157e01(0x129)])[_0x157e01(0x200)] + '\x20sessions'), this[_0x157e01(0x277)]['debug'](this[_0x157e01(0x129)]), this[_0x157e01(0xe5)]();
546
- }
547
-
548
- ['_sessionTerminated'](_0x387d07) {
549
- const _0x494738 = a0_0x35184d;
550
-
551
- this[_0x494738(0x277)]['debug'](_0x494738(0x190) + _0x387d07[_0x494738(0x108)] + '\x20terminated,\x20removing\x20in\x20' + this['_options'][_0x494738(0x25e)] + _0x494738(0x1c5));
552
-
553
- const _0x41f3d7 = this;
554
-
555
- setTimeout(function () {
556
- _0x41f3d7['_removeSession'](_0x387d07);
557
- }, this['_options']['autoRemoveSessionTime']);
558
- }
559
-
560
- [a0_0x35184d(0xfe)]() {
561
- const _0x1d889c = a0_0x35184d;
562
-
563
- for (let _0x1f4fc6 in this[_0x1d889c(0x129)]) {
564
- if (this[_0x1d889c(0x129)][_0x1d889c(0x10c)](_0x1f4fc6)) {
565
- let _0x5e5385 = this[_0x1d889c(0x129)][_0x1f4fc6];
566
-
567
- if (_0x5e5385[_0x1d889c(0xd8)] === 'INITIALIZING' || _0x5e5385[_0x1d889c(0xd8)] === _0x1d889c(0x1f0) || _0x5e5385[_0x1d889c(0xd8)] === _0x1d889c(0x10e) || _0x5e5385['state'] === _0x1d889c(0x192)) return !![];
568
- }
569
- }
570
-
571
- return ![];
572
- }
573
-
574
- [a0_0x35184d(0x1b9)](_0x1ddbb5) {
575
- const _0x3effc4 = a0_0x35184d;
576
- this['log'][_0x3effc4(0x258)](_0x3effc4(0x114) + _0x1ddbb5), this[_0x3effc4(0x18f)] = _0x1ddbb5;
577
-
578
- try {
579
- this[_0x3effc4(0x1af)](_0x3effc4(0x156), {
580
- 'state': _0x1ddbb5
581
- });
582
- } catch (_0x2bc6dc) {
583
- this[_0x3effc4(0x277)][_0x3effc4(0x247)](_0x3effc4(0x107) + _0x2bc6dc);
584
- }
585
- }
586
-
587
- ['_fireIncomingCallEvent'](_0x353f5b) {
588
- const _0x5d5410 = a0_0x35184d;
589
-
590
- try {
591
- this[_0x5d5410(0x1af)](_0x5d5410(0x20f), _0x353f5b);
592
- } catch (_0x2389f8) {
593
- this['log'][_0x5d5410(0x247)](_0x5d5410(0x10d) + _0x2389f8);
594
- }
595
- }
596
-
597
- [a0_0x35184d(0x184)]() {
598
- let _0xedd94a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
599
-
600
- const _0x421366 = a0_0x35184d;
601
-
602
- let _0x36d1fa;
603
-
604
- _0x36d1fa = (0, _camelcaseKeys.default)(_0xedd94a), _0x36d1fa['recordings'] = (0, _camelcaseKeys.default)(_0xedd94a[_0x421366(0x254)]), _0x36d1fa[_0x421366(0x1a4)] = _0x36d1fa[_0x421366(0x1a4)] * 0x3e8, _0x36d1fa['answerDuration'] = _0x36d1fa['answerDuration'] * 0x3e8, _0x36d1fa['activeDuration'] = _0x36d1fa[_0x421366(0x1fa)] * 0x3e8, _0x36d1fa['durationStr'] = _common.Tools[_0x421366(0x16b)](_0x36d1fa[_0x421366(0x1a4)]), _0x36d1fa[_0x421366(0xc8)] = _0x36d1fa[_0x421366(0x12d)] ? _common.Tools[_0x421366(0x16b)](_0x36d1fa[_0x421366(0x12d)]) : '', _0x36d1fa[_0x421366(0xf7)] = _0x36d1fa[_0x421366(0x1fa)] ? _common.Tools[_0x421366(0x16b)](_0x36d1fa[_0x421366(0x1fa)]) : '';
605
-
606
- try {
607
- this[_0x421366(0x1af)](_0x421366(0x102), _0x36d1fa);
608
- } catch (_0x3259ca) {
609
- this[_0x421366(0x277)][_0x421366(0x247)]('Exception\x20in\x20callDataInfo\x20event:\x20' + _0x3259ca);
610
- }
611
- }
612
-
613
- ['_checkMediaPermission']() {
614
- const _0x46efd0 = a0_0x35184d;
615
- if (!this[_0x46efd0(0x15f)]) throw new _common.Exceptions[_0x46efd0(0xf4)]();
616
- }
617
-
618
- }
619
-
620
- exports.Phone = Phone;
621
-
622
- class Session extends _events.default {
623
- constructor(_0xc7e78a) {
624
- const _0x33de8e = a0_0x35184d;
625
- super(), this[_0x33de8e(0x171)] = _0xc7e78a, this['log'] = _0xc7e78a[_0x33de8e(0x277)], this[_0x33de8e(0x14a)] = null, this['_webRTCSession'] = null, this[_0x33de8e(0x13c)] = null, this['_iceCandidateTimer'] = null, this[_0x33de8e(0x12b)] = ![], this[_0x33de8e(0x1dd)] = ![], this[_0x33de8e(0x117)] = ![], this[_0x33de8e(0x120)] = null, this[_0x33de8e(0xef)] = null, this['_callAnswerTime'] = null, this['_callEndTime'] = null, this[_0x33de8e(0x116)] = null, this[_0x33de8e(0x134)] = null, this[_0x33de8e(0x1c6)] = null, this[_0x33de8e(0x1d3)] = null, this[_0x33de8e(0x1be)] = null, this[_0x33de8e(0x1ec)] = ![], this[_0x33de8e(0x1b1)] = null, this[_0x33de8e(0x25d)] = null, this['_rtcpStatsTimer'] = null, this['_currentReport'] = null, this[_0x33de8e(0xfb)] = 0x0, this[_0x33de8e(0x234)] = null, this['_mediaSwitch'] = null;
626
- }
627
-
628
- ['newOutboundSession'](_0x489345, _0x1ad14a) {
629
- const _0x41b825 = a0_0x35184d;
630
- this['_callUUID'] = _common.Tools[_0x41b825(0x26a)](), this[_0x41b825(0x277)][_0x41b825(0xcf)](_0x41b825(0x13e) + _0x489345 + '\x20[' + this['_callUUID'] + ']'), this[_0x41b825(0xd3)] = _0x489345;
631
- let _0x472d3b = {
632
- 'mediaConstraints': {
633
- 'audio': !![],
634
- 'video': ![]
635
- },
636
- 'pcConfig': {
637
- 'iceServers': [{
638
- 'urls': [_0x41b825(0x167)]
639
- }]
640
- },
641
- 'extraHeaders': [_0x41b825(0x1bd) + this[_0x41b825(0x171)][_0x41b825(0x22c)][_0x41b825(0x1ba)], _0x41b825(0x162) + this[_0x41b825(0x14a)], _0x41b825(0x195) + _0x1ad14a[_0x41b825(0x1a2)]]
642
- };
643
- _0x1ad14a[_0x41b825(0x1e2)] && _0x472d3b[_0x41b825(0x226)][_0x41b825(0xfd)]('X-CID-Number-Id:\x20' + _0x1ad14a['explicitCallerId']);
644
- _0x1ad14a[_0x41b825(0x224)] && _0x472d3b[_0x41b825(0x226)][_0x41b825(0xfd)]('X-Short-CID-Id:\x20' + _0x1ad14a[_0x41b825(0x224)]);
645
- _0x1ad14a['metaInfo'] && _0x472d3b['extraHeaders']['push'](_0x41b825(0x1e7) + encodeURI(_0x1ad14a['metaInfo'][_0x41b825(0x227)]()[_0x41b825(0x26b)](0x0, 0xff)));
646
-
647
- if (_0x1ad14a[_0x41b825(0x1b4)]) {
648
- if (isNaN(_0x1ad14a[_0x41b825(0x1b4)])) throw new _common.Exceptions['InvalidParameter'](_0x41b825(0x172));
649
- this[_0x41b825(0x277)][_0x41b825(0xcf)](_0x41b825(0x1de) + _0x1ad14a['record'] + _0x41b825(0x246)), _0x472d3b['extraHeaders'][_0x41b825(0xfd)](_0x41b825(0x1f9) + _0x1ad14a[_0x41b825(0x1b4)]), this[_0x41b825(0x117)] = !![];
650
- } else this['_isRecording'] = ![];
651
-
652
- this[_0x41b825(0x1ec)] = _0x1ad14a['_isListenCall'];
653
- if (_0x1ad14a['mediaSwitchURI']) this[_0x41b825(0x277)][_0x41b825(0xcf)](_0x41b825(0x1f1) + _0x1ad14a[_0x41b825(0x174)]), _0x472d3b[_0x41b825(0x226)]['push'](_0x41b825(0x23a) + _0x1ad14a[_0x41b825(0x174)]);else {
654
- const _0x3e4138 = this[_0x41b825(0x1d8)]();
655
-
656
- _0x3e4138[_0x41b825(0x200)] > 0x0 ? _0x3e4138[0x0][_0x41b825(0x112)] ? (this[_0x41b825(0x277)]['debug'](_0x41b825(0x14d) + _0x3e4138[0x0][_0x41b825(0x112)]), _0x472d3b[_0x41b825(0x226)][_0x41b825(0xfd)](_0x41b825(0xde) + _0x3e4138[0x0][_0x41b825(0x112)])) : this[_0x41b825(0x277)][_0x41b825(0x250)](_0x41b825(0x23b)) : this[_0x41b825(0x277)][_0x41b825(0xcf)]('No\x20other\x20active\x20calls,\x20no\x20media\x20switch\x20grouping\x20requested');
657
- }
658
-
659
- const _0x31c3a9 = _0x41b825(0x12c) + _0x489345 + _0x41b825(0x17b);
660
-
661
- try {
662
- this[_0x41b825(0x10b)](this[_0x41b825(0x171)][_0x41b825(0x15e)][_0x41b825(0x274)](_0x31c3a9, _0x472d3b));
663
- } catch (_0x2006de) {
664
- return this['log'][_0x41b825(0x247)](_0x41b825(0x20d), _0x2006de), null;
665
- }
666
-
667
- _0x1ad14a[_0x41b825(0x237)] && this[_0x41b825(0x1bc)](_0x1ad14a[_0x41b825(0x237)]);
668
- }
669
-
670
- [a0_0x35184d(0x196)](_0x1f720f) {
671
- const _0x2c15ec = a0_0x35184d;
672
- this[_0x2c15ec(0x14a)] = _0x1f720f[_0x2c15ec(0x152)][_0x2c15ec(0xf3)](_0x2c15ec(0xfc), 0x0), this[_0x2c15ec(0x1c6)] = _0x1f720f[_0x2c15ec(0x152)]['getHeader']('X-DID', 0x0), this[_0x2c15ec(0x1be)] = unescape(_0x1f720f['request'][_0x2c15ec(0xf3)](_0x2c15ec(0x1a0), 0x0)), this[_0x2c15ec(0xd1)] = _0x1f720f['request'][_0x2c15ec(0x253)][_0x2c15ec(0x261)], this[_0x2c15ec(0x134)] = _0x1f720f[_0x2c15ec(0x152)][_0x2c15ec(0x253)]['uri'][_0x2c15ec(0x11e)], this['log'][_0x2c15ec(0x258)]('Incoming\x20call\x20from\x20' + this[_0x2c15ec(0x134)] + '\x20[' + this['_callUUID'] + ']'), this[_0x2c15ec(0x277)][_0x2c15ec(0xcf)](_0x1f720f), this[_0x2c15ec(0x112)] = _0x1f720f[_0x2c15ec(0x152)][_0x2c15ec(0xf3)](_0x2c15ec(0x207)), this[_0x2c15ec(0x277)]['debug'](_0x2c15ec(0x165) + this[_0x2c15ec(0x112)]), this[_0x2c15ec(0x10b)](_0x1f720f[_0x2c15ec(0x257)]);
673
- }
674
-
675
- [a0_0x35184d(0x1d8)]() {
676
- const _0x59615b = a0_0x35184d,
677
- _0x3f47f3 = this[_0x59615b(0x171)][_0x59615b(0x24c)];
678
-
679
- let _0x285ec1 = [];
680
-
681
- for (let _0xd48dea in _0x3f47f3) {
682
- _0x3f47f3[_0xd48dea] && _0x3f47f3[_0xd48dea][_0x59615b(0x105)] !== this[_0x59615b(0x105)] && _0x285ec1[_0x59615b(0xfd)](_0x3f47f3[_0xd48dea]);
683
- }
684
-
685
- return _0x285ec1;
686
- }
687
-
688
- [a0_0x35184d(0x10b)](_0x4e7a5f) {
689
- const _0x327ece = a0_0x35184d;
690
- this[_0x327ece(0x214)] = _0x4e7a5f, this[_0x327ece(0xef)] = Date[_0x327ece(0x21f)]();
691
-
692
- const _0x3737d9 = this;
693
-
694
- this[_0x327ece(0x214)]['on'](_0x327ece(0x1b0), function (_0x214824) {
695
- const _0x1711a3 = _0x327ece,
696
- _0x5f093d = _0x214824[_0x1711a3(0x145)];
697
-
698
- _0x3737d9[_0x1711a3(0x277)][_0x1711a3(0xcf)](_0x1711a3(0x115) + _0x5f093d[_0x1711a3(0x145)]);
699
-
700
- if (_0x5f093d['type'] === _0x1711a3(0xf9) && _0x5f093d[_0x1711a3(0x13d)] !== null && _0x5f093d['relatedPort'] !== null) {
701
- _0x3737d9['log']['info'](_0x1711a3(0x124) + _0x5f093d[_0x1711a3(0x145)]);
702
-
703
- if (_0x3737d9['_iceCandidateTimer'] != null) clearTimeout(_0x3737d9[_0x1711a3(0xec)]);
704
-
705
- _0x214824[_0x1711a3(0xf2)]();
706
- } else {
707
- if (_0x3737d9[_0x1711a3(0xec)] != null) clearTimeout(_0x3737d9[_0x1711a3(0xec)]);
708
- _0x3737d9[_0x1711a3(0xec)] = setTimeout(function (_0x56b7ca) {
709
- const _0x1243f7 = _0x1711a3;
710
- _0x3737d9[_0x1243f7(0x277)]['debug'](_0x1243f7(0x232) + _0x3737d9['_phone']['options'][_0x1243f7(0x12e)] + _0x1243f7(0x147)), _0x56b7ca[_0x1243f7(0xf2)]();
711
- }, _0x3737d9[_0x1711a3(0x171)][_0x1711a3(0x22c)][_0x1711a3(0x12e)], _0x214824);
712
- }
713
- }), this[_0x327ece(0x214)]['on']('connecting', function () {
714
- const _0x143d7a = _0x327ece;
715
- _0x3737d9['_startDurationUpdateTimer'](), _0x3737d9[_0x143d7a(0xcb)](), _0x3737d9[_0x143d7a(0x1e1)]('INITIALIZING');
716
- }), this[_0x327ece(0x214)]['on']('sending', function () {
717
- const _0x26ef8f = _0x327ece;
718
- _0x3737d9[_0x26ef8f(0x171)][_0x26ef8f(0x22c)]['playCallInitializedTone'] && _0x3737d9[_0x26ef8f(0x171)][_0x26ef8f(0x157)](ST_CALLINIT), _0x3737d9[_0x26ef8f(0x1e1)](_0x26ef8f(0x1f0));
719
- }), this[_0x327ece(0x214)]['on']('progress', function (_0x7361e4) {
720
- const _0x2542a7 = _0x327ece;
721
- _0x7361e4[_0x2542a7(0x1e0)] === 'remote' && (_0x3737d9['_setSessionState']('PROGRESS', {
722
- 'code': _0x7361e4['response'][_0x2542a7(0x153)]
723
- }), _0x3737d9[_0x2542a7(0x171)][_0x2542a7(0xe5)](), _0x7361e4[_0x2542a7(0x22f)][_0x2542a7(0x153)] === 0xb4 && _0x3737d9[_0x2542a7(0x171)]['_startRepeatTone'](ST_RINGBACK), _0x3737d9['_answerCallTimeout'] && (_0x3737d9[_0x2542a7(0x234)] = setTimeout(function () {
724
- const _0x35ccda = _0x2542a7;
725
-
726
- _0x3737d9[_0x35ccda(0x277)][_0x35ccda(0x258)](_0x35ccda(0x1f5) + _0x3737d9[_0x35ccda(0xfb)] + _0x35ccda(0x1d2));
727
-
728
- try {
729
- _0x3737d9['hangup']();
730
- } catch (_0x9afee0) {
731
- _0x3737d9[_0x35ccda(0x277)]['info'](_0x35ccda(0x25a));
732
- }
733
- }, _0x3737d9[_0x2542a7(0xfb)] * 0x3e8)));
734
- }), this[_0x327ece(0x214)]['on'](_0x327ece(0xc6), function (_0x5a7f3a) {
735
- const _0x4286ad = _0x327ece;
736
- _0x3737d9[_0x4286ad(0x171)][_0x4286ad(0xe5)](), _0x3737d9[_0x4286ad(0x12f)] = Date[_0x4286ad(0x21f)]();
737
- _0x3737d9[_0x4286ad(0xfb)] && (clearTimeout(_0x3737d9[_0x4286ad(0x234)]), _0x3737d9[_0x4286ad(0xfb)] = 0x0);
738
-
739
- if (_0x5a7f3a[_0x4286ad(0x1e0)] === _0x4286ad(0xc4)) {
740
- const _0x266816 = _0x5a7f3a[_0x4286ad(0x22f)][_0x4286ad(0xf3)]('X-Recording');
741
-
742
- _0x266816 === 'true' ? _0x3737d9[_0x4286ad(0x277)][_0x4286ad(0xcf)](_0x4286ad(0x21a)) : _0x3737d9['log'][_0x4286ad(0xcf)](_0x4286ad(0x262)), _0x3737d9[_0x4286ad(0x112)] = _0x5a7f3a['response']['getHeader']('X-MS'), _0x3737d9[_0x4286ad(0x277)][_0x4286ad(0xcf)](_0x4286ad(0x165) + _0x3737d9[_0x4286ad(0x112)]);
743
- }
744
- }), this['_webRTCSession']['on']('confirmed', function () {
745
- const _0x1b6c83 = _0x327ece;
746
-
747
- _0x3737d9[_0x1b6c83(0x1e1)](_0x1b6c83(0x103));
748
- }), this['_webRTCSession']['on'](_0x327ece(0x104), function () {
749
- const _0x3f6830 = _0x327ece;
750
- _0x3737d9[_0x3f6830(0x171)]['_endRepeatTone'](), _0x3737d9[_0x3f6830(0x230)] = Date[_0x3f6830(0x21f)](), _0x3737d9['_answerCallTimeout'] && clearTimeout(_0x3737d9[_0x3f6830(0x234)]), _0x3737d9[_0x3f6830(0x1e1)](_0x3f6830(0x183));
751
- }), this[_0x327ece(0x214)]['on']('failed', function (_0x376898) {
752
- const _0x3c807d = _0x327ece;
753
- _0x3737d9[_0x3c807d(0x171)][_0x3c807d(0xe5)](), _0x3737d9['_callEndTime'] = Date[_0x3c807d(0x21f)]();
754
- _0x3737d9[_0x3c807d(0xfb)] && clearTimeout(_0x3737d9[_0x3c807d(0x234)]);
755
-
756
- let _0x4d39ff;
757
-
758
- _0x376898[_0x3c807d(0x24a)] ? _0x4d39ff = _0x376898[_0x3c807d(0x24a)][_0x3c807d(0x153)] + '\x20' + _0x376898['message'][_0x3c807d(0x239)] : _0x4d39ff = '', _0x3737d9['_setSessionState'](_0x3c807d(0x19f), {
759
- 'cause': _0x376898[_0x3c807d(0x20c)],
760
- 'message': _0x4d39ff
761
- });
762
- }), this['_webRTCSession']['on'](_0x327ece(0x24f), function (_0x518ccb) {
763
- const _0x570226 = _0x327ece;
764
-
765
- _0x3737d9[_0x570226(0x277)][_0x570226(0xcf)]('Session\x20DTMF', _0x518ccb);
766
- }), this[_0x327ece(0x214)]['on'](_0x327ece(0x218), function (_0x3cbdd0) {
767
- const _0x337911 = _0x327ece;
768
-
769
- _0x3737d9[_0x337911(0x277)][_0x337911(0xcf)]('New\x20session\x20info', _0x3cbdd0);
770
- }), this[_0x327ece(0x214)]['on'](_0x327ece(0x1c7), function () {
771
- const _0x1b2ee7 = _0x327ece;
772
- _0x3737d9['_isOnHold'] = !![], _0x3737d9[_0x1b2ee7(0x23d)](), _0x3737d9['_setSessionState'](_0x1b2ee7(0xca));
773
- }), this['_webRTCSession']['on'](_0x327ece(0x185), function () {
774
- const _0x232b5d = _0x327ece;
775
- _0x3737d9[_0x232b5d(0x12b)] = ![], _0x3737d9[_0x232b5d(0x23d)](), _0x3737d9[_0x232b5d(0x1e1)](_0x232b5d(0x103));
776
- }), this[_0x327ece(0x214)]['on'](_0x327ece(0x215), function (_0xc3017a) {
777
- const _0x195e1f = _0x327ece;
778
- _0x3737d9[_0x195e1f(0x277)][_0x195e1f(0xcf)]('Microphone\x20muted', _0xc3017a), _0x3737d9[_0x195e1f(0x1dd)] = !![], _0x3737d9[_0x195e1f(0x24e)]();
779
- }), this['_webRTCSession']['on']('unmuted', function (_0x41ece5) {
780
- const _0x2620eb = _0x327ece;
781
- _0x3737d9[_0x2620eb(0x277)][_0x2620eb(0xcf)]('Microphone\x20unmuted', _0x41ece5), _0x3737d9[_0x2620eb(0x1dd)] = ![], _0x3737d9['_fireMuteStateEvent']();
782
- }), this['_webRTCSession']['on'](_0x327ece(0x119), function (_0x135dc9) {
783
- const _0x27d8e = _0x327ece;
784
-
785
- _0x3737d9[_0x27d8e(0x277)][_0x27d8e(0xcf)](_0x27d8e(0x186), _0x135dc9);
786
- }), this[_0x327ece(0x214)]['on'](_0x327ece(0x256), function (_0x560fb6) {
787
- const _0x2ec07d = _0x327ece;
788
-
789
- _0x3737d9['log']['debug'](_0x2ec07d(0x18a), _0x560fb6);
790
- }), this['_webRTCSession']['on'](_0x327ece(0x1ab), function (_0x330581) {
791
- const _0x266a70 = _0x327ece;
792
-
793
- _0x3737d9[_0x266a70(0x277)][_0x266a70(0x247)](_0x266a70(0x198), _0x330581);
794
- }), _0x3737d9[_0x327ece(0x214)]['connection'] && _0x3737d9[_0x327ece(0x1cc)](_0x3737d9[_0x327ece(0x214)]), this[_0x327ece(0x277)][_0x327ece(0xcf)](_0x327ece(0x11d)), this[_0x327ece(0x277)][_0x327ece(0xcf)](this);
795
- }
796
-
797
- [a0_0x35184d(0x1da)]() {
798
- let _0x9c04b8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
799
-
800
- const _0xc6240b = a0_0x35184d;
801
- !_0x9c04b8 ? (this[_0xc6240b(0x277)][_0xc6240b(0x258)](_0xc6240b(0xc9)), this[_0xc6240b(0x214)]['terminate']()) : (this[_0xc6240b(0x277)][_0xc6240b(0x258)](_0xc6240b(0x221) + _0x9c04b8), this[_0xc6240b(0x25d)] = _0x9c04b8, this[_0xc6240b(0x214)][_0xc6240b(0xe3)]({
802
- 'extraHeaders': ['X-HDISP:\x20' + _0x9c04b8]
803
- }));
804
- }
805
-
806
- [a0_0x35184d(0x235)]() {
807
- let _0xb41583 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
808
-
809
- const _0x153906 = a0_0x35184d;
810
- let _0x33c89b = {
811
- 'mediaConstraints': {
812
- 'audio': !![],
813
- 'video': ![]
814
- },
815
- 'pcConfig': {
816
- 'iceServers': [{
817
- 'urls': ['stun:stun.l.google.com:19302']
818
- }]
819
- },
820
- 'extraHeaders': ['X-Call-token:\x20' + this['_phone']['options'][_0x153906(0x1ba)]]
821
- };
822
- _0xb41583 && _0x33c89b['extraHeaders'][_0x153906(0xfd)](_0x153906(0x1e7) + encodeURI(_0xb41583[_0x153906(0x227)]()[_0x153906(0x26b)](0x0, 0xff))), this[_0x153906(0x214)][_0x153906(0x235)](_0x33c89b), this[_0x153906(0x1cc)](this['_webRTCSession']);
823
- }
824
-
825
- [a0_0x35184d(0x187)]() {
826
- let _0x39c653 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0x25b;
827
-
828
- let _0xa28556 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : a0_0x35184d(0x19b);
829
-
830
- const _0x1c32d9 = a0_0x35184d;
831
- this['log'][_0x1c32d9(0x258)](_0x1c32d9(0xd0)), this[_0x1c32d9(0x214)]['terminate']({
832
- 'status_code': _0x39c653,
833
- 'reason_phrase': _0xa28556
834
- });
835
- }
836
-
837
- get [a0_0x35184d(0x108)]() {
838
- const _0x5db6cb = a0_0x35184d;
839
- return this[_0x5db6cb(0x14a)];
840
- }
841
-
842
- get [a0_0x35184d(0xd3)]() {
843
- const _0x19835d = a0_0x35184d;
844
- return this[_0x19835d(0x1c6)];
845
- }
846
-
847
- get [a0_0x35184d(0x1cd)]() {
848
- const _0x9e7eb8 = a0_0x35184d;
849
- return this[_0x9e7eb8(0x1be)];
850
- }
851
-
852
- get ['originatingNumber']() {
853
- const _0x2f86cd = a0_0x35184d;
854
- return this[_0x2f86cd(0x134)];
855
- }
856
-
857
- set [a0_0x35184d(0xd3)](_0x352858) {
858
- const _0x3e6914 = a0_0x35184d;
859
- this[_0x3e6914(0x277)][_0x3e6914(0xcf)](_0x3e6914(0x11c) + _0x352858), this['_destinationNumber'] = _0x352858;
860
- }
861
-
862
- get [a0_0x35184d(0xd8)]() {
863
- const _0x289148 = a0_0x35184d;
864
- return this[_0x289148(0x13c)];
865
- }
866
-
867
- get [a0_0x35184d(0x126)]() {
868
- const _0x37de0f = a0_0x35184d;
869
- if (this['_isListenCall']) return this[_0x37de0f(0x277)]['debug']('Call\x20direction\x20is\x20LISTEN'), _0x37de0f(0x1d5);else {
870
- if (this[_0x37de0f(0x214)][_0x37de0f(0x126)] === 'incoming') return this[_0x37de0f(0x277)][_0x37de0f(0xcf)](_0x37de0f(0x229)), _0x37de0f(0x1d0);else return this[_0x37de0f(0x214)][_0x37de0f(0x126)] === _0x37de0f(0x26d) ? (this[_0x37de0f(0x277)]['debug']('Call\x20direction\x20is\x20OUTBOUND'), _0x37de0f(0x242)) : (this[_0x37de0f(0x277)]['error'](_0x37de0f(0x1d9) + this['_webRTCSession'][_0x37de0f(0x126)]), _0x37de0f(0x238));
871
- }
872
- }
873
-
874
- [a0_0x35184d(0x16c)]() {
875
- const _0x2e33ed = a0_0x35184d,
876
- _0x468080 = {
877
- 'extraHeaders': ['Record:\x20on']
878
- };
879
-
880
- this[_0x2e33ed(0x277)][_0x2e33ed(0xcf)](_0x2e33ed(0x1b5));
881
-
882
- const _0x5ac582 = this;
883
-
884
- this[_0x2e33ed(0x214)]['once'](_0x2e33ed(0x218), _0x24058f => {
885
- const _0x59a152 = _0x2e33ed;
886
- _0x24058f['originator'] === _0x59a152(0x133) && (_0x24058f[_0x59a152(0x258)]['on'](_0x59a152(0x240), function () {
887
- const _0x3a8d95 = _0x59a152;
888
- _0x5ac582[_0x3a8d95(0x277)]['info']('Recording\x20started\x20successfully'), _0x5ac582[_0x3a8d95(0x117)] = !![];
889
-
890
- try {
891
- _0x5ac582[_0x3a8d95(0x1af)](_0x3a8d95(0x1c2), {
892
- 'state': !![],
893
- 'error': null
894
- });
895
- } catch (_0x290181) {
896
- _0x5ac582[_0x3a8d95(0x277)]['error'](_0x3a8d95(0x24d) + _0x290181);
897
- }
898
- }), _0x24058f[_0x59a152(0x258)]['on'](_0x59a152(0x161), function (_0x1e5787) {
899
- const _0x33b11f = _0x59a152;
900
- _0x5ac582[_0x33b11f(0x120)] = _0x1e5787[_0x33b11f(0x22f)][_0x33b11f(0x239)], _0x5ac582[_0x33b11f(0x277)][_0x33b11f(0x247)]('Recording\x20start\x20failed:\x20' + _0x5ac582[_0x33b11f(0x120)]), _0x5ac582[_0x33b11f(0x177)]();
901
- }));
902
- }), this[_0x2e33ed(0x214)][_0x2e33ed(0x1e5)](_0x2e33ed(0x181), null, _0x468080);
903
- }
904
-
905
- ['stopRecording']() {
906
- const _0x18f638 = a0_0x35184d,
907
- _0x56b212 = {
908
- 'extraHeaders': [_0x18f638(0x118)]
909
- };
910
-
911
- this[_0x18f638(0x277)][_0x18f638(0xcf)](_0x18f638(0x25c));
912
-
913
- const _0x162e9a = this;
914
-
915
- this['_webRTCSession'][_0x18f638(0x263)](_0x18f638(0x218), _0x197195 => {
916
- const _0x1f0de5 = _0x18f638;
917
- _0x197195['info']['on'](_0x1f0de5(0x240), function () {
918
- const _0x336a64 = _0x1f0de5;
919
- _0x162e9a[_0x336a64(0x277)][_0x336a64(0x258)]('Recording\x20stopped\x20successfully'), _0x162e9a[_0x336a64(0x117)] = ![];
920
-
921
- try {
922
- _0x162e9a[_0x336a64(0x1af)]('recordingStateChange', {
923
- 'state': ![],
924
- 'error': null
925
- });
926
- } catch (_0x2711bd) {
927
- _0x162e9a['log'][_0x336a64(0x247)](_0x336a64(0x24d) + _0x2711bd);
928
- }
929
- }), _0x197195['info']['on']('failed', function (_0x17c6f1) {
930
- const _0x29611f = _0x1f0de5;
931
-
932
- _0x162e9a['log']['error'](_0x29611f(0x155) + _0x17c6f1[_0x29611f(0x22f)]['reason_phrase']);
933
-
934
- try {
935
- _0x162e9a[_0x29611f(0x1af)](_0x29611f(0x1c2), {
936
- 'state': _0x162e9a[_0x29611f(0x117)],
937
- 'error': _0x17c6f1[_0x29611f(0x22f)][_0x29611f(0x239)]
938
- });
939
- } catch (_0x86e83a) {
940
- _0x162e9a[_0x29611f(0x277)]['error'](_0x29611f(0x24d) + _0x86e83a);
941
- }
942
- });
943
- }), this[_0x18f638(0x214)][_0x18f638(0x1e5)](_0x18f638(0x181), null, _0x56b212);
944
- }
945
-
946
- ['toggleRecording']() {
947
- const _0x55d403 = a0_0x35184d;
948
- return !this[_0x55d403(0x117)] ? (this[_0x55d403(0x16c)](), !![]) : (this[_0x55d403(0x160)](), ![]);
949
- }
950
-
951
- get [a0_0x35184d(0x1e3)]() {
952
- const _0x46d2b5 = a0_0x35184d;
953
- return this[_0x46d2b5(0x117)];
954
- }
955
-
956
- [a0_0x35184d(0x231)]() {
957
- const _0x38a9df = a0_0x35184d;
958
- this[_0x38a9df(0x277)][_0x38a9df(0x258)](_0x38a9df(0x1ed)), this[_0x38a9df(0x214)][_0x38a9df(0x22a)]();
959
- }
960
-
961
- [a0_0x35184d(0x26f)]() {
962
- const _0x57bdf6 = a0_0x35184d;
963
- this[_0x57bdf6(0x277)][_0x57bdf6(0x258)](_0x57bdf6(0x1f4)), this['_webRTCSession'][_0x57bdf6(0xf6)]();
964
- }
965
-
966
- ['toggleMute']() {
967
- const _0x1e5511 = a0_0x35184d;
968
- !this[_0x1e5511(0x1dd)] ? this['muteMic']() : this['unmuteMic']();
969
- }
970
-
971
- get [a0_0x35184d(0x243)]() {
972
- const _0xdebb45 = a0_0x35184d;
973
- return this[_0xdebb45(0x1dd)];
974
- }
975
-
976
- ['hold']() {
977
- const _0x2c024d = a0_0x35184d;
978
- this[_0x2c024d(0x277)][_0x2c024d(0x258)](_0x2c024d(0xdc)), this[_0x2c024d(0x214)][_0x2c024d(0x1c7)]();
979
- }
980
-
981
- [a0_0x35184d(0x185)]() {
982
- const _0x50a9fb = a0_0x35184d;
983
- this[_0x50a9fb(0x277)]['info']('Uncall\x20call'), this[_0x50a9fb(0x171)][_0x50a9fb(0x175)](), this['_webRTCSession'][_0x50a9fb(0x185)]();
984
- }
985
-
986
- [a0_0x35184d(0x25b)]() {
987
- const _0x5dc077 = a0_0x35184d;
988
- !this[_0x5dc077(0x12b)] ? this[_0x5dc077(0x1c7)]() : this[_0x5dc077(0x185)]();
989
- }
990
-
991
- get [a0_0x35184d(0x1ff)]() {
992
- const _0x2337f8 = a0_0x35184d;
993
- return this[_0x2337f8(0x12b)];
994
- }
995
-
996
- [a0_0x35184d(0x264)](_0x520a56) {
997
- let _0xf1da67 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !![];
998
-
999
- const _0x4121b8 = a0_0x35184d;
1000
- if (!(_0x520a56 in DTMF_FREQUENCY_TABLE)) throw new _common.Exceptions[_0x4121b8(0x266)](_0x4121b8(0x1b6));
1001
- this[_0x4121b8(0x277)][_0x4121b8(0x258)](_0x4121b8(0x1bf) + _0x520a56), this[_0x4121b8(0x214)][_0x4121b8(0x264)](_0x520a56);
1002
-
1003
- if (_0xf1da67) {
1004
- const _0x32ca07 = DTMF_FREQUENCY_TABLE[_0x520a56];
1005
- if (this[_0x4121b8(0x1dd)]) this[_0x4121b8(0x277)][_0x4121b8(0xcf)](_0x4121b8(0x19d)), this[_0x4121b8(0x171)][_0x4121b8(0x158)](0x1f4, _0x32ca07[0x0], _0x32ca07[0x1]);else {
1006
- this[_0x4121b8(0x277)][_0x4121b8(0xcf)](_0x4121b8(0xc7)), this[_0x4121b8(0x214)]['mute']();
1007
-
1008
- const _0x27567f = this;
1009
-
1010
- this['_phone'][_0x4121b8(0x158)](0x1f4, _0x32ca07[0x0], _0x32ca07[0x1], function () {
1011
- const _0x573577 = _0x4121b8;
1012
- _0x27567f[_0x573577(0x277)][_0x573577(0xcf)]('Unmute\x20mic\x20after\x20DTMF'), _0x27567f[_0x573577(0x214)][_0x573577(0xf6)]();
1013
- });
1014
- }
1015
- }
1016
- }
1017
-
1018
- [a0_0x35184d(0x163)](_0x58160c) {
1019
- const _0x5d5cf9 = a0_0x35184d;
1020
-
1021
- this[_0x5d5cf9(0x277)]['info'](_0x5d5cf9(0x176) + this[_0x5d5cf9(0x108)] + _0x5d5cf9(0x15a) + _0x58160c[_0x5d5cf9(0x108)]);
1022
-
1023
- const _0x46b7ba = this['_webRTCSession']['refer'](this[_0x5d5cf9(0x214)][_0x5d5cf9(0x101)][_0x5d5cf9(0xed)], {
1024
- 'replaces': _0x58160c[_0x5d5cf9(0x214)]
1025
- }),
1026
- _0x4b7ee4 = this;
1027
-
1028
- _0x46b7ba['on'](_0x5d5cf9(0x21e), function () {
1029
- const _0x199abc = _0x5d5cf9;
1030
-
1031
- _0x4b7ee4['log'][_0x199abc(0x258)](_0x199abc(0xce));
1032
- }), _0x46b7ba['on'](_0x5d5cf9(0x1fe), function (_0x2d20b2) {
1033
- const _0x26e6b0 = _0x5d5cf9;
1034
-
1035
- _0x4b7ee4[_0x26e6b0(0x277)][_0x26e6b0(0x247)](_0x26e6b0(0x1e9) + _0x2d20b2);
1036
- }), _0x46b7ba['on'](_0x5d5cf9(0x161), function (_0x59d684) {
1037
- const _0x12168c = _0x5d5cf9;
1038
-
1039
- _0x4b7ee4[_0x12168c(0x277)]['error'](_0x12168c(0x178) + _0x59d684);
1040
- });
1041
- }
1042
-
1043
- [a0_0x35184d(0x271)](_0x3de786) {
1044
- let _0x53bfb1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ![];
1045
-
1046
- const _0x26b660 = a0_0x35184d;
1047
- if (!this[_0x26b660(0x171)][_0x26b660(0x154)][_0x26b660(0x1ac)]) throw new _common.Exceptions['NotAllowed'](_0x26b660(0x135));
1048
-
1049
- this[_0x26b660(0x277)]['info']('Playback\x20media\x20file\x20' + _0x3de786 + '\x20hangup\x20after\x20' + _0x53bfb1);
1050
-
1051
- const _0x2ec2a9 = this[_0x26b660(0x171)]['_eventClient'][_0x26b660(0x1b2)](_0x26b660(0xe7), {
1052
- 'call_uuid': this[_0x26b660(0x108)],
1053
- 'call_command': 'playback',
1054
- 'media_file_id': _0x3de786,
1055
- 'hangup_after': _0x53bfb1
1056
- });
1057
-
1058
- return _0x53bfb1 && (this[_0x26b660(0x171)]['_remoteAudioElement'][_0x26b660(0xeb)] = null, this[_0x26b660(0x214)]['mute'](), _0x2ec2a9['then'](() => {
1059
- const _0x184bd6 = _0x26b660;
1060
-
1061
- this[_0x184bd6(0x1e1)](_0x184bd6(0x111));
1062
- })), _0x2ec2a9;
1063
- }
1064
-
1065
- [a0_0x35184d(0x11a)]() {
1066
- let _0x3038c4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0x0;
1067
-
1068
- const _0x582d5f = a0_0x35184d;
1069
- if (!this['direction'] === _0x582d5f(0x1d5)) throw new _common.Exceptions[_0x582d5f(0x16d)](_0x582d5f(0x203));
1070
- if (_0x3038c4 < 0x0 || _0x3038c4 > 0x2) throw new _common.Exceptions[_0x582d5f(0x194)]('Invalid\x20mode');
1071
-
1072
- let _0x11b105;
1073
-
1074
- _0x3038c4 === 0x0 && (_0x11b105 = 0x0), _0x3038c4 === 0x1 && (_0x11b105 = 0x2), _0x3038c4 === 0x2 && (_0x11b105 = 0x3), this['sendDTMF'](_0x11b105, ![]), this['_whisperMode'] = _0x3038c4, this[_0x582d5f(0x217)]();
1075
- }
1076
-
1077
- [a0_0x35184d(0x1d4)]() {
1078
- const _0x34be96 = a0_0x35184d,
1079
- _0x48cffe = this;
1080
-
1081
- !this['_durationUpdTimerObj'] && (this[_0x34be96(0x116)] = setInterval(function () {
1082
- const _0x387caf = _0x34be96,
1083
- _0x375d05 = _0x48cffe[_0x387caf(0x12f)] ? Date[_0x387caf(0x21f)]() - _0x48cffe[_0x387caf(0x12f)] : null,
1084
- _0x4c3e97 = {
1085
- 'uuid': _0x48cffe['_callUUID'],
1086
- 'beginTime': _0x48cffe[_0x387caf(0xef)],
1087
- 'answerTime': _0x48cffe[_0x387caf(0x12f)],
1088
- 'endTime': _0x48cffe[_0x387caf(0x230)],
1089
- 'duration': Date[_0x387caf(0x21f)]() - _0x48cffe['_callBeginTime'],
1090
- 'durationStr': _common.Tools['createDurationString'](Date[_0x387caf(0x21f)]() - _0x48cffe[_0x387caf(0xef)]),
1091
- 'activeDuration': _0x375d05,
1092
- 'activeDurationStr': _0x375d05 ? _common.Tools[_0x387caf(0x16b)](_0x375d05) : ''
1093
- };
1094
-
1095
- try {
1096
- _0x48cffe['emit'](_0x387caf(0x1c9), _0x4c3e97);
1097
- } catch (_0x35584f) {
1098
- _0x48cffe[_0x387caf(0x277)][_0x387caf(0x247)](_0x387caf(0x197) + _0x35584f);
1099
- }
1100
- }, 0x3e8));
1101
- }
1102
-
1103
- [a0_0x35184d(0xcb)]() {
1104
- const _0x1a4f61 = a0_0x35184d;
1105
-
1106
- if (!this[_0x1a4f61(0x1a3)]) {
1107
- const _0x30e52e = {
1108
- 'outboundPacketsSent': 0x0,
1109
- 'outboundBytesSent': 0x0,
1110
- 'outboundPacketsLost': 0x0,
1111
- 'outboundJitter': 0x0,
1112
- 'inboundPacketsReceived': 0x0,
1113
- 'inboundBytesReceived': 0x0,
1114
- 'inboundPacketsLost': 0x0,
1115
- 'inboundJitter': 0x0,
1116
- 'roundTripTime': 0x0
1117
- };
1118
- this[_0x1a4f61(0x267)] = Object[_0x1a4f61(0x17f)]({}, _0x30e52e), this[_0x1a4f61(0x1a3)] = setInterval(() => {
1119
- const _0x1b0703 = _0x1a4f61;
1120
-
1121
- this[_0x1b0703(0x214)][_0x1b0703(0x273)][_0x1b0703(0x204)]()[_0x1b0703(0x1a5)](_0x50aa2d => {
1122
- const _0x1a6192 = _0x1b0703;
1123
-
1124
- let _0x7ff17c = Object[_0x1a6192(0x17f)]({}, _0x30e52e),
1125
- _0x235051 = Object['assign']({}, _0x30e52e);
1126
-
1127
- for (let _0x2770cf of _0x50aa2d[_0x1a6192(0x15b)]()) {
1128
- switch (_0x2770cf['type']) {
1129
- case _0x1a6192(0x22e):
1130
- _0x7ff17c[_0x1a6192(0x100)] = _0x2770cf[_0x1a6192(0x180)], _0x235051['outboundPacketsSent'] = _0x2770cf[_0x1a6192(0x180)] - this[_0x1a6192(0x267)][_0x1a6192(0x100)], _0x7ff17c['outboundBytesSent'] = _0x2770cf[_0x1a6192(0x122)], _0x235051['outboundBytesSent'] = _0x2770cf['bytesSent'] - this[_0x1a6192(0x267)][_0x1a6192(0xee)];
1131
- break;
1132
-
1133
- case _0x1a6192(0x110):
1134
- _0x7ff17c['inboundPacketsReceived'] = _0x2770cf[_0x1a6192(0xf0)], _0x235051[_0x1a6192(0x19e)] = _0x2770cf['packetsReceived'] - this[_0x1a6192(0x267)][_0x1a6192(0x19e)], _0x7ff17c['inboundBytesReceived'] = _0x2770cf['bytesReceived'], _0x235051[_0x1a6192(0x150)] = _0x2770cf[_0x1a6192(0x123)] - this[_0x1a6192(0x267)][_0x1a6192(0x150)], _0x7ff17c[_0x1a6192(0x228)] = _0x2770cf[_0x1a6192(0x1e4)], _0x235051[_0x1a6192(0x228)] = _0x2770cf[_0x1a6192(0x1e4)] - this[_0x1a6192(0x267)]['inboundPacketsLost'], _0x7ff17c[_0x1a6192(0x211)] = _0x2770cf['jitter'] * 0x3e8, _0x235051[_0x1a6192(0x211)] = _0x2770cf['jitter'] * 0x3e8;
1135
- break;
1136
-
1137
- case _0x1a6192(0xe0):
1138
- _0x7ff17c[_0x1a6192(0x19a)] = _0x2770cf[_0x1a6192(0x1e4)], _0x235051[_0x1a6192(0x19a)] = _0x2770cf[_0x1a6192(0x1e4)] - this[_0x1a6192(0x267)][_0x1a6192(0x19a)], _0x7ff17c[_0x1a6192(0x1c1)] = _0x2770cf['jitter'] * 0x3e8, _0x235051[_0x1a6192(0x1c1)] = _0x2770cf[_0x1a6192(0x202)] * 0x3e8, _0x7ff17c[_0x1a6192(0xe8)] = _0x2770cf[_0x1a6192(0xe8)] * 0x3e8, _0x235051[_0x1a6192(0xe8)] = _0x2770cf[_0x1a6192(0xe8)] * 0x3e8;
1139
- break;
1140
-
1141
- default:
1142
- break;
1143
- }
1144
- }
1145
-
1146
- this['_currentReport'] = this[_0x1a6192(0x10f)](_0x7ff17c);
1147
-
1148
- if (_0x7ff17c[_0x1a6192(0xe8)]) {
1149
- const _0x416aee = {
1150
- 'total': this[_0x1a6192(0x267)],
1151
- 'delta': this[_0x1a6192(0x10f)](_0x235051)
1152
- };
1153
-
1154
- try {
1155
- this[_0x1a6192(0x1af)](_0x1a6192(0x1c3), _0x416aee);
1156
- } catch (_0x12436f) {
1157
- this[_0x1a6192(0x277)]['error'](_0x1a6192(0x1fc) + _0x12436f);
1158
- }
1159
- }
1160
- });
1161
- }, 0x1388);
1162
- }
1163
- }
1164
-
1165
- [a0_0x35184d(0x10f)](_0x3349d4) {
1166
- const _0x2bdc76 = a0_0x35184d;
1167
- _0x3349d4[_0x2bdc76(0xea)] = _0x3349d4[_0x2bdc76(0x19a)] / _0x3349d4[_0x2bdc76(0x100)], _0x3349d4['inboundPacketLossPct'] = _0x3349d4[_0x2bdc76(0x228)] / _0x3349d4['inboundPacketsReceived'], _0x3349d4['effectiveLatency'] = _0x3349d4[_0x2bdc76(0xe8)] + (_0x3349d4[_0x2bdc76(0x211)] + _0x3349d4[_0x2bdc76(0x1c1)]) + 0xa;
1168
-
1169
- const _0xe8010b = (_0x3349d4[_0x2bdc76(0xea)] + _0x3349d4[_0x2bdc76(0x188)]) * 0x64,
1170
- _0xc6948d = 0x5f * _0xe8010b / (_0xe8010b + 0xa),
1171
- _0x15a781 = _0x3349d4[_0x2bdc76(0x22d)] * 0.1;
1172
-
1173
- _0x3349d4['rFactor'] = Math['max'](0x0, 0x64 - _0xc6948d - _0x15a781), _0x3349d4[_0x2bdc76(0x143)] = 0x1 + 0.035 * _0x3349d4[_0x2bdc76(0x275)] + 0.000007 * _0x3349d4[_0x2bdc76(0x275)] * (_0x3349d4[_0x2bdc76(0x275)] - 0x3c) * (0x64 - _0x3349d4['rFactor']);
1174
-
1175
- switch (!![]) {
1176
- case _0x3349d4['rFactor'] < 0x32:
1177
- _0x3349d4['qualityString'] = _0x2bdc76(0xc5);
1178
- break;
1179
-
1180
- case _0x3349d4['rFactor'] < 0x46:
1181
- _0x3349d4['qualityString'] = _0x2bdc76(0x13b);
1182
- break;
1183
-
1184
- case _0x3349d4['rFactor'] < 0x50:
1185
- _0x3349d4[_0x2bdc76(0x130)] = _0x2bdc76(0x128);
1186
- break;
1187
-
1188
- case _0x3349d4[_0x2bdc76(0x275)] < 0x5a:
1189
- _0x3349d4[_0x2bdc76(0x130)] = _0x2bdc76(0x16a);
1190
- break;
1191
-
1192
- case _0x3349d4['rFactor'] <= 0x64:
1193
- _0x3349d4[_0x2bdc76(0x130)] = 'Excellent';
1194
- break;
1195
-
1196
- default:
1197
- _0x3349d4['qualityString'] = _0x2bdc76(0x212);
1198
- }
1199
-
1200
- return _0x3349d4;
1201
- }
1202
-
1203
- [a0_0x35184d(0x1e1)](_0x2a3c7b) {
1204
- let _0x1224b6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1205
-
1206
- const _0x154ce8 = a0_0x35184d;
1207
-
1208
- this['log'][_0x154ce8(0xcf)](_0x154ce8(0x1fb) + _0x2a3c7b);
1209
-
1210
- _0x1224b6 && this[_0x154ce8(0x277)][_0x154ce8(0xcf)](_0x1224b6);
1211
- this[_0x154ce8(0x13c)] = _0x2a3c7b;
1212
-
1213
- try {
1214
- this[_0x154ce8(0x1af)](_0x154ce8(0x249), Object['assign']({
1215
- 'state': _0x2a3c7b,
1216
- 'uuid': this[_0x154ce8(0x14a)]
1217
- }, _0x1224b6));
1218
- } catch (_0x4a4a3e) {
1219
- this[_0x154ce8(0x277)]['error'](_0x154ce8(0x14f) + _0x4a4a3e);
1220
- }
1221
-
1222
- _0x2a3c7b === _0x154ce8(0x183) && (this['_callDisposition'] = this['_manualDisposition'] || _0x154ce8(0x21c), this[_0x154ce8(0xd7)]());
1223
-
1224
- if (_0x2a3c7b === _0x154ce8(0x19f)) {
1225
- _0x1224b6[_0x154ce8(0x20c)] === _0x154ce8(0x16f) && (this[_0x154ce8(0x1d3)] = _0x154ce8(0x18c), this[_0x154ce8(0x171)][_0x154ce8(0x22c)]['playSignalTones'] && this[_0x154ce8(0x171)][_0x154ce8(0x157)](ST_TEMP_UNAVAIL));
1226
- _0x1224b6[_0x154ce8(0x20c)] === _0x154ce8(0x245) && (this[_0x154ce8(0x1d3)] = _0x154ce8(0x21d), this['_phone'][_0x154ce8(0x22c)][_0x154ce8(0xe6)] && this['_phone'][_0x154ce8(0x157)](ST_INVALID_NUMBER));
1227
- _0x1224b6['cause'] === _0x154ce8(0x1aa) && (this[_0x154ce8(0x1d3)] = this[_0x154ce8(0x25d)] || _0x154ce8(0x260));
1228
- _0x1224b6[_0x154ce8(0x20c)] === _0x154ce8(0xe9) && (this[_0x154ce8(0x126)] === 'INBOUND' ? this[_0x154ce8(0x1d3)] = 'REJECTED' : this[_0x154ce8(0x1d3)] = _0x154ce8(0x241));
1229
- _0x1224b6[_0x154ce8(0x20c)] === _0x154ce8(0x1c4) && (this[_0x154ce8(0x1d3)] = 'BUSY', this[_0x154ce8(0x171)][_0x154ce8(0x22c)][_0x154ce8(0xe6)] && this[_0x154ce8(0x171)][_0x154ce8(0x157)](ST_BUSY));
1230
-
1231
- if (this[_0x154ce8(0x214)][_0x154ce8(0x126)] === _0x154ce8(0x193)) {}
1232
-
1233
- this[_0x154ce8(0xd7)]();
1234
- }
1235
- }
1236
-
1237
- [a0_0x35184d(0xd7)]() {
1238
- const _0x3af1d8 = a0_0x35184d;
1239
- this['log'][_0x3af1d8(0x258)]('Call\x20finished'), this[_0x3af1d8(0x255)](), clearInterval(this[_0x3af1d8(0x116)]), clearInterval(this[_0x3af1d8(0x1a3)]), this[_0x3af1d8(0x171)][_0x3af1d8(0xf1)](this);
1240
- }
1241
-
1242
- ['_setAnswerCallTimeout'](_0x9d53d4) {
1243
- const _0x2d7dde = a0_0x35184d;
1244
- this[_0x2d7dde(0x277)][_0x2d7dde(0xcf)](_0x2d7dde(0x248) + _0x9d53d4), this[_0x2d7dde(0xfb)] = _0x9d53d4;
1245
- }
1246
-
1247
- [a0_0x35184d(0x177)]() {
1248
- const _0x18c465 = a0_0x35184d;
1249
-
1250
- try {
1251
- this[_0x18c465(0x1af)](_0x18c465(0x1c2), {
1252
- 'state': this[_0x18c465(0x117)],
1253
- 'error': this['_recordingError']
1254
- });
1255
- } catch (_0x4f5a20) {
1256
- this[_0x18c465(0x277)][_0x18c465(0x247)]('Exception\x20in\x20recording\x20state\x20change\x20event:\x20' + _0x4f5a20);
1257
- }
1258
- }
1259
-
1260
- [a0_0x35184d(0x24e)]() {
1261
- const _0x292031 = a0_0x35184d;
1262
-
1263
- try {
1264
- this[_0x292031(0x1af)](_0x292031(0x1cf), {
1265
- 'state': this['_isMuted']
1266
- });
1267
- } catch (_0x1b55a) {
1268
- this['log'][_0x292031(0x247)](_0x292031(0x1f6) + _0x1b55a);
1269
- }
1270
- }
1271
-
1272
- [a0_0x35184d(0x23d)]() {
1273
- const _0x17279d = a0_0x35184d;
1274
-
1275
- try {
1276
- this[_0x17279d(0x1af)]('holdStateChange', {
1277
- 'state': this[_0x17279d(0x12b)]
1278
- });
1279
- } catch (_0x22c4f7) {
1280
- this[_0x17279d(0x277)][_0x17279d(0x247)](_0x17279d(0x268) + _0x22c4f7);
1281
- }
1282
- }
1283
-
1284
- ['_fireWhisperModeChangeEvent']() {
1285
- const _0x24e3aa = a0_0x35184d;
1286
-
1287
- try {
1288
- this[_0x24e3aa(0x1af)](_0x24e3aa(0x1c0), {
1289
- 'mode': this[_0x24e3aa(0x1b1)]
1290
- });
1291
- } catch (_0x301208) {
1292
- this[_0x24e3aa(0x277)][_0x24e3aa(0x247)](_0x24e3aa(0xd9) + _0x301208);
1293
- }
1294
- }
1295
-
1296
- [a0_0x35184d(0x255)]() {
1297
- const _0x359f8d = a0_0x35184d;
1298
-
1299
- let _0x4a6871;
1300
-
1301
- _0x4a6871 = {
1302
- 'uuid': this[_0x359f8d(0x14a)],
1303
- 'direction': this[_0x359f8d(0x126)],
1304
- 'disposition': this[_0x359f8d(0x1d3)],
1305
- 'originatingNumber': this['_originatingNumber'],
1306
- 'destinationNumber': this[_0x359f8d(0x1c6)],
1307
- 'duration': this['_callEndTime'] - this[_0x359f8d(0xef)],
1308
- 'answerDuration': this[_0x359f8d(0x12f)] ? this['_callAnswerTime'] - this[_0x359f8d(0xef)] : null,
1309
- 'activeDuration': this[_0x359f8d(0x12f)] ? this[_0x359f8d(0x230)] - this[_0x359f8d(0x12f)] : null,
1310
- 'startTime': new Date(this[_0x359f8d(0xef)])[_0x359f8d(0x137)](),
1311
- 'endTime': new Date(this[_0x359f8d(0x230)])[_0x359f8d(0x137)](),
1312
- 'answerTime': this[_0x359f8d(0x12f)] ? new Date(this[_0x359f8d(0x12f)])['toISOString']() : null
1313
- }, _0x4a6871['durationStr'] = _common.Tools[_0x359f8d(0x16b)](_0x4a6871[_0x359f8d(0x1a4)]), _0x4a6871[_0x359f8d(0xc8)] = _0x4a6871[_0x359f8d(0x12d)] ? _common.Tools[_0x359f8d(0x16b)](_0x4a6871[_0x359f8d(0x12d)]) : '', _0x4a6871[_0x359f8d(0xf7)] = _0x4a6871[_0x359f8d(0x1fa)] ? _common.Tools[_0x359f8d(0x16b)](_0x4a6871[_0x359f8d(0x1fa)]) : '', _0x4a6871['callQualityReport'] = this[_0x359f8d(0x267)];
1314
-
1315
- try {
1316
- this[_0x359f8d(0x1af)](_0x359f8d(0x1a9), _0x4a6871);
1317
- } catch (_0x138a2b) {
1318
- this[_0x359f8d(0x277)]['error'](_0x359f8d(0x220) + _0x138a2b);
1319
- }
1320
- }
1321
-
1322
- [a0_0x35184d(0x1cc)](_0x4f7c43) {
1323
- const _0x327370 = a0_0x35184d;
1324
- this['_phone']['_endRepeatTone']();
1325
-
1326
- const _0x52f8db = this;
1327
-
1328
- _0x4f7c43[_0x327370(0x1cb)][_0x327370(0x20a)] = function (_0x3d1579) {
1329
- const _0x282f74 = _0x327370;
1330
- _0x52f8db[_0x282f74(0x277)]['debug'](_0x282f74(0xe1)), _0x52f8db['log'][_0x282f74(0xcf)](_0x3d1579), _0x52f8db[_0x282f74(0x171)][_0x282f74(0x1f7)][_0x282f74(0xeb)] = _0x3d1579[_0x282f74(0x1f8)][0x0];
1331
- };
1332
- }
1333
-
1334
- }
1335
-
1336
- exports.Session = Session;