@telegenta/webclient 2.0.11 → 2.0.12

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 (54) hide show
  1. package/README.md +0 -0
  2. package/babel.config.js +0 -0
  3. package/browser/telegenta.min.js +1 -1
  4. package/demos/add_phone_number.html +0 -0
  5. package/demos/calldata_available.html +0 -0
  6. package/demos/embedded_config.html +94 -94
  7. package/demos/event_client.html +225 -225
  8. package/demos/phone_client.html +557 -557
  9. package/demos/styles.css +0 -0
  10. package/demos/telegenta.min.js +1 -0
  11. package/docs/EventClient.html +1 -1
  12. package/docs/Phone.html +1 -1
  13. package/docs/Session.html +1 -1
  14. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  15. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -0
  16. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  17. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  18. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -0
  19. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  20. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  21. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -0
  22. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  23. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  24. package/docs/fonts/OpenSans-Light-webfont.svg +0 -0
  25. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  26. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  27. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -0
  28. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  29. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  30. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -0
  31. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  32. package/docs/global.html +1 -1
  33. package/docs/index.html +1 -1
  34. package/docs/scripts/linenumber.js +0 -0
  35. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  36. package/docs/scripts/prettify/lang-css.js +0 -0
  37. package/docs/scripts/prettify/prettify.js +0 -0
  38. package/docs/styles/jsdoc-default.css +0 -0
  39. package/docs/styles/prettify-jsdoc.css +0 -0
  40. package/docs/styles/prettify-tomorrow.css +0 -0
  41. package/embedded_client/embedded_phone.js +0 -0
  42. package/embedded_client/index.html +0 -0
  43. package/embedded_client/server.php +0 -0
  44. package/embedded_client/styles.css +0 -0
  45. package/embedded_client/tiny_rest_client.php +0 -0
  46. package/embedded_client/webphone_sprites.png +0 -0
  47. package/es5/event-client.js +175 -220
  48. package/es5/index.js +0 -0
  49. package/es5/phone-client.js +774 -1177
  50. package/package.json +1 -1
  51. package/src/event-client.js +1 -1
  52. package/src/index.js +0 -0
  53. package/src/phone-client.js +1 -1
  54. package/webpack.config.js +0 -0
@@ -17,27 +17,36 @@ var _camelcaseKeys = _interopRequireDefault(require("camelcase-keys"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- var _0x571f = ['muteStateChange', 'holdStateChange', 'Exception\x20in\x20hold\x20state\x20change\x20event:\x20', 'whisperModeChange', 'Exception\x20in\x20whisper\x20mode\x20change\x20event:\x20', 'toISOString', 'callQualityReport', 'callEnded', 'Exception\x20in\x20callEnded\x20event:\x20', 'ontrack', 'Start\x20media\x20output\x20(track):', '_mediaPermission', '_mediaPermissionError', '_UA', '_connectionState', '_isStarted', '_eventClient', '_options', '_sessionCounter', '_activeSessions', '_remoteAudioElement', 'autoplay', '_toneAudioElement', 'AUDIO', '_toneTimer', '_repeatToneActive', '_repeatToneSequence', '_toneGainProcessor', 'log', 'LogHandler', 'INFO', 'level', 'DEBUG', 'debug', 'JsSIP:*', 'disable', 'info', 'Get\x20media\x20permission', 'getUserMedia', 'then', 'error', 'start', '_checkMediaPermission', 'warning', 'Phone\x20already\x20started,\x20stopping\x20first', 'stop', 'assign', '_initToneGenerator', 'provisionToken', 'Using\x20provisioning\x20token\x20authorization', 'wssServer', 'wss_server', 'eventServer', 'authorizationUsername', 'wss_username', 'wss_password', 'wss_token', 'Using\x20manual\x20specified\x20credentials', 'InvalidOptions', 'Missing\x20username', 'password', 'callToken', 'useCallDataInfoEvent', 'Enabled\x20event\x20service\x20because\x20\x27useCallDataInfoEvent\x27\x20is\x20enabled', 'connectEventService', 'connect', 'Connected\x20to\x20event\x20server', 'calldata_available', 'subscribe', '_fireCallDataInfoEvent', 'Event\x20callback\x20failed:\x20', 'Subscription\x20successful\x20ID\x20=\x20', 'Subscribe\x20failed:\x20', 'Unable\x20to\x20connect\x20to\x20event\x20server:\x20', 'UnableToConnect', 'Unable\x20to\x20connect\x20phone\x20websocket:\x20', 'Starting\x20phone', '@telegenta.com', 'New\x20RTCSession', 'remote', 'newInboundSession', 'playRingOnIncoming', '_startRepeatTone', 'autoBusyIncoming', 'keys', 'length', 'Autorejecting\x20incoming\x20call\x20', 'uuid', '\x20because\x20there\x20is\x20already\x20active\x20calls', 'reject', 'Busy', '_addSession', '_setSessionState', 'INCOMING', '_fireIncomingCallEvent', 'CONNECTING', 'connected', '_setConnectionState', 'CONNECTED', 'disconnected', 'registered', 'REGISTERED', 'unregistered', 'UNREGISTERED', 'registrationFailed', 'REGISTRATION_FAILED', 'NotReady', 'Phone\x20is\x20not\x20started', 'Event\x20client\x20not\x20running,\x20not\x20stopping', 'disconnect', 'Unable\x20to\x20disconnect\x20event\x20client', 'call', '_checkForConnectingCalls', 'NotAllowed', 'Unable\x20to\x20make\x20new\x20calls\x20while\x20others\x20are\x20connecting', 'holdAllCalls', 'trim', 'replace', 'Calling\x20number:\x20', 'split', 'sip:', 'Initiating\x20listen\x20to\x20call\x20with\x20uuid\x20', '\x20on\x20media\x20switch\x20', 'listen-', 'getSessionByUUID', 'hasOwnProperty', 'options', 'push', 'hasMediaPermission', 'hasMediaPermissionError', 'browserSupported', 'browserIsFirefox', 'browserIsOpera', 'browserIsSafari', 'remoteAudioElement', 'playTone', 'Playing\x20tone\x20', '\x20/\x20', '\x20for\x20', '\x20ms', '_oscillator1', 'frequency', 'value', '_oscillator2', 'gain', 'toneVolume', 'stopTone', 'Repeating\x20tone\x20sequence\x20started', '_doRepeatTone', 'Playing\x20repeated\x20tone,\x20pos\x20=\x20', '_repeatToneSequencePos', '_endRepeatTone', 'webkitAudioContext', 'Audio\x20API\x20not\x20supported\x20by\x20this\x20browser', '_toneStreamNode', 'createMediaStreamDestination', 'srcObject', 'stream', 'createOscillator', 'state', 'ACTIVE', 'hold', '__containerId', 'Adding\x20new\x20session\x20', '\x20sessions:', 'emit', 'sessionCreated', 'Exception\x20in\x20sessionCreated\x20event:\x20', 'Removing\x20session\x20', 'sessionRemoved', 'Exception\x20in\x20sessionRemoved\x20event:\x20', 'Session\x20', '_removeSession', 'autoRemoveSessionTime', 'INITIALIZING', 'Connection\x20state:\x20', 'connectionStateChange', 'incomingCall', 'Exception\x20in\x20incomingCall\x20event:\x20', 'recordings', 'answerDuration', 'durationStr', 'createDurationString', 'duration', 'answerDurationStr', 'activeDurationStr', 'activeDuration', 'callDataInfo', 'Exception\x20in\x20callDataInfo\x20event:\x20', '_callUUID', '_webRTCSession', '_sessionState', '_isOnHold', '_isMuted', '_isRecording', '_recordingError', '_callBeginTime', '_callAnswerTime', '_callEndTime', '_durationUpdTimerObj', '_originatingNumber', '_destinationNumber', '_callDisposition', '_localNumberName', '_isListenCall', '_currentReport', '_answerCallTimeout', '_answerCallTimer', '_mediaSwitch', 'createUUID', 'Created\x20new\x20outbound\x20session\x20to:\x20', 'destinationNumber', 'X-Call-token:\x20', '_phone', 'X-Max-cost:\x20', 'maximumCallCost', 'extraHeaders', 'X-CID-Number-Id:\x20', 'explicitCallerId', 'X-Short-CID-Id:\x20', 'explicitShortCallerId', 'X-Meta-Info:\x20', 'toString', 'substr', 'record', 'InvalidParameter', 'Recording\x20enabled\x20and\x20kept\x20for\x20', '\x20days', 'X-Record:\x20', 'mediaSwitchURI', 'X-RMS:\x20', 'getOtherSessions', 'X-RMS:\x20sip:', 'Other\x20sessions\x20exist\x20but\x20media\x20switch\x20address\x20is\x20invalid', '_initWebRTCSession', 'answerCallTimeout', '_setAnswerCallTimeout', 'request', 'getHeader', 'X-P-UUID', 'X-DID-NAME', 'from', 'uri', 'user', 'Incoming\x20call\x20from\x20', 'X-MS', 'Media\x20switch\x20handling\x20call:\x20', 'session', 'sessions', 'candidate', 'type', 'relatedPort', 'Accepting\x20ICE\x20candidate:\x20', '_iceCandidateTimer', 'ready', 'ICE\x20Timeout\x20(', 'iceGatherTimeout', '\x20ms)\x20reached', 'connecting', '_startRTCPStatsUpdateTimer', 'sending', 'CALLING', 'progress', 'originator', 'PROGRESS', 'response', 'status_code', 'Answer\x20call\x20timeout\x20after\x20', 'accepted', 'X-Recording', 'Call\x20is\x20being\x20prerecorded', 'No\x20call\x20recording\x20started\x20yet', 'ended', 'now', 'TERMINATED', 'failed', 'message', 'reason_phrase', 'FAILED', 'cause', 'dtmf', 'Session\x20DTMF', 'newInfo', 'New\x20session\x20info', '_fireHoldStateEvent', 'ON_HOLD', 'unhold', 'muted', 'Microphone\x20muted', '_fireMuteStateEvent', 'unmuted', 'Microphone\x20unmuted', 'reinvite', 'Session\x20reinvite', 'Session\x20update', 'getusermediafailed', 'Getusermedia\x20failed', 'connection', '_handleRemoteAudio', 'WebRTCSession\x20object:', 'hangup', 'Hanging\x20up\x20call', 'terminate', 'Hanging\x20up\x20call\x20with\x20disposition\x20', '_manualDisposition', 'X-HDISP:\x20', 'answer', 'stun:stun.l.google.com:19302', 'Rejected\x20call', 'Rejecting\x20call', 'direction', 'LISTEN', 'incoming', 'INBOUND', 'Call\x20direction\x20is\x20OUTBOUND', 'OUTBOUND', 'Unknown\x20call\x20direction:\x20', 'startRecording', 'Record:\x20on', 'Request\x20start\x20recording', 'once', 'succeeded', 'Recording\x20started\x20successfully', 'Recording\x20start\x20failed:\x20', 'sendInfo', 'application/info', 'stopRecording', 'Record:\x20off', 'Request\x20stop\x20recording', 'Recording\x20stopped\x20successfully', 'Exception\x20in\x20recordingStateChange\x20event:\x20', 'recordingStateChange', 'isRecording', 'muteMic', 'Mute\x20microphone', 'mute', 'unmuteMic', 'Unmute\x20microphone', 'unmute', 'isMuted', 'Hold\x20call', 'isOnHold', 'sendDTMF', 'Invalid\x20DTMF\x20code', 'Sending\x20DTMF:\x20', 'Mic\x20already\x20muted,\x20just\x20sending\x20DTMF', 'Mute\x20mic\x20while\x20sending\x20DTMF', 'Unmute\x20mic\x20after\x20DTMF', 'transfer', 'Transferring\x20', '\x20=>\x20', 'refer', 'requestSucceeded', 'Transfer\x20completed\x20successfully', 'requestFailed', 'Transfer\x20rejected:\x20', 'Transfer\x20failed:\x20', 'playback', 'Event\x20service\x20not\x20enabled', 'Playback\x20media\x20file\x20', '\x20hangup\x20after\x20', 'call_command', 'PLAYBACK', 'setWhisperMode', 'Call\x20is\x20not\x20correct\x20type\x20(listen)', 'Invalid\x20mode', '_fireWhisperModeChangeEvent', '_startDurationUpdateTimer', 'Exception\x20in\x20call\x20duration\x20update\x20event:\x20', '_rtcpStatsTimer', 'getStats', 'values', 'outbound-rtp', 'outboundPacketsSent', 'packetsSent', 'outboundBytesSent', 'bytesSent', 'inbound-rtp', 'inboundPacketsReceived', 'packetsReceived', 'bytesReceived', 'inboundBytesReceived', 'inboundPacketsLost', 'packetsLost', 'inboundJitter', 'jitter', 'remote-inbound-rtp', 'outboundPacketsLost', 'outboundJitter', 'roundTripTime', '_calcReportMetrics', 'callQualityReportUpdate', 'Exception\x20in\x20call\x20quality\x20report\x20update\x20event:\x20', 'outboundPacketLossPct', 'inboundPacketLossPct', 'effectiveLatency', 'rFactor', 'Bad', 'qualityString', 'Fair', 'Good', 'Excellent', 'Error', 'Session\x20state:\x20', 'sessionStateChange', 'NORMAL', '_callFinished', 'Unavailable', 'TEMP_UNAVAIL', 'playSignalTones', 'INVALID_NUMBER', 'Canceled', 'NO_ANSWER', 'Rejected', 'REJECTED', 'BARRED', 'BUSY', 'Call\x20finished', '_fireCallEndedEvent', '_sessionTerminated', 'Setting\x20answer\x20call\x20timeout\x20to:\x20'];
20
+ const a0_0x35184d = a0_0x2d29;
21
21
 
22
- (function (_0x7ebfd7, _0x4048a2) {
23
- var _0x38b4df = function _0x38b4df(_0x3fa5a8) {
24
- while (--_0x3fa5a8) {
25
- _0x7ebfd7['push'](_0x7ebfd7['shift']());
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']());
26
33
  }
27
- };
34
+ }
35
+ })(a0_0x29ff, 0x44d7e);
28
36
 
29
- _0x38b4df(++_0x4048a2);
30
- })(_0x571f, 0x1b0);
37
+ function a0_0x2d29(_0x3cab44, _0x4a422b) {
38
+ const _0x29ff42 = a0_0x29ff();
31
39
 
32
- var _0x2b52 = function _0x2b52(_0x538dac, _0x480a7e) {
33
- _0x538dac = _0x538dac - 0x0;
34
- var _0x3a6337 = _0x571f[_0x538dac];
35
- return _0x3a6337;
36
- };
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
+ }
37
46
 
38
47
  const options = {
39
- 'wssServer': 'wss://api.telegenta.com/sip/',
40
- 'eventServer': 'wss://api.telegenta.com/es/',
48
+ 'wssServer': a0_0x35184d(0x272),
49
+ 'eventServer': a0_0x35184d(0x11b),
41
50
  'provisionToken': null,
42
51
  'authorizationUsername': null,
43
52
  'password': null,
@@ -54,8 +63,8 @@ const options = {
54
63
  'autoRemoveSessionTime': 0xbb8,
55
64
  'playRingOnIncoming': !![],
56
65
  'playCallInitializedTone': ![]
57
- };
58
- const DTMF_FREQUENCY_TABLE = {
66
+ },
67
+ DTMF_FREQUENCY_TABLE = {
59
68
  '1': [0x4b9, 0x2b9],
60
69
  '2': [0x538, 0x2b9],
61
70
  '3': [0x5c5, 0x2b9],
@@ -72,20 +81,20 @@ const DTMF_FREQUENCY_TABLE = {
72
81
  '0': [0x538, 0x3ad],
73
82
  '#': [0x5c5, 0x3ad],
74
83
  'd': [0x661, 0x3ad]
75
- };
76
- const ST_TEMP_UNAVAIL = [{
84
+ },
85
+ ST_TEMP_UNAVAIL = [{
77
86
  'd': 0xfa,
78
87
  'f1': 0x1a9,
79
88
  'f2': 0x0,
80
89
  'g': 0xfa
81
- }];
82
- const ST_BUSY = [{
90
+ }],
91
+ ST_BUSY = [{
83
92
  'd': 0x1f4,
84
93
  'f1': 0x1a9,
85
94
  'f2': 0x0,
86
95
  'g': 0x1f4
87
- }];
88
- const ST_INVALID_NUMBER = [{
96
+ }],
97
+ ST_INVALID_NUMBER = [{
89
98
  'd': 0x14d,
90
99
  'f1': 0x3b6,
91
100
  'f2': 0x0,
@@ -100,8 +109,8 @@ const ST_INVALID_NUMBER = [{
100
109
  'f1': 0x708,
101
110
  'f2': 0x0,
102
111
  'g': 0x3e8
103
- }];
104
- const ST_CALLINIT = [{
112
+ }],
113
+ ST_CALLINIT = [{
105
114
  'd': 0xc8,
106
115
  'f1': 0x1f4,
107
116
  'f2': 0x0,
@@ -111,14 +120,14 @@ const ST_CALLINIT = [{
111
120
  'f1': 0x2bc,
112
121
  'f2': 0x0,
113
122
  'g': 0x1388
114
- }];
115
- const ST_RINGBACK = [{
123
+ }],
124
+ ST_RINGBACK = [{
116
125
  'd': 0x3e8,
117
126
  'f1': 0x1a9,
118
127
  'f2': 0x0,
119
128
  'g': 0xfa0
120
- }];
121
- const ST_INCOMING = [{
129
+ }],
130
+ ST_INCOMING = [{
122
131
  'd': 0x96,
123
132
  'f1': 0x190,
124
133
  'f2': 0x0,
@@ -150,279 +159,205 @@ const ST_INCOMING = [{
150
159
  'g': 0xbb8
151
160
  }];
152
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
+
153
172
  class Phone extends _events.default {
154
173
  constructor() {
155
- let logger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
156
- super();
157
- this[_0x2b52('0x0')] = ![];
158
- this[_0x2b52('0x1')] = ![];
159
- this[_0x2b52('0x2')] = null;
160
- this[_0x2b52('0x3')] = null;
161
- this[_0x2b52('0x4')] = ![];
162
- this[_0x2b52('0x5')] = null;
163
- this[_0x2b52('0x6')] = null;
164
- this[_0x2b52('0x7')] = 0x0;
165
- this[_0x2b52('0x8')] = {};
166
- this[_0x2b52('0x9')] = document['createElement']('AUDIO');
167
- this[_0x2b52('0x9')][_0x2b52('0xa')] = !![];
168
- this[_0x2b52('0xb')] = document['createElement'](_0x2b52('0xc'));
169
- this[_0x2b52('0xb')][_0x2b52('0xa')] = !![];
170
- this[_0x2b52('0xd')] = null;
171
- this[_0x2b52('0xe')] = ![];
172
- this[_0x2b52('0xf')] = [];
173
- this['_repeatToneSequencePos'] = 0x0;
174
- this[_0x2b52('0x10')] = null;
175
- this['_oscillator1'] = null;
176
- this['_oscillator2'] = null;
177
- this[_0x2b52('0x11')] = logger ? logger : new _common.Logger[_0x2b52('0x12')](_common.Logger['LOGLVL'][_0x2b52('0x13')]);
178
-
179
- if (this[_0x2b52('0x11')][_0x2b52('0x14')] === _common.Logger['LOGLVL'][_0x2b52('0x15')]) {
180
- _jssip.default[_0x2b52('0x16')]['disable'](_0x2b52('0x17'));
181
- } else {
182
- _jssip.default[_0x2b52('0x16')][_0x2b52('0x18')]('JsSIP:*');
183
- }
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));
184
178
  }
185
179
 
186
- ['prepareMedia']() {
187
- this['log'][_0x2b52('0x19')](_0x2b52('0x1a'));
180
+ [a0_0x35184d(0x26c)]() {
181
+ const _0x38669a = a0_0x35184d;
182
+
183
+ this[_0x38669a(0x277)]['info']('Get\x20media\x20permission');
188
184
 
189
- const self = this;
190
- const constraints = {
185
+ const _0x47ad25 = this,
186
+ _0x4bad14 = {
191
187
  'audio': !![],
192
188
  'video': ![]
193
189
  };
194
- return new Promise(function (resolve, reject) {
195
- navigator['mediaDevices'][_0x2b52('0x1b')](constraints)[_0x2b52('0x1c')](() => {
196
- self['_mediaPermission'] = !![];
197
- self[_0x2b52('0x1')] = ![];
198
-
199
- self[_0x2b52('0x11')][_0x2b52('0x19')]('Media\x20permission\x20granted');
200
-
201
- resolve();
202
- }, err => {
203
- self[_0x2b52('0x0')] = ![];
204
- self['_mediaPermissionError'] = !![];
205
190
 
206
- self['log'][_0x2b52('0x1d')]('Denied\x20media\x20permission:\x20' + err);
191
+ return new Promise(function (_0x444a23, _0x113cb4) {
192
+ const _0x5113c5 = _0x38669a;
207
193
 
208
- reject(err);
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);
209
200
  });
210
201
  });
211
202
  }
212
203
 
213
- [_0x2b52('0x1e')](phoneOptions) {
214
- this[_0x2b52('0x1f')]();
204
+ [a0_0x35184d(0xd2)](_0x2c9d9e) {
205
+ const _0x3e19bf = a0_0x35184d;
215
206
 
216
- if (this[_0x2b52('0x4')]) {
217
- this[_0x2b52('0x11')][_0x2b52('0x20')](_0x2b52('0x21'));
207
+ this[_0x3e19bf(0x12a)]();
218
208
 
219
- this[_0x2b52('0x22')]();
220
- }
221
-
222
- this[_0x2b52('0x6')] = Object[_0x2b52('0x23')](options, phoneOptions);
223
-
224
- this[_0x2b52('0x24')]();
209
+ this['_isStarted'] && (this[_0x3e19bf(0x277)][_0x3e19bf(0x250)](_0x3e19bf(0x18b)), this['stop']());
210
+ this['_options'] = Object['assign'](options, _0x2c9d9e), this['_initToneGenerator']();
225
211
 
226
- if (this[_0x2b52('0x6')]['provisionToken']) {
227
- let pt = null;
212
+ if (this[_0x3e19bf(0x154)][_0x3e19bf(0x1ea)]) {
213
+ let _0x424c81 = null;
228
214
 
229
215
  try {
230
- pt = JSON['parse'](atob(this[_0x2b52('0x6')][_0x2b52('0x25')]));
231
- } catch (_0x46f239) {
232
- throw new _common.Exceptions['InvalidOptions'](_0x2b52('0x25'), 'Invalid\x20token');
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');
233
219
  }
234
220
 
235
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x26'));
236
-
237
- this[_0x2b52('0x6')][_0x2b52('0x27')] = pt[_0x2b52('0x28')];
238
- this[_0x2b52('0x6')][_0x2b52('0x29')] = pt['event_server'];
239
- this[_0x2b52('0x6')][_0x2b52('0x2a')] = pt[_0x2b52('0x2b')];
240
- this[_0x2b52('0x6')]['password'] = pt[_0x2b52('0x2c')];
241
- this['_options']['callToken'] = pt[_0x2b52('0x2d')];
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)];
242
222
  } else {
243
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x2e'));
244
-
245
- if (!this[_0x2b52('0x6')][_0x2b52('0x2a')]) {
246
- throw new _common.Exceptions[_0x2b52('0x2f')](_0x2b52('0x2a'), _0x2b52('0x30'));
247
- }
223
+ this['log'][_0x3e19bf(0x258)](_0x3e19bf(0x1b3));
248
224
 
249
- if (!this[_0x2b52('0x6')]['password']) {
250
- throw new _common.Exceptions[_0x2b52('0x2f')](_0x2b52('0x31'), 'Missing\x20password');
251
- }
252
-
253
- if (!this[_0x2b52('0x6')]['callToken']) {
254
- throw new _common.Exceptions[_0x2b52('0x2f')](_0x2b52('0x32'), 'Missing\x20call\x20token');
255
- }
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));
256
228
  }
257
229
 
258
- if (this[_0x2b52('0x6')][_0x2b52('0x33')] && !this[_0x2b52('0x6')]['connectEventService']) {
259
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x34'));
260
-
261
- this[_0x2b52('0x6')][_0x2b52('0x35')] = !![];
262
- }
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;
263
233
 
264
- if (this[_0x2b52('0x6')]['connectEventService']) {
265
- this[_0x2b52('0x5')] = new _eventClient.EventClient(this[_0x2b52('0x11')]);
234
+ this['log'][_0x47dad1(0x258)](_0x47dad1(0x1d6));
266
235
 
267
- this[_0x2b52('0x5')][_0x2b52('0x36')](this[_0x2b52('0x6')]['eventServer'])['then'](() => {
268
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x37'));
236
+ if (this[_0x47dad1(0x154)][_0x47dad1(0x1a1)]) {
237
+ let _0x2ecd0c = {
238
+ 'event_name': _0x47dad1(0x18e),
239
+ 'call_token': this[_0x47dad1(0x154)][_0x47dad1(0x1ba)]
240
+ };
269
241
 
270
- if (this[_0x2b52('0x6')][_0x2b52('0x33')]) {
271
- let eventSpec = {
272
- 'event_name': _0x2b52('0x38'),
273
- 'call_token': this['_options'][_0x2b52('0x32')]
274
- };
242
+ this[_0x47dad1(0x18d)][_0x47dad1(0x138)](_0x2ecd0c, _0x314bc4 => {
243
+ const _0x16d66a = _0x47dad1;
275
244
 
276
- this[_0x2b52('0x5')][_0x2b52('0x39')](eventSpec, data => {
277
- try {
278
- this['log'][_0x2b52('0x16')]('Received\x20remote\x20call\x20data\x20info');
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;
279
252
 
280
- this[_0x2b52('0x11')]['debug'](data);
253
+ this['log'][_0x2295a7(0x258)](_0x2295a7(0x23e) + _0x58f97d);
254
+ }, _0x14ce53 => {
255
+ const _0x4f46ae = _0x47dad1;
281
256
 
282
- this[_0x2b52('0x3a')](data);
283
- } catch (_0x5884cb) {
284
- this[_0x2b52('0x11')]['error'](_0x2b52('0x3b') + _0x5884cb);
285
- }
286
- })['then'](subscriptionId => {
287
- this['log']['info'](_0x2b52('0x3c') + subscriptionId);
288
- }, reason => {
289
- this['log']['error'](_0x2b52('0x3d') + reason);
290
- });
291
- }
292
- }, reason => {
293
- this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x3e') + reason);
294
- });
295
- }
257
+ this[_0x4f46ae(0x277)][_0x4f46ae(0x247)](_0x4f46ae(0x1fd) + _0x14ce53);
258
+ });
259
+ }
260
+ }, _0x278fa6 => {
261
+ const _0x4db0c2 = _0x3e19bf;
296
262
 
297
- let wsSocket = null;
263
+ this[_0x4db0c2(0x277)][_0x4db0c2(0x247)](_0x4db0c2(0x1f2) + _0x278fa6);
264
+ }));
265
+ let _0x504113 = null;
298
266
 
299
267
  try {
300
- wsSocket = new _jssip.default['WebSocketInterface'](this[_0x2b52('0x6')][_0x2b52('0x27')]);
301
- } catch (_0x57272f) {
302
- throw new _common.Exceptions[_0x2b52('0x3f')](_0x2b52('0x40') + _0x57272f);
268
+ _0x504113 = new _jssip.default[_0x3e19bf(0x270)](this[_0x3e19bf(0x154)]['wssServer']);
269
+ } catch (_0x55dea5) {
270
+ throw new _common.Exceptions[_0x3e19bf(0x169)](_0x3e19bf(0x26e) + _0x55dea5);
303
271
  }
304
272
 
305
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x41'));
306
-
307
- this[_0x2b52('0x11')][_0x2b52('0x16')](this[_0x2b52('0x6')]);
308
-
309
- this[_0x2b52('0x2')] = new _jssip.default['UA']({
310
- 'sockets': [wsSocket],
311
- 'authorization_user': this[_0x2b52('0x6')][_0x2b52('0x2a')],
312
- 'password': this['_options'][_0x2b52('0x31')],
313
- 'register': this['_options']['register'],
314
- 'display_name': this[_0x2b52('0x6')]['authorizationUsername'],
315
- 'uri': this[_0x2b52('0x6')][_0x2b52('0x2a')] + _0x2b52('0x42'),
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),
316
280
  'session_timers': ![]
317
281
  });
318
- const self = this;
319
- this['_UA']['on']('newRTCSession', function (data) {
320
- self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x43'));
321
282
 
322
- if (data['originator'] === _0x2b52('0x44')) {
323
- const session = new Session(self);
283
+ const _0x48b7b2 = this;
324
284
 
325
- session[_0x2b52('0x45')](data);
285
+ this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0x173), function (_0x42f2f5) {
286
+ const _0x404c8b = _0x3e19bf;
326
287
 
327
- if (self['_options'][_0x2b52('0x46')]) {
328
- self[_0x2b52('0x47')](ST_INCOMING);
329
- }
288
+ _0x48b7b2[_0x404c8b(0x277)]['debug'](_0x404c8b(0x1db));
289
+
290
+ if (_0x42f2f5[_0x404c8b(0x1e0)] === _0x404c8b(0xc4)) {
291
+ const _0x5e4924 = new Session(_0x48b7b2);
330
292
 
331
- if (self['_options'][_0x2b52('0x48')]) {
332
- if (Object[_0x2b52('0x49')](self[_0x2b52('0x8')])[_0x2b52('0x4a')] > 0x0) {
333
- self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x4b') + session[_0x2b52('0x4c')] + _0x2b52('0x4d'));
293
+ _0x5e4924[_0x404c8b(0x196)](_0x42f2f5);
334
294
 
335
- session[_0x2b52('0x4e')](0x1e6, _0x2b52('0x4f'));
295
+ _0x48b7b2[_0x404c8b(0x154)]['playRingOnIncoming'] && _0x48b7b2[_0x404c8b(0x157)](ST_INCOMING);
336
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');
337
300
  return;
338
- } else {
339
- self[_0x2b52('0x11')][_0x2b52('0x16')]('There\x20are\x20no\x20other\x20sessions,\x20adding\x20incoming\x20call');
340
- }
301
+ } else _0x48b7b2['log']['debug']('There\x20are\x20no\x20other\x20sessions,\x20adding\x20incoming\x20call');
341
302
  }
342
303
 
343
- self[_0x2b52('0x50')](session);
344
-
345
- session[_0x2b52('0x51')](_0x2b52('0x52'));
346
-
347
- self[_0x2b52('0x53')](session);
304
+ _0x48b7b2[_0x404c8b(0x17e)](_0x5e4924), _0x5e4924[_0x404c8b(0x1e1)](_0x404c8b(0x192)), _0x48b7b2[_0x404c8b(0x140)](_0x5e4924);
348
305
  }
349
- });
350
-
351
- this[_0x2b52('0x2')]['on']('connecting', function () {
352
- self['_setConnectionState'](_0x2b52('0x54'));
353
- });
306
+ }), this[_0x3e19bf(0x15e)]['on']('connecting', function () {
307
+ const _0x4e3946 = _0x3e19bf;
354
308
 
355
- this[_0x2b52('0x2')]['on'](_0x2b52('0x55'), function () {
356
- self[_0x2b52('0x56')](_0x2b52('0x57'));
357
- });
358
-
359
- this[_0x2b52('0x2')]['on'](_0x2b52('0x58'), function () {
360
- self[_0x2b52('0x56')]('DISCONNECTED');
361
- });
309
+ _0x48b7b2[_0x4e3946(0x1b9)](_0x4e3946(0x251));
310
+ }), this['_UA']['on'](_0x3e19bf(0x210), function () {
311
+ const _0x90aac = _0x3e19bf;
362
312
 
363
- this[_0x2b52('0x2')]['on'](_0x2b52('0x59'), function () {
364
- self['_setConnectionState'](_0x2b52('0x5a'));
365
- });
313
+ _0x48b7b2[_0x90aac(0x1b9)](_0x90aac(0x151));
314
+ }), this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0xdb), function () {
315
+ const _0x38734c = _0x3e19bf;
366
316
 
367
- this['_UA']['on'](_0x2b52('0x5b'), function () {
368
- self[_0x2b52('0x56')](_0x2b52('0x5c'));
369
- });
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;
370
322
 
371
- this[_0x2b52('0x2')]['on'](_0x2b52('0x5d'), function () {
372
- self['_setConnectionState'](_0x2b52('0x5e'));
373
- });
323
+ _0x48b7b2[_0x41d417(0x1b9)](_0x41d417(0x265));
324
+ }), this['_UA']['on']('registrationFailed', function () {
325
+ const _0x42aab0 = _0x3e19bf;
374
326
 
375
- this[_0x2b52('0x2')][_0x2b52('0x1e')]();
376
-
377
- this[_0x2b52('0x4')] = !![];
378
-
379
- this[_0x2b52('0x11')][_0x2b52('0x19')]('Successfully\x20started\x20phone');
327
+ _0x48b7b2[_0x42aab0(0x1b9)](_0x42aab0(0xf8));
328
+ }), this[_0x3e19bf(0x15e)]['start'](), this['_isStarted'] = !![], this['log'][_0x3e19bf(0x258)](_0x3e19bf(0x168));
380
329
  }
381
330
 
382
- [_0x2b52('0x22')]() {
383
- if (!this[_0x2b52('0x4')]) {
384
- throw new _common.Exceptions[_0x2b52('0x5f')](_0x2b52('0x60'));
385
- }
386
-
387
- this[_0x2b52('0x2')]['removeAllListeners']();
388
-
389
- this[_0x2b52('0x2')][_0x2b52('0x22')]();
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)];
390
335
 
391
- delete this[_0x2b52('0x2')];
392
-
393
- if (!this[_0x2b52('0x5')]) {
394
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x61'));
336
+ if (!this[_0x5f53d7(0x18d)]) {
337
+ this[_0x5f53d7(0x277)][_0x5f53d7(0xcf)]('Event\x20client\x20not\x20running,\x20not\x20stopping');
395
338
 
396
339
  return;
397
340
  }
398
341
 
399
342
  try {
400
- this[_0x2b52('0x5')][_0x2b52('0x62')]();
401
-
402
- delete this['_eventClient'];
403
- } catch (_0x56956c) {
404
- this[_0x2b52('0x11')]['warning'](_0x2b52('0x63'));
343
+ this[_0x5f53d7(0x18d)][_0x5f53d7(0x1d1)](), delete this[_0x5f53d7(0x18d)];
344
+ } catch (_0x2f9732) {
345
+ this[_0x5f53d7(0x277)][_0x5f53d7(0x250)](_0x5f53d7(0x106));
405
346
  }
406
347
 
407
- this[_0x2b52('0x4')] = ![];
408
-
409
- this[_0x2b52('0x11')][_0x2b52('0x19')]('Phone\x20client\x20successfully\x20stopped');
348
+ this[_0x5f53d7(0x1c8)] = ![], this[_0x5f53d7(0x277)][_0x5f53d7(0x258)](_0x5f53d7(0x19c));
410
349
  }
411
350
 
412
- [_0x2b52('0x64')](number) {
413
- let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
351
+ [a0_0x35184d(0x274)](_0x3c9f9f) {
352
+ let _0x290d21 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
414
353
 
415
- if (!this[_0x2b52('0x4')]) {
416
- throw new _common.Exceptions[_0x2b52('0x5f')](_0x2b52('0x60'));
417
- }
418
-
419
- if (this[_0x2b52('0x65')]()) {
420
- throw _common.Exceptions[_0x2b52('0x66')](_0x2b52('0x67'));
421
- }
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));
422
357
 
423
- this[_0x2b52('0x68')]();
358
+ this[_0x4acb00(0x175)]();
424
359
 
425
- const callParams = Object[_0x2b52('0x23')]({
360
+ const _0x1e0866 = Object[_0x4acb00(0x17f)]({
426
361
  'record': ![],
427
362
  'maximumCallCost': 0x0,
428
363
  'answerCallTimeout': 0x0,
@@ -430,307 +365,254 @@ class Phone extends _events.default {
430
365
  'explicitShortCallerId': null,
431
366
  'metaInfo': null,
432
367
  '_isListenCall': ![]
433
- }, params);
368
+ }, _0x290d21);
434
369
 
435
- number = number[_0x2b52('0x69')]()[_0x2b52('0x6a')](/ |\(|\)/g, '');
370
+ _0x3c9f9f = _0x3c9f9f['trim']()[_0x4acb00(0x20e)](/ |\(|\)/g, ''), this['log'][_0x4acb00(0x258)](_0x4acb00(0x1ef) + _0x3c9f9f);
436
371
 
437
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x6b') + number);
372
+ let _0x7def15 = new Session(this);
438
373
 
439
- let session = new Session(this);
440
- session['newOutboundSession'](number, callParams);
441
-
442
- this[_0x2b52('0x50')](session);
443
-
444
- return session;
374
+ return _0x7def15[_0x4acb00(0x199)](_0x3c9f9f, _0x1e0866), this[_0x4acb00(0x17e)](_0x7def15), _0x7def15;
445
375
  }
446
376
 
447
- ['listen'](listenKey) {
448
- const s = listenKey[_0x2b52('0x6c')]('@');
449
-
450
- let callUUID = s[0x0];
451
- let mediaSwitch = _0x2b52('0x6d') + s[0x1];
377
+ [a0_0x35184d(0x13a)](_0x522c08) {
378
+ const _0x162aa5 = a0_0x35184d,
379
+ _0x1b67e0 = _0x522c08[_0x162aa5(0x109)]('@');
452
380
 
453
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x6e') + callUUID + _0x2b52('0x6f') + mediaSwitch);
381
+ let _0x55ec63 = _0x1b67e0[0x0],
382
+ _0x133dda = 'sip:' + _0x1b67e0[0x1];
454
383
 
455
- return this[_0x2b52('0x64')](_0x2b52('0x70') + callUUID, {
456
- 'mediaSwitchURI': mediaSwitch,
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,
457
386
  '_isListenCall': !![]
458
387
  });
459
388
  }
460
389
 
461
- [_0x2b52('0x71')](uuid) {
462
- for (let key in this[_0x2b52('0x8')]) {
463
- if (this['_activeSessions'][_0x2b52('0x72')](key)) {
464
- if (this[_0x2b52('0x8')][key][_0x2b52('0x4c')] === uuid) {
465
- return this[_0x2b52('0x8')][key];
466
- }
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];
467
396
  }
468
397
  }
469
398
 
470
399
  return null;
471
400
  }
472
401
 
473
- get [_0x2b52('0x73')]() {
474
- return this['_options'];
402
+ get [a0_0x35184d(0x22c)]() {
403
+ const _0x4d58db = a0_0x35184d;
404
+ return this[_0x4d58db(0x154)];
475
405
  }
476
406
 
477
- get ['sessions']() {
478
- let s = [];
407
+ get [a0_0x35184d(0x24c)]() {
408
+ const _0x9589bf = a0_0x35184d;
409
+ let _0x379812 = [];
479
410
 
480
- for (let key in this[_0x2b52('0x8')]) {
481
- if (this[_0x2b52('0x8')][_0x2b52('0x72')](key)) {
482
- s[_0x2b52('0x74')](this[_0x2b52('0x8')][key]);
483
- }
411
+ for (let _0x2a145d in this['_activeSessions']) {
412
+ this[_0x9589bf(0x129)]['hasOwnProperty'](_0x2a145d) && _0x379812[_0x9589bf(0xfd)](this[_0x9589bf(0x129)][_0x2a145d]);
484
413
  }
485
414
 
486
- return s;
415
+ return _0x379812;
487
416
  }
488
417
 
489
- get [_0x2b52('0x75')]() {
490
- return this[_0x2b52('0x0')];
418
+ get ['hasMediaPermission']() {
419
+ return this['_mediaPermission'];
491
420
  }
492
421
 
493
- get [_0x2b52('0x76')]() {
494
- return this[_0x2b52('0x1')];
422
+ get [a0_0x35184d(0x24b)]() {
423
+ const _0x1c346b = a0_0x35184d;
424
+ return this[_0x1c346b(0x1e8)];
495
425
  }
496
426
 
497
427
  get ['isStarted']() {
498
- return this[_0x2b52('0x4')];
428
+ const _0x564d34 = a0_0x35184d;
429
+ return this[_0x564d34(0x1c8)];
499
430
  }
500
431
 
501
- get [_0x2b52('0x77')]() {
502
- return _common.Tools['browserIsChrome']() || _common.Tools[_0x2b52('0x78')]() || _common.Tools[_0x2b52('0x79')]() || _common.Tools[_0x2b52('0x7a')]();
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']();
503
435
  }
504
436
 
505
- get [_0x2b52('0x7b')]() {
506
- return this[_0x2b52('0x9')];
437
+ get [a0_0x35184d(0x209)]() {
438
+ const _0x2bf85b = a0_0x35184d;
439
+ return this[_0x2bf85b(0x1f7)];
507
440
  }
508
441
 
509
- [_0x2b52('0x7c')](duration, freq1) {
510
- let freq2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0x0;
511
- let callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
442
+ [a0_0x35184d(0x158)](_0x1bd8e5, _0x2fc88c) {
443
+ let _0x990bef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0x0;
512
444
 
513
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x7d') + freq1 + _0x2b52('0x7e') + freq2 + _0x2b52('0x7f') + duration + _0x2b52('0x80'));
445
+ let _0x2eeacb = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
514
446
 
515
- this[_0x2b52('0x81')][_0x2b52('0x82')][_0x2b52('0x83')] = freq1;
516
- this[_0x2b52('0x84')][_0x2b52('0x82')][_0x2b52('0x83')] = freq2;
517
- this[_0x2b52('0x10')][_0x2b52('0x85')][_0x2b52('0x83')] = this['_options'][_0x2b52('0x86')];
518
- const self = this;
519
- this['_toneTimer'] = setTimeout(function () {
520
- self[_0x2b52('0x87')]();
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)];
521
449
 
522
- if (callback) {
523
- callback();
524
- }
525
- }, duration);
526
- }
450
+ const _0x531960 = this;
527
451
 
528
- [_0x2b52('0x87')]() {
529
- this[_0x2b52('0x81')][_0x2b52('0x82')][_0x2b52('0x83')] = 0x0;
530
- this[_0x2b52('0x84')]['frequency'][_0x2b52('0x83')] = 0x0;
531
- this['_toneGainProcessor'][_0x2b52('0x85')][_0x2b52('0x83')] = 0x0;
532
- clearTimeout(this[_0x2b52('0xd')]);
452
+ this[_0x13df61(0x223)] = setTimeout(function () {
453
+ const _0x5271f8 = _0x13df61;
454
+ _0x531960[_0x5271f8(0x213)](), _0x2eeacb && _0x2eeacb();
455
+ }, _0x1bd8e5);
533
456
  }
534
457
 
535
- [_0x2b52('0x47')](sequences) {
536
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x88'));
537
-
538
- this['log'][_0x2b52('0x16')](sequences);
539
-
540
- this[_0x2b52('0xf')] = sequences;
541
- this['_repeatToneSequencePos'] = 0x0;
542
- this[_0x2b52('0xe')] = !![];
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
+ }
543
462
 
544
- this[_0x2b52('0x89')]();
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)]();
545
466
  }
546
467
 
547
- [_0x2b52('0x89')]() {
548
- if (this[_0x2b52('0xe')]) {
549
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x8a') + this['_repeatToneSequencePos']);
468
+ [a0_0x35184d(0x1ce)]() {
469
+ const _0x551500 = a0_0x35184d;
550
470
 
551
- let toneDef = this[_0x2b52('0xf')][this[_0x2b52('0x8b')]];
471
+ if (this[_0x551500(0xd5)]) {
472
+ this[_0x551500(0x277)][_0x551500(0xcf)](_0x551500(0x233) + this[_0x551500(0x159)]);
552
473
 
553
- this[_0x2b52('0x8b')]++;
474
+ let _0xa278a7 = this[_0x551500(0x136)][this[_0x551500(0x159)]];
554
475
 
555
- if (this[_0x2b52('0x8b')] === this[_0x2b52('0xf')][_0x2b52('0x4a')]) {
556
- this[_0x2b52('0x8b')] = 0x0;
557
- }
476
+ this[_0x551500(0x159)]++;
477
+ this[_0x551500(0x159)] === this[_0x551500(0x136)][_0x551500(0x200)] && (this[_0x551500(0x159)] = 0x0);
558
478
 
559
- const self = this;
479
+ const _0x581b1f = this;
560
480
 
561
- this[_0x2b52('0x7c')](toneDef['d'], toneDef['f1'], toneDef['f2'], function () {
562
- setTimeout(self[_0x2b52('0x89')]['bind'](self), toneDef['g']);
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']);
563
484
  });
564
485
  }
565
486
  }
566
487
 
567
- [_0x2b52('0x8c')]() {
568
- if (this[_0x2b52('0xe')]) {
569
- this[_0x2b52('0x11')][_0x2b52('0x19')]('Repeating\x20tone\x20stopped');
570
-
571
- this['_repeatToneActive'] = ![];
572
-
573
- this[_0x2b52('0x87')]();
574
- }
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)]());
575
491
  }
576
492
 
577
- ['_initToneGenerator']() {
578
- const AudioContext = window['AudioContext'] || window[_0x2b52('0x8d')] || ![];
493
+ [a0_0x35184d(0x148)]() {
494
+ const _0x12e171 = a0_0x35184d,
495
+ _0x2400c2 = window['AudioContext'] || window['webkitAudioContext'] || ![];
579
496
 
580
- if (!AudioContext) {
581
- throw new _common.Exceptions['NotAllowed'](_0x2b52('0x8e'));
582
- }
583
-
584
- const ctx = new AudioContext();
585
- this[_0x2b52('0x8f')] = ctx[_0x2b52('0x90')]();
586
- this[_0x2b52('0xb')][_0x2b52('0x91')] = this[_0x2b52('0x8f')][_0x2b52('0x92')];
587
- this[_0x2b52('0x10')] = ctx['createGain']();
588
- this[_0x2b52('0x10')]['gain'][_0x2b52('0x83')] = 0x0;
589
-
590
- this['_toneGainProcessor'][_0x2b52('0x36')](this[_0x2b52('0x8f')]);
591
-
592
- this[_0x2b52('0x81')] = ctx[_0x2b52('0x93')]();
593
- this['_oscillator1']['connect'](this[_0x2b52('0x10')]);
594
- this[_0x2b52('0x81')][_0x2b52('0x82')][_0x2b52('0x83')] = 0x0;
595
-
596
- this[_0x2b52('0x81')][_0x2b52('0x1e')]();
597
-
598
- this['_oscillator2'] = ctx[_0x2b52('0x93')]();
497
+ if (!_0x2400c2) throw new _common.Exceptions[_0x12e171(0x16d)](_0x12e171(0x208));
599
498
 
600
- this[_0x2b52('0x84')]['connect'](this[_0x2b52('0x10')]);
499
+ const _0x4083df = new _0x2400c2();
601
500
 
602
- this['_oscillator2'][_0x2b52('0x82')][_0x2b52('0x83')] = 0x0;
603
-
604
- this[_0x2b52('0x84')][_0x2b52('0x1e')]();
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)]();
605
502
  }
606
503
 
607
- ['holdAllCalls']() {
608
- this[_0x2b52('0x11')]['info']('Holding\x20all\x20active\x20sessions');
504
+ [a0_0x35184d(0x175)]() {
505
+ const _0x422c16 = a0_0x35184d;
609
506
 
610
- if (this[_0x2b52('0x65')]()) {
611
- throw _common.Exceptions[_0x2b52('0x66')]('A\x20session\x20is\x20currently\x20connecting');
612
- }
507
+ this['log'][_0x422c16(0x258)](_0x422c16(0x141));
613
508
 
614
- for (let key in this[_0x2b52('0x8')]) {
615
- if (this['_activeSessions'][_0x2b52('0x72')](key)) {
616
- let session = this[_0x2b52('0x8')][key];
509
+ if (this[_0x422c16(0xfe)]()) throw _common.Exceptions[_0x422c16(0x16d)]('A\x20session\x20is\x20currently\x20connecting');
617
510
 
618
- if (session[_0x2b52('0x94')] === _0x2b52('0x95')) {
619
- session[_0x2b52('0x96')]();
620
- }
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)]();
621
515
  }
622
516
  }
623
517
  }
624
518
 
625
- ['_addSession'](session) {
626
- this[_0x2b52('0x7')]++;
627
- session[_0x2b52('0x97')] = this[_0x2b52('0x7')];
628
-
629
- this['log'][_0x2b52('0x19')](_0x2b52('0x98') + session[_0x2b52('0x97')] + ':\x20' + session[_0x2b52('0x4c')]);
630
-
631
- this['_activeSessions'][session[_0x2b52('0x97')]] = session;
632
-
633
- this['log'][_0x2b52('0x16')]('We\x20now\x20have\x20' + Object[_0x2b52('0x49')](this['_activeSessions'])['length'] + _0x2b52('0x99'));
634
-
635
- this[_0x2b52('0x11')][_0x2b52('0x16')](this['_activeSessions']);
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)]);
636
522
 
637
523
  try {
638
- this[_0x2b52('0x9a')](_0x2b52('0x9b'), {
639
- 'session': session
524
+ this[_0x145d82(0x1af)](_0x145d82(0x15d), {
525
+ 'session': _0x2fbd93
640
526
  });
641
- } catch (_0x48e4f5) {
642
- this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x9c') + _0x48e4f5);
527
+ } catch (_0x295d5d) {
528
+ this[_0x145d82(0x277)][_0x145d82(0x247)](_0x145d82(0xcc) + _0x295d5d);
643
529
  }
644
530
  }
645
531
 
646
- ['_removeSession'](session) {
647
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x9d') + session[_0x2b52('0x97')] + ':\x20' + session[_0x2b52('0x4c')]);
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)]);
648
536
 
649
537
  try {
650
- this['emit'](_0x2b52('0x9e'), {
651
- 'session': session
538
+ this[_0x157e01(0x1af)](_0x157e01(0x125), {
539
+ 'session': _0x264167
652
540
  });
653
- } catch (_0x2847a2) {
654
- this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x9f') + _0x2847a2);
541
+ } catch (_0x26e238) {
542
+ this[_0x157e01(0x277)][_0x157e01(0x247)](_0x157e01(0x139) + _0x26e238);
655
543
  }
656
544
 
657
- delete this['_activeSessions'][session[_0x2b52('0x97')]];
658
-
659
- this[_0x2b52('0x11')][_0x2b52('0x16')]('We\x20now\x20have\x20' + Object[_0x2b52('0x49')](this['_activeSessions'])[_0x2b52('0x4a')] + '\x20sessions');
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
+ }
660
547
 
661
- this[_0x2b52('0x11')][_0x2b52('0x16')](this['_activeSessions']);
548
+ ['_sessionTerminated'](_0x387d07) {
549
+ const _0x494738 = a0_0x35184d;
662
550
 
663
- this[_0x2b52('0x8c')]();
664
- }
551
+ this[_0x494738(0x277)]['debug'](_0x494738(0x190) + _0x387d07[_0x494738(0x108)] + '\x20terminated,\x20removing\x20in\x20' + this['_options'][_0x494738(0x25e)] + _0x494738(0x1c5));
665
552
 
666
- ['_sessionTerminated'](session) {
667
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xa0') + session[_0x2b52('0x4c')] + '\x20terminated,\x20removing\x20in\x20' + this[_0x2b52('0x6')]['autoRemoveSessionTime'] + _0x2b52('0x80'));
553
+ const _0x41f3d7 = this;
668
554
 
669
- const self = this;
670
555
  setTimeout(function () {
671
- self[_0x2b52('0xa1')](session);
672
- }, this[_0x2b52('0x6')][_0x2b52('0xa2')]);
556
+ _0x41f3d7['_removeSession'](_0x387d07);
557
+ }, this['_options']['autoRemoveSessionTime']);
673
558
  }
674
559
 
675
- [_0x2b52('0x65')]() {
676
- for (let key in this[_0x2b52('0x8')]) {
677
- if (this[_0x2b52('0x8')][_0x2b52('0x72')](key)) {
678
- let session = this[_0x2b52('0x8')][key];
560
+ [a0_0x35184d(0xfe)]() {
561
+ const _0x1d889c = a0_0x35184d;
679
562
 
680
- if (session[_0x2b52('0x94')] === _0x2b52('0xa3') || session[_0x2b52('0x94')] === 'CALLING' || session[_0x2b52('0x94')] === 'PROGRESS' || session[_0x2b52('0x94')] === 'INCOMING') {
681
- return !![];
682
- }
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 !![];
683
568
  }
684
569
  }
685
570
 
686
571
  return ![];
687
572
  }
688
573
 
689
- [_0x2b52('0x56')](state) {
690
- this[_0x2b52('0x11')]['info'](_0x2b52('0xa4') + state);
691
-
692
- this[_0x2b52('0x3')] = state;
574
+ [a0_0x35184d(0x1b9)](_0x1ddbb5) {
575
+ const _0x3effc4 = a0_0x35184d;
576
+ this['log'][_0x3effc4(0x258)](_0x3effc4(0x114) + _0x1ddbb5), this[_0x3effc4(0x18f)] = _0x1ddbb5;
693
577
 
694
578
  try {
695
- this['emit'](_0x2b52('0xa5'), {
696
- 'state': state
579
+ this[_0x3effc4(0x1af)](_0x3effc4(0x156), {
580
+ 'state': _0x1ddbb5
697
581
  });
698
- } catch (_0x46efb6) {
699
- this[_0x2b52('0x11')]['error']('Exception\x20in\x20connectionStateChange\x20event:\x20' + _0x46efb6);
582
+ } catch (_0x2bc6dc) {
583
+ this[_0x3effc4(0x277)][_0x3effc4(0x247)](_0x3effc4(0x107) + _0x2bc6dc);
700
584
  }
701
585
  }
702
586
 
703
- [_0x2b52('0x53')](session) {
587
+ ['_fireIncomingCallEvent'](_0x353f5b) {
588
+ const _0x5d5410 = a0_0x35184d;
589
+
704
590
  try {
705
- this[_0x2b52('0x9a')](_0x2b52('0xa6'), session);
706
- } catch (_0x1fb729) {
707
- this['log'][_0x2b52('0x1d')](_0x2b52('0xa7') + _0x1fb729);
591
+ this[_0x5d5410(0x1af)](_0x5d5410(0x20f), _0x353f5b);
592
+ } catch (_0x2389f8) {
593
+ this['log'][_0x5d5410(0x247)](_0x5d5410(0x10d) + _0x2389f8);
708
594
  }
709
595
  }
710
596
 
711
- [_0x2b52('0x3a')]() {
712
- let eventData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
713
- let e;
714
- e = (0, _camelcaseKeys.default)(eventData);
715
- e[_0x2b52('0xa8')] = (0, _camelcaseKeys.default)(eventData[_0x2b52('0xa8')]);
716
- e['duration'] = e['duration'] * 0x3e8;
717
- e['answerDuration'] = e[_0x2b52('0xa9')] * 0x3e8;
718
- e['activeDuration'] = e['activeDuration'] * 0x3e8;
719
- e[_0x2b52('0xaa')] = _common.Tools[_0x2b52('0xab')](e[_0x2b52('0xac')]);
720
- e[_0x2b52('0xad')] = e[_0x2b52('0xa9')] ? _common.Tools[_0x2b52('0xab')](e['answerDuration']) : '';
721
- e[_0x2b52('0xae')] = e['activeDuration'] ? _common.Tools['createDurationString'](e[_0x2b52('0xaf')]) : '';
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)]) : '';
722
605
 
723
606
  try {
724
- this[_0x2b52('0x9a')](_0x2b52('0xb0'), e);
725
- } catch (_0x14d3a3) {
726
- this['log'][_0x2b52('0x1d')](_0x2b52('0xb1') + _0x14d3a3);
607
+ this[_0x421366(0x1af)](_0x421366(0x102), _0x36d1fa);
608
+ } catch (_0x3259ca) {
609
+ this[_0x421366(0x277)][_0x421366(0x247)]('Exception\x20in\x20callDataInfo\x20event:\x20' + _0x3259ca);
727
610
  }
728
611
  }
729
612
 
730
- [_0x2b52('0x1f')]() {
731
- if (!this[_0x2b52('0x0')]) {
732
- throw new _common.Exceptions['MediaNotPrepared']();
733
- }
613
+ ['_checkMediaPermission']() {
614
+ const _0x46efd0 = a0_0x35184d;
615
+ if (!this[_0x46efd0(0x15f)]) throw new _common.Exceptions[_0x46efd0(0xf4)]();
734
616
  }
735
617
 
736
618
  }
@@ -738,727 +620,491 @@ class Phone extends _events.default {
738
620
  exports.Phone = Phone;
739
621
 
740
622
  class Session extends _events.default {
741
- constructor(phone) {
742
- super();
743
- this['_phone'] = phone;
744
- this[_0x2b52('0x11')] = phone[_0x2b52('0x11')];
745
- this[_0x2b52('0xb2')] = null;
746
- this[_0x2b52('0xb3')] = null;
747
- this[_0x2b52('0xb4')] = null;
748
- this['_iceCandidateTimer'] = null;
749
- this[_0x2b52('0xb5')] = ![];
750
- this[_0x2b52('0xb6')] = ![];
751
- this[_0x2b52('0xb7')] = ![];
752
- this[_0x2b52('0xb8')] = null;
753
- this[_0x2b52('0xb9')] = null;
754
- this[_0x2b52('0xba')] = null;
755
- this[_0x2b52('0xbb')] = null;
756
- this[_0x2b52('0xbc')] = null;
757
- this[_0x2b52('0xbd')] = null;
758
- this[_0x2b52('0xbe')] = null;
759
- this[_0x2b52('0xbf')] = null;
760
- this[_0x2b52('0xc0')] = null;
761
- this[_0x2b52('0xc1')] = ![];
762
- this['_whisperMode'] = null;
763
- this['_manualDisposition'] = null;
764
- this['_rtcpStatsTimer'] = null;
765
- this[_0x2b52('0xc2')] = null;
766
- this[_0x2b52('0xc3')] = 0x0;
767
- this[_0x2b52('0xc4')] = null;
768
- this[_0x2b52('0xc5')] = null;
769
- }
770
-
771
- ['newOutboundSession'](number, callParams) {
772
- this[_0x2b52('0xb2')] = _common.Tools[_0x2b52('0xc6')]();
773
-
774
- this['log'][_0x2b52('0x16')](_0x2b52('0xc7') + number + '\x20[' + this[_0x2b52('0xb2')] + ']');
775
-
776
- this[_0x2b52('0xc8')] = number;
777
- let options = {
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 = {
778
632
  'mediaConstraints': {
779
633
  'audio': !![],
780
634
  'video': ![]
781
635
  },
782
636
  'pcConfig': {
783
637
  'iceServers': [{
784
- 'urls': ['stun:stun.l.google.com:19302']
638
+ 'urls': [_0x41b825(0x167)]
785
639
  }]
786
640
  },
787
- 'extraHeaders': [_0x2b52('0xc9') + this[_0x2b52('0xca')]['options']['callToken'], 'X-P-UUID:\x20' + this[_0x2b52('0xb2')], _0x2b52('0xcb') + callParams[_0x2b52('0xcc')]]
641
+ 'extraHeaders': [_0x41b825(0x1bd) + this[_0x41b825(0x171)][_0x41b825(0x22c)][_0x41b825(0x1ba)], _0x41b825(0x162) + this[_0x41b825(0x14a)], _0x41b825(0x195) + _0x1ad14a[_0x41b825(0x1a2)]]
788
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)));
789
646
 
790
- if (callParams['explicitCallerId']) {
791
- options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xce') + callParams[_0x2b52('0xcf')]);
792
- }
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'] = ![];
793
651
 
794
- if (callParams['explicitShortCallerId']) {
795
- options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xd0') + callParams[_0x2b52('0xd1')]);
796
- }
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)]();
797
655
 
798
- if (callParams['metaInfo']) {
799
- options[_0x2b52('0xcd')]['push'](_0x2b52('0xd2') + encodeURI(callParams['metaInfo'][_0x2b52('0xd3')]()[_0x2b52('0xd4')](0x0, 0xff)));
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');
800
657
  }
801
658
 
802
- if (callParams['record']) {
803
- if (isNaN(callParams[_0x2b52('0xd5')])) {
804
- throw new _common.Exceptions[_0x2b52('0xd6')]('Record\x20parameter\x20must\x20be\x20a\x20number');
805
- }
806
-
807
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xd7') + callParams[_0x2b52('0xd5')] + _0x2b52('0xd8'));
808
-
809
- options[_0x2b52('0xcd')]['push'](_0x2b52('0xd9') + callParams[_0x2b52('0xd5')]);
810
-
811
- this['_isRecording'] = !![];
812
- } else {
813
- this[_0x2b52('0xb7')] = ![];
814
- }
815
-
816
- this['_isListenCall'] = callParams[_0x2b52('0xc1')];
817
-
818
- if (callParams[_0x2b52('0xda')]) {
819
- this[_0x2b52('0x11')][_0x2b52('0x16')]('Requesting\x20specific\x20media\x20switch\x20' + callParams[_0x2b52('0xda')]);
820
-
821
- options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xdb') + callParams[_0x2b52('0xda')]);
822
- } else {
823
- const otherSessions = this[_0x2b52('0xdc')]();
824
-
825
- if (otherSessions[_0x2b52('0x4a')] > 0x0) {
826
- if (otherSessions[0x0]['_mediaSwitch']) {
827
- this['log'][_0x2b52('0x16')]('Requesting\x20call\x20grouping\x20on\x20media\x20switch\x20' + otherSessions[0x0][_0x2b52('0xc5')]);
828
-
829
- options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xdd') + otherSessions[0x0][_0x2b52('0xc5')]);
830
- } else {
831
- this[_0x2b52('0x11')][_0x2b52('0x20')](_0x2b52('0xde'));
832
- }
833
- } else {
834
- this[_0x2b52('0x11')][_0x2b52('0x16')]('No\x20other\x20active\x20calls,\x20no\x20media\x20switch\x20grouping\x20requested');
835
- }
836
- }
837
-
838
- const uri = 'sip:' + number + _0x2b52('0x42');
659
+ const _0x31c3a9 = _0x41b825(0x12c) + _0x489345 + _0x41b825(0x17b);
839
660
 
840
661
  try {
841
- this[_0x2b52('0xdf')](this[_0x2b52('0xca')]['_UA'][_0x2b52('0x64')](uri, options));
842
- } catch (_0x947053) {
843
- this['log'][_0x2b52('0x1d')]('Error\x20starting\x20call:', _0x947053);
844
-
845
- return null;
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;
846
665
  }
847
666
 
848
- if (callParams[_0x2b52('0xe0')]) {
849
- this[_0x2b52('0xe1')](callParams[_0x2b52('0xe0')]);
850
- }
667
+ _0x1ad14a[_0x41b825(0x237)] && this[_0x41b825(0x1bc)](_0x1ad14a[_0x41b825(0x237)]);
851
668
  }
852
669
 
853
- [_0x2b52('0x45')](newSessionRequest) {
854
- this[_0x2b52('0xb2')] = newSessionRequest[_0x2b52('0xe2')][_0x2b52('0xe3')](_0x2b52('0xe4'), 0x0);
855
- this[_0x2b52('0xbe')] = newSessionRequest[_0x2b52('0xe2')]['getHeader']('X-DID', 0x0);
856
- this[_0x2b52('0xc0')] = unescape(newSessionRequest[_0x2b52('0xe2')][_0x2b52('0xe3')](_0x2b52('0xe5'), 0x0));
857
- this['_originName'] = newSessionRequest[_0x2b52('0xe2')][_0x2b52('0xe6')]['display_name'];
858
- this[_0x2b52('0xbd')] = newSessionRequest['request'][_0x2b52('0xe6')][_0x2b52('0xe7')][_0x2b52('0xe8')];
859
-
860
- this['log'][_0x2b52('0x19')](_0x2b52('0xe9') + this[_0x2b52('0xbd')] + '\x20[' + this[_0x2b52('0xb2')] + ']');
861
-
862
- this[_0x2b52('0x11')][_0x2b52('0x16')](newSessionRequest);
863
-
864
- this[_0x2b52('0xc5')] = newSessionRequest['request'][_0x2b52('0xe3')](_0x2b52('0xea'));
865
-
866
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xeb') + this[_0x2b52('0xc5')]);
867
-
868
- this[_0x2b52('0xdf')](newSessionRequest[_0x2b52('0xec')]);
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)]);
869
673
  }
870
674
 
871
- [_0x2b52('0xdc')]() {
872
- const allSessions = this[_0x2b52('0xca')][_0x2b52('0xed')];
675
+ [a0_0x35184d(0x1d8)]() {
676
+ const _0x59615b = a0_0x35184d,
677
+ _0x3f47f3 = this[_0x59615b(0x171)][_0x59615b(0x24c)];
873
678
 
874
- let s = [];
679
+ let _0x285ec1 = [];
875
680
 
876
- for (let key in allSessions) {
877
- if (allSessions[key]) {
878
- if (allSessions[key]['__containerId'] !== this[_0x2b52('0x97')]) {
879
- s[_0x2b52('0x74')](allSessions[key]);
880
- }
881
- }
681
+ for (let _0xd48dea in _0x3f47f3) {
682
+ _0x3f47f3[_0xd48dea] && _0x3f47f3[_0xd48dea][_0x59615b(0x105)] !== this[_0x59615b(0x105)] && _0x285ec1[_0x59615b(0xfd)](_0x3f47f3[_0xd48dea]);
882
683
  }
883
684
 
884
- return s;
685
+ return _0x285ec1;
885
686
  }
886
687
 
887
- ['_initWebRTCSession'](webRTCSession) {
888
- this['_webRTCSession'] = webRTCSession;
889
- this['_callBeginTime'] = Date['now']();
890
- const self = this;
891
-
892
- this[_0x2b52('0xb3')]['on']('icecandidate', function (event) {
893
- const c = event['candidate'];
894
-
895
- self[_0x2b52('0x11')][_0x2b52('0x16')]('Got\x20ICE\x20candidate:\x20' + c[_0x2b52('0xee')]);
896
-
897
- if (c[_0x2b52('0xef')] === 'srflx' && c['relatedAddress'] !== null && c[_0x2b52('0xf0')] !== null) {
898
- self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0xf1') + c[_0x2b52('0xee')]);
899
-
900
- if (self[_0x2b52('0xf2')] != null) clearTimeout(self[_0x2b52('0xf2')]);
901
-
902
- event[_0x2b52('0xf3')]();
903
- } else {
904
- if (self['_iceCandidateTimer'] != null) clearTimeout(self[_0x2b52('0xf2')]);
905
- self[_0x2b52('0xf2')] = setTimeout(function (data) {
906
- self['log'][_0x2b52('0x16')](_0x2b52('0xf4') + self[_0x2b52('0xca')][_0x2b52('0x73')][_0x2b52('0xf5')] + _0x2b52('0xf6'));
907
-
908
- data['ready']();
909
- }, self[_0x2b52('0xca')][_0x2b52('0x73')]['iceGatherTimeout'], event);
910
- }
911
- });
912
-
913
- this['_webRTCSession']['on'](_0x2b52('0xf7'), function () {
914
- self['_startDurationUpdateTimer']();
688
+ [a0_0x35184d(0x10b)](_0x4e7a5f) {
689
+ const _0x327ece = a0_0x35184d;
690
+ this[_0x327ece(0x214)] = _0x4e7a5f, this[_0x327ece(0xef)] = Date[_0x327ece(0x21f)]();
915
691
 
916
- self[_0x2b52('0xf8')]();
692
+ const _0x3737d9 = this;
917
693
 
918
- self[_0x2b52('0x51')]('INITIALIZING');
919
- });
694
+ this[_0x327ece(0x214)]['on'](_0x327ece(0x1b0), function (_0x214824) {
695
+ const _0x1711a3 = _0x327ece,
696
+ _0x5f093d = _0x214824[_0x1711a3(0x145)];
920
697
 
921
- this[_0x2b52('0xb3')]['on'](_0x2b52('0xf9'), function () {
922
- if (self[_0x2b52('0xca')][_0x2b52('0x73')]['playCallInitializedTone']) {
923
- self['_phone'][_0x2b52('0x47')](ST_CALLINIT);
924
- }
698
+ _0x3737d9[_0x1711a3(0x277)][_0x1711a3(0xcf)](_0x1711a3(0x115) + _0x5f093d[_0x1711a3(0x145)]);
925
699
 
926
- self[_0x2b52('0x51')](_0x2b52('0xfa'));
927
- });
700
+ if (_0x5f093d['type'] === _0x1711a3(0xf9) && _0x5f093d[_0x1711a3(0x13d)] !== null && _0x5f093d['relatedPort'] !== null) {
701
+ _0x3737d9['log']['info'](_0x1711a3(0x124) + _0x5f093d[_0x1711a3(0x145)]);
928
702
 
929
- this[_0x2b52('0xb3')]['on'](_0x2b52('0xfb'), function (data) {
930
- if (data[_0x2b52('0xfc')] === 'remote') {
931
- self[_0x2b52('0x51')](_0x2b52('0xfd'), {
932
- 'code': data[_0x2b52('0xfe')][_0x2b52('0xff')]
933
- });
703
+ if (_0x3737d9['_iceCandidateTimer'] != null) clearTimeout(_0x3737d9[_0x1711a3(0xec)]);
934
704
 
935
- self[_0x2b52('0xca')][_0x2b52('0x8c')]();
936
-
937
- if (data[_0x2b52('0xfe')][_0x2b52('0xff')] === 0xb4) {
938
- self[_0x2b52('0xca')][_0x2b52('0x47')](ST_RINGBACK);
939
- }
940
-
941
- if (self[_0x2b52('0xc3')]) {
942
- self['_answerCallTimer'] = setTimeout(function () {
943
- self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x100') + self[_0x2b52('0xc3')] + '\x20seconds');
944
-
945
- try {
946
- self['hangup']();
947
- } catch (_0x37f186) {
948
- self['log'][_0x2b52('0x19')]('No\x20active\x20session,\x20ignoring\x20answer\x20call\x20timeout');
949
- }
950
- }, self[_0x2b52('0xc3')] * 0x3e8);
951
- }
952
- }
953
- });
954
-
955
- this['_webRTCSession']['on'](_0x2b52('0x101'), function (data) {
956
- self[_0x2b52('0xca')][_0x2b52('0x8c')]();
957
-
958
- self[_0x2b52('0xba')] = Date['now']();
959
-
960
- if (self[_0x2b52('0xc3')]) {
961
- clearTimeout(self[_0x2b52('0xc4')]);
962
- self[_0x2b52('0xc3')] = 0x0;
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);
963
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));
964
727
 
965
- if (data['originator'] === 'remote') {
966
- const recState = data[_0x2b52('0xfe')]['getHeader'](_0x2b52('0x102'));
967
-
968
- if (recState === 'true') {
969
- self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x103'));
970
- } else {
971
- self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x104'));
728
+ try {
729
+ _0x3737d9['hangup']();
730
+ } catch (_0x9afee0) {
731
+ _0x3737d9[_0x35ccda(0x277)]['info'](_0x35ccda(0x25a));
972
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);
973
738
 
974
- self[_0x2b52('0xc5')] = data[_0x2b52('0xfe')][_0x2b52('0xe3')](_0x2b52('0xea'));
739
+ if (_0x5a7f3a[_0x4286ad(0x1e0)] === _0x4286ad(0xc4)) {
740
+ const _0x266816 = _0x5a7f3a[_0x4286ad(0x22f)][_0x4286ad(0xf3)]('X-Recording');
975
741
 
976
- self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xeb') + self['_mediaSwitch']);
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)]);
977
743
  }
978
- });
979
-
980
- this[_0x2b52('0xb3')]['on']('confirmed', function () {
981
- self[_0x2b52('0x51')](_0x2b52('0x95'));
982
- });
983
-
984
- this[_0x2b52('0xb3')]['on'](_0x2b52('0x105'), function () {
985
- self[_0x2b52('0xca')]['_endRepeatTone']();
986
-
987
- self[_0x2b52('0xbb')] = Date[_0x2b52('0x106')]();
988
-
989
- if (self[_0x2b52('0xc3')]) {
990
- clearTimeout(self[_0x2b52('0xc4')]);
991
- }
992
-
993
- self[_0x2b52('0x51')](_0x2b52('0x107'));
994
- });
995
-
996
- this[_0x2b52('0xb3')]['on'](_0x2b52('0x108'), function (data) {
997
- self[_0x2b52('0xca')][_0x2b52('0x8c')]();
998
-
999
- self[_0x2b52('0xbb')] = Date[_0x2b52('0x106')]();
1000
-
1001
- if (self[_0x2b52('0xc3')]) {
1002
- clearTimeout(self['_answerCallTimer']);
1003
- }
1004
-
1005
- let m;
1006
-
1007
- if (data[_0x2b52('0x109')]) {
1008
- m = data['message'][_0x2b52('0xff')] + '\x20' + data['message'][_0x2b52('0x10a')];
1009
- } else {
1010
- m = '';
1011
- }
1012
-
1013
- self['_setSessionState'](_0x2b52('0x10b'), {
1014
- 'cause': data[_0x2b52('0x10c')],
1015
- 'message': m
1016
- });
1017
- });
1018
-
1019
- this[_0x2b52('0xb3')]['on'](_0x2b52('0x10d'), function (data) {
1020
- self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x10e'), data);
1021
- });
1022
-
1023
- this[_0x2b52('0xb3')]['on'](_0x2b52('0x10f'), function (data) {
1024
- self['log'][_0x2b52('0x16')](_0x2b52('0x110'), data);
1025
- });
1026
-
1027
- this[_0x2b52('0xb3')]['on']('hold', function () {
1028
- self['_isOnHold'] = !![];
1029
-
1030
- self[_0x2b52('0x111')]();
1031
-
1032
- self['_setSessionState'](_0x2b52('0x112'));
1033
- });
1034
-
1035
- this['_webRTCSession']['on'](_0x2b52('0x113'), function () {
1036
- self['_isOnHold'] = ![];
1037
-
1038
- self[_0x2b52('0x111')]();
1039
-
1040
- self[_0x2b52('0x51')](_0x2b52('0x95'));
1041
- });
1042
-
1043
- this[_0x2b52('0xb3')]['on'](_0x2b52('0x114'), function (data) {
1044
- self['log']['debug'](_0x2b52('0x115'), data);
1045
- self[_0x2b52('0xb6')] = !![];
1046
-
1047
- self[_0x2b52('0x116')]();
1048
- });
1049
-
1050
- this['_webRTCSession']['on'](_0x2b52('0x117'), function (data) {
1051
- self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x118'), data);
1052
-
1053
- self[_0x2b52('0xb6')] = ![];
1054
-
1055
- self[_0x2b52('0x116')]();
1056
- });
1057
- this['_webRTCSession']['on'](_0x2b52('0x119'), function (data) {
1058
- self[_0x2b52('0x11')]['debug'](_0x2b52('0x11a'), data);
1059
- });
1060
-
1061
- this[_0x2b52('0xb3')]['on']('update', function (data) {
1062
- self['log']['debug'](_0x2b52('0x11b'), data);
1063
- });
1064
-
1065
- this['_webRTCSession']['on'](_0x2b52('0x11c'), function (data) {
1066
- self[_0x2b52('0x11')]['error'](_0x2b52('0x11d'), data);
1067
- });
1068
-
1069
- if (self[_0x2b52('0xb3')][_0x2b52('0x11e')]) {
1070
- self[_0x2b52('0x11f')](self[_0x2b52('0xb3')]);
1071
- }
1072
-
1073
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x120'));
1074
-
1075
- this[_0x2b52('0x11')][_0x2b52('0x16')](this);
1076
- }
1077
-
1078
- [_0x2b52('0x121')]() {
1079
- let disposition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1080
-
1081
- if (!disposition) {
1082
- this['log'][_0x2b52('0x19')](_0x2b52('0x122'));
1083
-
1084
- this['_webRTCSession'][_0x2b52('0x123')]();
1085
- } else {
1086
- this[_0x2b52('0x11')]['info'](_0x2b52('0x124') + disposition);
1087
-
1088
- this[_0x2b52('0x125')] = disposition;
1089
-
1090
- this['_webRTCSession'][_0x2b52('0x123')]({
1091
- 'extraHeaders': [_0x2b52('0x126') + disposition]
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
1092
761
  });
1093
- }
1094
- }
1095
-
1096
- [_0x2b52('0x127')]() {
1097
- let metaInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1098
- let options = {
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 = {
1099
811
  'mediaConstraints': {
1100
812
  'audio': !![],
1101
813
  'video': ![]
1102
814
  },
1103
815
  'pcConfig': {
1104
816
  'iceServers': [{
1105
- 'urls': [_0x2b52('0x128')]
817
+ 'urls': ['stun:stun.l.google.com:19302']
1106
818
  }]
1107
819
  },
1108
- 'extraHeaders': [_0x2b52('0xc9') + this[_0x2b52('0xca')][_0x2b52('0x73')][_0x2b52('0x32')]]
820
+ 'extraHeaders': ['X-Call-token:\x20' + this['_phone']['options'][_0x153906(0x1ba)]]
1109
821
  };
1110
-
1111
- if (metaInfo) {
1112
- options['extraHeaders'][_0x2b52('0x74')](_0x2b52('0xd2') + encodeURI(metaInfo['toString']()[_0x2b52('0xd4')](0x0, 0xff)));
1113
- }
1114
-
1115
- this['_webRTCSession']['answer'](options);
1116
- this['_handleRemoteAudio'](this[_0x2b52('0xb3')]);
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']);
1117
823
  }
1118
824
 
1119
- [_0x2b52('0x4e')]() {
1120
- let statusCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0x25b;
1121
- let reasonPhrase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _0x2b52('0x129');
825
+ [a0_0x35184d(0x187)]() {
826
+ let _0x39c653 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0x25b;
1122
827
 
1123
- this['log'][_0x2b52('0x19')](_0x2b52('0x12a'));
828
+ let _0xa28556 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : a0_0x35184d(0x19b);
1124
829
 
1125
- this['_webRTCSession']['terminate']({
1126
- 'status_code': statusCode,
1127
- 'reason_phrase': reasonPhrase
830
+ const _0x1c32d9 = a0_0x35184d;
831
+ this['log'][_0x1c32d9(0x258)](_0x1c32d9(0xd0)), this[_0x1c32d9(0x214)]['terminate']({
832
+ 'status_code': _0x39c653,
833
+ 'reason_phrase': _0xa28556
1128
834
  });
1129
835
  }
1130
836
 
1131
- get [_0x2b52('0x4c')]() {
1132
- return this[_0x2b52('0xb2')];
837
+ get [a0_0x35184d(0x108)]() {
838
+ const _0x5db6cb = a0_0x35184d;
839
+ return this[_0x5db6cb(0x14a)];
1133
840
  }
1134
841
 
1135
- get [_0x2b52('0xc8')]() {
1136
- return this[_0x2b52('0xbe')];
842
+ get [a0_0x35184d(0xd3)]() {
843
+ const _0x19835d = a0_0x35184d;
844
+ return this[_0x19835d(0x1c6)];
1137
845
  }
1138
846
 
1139
- get ['localNumberName']() {
1140
- return this[_0x2b52('0xc0')];
847
+ get [a0_0x35184d(0x1cd)]() {
848
+ const _0x9e7eb8 = a0_0x35184d;
849
+ return this[_0x9e7eb8(0x1be)];
1141
850
  }
1142
851
 
1143
852
  get ['originatingNumber']() {
1144
- return this[_0x2b52('0xbd')];
853
+ const _0x2f86cd = a0_0x35184d;
854
+ return this[_0x2f86cd(0x134)];
1145
855
  }
1146
856
 
1147
- set [_0x2b52('0xc8')](number) {
1148
- this['log'][_0x2b52('0x16')]('Setting\x20destination\x20number\x20to:\x20' + number);
1149
-
1150
- this[_0x2b52('0xbe')] = number;
857
+ set [a0_0x35184d(0xd3)](_0x352858) {
858
+ const _0x3e6914 = a0_0x35184d;
859
+ this[_0x3e6914(0x277)][_0x3e6914(0xcf)](_0x3e6914(0x11c) + _0x352858), this['_destinationNumber'] = _0x352858;
1151
860
  }
1152
861
 
1153
- get [_0x2b52('0x94')]() {
1154
- return this[_0x2b52('0xb4')];
862
+ get [a0_0x35184d(0xd8)]() {
863
+ const _0x289148 = a0_0x35184d;
864
+ return this[_0x289148(0x13c)];
1155
865
  }
1156
866
 
1157
- get [_0x2b52('0x12b')]() {
1158
- if (this[_0x2b52('0xc1')]) {
1159
- this[_0x2b52('0x11')][_0x2b52('0x16')]('Call\x20direction\x20is\x20LISTEN');
1160
-
1161
- return _0x2b52('0x12c');
1162
- } else if (this[_0x2b52('0xb3')]['direction'] === _0x2b52('0x12d')) {
1163
- this['log'][_0x2b52('0x16')]('Call\x20direction\x20is\x20INBOUND');
1164
-
1165
- return _0x2b52('0x12e');
1166
- } else if (this['_webRTCSession']['direction'] === 'outgoing') {
1167
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x12f'));
1168
-
1169
- return _0x2b52('0x130');
1170
- } else {
1171
- this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x131') + this[_0x2b52('0xb3')][_0x2b52('0x12b')]);
1172
-
1173
- return 'UNKNOWN';
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));
1174
871
  }
1175
872
  }
1176
873
 
1177
- [_0x2b52('0x132')]() {
1178
- const opt = {
1179
- 'extraHeaders': [_0x2b52('0x133')]
874
+ [a0_0x35184d(0x16c)]() {
875
+ const _0x2e33ed = a0_0x35184d,
876
+ _0x468080 = {
877
+ 'extraHeaders': ['Record:\x20on']
1180
878
  };
1181
879
 
1182
- this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x134'));
880
+ this[_0x2e33ed(0x277)][_0x2e33ed(0xcf)](_0x2e33ed(0x1b5));
1183
881
 
1184
- const self = this;
882
+ const _0x5ac582 = this;
1185
883
 
1186
- this[_0x2b52('0xb3')][_0x2b52('0x135')](_0x2b52('0x10f'), data => {
1187
- if (data[_0x2b52('0xfc')] === 'local') {
1188
- data[_0x2b52('0x19')]['on'](_0x2b52('0x136'), function () {
1189
- self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x137'));
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)] = !![];
1190
889
 
1191
- self['_isRecording'] = !![];
1192
-
1193
- try {
1194
- self[_0x2b52('0x9a')]('recordingStateChange', {
1195
- 'state': !![],
1196
- 'error': null
1197
- });
1198
- } catch (_0x542ae6) {
1199
- self[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20recordingStateChange\x20event:\x20' + _0x542ae6);
1200
- }
1201
- });
1202
-
1203
- data[_0x2b52('0x19')]['on']('failed', function (data) {
1204
- self[_0x2b52('0xb8')] = data['response'][_0x2b52('0x10a')];
1205
-
1206
- self[_0x2b52('0x11')]['error'](_0x2b52('0x138') + self[_0x2b52('0xb8')]);
1207
-
1208
- self['_fireRecordingStateEvent']();
1209
- });
1210
- }
1211
- });
1212
-
1213
- this[_0x2b52('0xb3')][_0x2b52('0x139')](_0x2b52('0x13a'), null, opt);
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);
1214
903
  }
1215
904
 
1216
- [_0x2b52('0x13b')]() {
1217
- const opt = {
1218
- 'extraHeaders': [_0x2b52('0x13c')]
905
+ ['stopRecording']() {
906
+ const _0x18f638 = a0_0x35184d,
907
+ _0x56b212 = {
908
+ 'extraHeaders': [_0x18f638(0x118)]
1219
909
  };
1220
910
 
1221
- this[_0x2b52('0x11')]['debug'](_0x2b52('0x13d'));
911
+ this[_0x18f638(0x277)][_0x18f638(0xcf)](_0x18f638(0x25c));
1222
912
 
1223
- const self = this;
1224
- this['_webRTCSession']['once'](_0x2b52('0x10f'), data => {
1225
- data['info']['on'](_0x2b52('0x136'), function () {
1226
- self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x13e'));
913
+ const _0x162e9a = this;
1227
914
 
1228
- self[_0x2b52('0xb7')] = ![];
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)] = ![];
1229
920
 
1230
921
  try {
1231
- self[_0x2b52('0x9a')]('recordingStateChange', {
922
+ _0x162e9a[_0x336a64(0x1af)]('recordingStateChange', {
1232
923
  'state': ![],
1233
924
  'error': null
1234
925
  });
1235
- } catch (_0x5d2fdc) {
1236
- self['log'][_0x2b52('0x1d')](_0x2b52('0x13f') + _0x5d2fdc);
926
+ } catch (_0x2711bd) {
927
+ _0x162e9a['log'][_0x336a64(0x247)](_0x336a64(0x24d) + _0x2711bd);
1237
928
  }
1238
- });
1239
- data['info']['on'](_0x2b52('0x108'), function (data) {
1240
- self[_0x2b52('0x11')][_0x2b52('0x1d')]('Recording\x20stopped\x20failed:\x20' + data[_0x2b52('0xfe')][_0x2b52('0x10a')]);
929
+ }), _0x197195['info']['on']('failed', function (_0x17c6f1) {
930
+ const _0x29611f = _0x1f0de5;
931
+
932
+ _0x162e9a['log']['error'](_0x29611f(0x155) + _0x17c6f1[_0x29611f(0x22f)]['reason_phrase']);
1241
933
 
1242
934
  try {
1243
- self[_0x2b52('0x9a')](_0x2b52('0x140'), {
1244
- 'state': self['_isRecording'],
1245
- 'error': data[_0x2b52('0xfe')][_0x2b52('0x10a')]
935
+ _0x162e9a[_0x29611f(0x1af)](_0x29611f(0x1c2), {
936
+ 'state': _0x162e9a[_0x29611f(0x117)],
937
+ 'error': _0x17c6f1[_0x29611f(0x22f)][_0x29611f(0x239)]
1246
938
  });
1247
- } catch (_0x37fc8f) {
1248
- self[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20recordingStateChange\x20event:\x20' + _0x37fc8f);
939
+ } catch (_0x86e83a) {
940
+ _0x162e9a[_0x29611f(0x277)]['error'](_0x29611f(0x24d) + _0x86e83a);
1249
941
  }
1250
942
  });
1251
- });
1252
-
1253
- this['_webRTCSession'][_0x2b52('0x139')]('application/info', null, opt);
943
+ }), this[_0x18f638(0x214)][_0x18f638(0x1e5)](_0x18f638(0x181), null, _0x56b212);
1254
944
  }
1255
945
 
1256
946
  ['toggleRecording']() {
1257
- if (!this[_0x2b52('0xb7')]) {
1258
- this[_0x2b52('0x132')]();
1259
-
1260
- return !![];
1261
- } else {
1262
- this[_0x2b52('0x13b')]();
1263
-
1264
- return ![];
1265
- }
947
+ const _0x55d403 = a0_0x35184d;
948
+ return !this[_0x55d403(0x117)] ? (this[_0x55d403(0x16c)](), !![]) : (this[_0x55d403(0x160)](), ![]);
1266
949
  }
1267
950
 
1268
- get [_0x2b52('0x141')]() {
1269
- return this[_0x2b52('0xb7')];
951
+ get [a0_0x35184d(0x1e3)]() {
952
+ const _0x46d2b5 = a0_0x35184d;
953
+ return this[_0x46d2b5(0x117)];
1270
954
  }
1271
955
 
1272
- [_0x2b52('0x142')]() {
1273
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x143'));
1274
-
1275
- this['_webRTCSession'][_0x2b52('0x144')]();
956
+ [a0_0x35184d(0x231)]() {
957
+ const _0x38a9df = a0_0x35184d;
958
+ this[_0x38a9df(0x277)][_0x38a9df(0x258)](_0x38a9df(0x1ed)), this[_0x38a9df(0x214)][_0x38a9df(0x22a)]();
1276
959
  }
1277
960
 
1278
- [_0x2b52('0x145')]() {
1279
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x146'));
1280
-
1281
- this[_0x2b52('0xb3')][_0x2b52('0x147')]();
961
+ [a0_0x35184d(0x26f)]() {
962
+ const _0x57bdf6 = a0_0x35184d;
963
+ this[_0x57bdf6(0x277)][_0x57bdf6(0x258)](_0x57bdf6(0x1f4)), this['_webRTCSession'][_0x57bdf6(0xf6)]();
1282
964
  }
1283
965
 
1284
966
  ['toggleMute']() {
1285
- if (!this[_0x2b52('0xb6')]) {
1286
- this[_0x2b52('0x142')]();
1287
- } else {
1288
- this[_0x2b52('0x145')]();
1289
- }
967
+ const _0x1e5511 = a0_0x35184d;
968
+ !this[_0x1e5511(0x1dd)] ? this['muteMic']() : this['unmuteMic']();
1290
969
  }
1291
970
 
1292
- get [_0x2b52('0x148')]() {
1293
- return this[_0x2b52('0xb6')];
971
+ get [a0_0x35184d(0x243)]() {
972
+ const _0xdebb45 = a0_0x35184d;
973
+ return this[_0xdebb45(0x1dd)];
1294
974
  }
1295
975
 
1296
- [_0x2b52('0x96')]() {
1297
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x149'));
1298
-
1299
- this[_0x2b52('0xb3')][_0x2b52('0x96')]();
976
+ ['hold']() {
977
+ const _0x2c024d = a0_0x35184d;
978
+ this[_0x2c024d(0x277)][_0x2c024d(0x258)](_0x2c024d(0xdc)), this[_0x2c024d(0x214)][_0x2c024d(0x1c7)]();
1300
979
  }
1301
980
 
1302
- [_0x2b52('0x113')]() {
1303
- this[_0x2b52('0x11')][_0x2b52('0x19')]('Uncall\x20call');
1304
-
1305
- this[_0x2b52('0xca')][_0x2b52('0x68')]();
1306
-
1307
- this[_0x2b52('0xb3')][_0x2b52('0x113')]();
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)]();
1308
984
  }
1309
985
 
1310
- ['toggleHold']() {
1311
- if (!this['_isOnHold']) {
1312
- this[_0x2b52('0x96')]();
1313
- } else {
1314
- this['unhold']();
1315
- }
986
+ [a0_0x35184d(0x25b)]() {
987
+ const _0x5dc077 = a0_0x35184d;
988
+ !this[_0x5dc077(0x12b)] ? this[_0x5dc077(0x1c7)]() : this[_0x5dc077(0x185)]();
1316
989
  }
1317
990
 
1318
- get [_0x2b52('0x14a')]() {
1319
- return this['_isOnHold'];
991
+ get [a0_0x35184d(0x1ff)]() {
992
+ const _0x2337f8 = a0_0x35184d;
993
+ return this[_0x2337f8(0x12b)];
1320
994
  }
1321
995
 
1322
- [_0x2b52('0x14b')](code) {
1323
- let playLocal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !![];
1324
-
1325
- if (!(code in DTMF_FREQUENCY_TABLE)) {
1326
- throw new _common.Exceptions[_0x2b52('0xd6')](_0x2b52('0x14c'));
1327
- }
1328
-
1329
- this[_0x2b52('0x11')]['info'](_0x2b52('0x14d') + code);
1330
-
1331
- this[_0x2b52('0xb3')][_0x2b52('0x14b')](code);
1332
-
1333
- if (playLocal) {
1334
- const f = DTMF_FREQUENCY_TABLE[code];
1335
-
1336
- if (this[_0x2b52('0xb6')]) {
1337
- this['log'][_0x2b52('0x16')](_0x2b52('0x14e'));
1338
-
1339
- this[_0x2b52('0xca')][_0x2b52('0x7c')](0x1f4, f[0x0], f[0x1]);
1340
- } else {
1341
- this[_0x2b52('0x11')]['debug'](_0x2b52('0x14f'));
996
+ [a0_0x35184d(0x264)](_0x520a56) {
997
+ let _0xf1da67 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !![];
1342
998
 
1343
- this[_0x2b52('0xb3')][_0x2b52('0x144')]();
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);
1344
1002
 
1345
- const self = this;
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']();
1346
1007
 
1347
- this[_0x2b52('0xca')]['playTone'](0x1f4, f[0x0], f[0x1], function () {
1348
- self[_0x2b52('0x11')]['debug'](_0x2b52('0x150'));
1008
+ const _0x27567f = this;
1349
1009
 
1350
- self['_webRTCSession'][_0x2b52('0x147')]();
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)]();
1351
1013
  });
1352
1014
  }
1353
1015
  }
1354
1016
  }
1355
1017
 
1356
- [_0x2b52('0x151')](dstSession) {
1357
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x152') + this[_0x2b52('0x4c')] + _0x2b52('0x153') + dstSession[_0x2b52('0x4c')]);
1018
+ [a0_0x35184d(0x163)](_0x58160c) {
1019
+ const _0x5d5cf9 = a0_0x35184d;
1358
1020
 
1359
- const referSubscriber = this[_0x2b52('0xb3')][_0x2b52('0x154')](this[_0x2b52('0xb3')]['_request']['ruri'], {
1360
- 'replaces': dstSession[_0x2b52('0xb3')]
1361
- });
1021
+ this[_0x5d5cf9(0x277)]['info'](_0x5d5cf9(0x176) + this[_0x5d5cf9(0x108)] + _0x5d5cf9(0x15a) + _0x58160c[_0x5d5cf9(0x108)]);
1362
1022
 
1363
- const self = this;
1364
- referSubscriber['on'](_0x2b52('0x155'), function () {
1365
- self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x156'));
1366
- });
1367
- referSubscriber['on'](_0x2b52('0x157'), function (cause) {
1368
- self[_0x2b52('0x11')]['error'](_0x2b52('0x158') + cause);
1369
- });
1370
- referSubscriber['on'](_0x2b52('0x108'), function (cause) {
1371
- self['log'][_0x2b52('0x1d')](_0x2b52('0x159') + cause);
1372
- });
1373
- }
1023
+ const _0x46b7ba = this['_webRTCSession']['refer'](this[_0x5d5cf9(0x214)][_0x5d5cf9(0x101)][_0x5d5cf9(0xed)], {
1024
+ 'replaces': _0x58160c[_0x5d5cf9(0x214)]
1025
+ }),
1026
+ _0x4b7ee4 = this;
1374
1027
 
1375
- [_0x2b52('0x15a')](media_file_id) {
1376
- let hangup_after = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ![];
1028
+ _0x46b7ba['on'](_0x5d5cf9(0x21e), function () {
1029
+ const _0x199abc = _0x5d5cf9;
1377
1030
 
1378
- if (!this[_0x2b52('0xca')]['_options'][_0x2b52('0x35')]) {
1379
- throw new _common.Exceptions[_0x2b52('0x66')](_0x2b52('0x15b'));
1380
- }
1031
+ _0x4b7ee4['log'][_0x199abc(0x258)](_0x199abc(0xce));
1032
+ }), _0x46b7ba['on'](_0x5d5cf9(0x1fe), function (_0x2d20b2) {
1033
+ const _0x26e6b0 = _0x5d5cf9;
1381
1034
 
1382
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x15c') + media_file_id + _0x2b52('0x15d') + hangup_after);
1035
+ _0x4b7ee4[_0x26e6b0(0x277)][_0x26e6b0(0x247)](_0x26e6b0(0x1e9) + _0x2d20b2);
1036
+ }), _0x46b7ba['on'](_0x5d5cf9(0x161), function (_0x59d684) {
1037
+ const _0x12168c = _0x5d5cf9;
1383
1038
 
1384
- const p = this[_0x2b52('0xca')][_0x2b52('0x5')]['fireEvent'](_0x2b52('0x15e'), {
1385
- 'call_uuid': this[_0x2b52('0x4c')],
1386
- 'call_command': _0x2b52('0x15a'),
1387
- 'media_file_id': media_file_id,
1388
- 'hangup_after': hangup_after
1039
+ _0x4b7ee4[_0x12168c(0x277)]['error'](_0x12168c(0x178) + _0x59d684);
1389
1040
  });
1390
-
1391
- if (hangup_after) {
1392
- this['_phone'][_0x2b52('0x9')][_0x2b52('0x91')] = null;
1393
-
1394
- p[_0x2b52('0x1c')](() => {
1395
- this['_setSessionState'](_0x2b52('0x15f'));
1396
- });
1397
- }
1398
-
1399
- return p;
1400
1041
  }
1401
1042
 
1402
- [_0x2b52('0x160')]() {
1403
- let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0x0;
1043
+ [a0_0x35184d(0x271)](_0x3de786) {
1044
+ let _0x53bfb1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ![];
1404
1045
 
1405
- if (!this[_0x2b52('0x12b')] === 'LISTEN') {
1406
- throw new _common.Exceptions[_0x2b52('0x66')](_0x2b52('0x161'));
1407
- }
1046
+ const _0x26b660 = a0_0x35184d;
1047
+ if (!this[_0x26b660(0x171)][_0x26b660(0x154)][_0x26b660(0x1ac)]) throw new _common.Exceptions['NotAllowed'](_0x26b660(0x135));
1408
1048
 
1409
- if (mode < 0x0 || mode > 0x2) {
1410
- throw new _common.Exceptions['InvalidOptions'](_0x2b52('0x162'));
1411
- }
1049
+ this[_0x26b660(0x277)]['info']('Playback\x20media\x20file\x20' + _0x3de786 + '\x20hangup\x20after\x20' + _0x53bfb1);
1412
1050
 
1413
- let t_dtmf_mode;
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
+ });
1414
1057
 
1415
- if (mode === 0x0) {
1416
- t_dtmf_mode = 0x0;
1417
- }
1058
+ return _0x53bfb1 && (this[_0x26b660(0x171)]['_remoteAudioElement'][_0x26b660(0xeb)] = null, this[_0x26b660(0x214)]['mute'](), _0x2ec2a9['then'](() => {
1059
+ const _0x184bd6 = _0x26b660;
1418
1060
 
1419
- if (mode === 0x1) {
1420
- t_dtmf_mode = 0x2;
1421
- }
1061
+ this[_0x184bd6(0x1e1)](_0x184bd6(0x111));
1062
+ })), _0x2ec2a9;
1063
+ }
1422
1064
 
1423
- if (mode === 0x2) {
1424
- t_dtmf_mode = 0x3;
1425
- }
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');
1426
1071
 
1427
- this['sendDTMF'](t_dtmf_mode, ![]);
1428
- this['_whisperMode'] = mode;
1072
+ let _0x11b105;
1429
1073
 
1430
- this[_0x2b52('0x163')]();
1074
+ _0x3038c4 === 0x0 && (_0x11b105 = 0x0), _0x3038c4 === 0x1 && (_0x11b105 = 0x2), _0x3038c4 === 0x2 && (_0x11b105 = 0x3), this['sendDTMF'](_0x11b105, ![]), this['_whisperMode'] = _0x3038c4, this[_0x582d5f(0x217)]();
1431
1075
  }
1432
1076
 
1433
- [_0x2b52('0x164')]() {
1434
- const self = this;
1077
+ [a0_0x35184d(0x1d4)]() {
1078
+ const _0x34be96 = a0_0x35184d,
1079
+ _0x48cffe = this;
1435
1080
 
1436
- if (!this['_durationUpdTimerObj']) {
1437
- this[_0x2b52('0xbc')] = setInterval(function () {
1438
- const activeDuration = self[_0x2b52('0xba')] ? Date[_0x2b52('0x106')]() - self[_0x2b52('0xba')] : null;
1439
- const e = {
1440
- 'uuid': self[_0x2b52('0xb2')],
1441
- 'beginTime': self['_callBeginTime'],
1442
- 'answerTime': self[_0x2b52('0xba')],
1443
- 'endTime': self[_0x2b52('0xbb')],
1444
- 'duration': Date[_0x2b52('0x106')]() - self[_0x2b52('0xb9')],
1445
- 'durationStr': _common.Tools[_0x2b52('0xab')](Date[_0x2b52('0x106')]() - self[_0x2b52('0xb9')]),
1446
- 'activeDuration': activeDuration,
1447
- 'activeDurationStr': activeDuration ? _common.Tools[_0x2b52('0xab')](activeDuration) : ''
1448
- };
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
+ };
1449
1094
 
1450
- try {
1451
- self['emit']('callDurationUpdate', e);
1452
- } catch (_0x84d80f) {
1453
- self[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x165') + _0x84d80f);
1454
- }
1455
- }, 0x3e8);
1456
- }
1095
+ try {
1096
+ _0x48cffe['emit'](_0x387caf(0x1c9), _0x4c3e97);
1097
+ } catch (_0x35584f) {
1098
+ _0x48cffe[_0x387caf(0x277)][_0x387caf(0x247)](_0x387caf(0x197) + _0x35584f);
1099
+ }
1100
+ }, 0x3e8));
1457
1101
  }
1458
1102
 
1459
- [_0x2b52('0xf8')]() {
1460
- if (!this[_0x2b52('0x166')]) {
1461
- const emptyReport = {
1103
+ [a0_0x35184d(0xcb)]() {
1104
+ const _0x1a4f61 = a0_0x35184d;
1105
+
1106
+ if (!this[_0x1a4f61(0x1a3)]) {
1107
+ const _0x30e52e = {
1462
1108
  'outboundPacketsSent': 0x0,
1463
1109
  'outboundBytesSent': 0x0,
1464
1110
  'outboundPacketsLost': 0x0,
@@ -1469,40 +1115,27 @@ class Session extends _events.default {
1469
1115
  'inboundJitter': 0x0,
1470
1116
  'roundTripTime': 0x0
1471
1117
  };
1472
- this[_0x2b52('0xc2')] = Object['assign']({}, emptyReport);
1473
- this['_rtcpStatsTimer'] = setInterval(() => {
1474
- this[_0x2b52('0xb3')]['_connection'][_0x2b52('0x167')]()[_0x2b52('0x1c')](data => {
1475
- let totalReport = Object[_0x2b52('0x23')]({}, emptyReport);
1476
-
1477
- let deltaReport = Object[_0x2b52('0x23')]({}, emptyReport);
1478
-
1479
- for (let report of data[_0x2b52('0x168')]()) {
1480
- switch (report[_0x2b52('0xef')]) {
1481
- case _0x2b52('0x169'):
1482
- totalReport[_0x2b52('0x16a')] = report[_0x2b52('0x16b')];
1483
- deltaReport['outboundPacketsSent'] = report[_0x2b52('0x16b')] - this['_currentReport'][_0x2b52('0x16a')];
1484
- totalReport[_0x2b52('0x16c')] = report[_0x2b52('0x16d')];
1485
- deltaReport['outboundBytesSent'] = report[_0x2b52('0x16d')] - this[_0x2b52('0xc2')][_0x2b52('0x16c')];
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)];
1486
1131
  break;
1487
1132
 
1488
- case _0x2b52('0x16e'):
1489
- totalReport[_0x2b52('0x16f')] = report['packetsReceived'];
1490
- deltaReport[_0x2b52('0x16f')] = report[_0x2b52('0x170')] - this[_0x2b52('0xc2')][_0x2b52('0x16f')];
1491
- totalReport['inboundBytesReceived'] = report[_0x2b52('0x171')];
1492
- deltaReport[_0x2b52('0x172')] = report[_0x2b52('0x171')] - this[_0x2b52('0xc2')][_0x2b52('0x172')];
1493
- totalReport[_0x2b52('0x173')] = report[_0x2b52('0x174')];
1494
- deltaReport[_0x2b52('0x173')] = report[_0x2b52('0x174')] - this[_0x2b52('0xc2')]['inboundPacketsLost'];
1495
- totalReport[_0x2b52('0x175')] = report[_0x2b52('0x176')] * 0x3e8;
1496
- deltaReport['inboundJitter'] = report[_0x2b52('0x176')] * 0x3e8;
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;
1497
1135
  break;
1498
1136
 
1499
- case _0x2b52('0x177'):
1500
- totalReport[_0x2b52('0x178')] = report[_0x2b52('0x174')];
1501
- deltaReport[_0x2b52('0x178')] = report[_0x2b52('0x174')] - this[_0x2b52('0xc2')][_0x2b52('0x178')];
1502
- totalReport[_0x2b52('0x179')] = report[_0x2b52('0x176')] * 0x3e8;
1503
- deltaReport['outboundJitter'] = report[_0x2b52('0x176')] * 0x3e8;
1504
- totalReport[_0x2b52('0x17a')] = report[_0x2b52('0x17a')] * 0x3e8;
1505
- deltaReport[_0x2b52('0x17a')] = report[_0x2b52('0x17a')] * 0x3e8;
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;
1506
1139
  break;
1507
1140
 
1508
1141
  default:
@@ -1510,18 +1143,18 @@ class Session extends _events.default {
1510
1143
  }
1511
1144
  }
1512
1145
 
1513
- this[_0x2b52('0xc2')] = this[_0x2b52('0x17b')](totalReport);
1146
+ this['_currentReport'] = this[_0x1a6192(0x10f)](_0x7ff17c);
1514
1147
 
1515
- if (totalReport[_0x2b52('0x17a')]) {
1516
- const finalReport = {
1517
- 'total': this[_0x2b52('0xc2')],
1518
- 'delta': this[_0x2b52('0x17b')](deltaReport)
1148
+ if (_0x7ff17c[_0x1a6192(0xe8)]) {
1149
+ const _0x416aee = {
1150
+ 'total': this[_0x1a6192(0x267)],
1151
+ 'delta': this[_0x1a6192(0x10f)](_0x235051)
1519
1152
  };
1520
1153
 
1521
1154
  try {
1522
- this[_0x2b52('0x9a')](_0x2b52('0x17c'), finalReport);
1523
- } catch (_0x5a116e) {
1524
- this[_0x2b52('0x11')]['error'](_0x2b52('0x17d') + _0x5a116e);
1155
+ this[_0x1a6192(0x1af)](_0x1a6192(0x1c3), _0x416aee);
1156
+ } catch (_0x12436f) {
1157
+ this[_0x1a6192(0x277)]['error'](_0x1a6192(0x1fc) + _0x12436f);
1525
1158
  }
1526
1159
  }
1527
1160
  });
@@ -1529,208 +1162,172 @@ class Session extends _events.default {
1529
1162
  }
1530
1163
  }
1531
1164
 
1532
- [_0x2b52('0x17b')](report) {
1533
- report[_0x2b52('0x17e')] = report['outboundPacketsLost'] / report[_0x2b52('0x16a')];
1534
- report[_0x2b52('0x17f')] = report['inboundPacketsLost'] / report[_0x2b52('0x16f')];
1535
- report[_0x2b52('0x180')] = report[_0x2b52('0x17a')] + (report[_0x2b52('0x175')] + report[_0x2b52('0x179')]) + 0xa;
1536
- const lossRate = (report[_0x2b52('0x17e')] + report[_0x2b52('0x17f')]) * 0x64;
1537
- const lossEffect = 0x5f * lossRate / (lossRate + 0xa);
1538
- const latencyEffect = report[_0x2b52('0x180')] * 0.1;
1539
- report[_0x2b52('0x181')] = Math['max'](0x0, 0x64 - lossEffect - latencyEffect);
1540
- report['mos'] = 0x1 + 0.035 * report['rFactor'] + 0.000007 * report[_0x2b52('0x181')] * (report['rFactor'] - 0x3c) * (0x64 - report[_0x2b52('0x181')]);
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']);
1541
1174
 
1542
1175
  switch (!![]) {
1543
- case report['rFactor'] < 0x32:
1544
- report['qualityString'] = _0x2b52('0x182');
1176
+ case _0x3349d4['rFactor'] < 0x32:
1177
+ _0x3349d4['qualityString'] = _0x2bdc76(0xc5);
1545
1178
  break;
1546
1179
 
1547
- case report['rFactor'] < 0x46:
1548
- report[_0x2b52('0x183')] = 'Poor';
1180
+ case _0x3349d4['rFactor'] < 0x46:
1181
+ _0x3349d4['qualityString'] = _0x2bdc76(0x13b);
1549
1182
  break;
1550
1183
 
1551
- case report[_0x2b52('0x181')] < 0x50:
1552
- report['qualityString'] = _0x2b52('0x184');
1184
+ case _0x3349d4['rFactor'] < 0x50:
1185
+ _0x3349d4[_0x2bdc76(0x130)] = _0x2bdc76(0x128);
1553
1186
  break;
1554
1187
 
1555
- case report[_0x2b52('0x181')] < 0x5a:
1556
- report[_0x2b52('0x183')] = _0x2b52('0x185');
1188
+ case _0x3349d4[_0x2bdc76(0x275)] < 0x5a:
1189
+ _0x3349d4[_0x2bdc76(0x130)] = _0x2bdc76(0x16a);
1557
1190
  break;
1558
1191
 
1559
- case report[_0x2b52('0x181')] <= 0x64:
1560
- report[_0x2b52('0x183')] = _0x2b52('0x186');
1192
+ case _0x3349d4['rFactor'] <= 0x64:
1193
+ _0x3349d4[_0x2bdc76(0x130)] = 'Excellent';
1561
1194
  break;
1562
1195
 
1563
1196
  default:
1564
- report[_0x2b52('0x183')] = _0x2b52('0x187');
1197
+ _0x3349d4['qualityString'] = _0x2bdc76(0x212);
1565
1198
  }
1566
1199
 
1567
- return report;
1200
+ return _0x3349d4;
1568
1201
  }
1569
1202
 
1570
- [_0x2b52('0x51')](state) {
1571
- let info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1203
+ [a0_0x35184d(0x1e1)](_0x2a3c7b) {
1204
+ let _0x1224b6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1572
1205
 
1573
- this['log'][_0x2b52('0x16')](_0x2b52('0x188') + state);
1206
+ const _0x154ce8 = a0_0x35184d;
1574
1207
 
1575
- if (info) {
1576
- this[_0x2b52('0x11')][_0x2b52('0x16')](info);
1577
- }
1208
+ this['log'][_0x154ce8(0xcf)](_0x154ce8(0x1fb) + _0x2a3c7b);
1578
1209
 
1579
- this['_sessionState'] = state;
1210
+ _0x1224b6 && this[_0x154ce8(0x277)][_0x154ce8(0xcf)](_0x1224b6);
1211
+ this[_0x154ce8(0x13c)] = _0x2a3c7b;
1580
1212
 
1581
1213
  try {
1582
- this[_0x2b52('0x9a')](_0x2b52('0x189'), Object[_0x2b52('0x23')]({
1583
- 'state': state,
1584
- 'uuid': this['_callUUID']
1585
- }, info));
1586
- } catch (_0x57aa89) {
1587
- this[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20sessionStateChange\x20event:' + _0x57aa89);
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);
1588
1220
  }
1589
1221
 
1590
- if (state === _0x2b52('0x107')) {
1591
- this[_0x2b52('0xbf')] = this['_manualDisposition'] || _0x2b52('0x18a');
1592
-
1593
- this[_0x2b52('0x18b')]();
1594
- }
1595
-
1596
- if (state === 'FAILED') {
1597
- if (info['cause'] === _0x2b52('0x18c')) {
1598
- this[_0x2b52('0xbf')] = _0x2b52('0x18d');
1599
-
1600
- if (this[_0x2b52('0xca')][_0x2b52('0x73')][_0x2b52('0x18e')]) {
1601
- this[_0x2b52('0xca')]['_startRepeatTone'](ST_TEMP_UNAVAIL);
1602
- }
1603
- }
1604
-
1605
- if (info['cause'] === 'Not\x20Found') {
1606
- this['_callDisposition'] = _0x2b52('0x18f');
1607
-
1608
- if (this['_phone']['options'][_0x2b52('0x18e')]) {
1609
- this[_0x2b52('0xca')]['_startRepeatTone'](ST_INVALID_NUMBER);
1610
- }
1611
- }
1612
-
1613
- if (info['cause'] === _0x2b52('0x190')) {
1614
- this[_0x2b52('0xbf')] = this[_0x2b52('0x125')] || _0x2b52('0x191');
1615
- }
1222
+ _0x2a3c7b === _0x154ce8(0x183) && (this['_callDisposition'] = this['_manualDisposition'] || _0x154ce8(0x21c), this[_0x154ce8(0xd7)]());
1616
1223
 
1617
- if (info['cause'] === _0x2b52('0x192')) {
1618
- if (this['direction'] === 'INBOUND') {
1619
- this[_0x2b52('0xbf')] = _0x2b52('0x193');
1620
- } else {
1621
- this[_0x2b52('0xbf')] = _0x2b52('0x194');
1622
- }
1623
- }
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));
1624
1230
 
1625
- if (info[_0x2b52('0x10c')] === _0x2b52('0x4f')) {
1626
- this[_0x2b52('0xbf')] = _0x2b52('0x195');
1231
+ if (this[_0x154ce8(0x214)][_0x154ce8(0x126)] === _0x154ce8(0x193)) {}
1627
1232
 
1628
- if (this['_phone'][_0x2b52('0x73')][_0x2b52('0x18e')]) {
1629
- this[_0x2b52('0xca')]['_startRepeatTone'](ST_BUSY);
1630
- }
1631
- }
1632
-
1633
- if (this['_webRTCSession'][_0x2b52('0x12b')] === _0x2b52('0x12d')) {}
1634
-
1635
- this[_0x2b52('0x18b')]();
1233
+ this[_0x154ce8(0xd7)]();
1636
1234
  }
1637
1235
  }
1638
1236
 
1639
- ['_callFinished']() {
1640
- this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x196'));
1641
-
1642
- this[_0x2b52('0x197')]();
1643
-
1644
- clearInterval(this[_0x2b52('0xbc')]);
1645
- clearInterval(this['_rtcpStatsTimer']);
1646
-
1647
- this['_phone'][_0x2b52('0x198')](this);
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);
1648
1240
  }
1649
1241
 
1650
- [_0x2b52('0xe1')](timeout) {
1651
- this['log']['debug'](_0x2b52('0x199') + timeout);
1652
- this[_0x2b52('0xc3')] = timeout;
1242
+ ['_setAnswerCallTimeout'](_0x9d53d4) {
1243
+ const _0x2d7dde = a0_0x35184d;
1244
+ this[_0x2d7dde(0x277)][_0x2d7dde(0xcf)](_0x2d7dde(0x248) + _0x9d53d4), this[_0x2d7dde(0xfb)] = _0x9d53d4;
1653
1245
  }
1654
1246
 
1655
- ['_fireRecordingStateEvent']() {
1247
+ [a0_0x35184d(0x177)]() {
1248
+ const _0x18c465 = a0_0x35184d;
1249
+
1656
1250
  try {
1657
- this[_0x2b52('0x9a')](_0x2b52('0x140'), {
1658
- 'state': this[_0x2b52('0xb7')],
1659
- 'error': this[_0x2b52('0xb8')]
1251
+ this[_0x18c465(0x1af)](_0x18c465(0x1c2), {
1252
+ 'state': this[_0x18c465(0x117)],
1253
+ 'error': this['_recordingError']
1660
1254
  });
1661
- } catch (_0x4eaf6e) {
1662
- this[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20recording\x20state\x20change\x20event:\x20' + _0x4eaf6e);
1255
+ } catch (_0x4f5a20) {
1256
+ this[_0x18c465(0x277)][_0x18c465(0x247)]('Exception\x20in\x20recording\x20state\x20change\x20event:\x20' + _0x4f5a20);
1663
1257
  }
1664
1258
  }
1665
1259
 
1666
- ['_fireMuteStateEvent']() {
1260
+ [a0_0x35184d(0x24e)]() {
1261
+ const _0x292031 = a0_0x35184d;
1262
+
1667
1263
  try {
1668
- this['emit'](_0x2b52('0x19a'), {
1669
- 'state': this[_0x2b52('0xb6')]
1264
+ this[_0x292031(0x1af)](_0x292031(0x1cf), {
1265
+ 'state': this['_isMuted']
1670
1266
  });
1671
- } catch (_0x1288e8) {
1672
- this[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20mute\x20state\x20change\x20event:\x20' + _0x1288e8);
1267
+ } catch (_0x1b55a) {
1268
+ this['log'][_0x292031(0x247)](_0x292031(0x1f6) + _0x1b55a);
1673
1269
  }
1674
1270
  }
1675
1271
 
1676
- [_0x2b52('0x111')]() {
1272
+ [a0_0x35184d(0x23d)]() {
1273
+ const _0x17279d = a0_0x35184d;
1274
+
1677
1275
  try {
1678
- this['emit'](_0x2b52('0x19b'), {
1679
- 'state': this[_0x2b52('0xb5')]
1276
+ this[_0x17279d(0x1af)]('holdStateChange', {
1277
+ 'state': this[_0x17279d(0x12b)]
1680
1278
  });
1681
- } catch (_0x2fc4e0) {
1682
- this['log'][_0x2b52('0x1d')](_0x2b52('0x19c') + _0x2fc4e0);
1279
+ } catch (_0x22c4f7) {
1280
+ this[_0x17279d(0x277)][_0x17279d(0x247)](_0x17279d(0x268) + _0x22c4f7);
1683
1281
  }
1684
1282
  }
1685
1283
 
1686
- [_0x2b52('0x163')]() {
1284
+ ['_fireWhisperModeChangeEvent']() {
1285
+ const _0x24e3aa = a0_0x35184d;
1286
+
1687
1287
  try {
1688
- this[_0x2b52('0x9a')](_0x2b52('0x19d'), {
1689
- 'mode': this['_whisperMode']
1288
+ this[_0x24e3aa(0x1af)](_0x24e3aa(0x1c0), {
1289
+ 'mode': this[_0x24e3aa(0x1b1)]
1690
1290
  });
1691
- } catch (_0x1cc8a1) {
1692
- this['log'][_0x2b52('0x1d')](_0x2b52('0x19e') + _0x1cc8a1);
1291
+ } catch (_0x301208) {
1292
+ this[_0x24e3aa(0x277)][_0x24e3aa(0x247)](_0x24e3aa(0xd9) + _0x301208);
1693
1293
  }
1694
1294
  }
1695
1295
 
1696
- [_0x2b52('0x197')]() {
1697
- let e;
1698
- e = {
1699
- 'uuid': this[_0x2b52('0xb2')],
1700
- 'direction': this[_0x2b52('0x12b')],
1701
- 'disposition': this[_0x2b52('0xbf')],
1702
- 'originatingNumber': this[_0x2b52('0xbd')],
1703
- 'destinationNumber': this[_0x2b52('0xbe')],
1704
- 'duration': this[_0x2b52('0xbb')] - this[_0x2b52('0xb9')],
1705
- 'answerDuration': this[_0x2b52('0xba')] ? this[_0x2b52('0xba')] - this[_0x2b52('0xb9')] : null,
1706
- 'activeDuration': this[_0x2b52('0xba')] ? this[_0x2b52('0xbb')] - this[_0x2b52('0xba')] : null,
1707
- 'startTime': new Date(this[_0x2b52('0xb9')])['toISOString'](),
1708
- 'endTime': new Date(this[_0x2b52('0xbb')])[_0x2b52('0x19f')](),
1709
- 'answerTime': this['_callAnswerTime'] ? new Date(this[_0x2b52('0xba')])[_0x2b52('0x19f')]() : null
1710
- };
1711
- e['durationStr'] = _common.Tools['createDurationString'](e['duration']);
1712
- e[_0x2b52('0xad')] = e[_0x2b52('0xa9')] ? _common.Tools['createDurationString'](e[_0x2b52('0xa9')]) : '';
1713
- e[_0x2b52('0xae')] = e[_0x2b52('0xaf')] ? _common.Tools['createDurationString'](e[_0x2b52('0xaf')]) : '';
1714
- e[_0x2b52('0x1a0')] = this['_currentReport'];
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)];
1715
1314
 
1716
1315
  try {
1717
- this['emit'](_0x2b52('0x1a1'), e);
1718
- } catch (_0x5dc5dd) {
1719
- this[_0x2b52('0x11')]['error'](_0x2b52('0x1a2') + _0x5dc5dd);
1316
+ this[_0x359f8d(0x1af)](_0x359f8d(0x1a9), _0x4a6871);
1317
+ } catch (_0x138a2b) {
1318
+ this[_0x359f8d(0x277)]['error'](_0x359f8d(0x220) + _0x138a2b);
1720
1319
  }
1721
1320
  }
1722
1321
 
1723
- ['_handleRemoteAudio'](session) {
1724
- this[_0x2b52('0xca')][_0x2b52('0x8c')]();
1725
-
1726
- const self = this;
1727
-
1728
- session[_0x2b52('0x11e')][_0x2b52('0x1a3')] = function (event) {
1729
- self[_0x2b52('0x11')]['debug'](_0x2b52('0x1a4'));
1322
+ [a0_0x35184d(0x1cc)](_0x4f7c43) {
1323
+ const _0x327370 = a0_0x35184d;
1324
+ this['_phone']['_endRepeatTone']();
1730
1325
 
1731
- self['log'][_0x2b52('0x16')](event);
1326
+ const _0x52f8db = this;
1732
1327
 
1733
- self[_0x2b52('0xca')][_0x2b52('0x9')][_0x2b52('0x91')] = event['streams'][0x0];
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];
1734
1331
  };
1735
1332
  }
1736
1333