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