Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BoxDialer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
BoxDialer
Commits
90e1b5e1
Commit
90e1b5e1
authored
Jun 11, 2024
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "update"
This reverts commit
2c43f396
.
parent
2c43f396
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
main.js
prod/main.js
+3
-3
No files found.
prod/main.js
View file @
90e1b5e1
...
...
@@ -3009,7 +3009,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style */ \"./src/components/settingComponents/fixComponent/style.js\");\n/* harmony import */ var _mui_material_Switch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @mui/material/Switch */ \"./node_modules/@mui/material/Switch/Switch.js\");\n/* harmony import */ var _MiniTable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../MiniTable */ \"./src/components/MiniTable/index.jsx\");\n/* harmony import */ var _storage_globalColorConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../storage/globalColorConfig */ \"./src/storage/globalColorConfig.js\");\n/* harmony import */ var _mui_material_Slider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @mui/material/Slider */ \"./node_modules/@mui/material/Slider/Slider.js\");\n\n\n\n\n\n\nvar FixComponent = function FixComponent() {\n var useColorConfigStore = (0,_storage_globalColorConfig__WEBPACK_IMPORTED_MODULE_3__.useColorConfig)(function (store) {\n return store;\n });\n console.log('useColorConfig client: ', useColorConfigStore.state.autoAnswer);\n var marks = [{\n value: 1,\n label: '
0s'\n }, {\n value: 50,\n label: '5s'\n }, {\n value: 100,\n label: '10
s'\n }];\n var tableData = [{\n id: '1',\n title: 'Auto answer',\n type: 'row',\n child: useColorConfigStore.state.autoAnswer && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n padding: '0 20px 0 5px'\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_mui_material_Slider__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n \"aria-label\": \"Restricted values\",\n defaultValue: 40,\n step: null,\n value: useColorConfigStore.state.autoAnswerSecond,\n marks: marks,\n onChange: function onChange(e) {\n return useColorConfigStore.setColor({\n name: 'autoAnswerSecond',\n value: e.target.value\n });\n }\n })),\n inputTag: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_mui_material_Switch__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n size: 'small',\n checked: useColorConfigStore.state.autoAnswer,\n onChange: function onChange(e) {\n return useColorConfigStore.setColor({\n name: 'autoAnswer',\n value: e.target.checked\n });\n }\n })\n }];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_style__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MiniTable__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n data: tableData\n }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FixComponent);\n\n//# sourceURL=webpack://boxdialer/./src/components/settingComponents/fixComponent/index.jsx?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style */ \"./src/components/settingComponents/fixComponent/style.js\");\n/* harmony import */ var _mui_material_Switch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @mui/material/Switch */ \"./node_modules/@mui/material/Switch/Switch.js\");\n/* harmony import */ var _MiniTable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../MiniTable */ \"./src/components/MiniTable/index.jsx\");\n/* harmony import */ var _storage_globalColorConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../storage/globalColorConfig */ \"./src/storage/globalColorConfig.js\");\n/* harmony import */ var _mui_material_Slider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @mui/material/Slider */ \"./node_modules/@mui/material/Slider/Slider.js\");\n\n\n\n\n\n\nvar FixComponent = function FixComponent() {\n var useColorConfigStore = (0,_storage_globalColorConfig__WEBPACK_IMPORTED_MODULE_3__.useColorConfig)(function (store) {\n return store;\n });\n console.log('useColorConfig client: ', useColorConfigStore.state.autoAnswer);\n var marks = [{\n value: 1,\n label: '
1s'\n }, {\n value: 40,\n label: '3s'\n }, {\n value: 100,\n label: '6
s'\n }];\n var tableData = [{\n id: '1',\n title: 'Auto answer',\n type: 'row',\n child: useColorConfigStore.state.autoAnswer && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n style: {\n padding: '0 20px 0 5px'\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_mui_material_Slider__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n \"aria-label\": \"Restricted values\",\n defaultValue: 40,\n step: null,\n value: useColorConfigStore.state.autoAnswerSecond,\n marks: marks,\n onChange: function onChange(e) {\n return useColorConfigStore.setColor({\n name: 'autoAnswerSecond',\n value: e.target.value\n });\n }\n })),\n inputTag: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_mui_material_Switch__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n size: 'small',\n checked: useColorConfigStore.state.autoAnswer,\n onChange: function onChange(e) {\n return useColorConfigStore.setColor({\n name: 'autoAnswer',\n value: e.target.checked\n });\n }\n })\n }];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_style__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MiniTable__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n data: tableData\n }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FixComponent);\n\n//# sourceURL=webpack://boxdialer/./src/components/settingComponents/fixComponent/index.jsx?");
/***/ }),
...
...
@@ -3042,7 +3042,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BoxDialer: () => (/* binding */ BoxDialer)\n/* harmony export */ });\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _sounds_ringtone_wav__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../sounds/ringtone.wav */ \"./src/sounds/ringtone.wav\");\n/* harmony import */ var _sounds_ringbacktone_wav__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../sounds/ringbacktone.wav */ \"./src/sounds/ringbacktone.wav\");\n/* harmony import */ var _sounds_dtmf_wav__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../sounds/dtmf.wav */ \"./src/sounds/dtmf.wav\");\n/* harmony import */ var jssip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! jssip */ \"./node_modules/jssip/lib-es5/JsSIP.js\");\n/* harmony import */ var jssip__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(jssip__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _img_tug_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../img/tug.png */ \"./src/img/tug.png\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../package.json */ \"./package.json\");\n/** @format */\n\n\n\n\n\n\n\n\nvar BoxDialer = /*#__PURE__*/function () {\n function BoxDialer() {\n var _this = this;\n this.sTransferNumber = void 0;\n this.oRingTone = void 0;\n this.oRingbackTone = void 0;\n this.oSipStack = void 0;\n this.oSipSessionRegister = void 0;\n this.oSipSessionCall = void 0;\n this.oSipSessionCallSecond = void 0;\n this.oSipSessionTransferCall = void 0;\n this.videoRemote = void 0;\n this.videoLocal = void 0;\n this.remoteAudio = void 0;\n this.bFullScreen = false;\n this.oNotifICall = void 0;\n this.bDisableVideo = false;\n this.viewVideoLocal = void 0;\n this.viewVideoRemote = void 0;\n this.viewLocalScreencast = void 0;\n // <video> (webrtc) or <div> (webrtc4all)\n this.oConfigCall = void 0;\n this.callDirection = void 0;\n this.oReadyStateTimer = void 0;\n this.ringtone = void 0;\n this.ringbacktone = void 0;\n this.sipState = void 0;\n this.sipBxState = void 0;\n this.soundBool = void 0;\n this.onSipStateChange = {};\n this.callEvetsBoxDialer = void 0;\n this.musicContext = void 0;\n this.gainNode = void 0;\n this.gainNode = void 0;\n this.oscillator1 = void 0;\n this.oscillator2 = void 0;\n this.extnum = void 0;\n this.timer = {\n time: 0,\n type: null\n };\n this.innerTimer = {\n time: 0,\n type: null\n };\n this.options = void 0;\n this.socket = void 0;\n this.ua = void 0;\n this.testTimer = void 0;\n this.testInnerTimer = void 0;\n this.callSession = void 0;\n this.sipDomain = void 0;\n this.player = void 0;\n this.strmTrack = void 0;\n this.isRestarting = void 0;\n this.globalHistoryData = void 0;\n this.sipRegister = function (_ref) {\n var number = _ref.number,\n secret = _ref.secret,\n wsurl = _ref.wsurl,\n isIce = _ref.isIce;\n try {\n var _window;\n if ((_window = window) != null && _window.alovoice_setversion && _package_json__WEBPACK_IMPORTED_MODULE_6__ != null && _package_json__WEBPACK_IMPORTED_MODULE_6__.version) {\n window.alovoice_setversion(_package_json__WEBPACK_IMPORTED_MODULE_6__ == null ? void 0 : _package_json__WEBPACK_IMPORTED_MODULE_6__.version);\n }\n if (_this.options) {\n var _BX;\n if (typeof BX !== 'undefined') (_BX = BX) == null || (_BX = _BX.localStorage) == null ? void 0 : _BX.remove('viExternalCard');\n _this.socket = new jssip__WEBPACK_IMPORTED_MODULE_4__.WebSocketInterface(\"wss://\" + wsurl + \"/ws\");\n _this.callSession = false;\n _this.sipDomain = wsurl;\n console.log('ua_configure ', {\n sockets: [_this.socket],\n uri: \"sip:\" + number + \"@\" + wsurl,\n password: secret,\n stun_server: 'stun:stun.l.google.com:19302'\n });\n _this.ua = new jssip__WEBPACK_IMPORTED_MODULE_4__.UA({\n sockets: [_this.socket],\n uri: \"sip:\" + number + \"@\" + wsurl,\n password: secret,\n stun_server: 'stun:stun.l.google.com:19302',\n register_expires: 60\n });\n if (typeof BX !== 'undefined') {\n console.log('setting_my_call =============================-----------');\n window.localStorage.setItem(BX.bitrix_sessid() + '_mycall', _this.ua.configuration.instance_id);\n window.localStorage.setItem('mycall', _this.ua.configuration.instance_id);\n }\n _this.ua.on('connected', function (e) {\n console.log('%c sip_register [connected]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('disconnected', function (e) {\n _this.onSipStateChange.dynamicValue('pending');\n console.log('%c sip_register [disconnected]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('registered', function (e) {\n _this.onSipStateChange.dynamicValue('connected');\n console.log('%c sip_register [registered]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('unregistered', function (e) {\n console.log('%c sip_register [unregistered]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('registrationFailed', function (e) {\n console.log('%c sip_register [registrationFailed]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('connecting', function (e) {\n console.log('%c connecting: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('registrationExpiring', function (e) {\n console.log('%c registrationExpiring: ', 'font-size: 22px; color: yellow;', e);\n _this.ua.register();\n });\n _this.ua.on('newMessage', function (e) {\n console.log('%c newMessage: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('sipEvent', function (e) {\n console.log('%c sipEvent: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('newOptions', function (e) {\n console.log('%c newOptions: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('newRTCSession', function (data) {\n var _this$callSession;\n console.log('%c newRTCSession: ', 'font-size: 22px; color: yellow;', data);\n _this.callSession = data.session;\n if (_this.callSession && _this.callSession.connection) {\n _this.callSession.connection.onaddstream = function (e) {\n _this.strmTrack = e.stream.getAudioTracks();\n if (_this.strmTrack[0]) {\n _this.remoteAudio.srcObject = new MediaStream([_this.strmTrack[0]]);\n _this.remoteAudio.play();\n }\n };\n }\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: true,\n callType: 'incoming'\n }\n });\n _this.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connectingIncoming',\n from: _this == null || (_this$callSession = _this.callSession) == null || (_this$callSession = _this$callSession._remote_identity) == null || (_this$callSession = _this$callSession._uri) == null ? void 0 : _this$callSession.user\n });\n if (_this.callSession.direction === 'incoming') {\n var _this$globalHistoryDa, _this$globalHistoryDa2;\n var second;\n console.log('auto_answer is work: ', (_this$globalHistoryDa = _this.globalHistoryData) == null ? void 0 : _this$globalHistoryDa.autoAnswer);\n if ((_this$globalHistoryDa2 = _this.globalHistoryData) != null && _this$globalHistoryDa2.autoAnswer) {\n var _this$globalHistoryDa3;\n switch ((_this$globalHistoryDa3 = _this.globalHistoryData) == null ? void 0 : _this$globalHistoryDa3.autoAnswerSecond) {\n case 1:\n second = 1000;\n break;\n case
50:\n second = 5000;\n break;\n case 100:\n second = 10
000;\n break;\n default:\n second = 0;\n }\n console.log('auto_answer second: ', second);\n setTimeout(function () {\n console.log('auto_answer run boxDialer.answerButtonClick()');\n _this.answerButtonClick();\n }, second);\n }\n _this.showNotification(function () {\n _this.answerButtonClick();\n });\n _this.onSoundType({\n type: 'ring',\n bool: true\n });\n _this.setGuiPhoneState({\n funcName: 'modalState',\n stateCode: 'connectingIncoming',\n funcParam: {\n bool: true,\n callType: 'incoming'\n }\n });\n\n // window.innerCallBegin();\n\n _this.callSession.on('progress', function (e) {\n console.log('%c progress: ', 'font-size: 22px; color: yellow;', e);\n _this.setGuiPhoneState({\n stateCode: 'incoming'\n });\n });\n // incoming call here\n _this.callSession.on('accepted', function () {\n console.log('%c newRTCSession accepted: ', 'font-size: 22px; color: yellow;', e);\n // the call has answered\n _this.onSoundType({\n type: 'ring',\n bool: false\n });\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: true,\n callType: 'connected'\n }\n });\n _this.onSipStateChange.innerCallerModal({\n bool: false,\n type: '',\n from: ''\n });\n });\n _this.callSession.on('confirmed', function () {\n var _this$callSession2;\n console.log('%c newRTCSession confirmed: ', 'font-size: 22px; color: yellow;');\n // this handler will be called for incoming calls too\n console.log('%c incoming confirmed', 'font-size: 22px; color: yellow;');\n _this.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connected',\n from: _this == null || (_this$callSession2 = _this.callSession) == null || (_this$callSession2 = _this$callSession2._remote_identity) == null || (_this$callSession2 = _this$callSession2._uri) == null ? void 0 : _this$callSession2.user\n });\n _this.startInnerTimer();\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: true,\n callType: 'connected'\n }\n });\n });\n _this.callSession.on('ended', function () {\n console.log('%c newRTCSession ended: ', 'font-size: 22px; color: yellow;');\n // the call has ended\n console.log('%c incoming end', 'font-size: 22px; color: yellow;');\n _this.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n _this.stopInnerTimer();\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n _this.closeBxCall();\n _this.hangupButtonClick();\n _this.removeViExternalCard();\n });\n _this.callSession.on('failed', function () {\n // unable to establish the call\n console.log('%c incoming faile ', 'font-size: 22px; color: yellow;');\n _this.onSipStateChange.innerCallerModal({\n bool: false,\n type: null\n });\n _this.stopInnerTimer();\n _this.onSoundType({\n type: 'ring',\n bool: false\n });\n _this.closeBxCall();\n _this.hangupButtonClick();\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n });\n _this.callSession.on('connecting', function (e) {\n console.log('%c connecting: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('sending', function (e) {\n console.log('%c sending: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('newDTMF', function (e) {\n console.log('%c newDTMF: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('newInfo', function (e) {\n console.log('%c newInfo: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('hold', function (e) {\n console.log('%c ___________hold: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('unhold', function (e) {\n console.log('%c ___________unhold: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('muted', function (e) {\n console.log('%c muted: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('unmuted', function (e) {\n console.log('%c unmuted: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('reinvite', function (e) {\n console.log('%c reinvite: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('update', function (e) {\n console.log('%c update: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('refer', function (e) {\n console.log('%c refer: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('replaces', function (e) {\n console.log('%c replaces: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('sdp', function (e) {\n console.log('%c sdp: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('icecandidate', function (e) {\n console.log('%c icecandidate: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('getusermediafailed', function (e) {\n console.log('%c getusermediafailed: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('peerconnection: createofferfailed', function (e) {\n console.log('%c peerconnection: createofferfailed: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('peerconnection: setlocaldescriptionfailed', function (e) {\n console.log('%c peerconnection: setlocaldescriptionfailed: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('peerconnection: setremotedescriptionfailed', function (e) {\n console.log('%c peerconnection: setremotedescriptionfailed: ', 'font-size: 22px; color: yellow;', e);\n });\n }\n });\n _this.ua.start();\n }\n } catch (err) {\n console.log(\"jsSip_error: \", err);\n }\n };\n this.played = false;\n document.body.addEventListener('click', function () {\n _this.played = true;\n });\n this.isRestarting = false;\n this.videoRemote = document.createElement('video');\n this.videoLocal = document.createElement('video');\n this.remoteAudio = document.createElement('audio');\n this.remoteAudio.autoplay = true;\n document.body.appendChild(this.videoRemote);\n document.body.appendChild(this.videoLocal);\n document.body.appendChild(this.remoteAudio);\n this.ringtone = new Audio(_sounds_ringtone_wav__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n this.waitRingTone = new Audio(_sounds_ringbacktone_wav__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n this.pickSound = new Audio(_sounds_dtmf_wav__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n this.ringtone.loop = true;\n this.waitRingTone.loop = true;\n this.callEvetsBoxDialer = {\n callHold: false,\n callMute: null\n };\n this.options = {\n eventHandlers: this.uaEvents(),\n mediaConstraints: {\n audio: true,\n video: false\n }\n };\n }\n var _proto = BoxDialer.prototype;\n _proto.setGlobalHistoryData = function setGlobalHistoryData(data) {\n console.log('setGlobalHistoryData: ', data);\n this.globalHistoryData = data;\n };\n _proto.dialTone = function dialTone(freq1, freq2) {\n // merger = context.createChannelMerger(2);\n // setTimeout(() => {\n // \tconsole.log('-= sTOPING BY TIMEOUT');\n // \tthis.stop();\n // }, 1000);\n // if (this.oscillator1 || this.oscillator2) return;\n // console.log('Begin dialTone:', this.oscillator1, this.oscillator2);\n // this.oscillator1 = this.musicContext.createOscillator();\n // // this.oscillator1.type = null;\n // this.oscillator1.frequency.value = freq1;\n // this.gainNode = this.musicContext.createGain\n // \t? this.musicContext.createGain()\n // \t: this.musicContext.createGainNode();\n // this.oscillator1.connect(this.gainNode, 0, 0);\n // this.gainNode.connect(this.musicContext.destination);\n // this.gainNode.gain.value = 0.1;\n // this.oscillator1.start\n // \t? this.oscillator1.start(0)\n // \t: this.oscillator1.noteOn(0);\n // // this.gainNode.connect(merger,0,1);\n // this.oscillator2 = this.musicContext.createOscillator();\n // // this.oscillator2.type = null;\n // this.oscillator2.frequency.value = freq2;\n // this.gainNode = this.musicContext.createGain\n // \t? this.musicContext.createGain()\n // \t: this.musicContext.createGainNode();\n // this.oscillator2.connect(this.gainNode);\n // this.gainNode.connect(this.musicContext.destination);\n // // this.gainNode.connect(merger,0,0);\n // this.gainNode.gain.value = 0.1;\n // this.oscillator2.start\n // \t? this.oscillator2.start(0)\n // \t: this.oscillator2.noteOn(0);\n };\n _proto.start = function start() {\n // if (typeof this.oscillator1 != 'undefined') this.oscillator1.disconnect();\n // if (typeof this.oscillator2 != 'undefined') this.oscillator2.disconnect();\n // oscOn(\n // \tparseFloat(document.getElementById('freq').value),\n // \tparseFloat(document.getElementById('freq2').value),\n // );\n };\n _proto.stop = function stop() {\n // console.log('STOP', this.oscillator1, this.oscillator2);\n // console.log('FUNC', this.oscillator1?.disconnect, this.oscillator1?.stop);\n // this.oscillator1?.disconnect();\n // this.oscillator2?.disconnect();\n // this.oscillator1?.stop();\n // this.oscillator2?.stop();\n // this.oscillator1 = null;\n // this.oscillator2 = null;\n };\n _proto.uaEvents = function uaEvents() {\n var _this2 = this;\n return {\n progress: function progress(e) {\n var _this2$callSession;\n console.log('%c progress', 'font-size: 22px; color: green;', e);\n // this.hangupButtonClick();\n // this.closeBxCall();\n\n // window.innerCallBegin(true);\n _this2.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connectingOutgoing',\n from: _this2 == null || (_this2$callSession = _this2.callSession) == null || (_this2$callSession = _this2$callSession._remote_identity) == null || (_this2$callSession = _this2$callSession._uri) == null ? void 0 : _this2$callSession.user\n });\n _this2.setGuiPhoneState({\n funcName: 'modalState',\n stateCode: 'connectingOutgoing',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n },\n failed: function failed(e) {\n console.log('%c failed', 'font-size: 22px; color: green;', e);\n if (e != null && e.cause) {\n react_hot_toast__WEBPACK_IMPORTED_MODULE_0__.toast.error(e == null ? void 0 : e.cause);\n }\n // console.log('call failed with cause: ' + e.data);\n _this2.closeBxCall();\n _this2.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n _this2.stopInnerTimer();\n if (e.cause == 'User Denied Media Access') {\n console.log('User_Danied_Media_Access');\n react_hot_toast__WEBPACK_IMPORTED_MODULE_0__.toast.error('Your micrafon is OFF', {\n style: {\n zIndex: '99999999999999999'\n }\n });\n window.navigator.mediaDevices.getUserMedia({\n audio: true\n }).then(function (stream) {\n console.log('User_Danied_Media_Access', 'You let me use your mic!');\n })[\"catch\"](function (err) {\n console.log('User_Danied_Media_Access', 'No mic for you!');\n });\n }\n },\n ended: function ended(e) {\n console.log('%c ended', 'font-size: 22px; color: green;');\n _this2.closeBxCall();\n _this2.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n _this2.stopInnerTimer();\n _this2.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n _this2.removeViExternalCard();\n },\n confirmed: function confirmed(e) {\n var _this2$callSession2;\n console.log('%c confirmed', 'font-size: 22px; color: green;', e);\n // console.log(`%c BXLOG:`, datas, 'background-color: red;');\n _this2.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connected',\n from: _this2 == null || (_this2$callSession2 = _this2.callSession) == null || (_this2$callSession2 = _this2$callSession2._remote_identity) == null || (_this2$callSession2 = _this2$callSession2._uri) == null ? void 0 : _this2$callSession2.user\n });\n _this2.startInnerTimer();\n _this2.setGuiPhoneState({\n funcName: 'modalState',\n stateCode: 'connected',\n funcParam: {\n bool: true,\n callType: 'connected',\n callFromName: 'Test'\n }\n });\n }\n };\n };\n _proto.isUaRunning = function isUaRunning() {\n return Boolean(typeof window.BX !== 'undefined') && Boolean(window.localStorage.getItem(BX.bitrix_sessid() + '_mycall')) && Boolean(window.localStorage.getItem('mycall'));\n };\n _proto.removeViExternalCard = function removeViExternalCard() {\n // if (\n // \ttypeof BX !== 'undefined' &&\n // \twindow.localStorage.getItem(BX.bitrix_sessid() + '_mycall') &&\n // \twindow.localStorage.getItem('mycall')\n // ) {\n // \tBX?.localStorage?.remove('viExternalCard');\n // } else if (typeof BX !== 'undefined') {\n // \tBX?.localStorage?.remove('viExternalCard');\n // }\n };\n _proto.startTimer = function startTimer() {\n var _this3 = this;\n this.testTimer = setInterval(function () {\n _this3.timer.time = _this3.timer.time + 1;\n _this3.onSipStateChange.setDndTimer(_this3.timer.time);\n }, 1000);\n };\n _proto.stopTimer = function stopTimer() {\n clearInterval(this.testTimer);\n this.timer.time = 0;\n this.onSipStateChange.setDndTimer(this.timer.time);\n };\n _proto.startInnerTimer = function startInnerTimer() {\n var _this4 = this;\n this.testInnerTimer = setInterval(function () {\n _this4.innerTimer.time = _this4.innerTimer.time + 1;\n _this4.onSipStateChange.innerTimer(_this4.innerTimer.time);\n }, 1000);\n };\n _proto.stopInnerTimer = function stopInnerTimer() {\n clearInterval(this.testInnerTimer);\n this.innerTimer.time = 0;\n this.onSipStateChange.innerTimer(this.innerTimer.time);\n };\n _proto.showNotification = function showNotification(cbk) {\n var callerId = this.callSession._remote_identity._uri.user;\n var greeting = new Notification(\"\\u0417\\u0432\\u043E\\u043D\\u043E\\u043A \\u043E\\u0442 \" + callerId, {\n body: 'Answer Call',\n icon: _img_tug_png__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n });\n greeting.addEventListener('click', cbk);\n };\n _proto.onSoundType = function onSoundType(_ref2) {\n var type = _ref2.type,\n bool = _ref2.bool;\n this.ringtone.remove();\n this.waitRingTone.remove();\n this.pickSound.remove();\n if (this.played) {\n switch (type) {\n case 'ring':\n if (bool) {\n this.ringtone.pause();\n this.ringtone.remove();\n this.ringtone.play();\n } else {\n this.ringtone.pause();\n this.ringtone.remove();\n }\n break;\n case 'wait':\n if (bool) {\n this.waitRingTone.pause();\n this.waitRingTone.remove();\n console.log(this.waitRingTone, 'sound waitRingTone');\n this.waitRingTone.play();\n } else {\n this.waitRingTone.pause();\n this.waitRingTone.remove();\n }\n break;\n case 'pick':\n if (bool) {\n this.pickSound.remove();\n this.pickSound.pause();\n this.pickSound.play();\n } else {\n this.pickSound.pause();\n this.pickSound.remove();\n }\n break;\n default:\n console.error('onSoundType: Such a sound does not exist');\n break;\n }\n }\n };\n _proto.getBxUiState = function getBxUiState(sipState) {\n // if (sipState && !!sipState.length) sipState = this.sipState;\n var uiStates = {\n incoming: '1',\n transferIncoming: '2',\n outgoing: '3',\n connectingIncoming: '4',\n connectingOutgoing: '5',\n connected: '6',\n transferring: '7',\n transferFailed: '8',\n transferConnected: '9',\n idle: '10',\n error: '11',\n moneyError: '12',\n sipPhoneError: '13',\n redial: '14',\n externalCard: '15'\n };\n console.log('getBxUiState_inset: ', sipState, uiStates[sipState]);\n this.sipBxState = uiStates[sipState];\n return sipState && uiStates[sipState] ? uiStates[sipState] : '';\n };\n _proto.callBxMethods = function callBxMethods(_ref3) {\n var bxMethodName = _ref3.bxMethodName,\n bxFuncParams = _ref3.bxFuncParams,\n callback = _ref3.callback;\n if (window.BX24 && window.BX24.placement) {\n var _window2;\n (_window2 = window) == null ? void 0 : _window2.BX24.placement.call(bxMethodName, bxFuncParams, callback);\n } else if (window.alovoicePhone && window.alovoicePhone.callMethods) {\n window.alovoicePhone.callMethods[bxMethodName](bxFuncParams, callback);\n }\n if (bxFuncParams.uiState == '5') {\n this.removeViExternalCard();\n }\n };\n _proto.closeBxCall = function closeBxCall() {\n if (window.BX24 && window.BX24.placement) {\n var _window3;\n (_window3 = window) == null ? void 0 : _window3.BX24.placement.call('CallCardClose', {}, function () {});\n } else if (window.alovoicePhone && window.alovoicePhone.callMethods && window.alovoicePhone.bodClose) {\n var _window4;\n (_window4 = window) == null || (_window4 = _window4.alovoicePhone) == null ? void 0 : _window4.bodClose();\n }\n };\n _proto.setGuiPhoneState = function setGuiPhoneState(_ref4) {\n var _window5, _window6;\n var stateCode = _ref4.stateCode,\n funcName = _ref4.funcName,\n funcParam = _ref4.funcParam;\n if ((_window5 = window) != null && _window5.alovoice_wsphone && !!(stateCode != null && stateCode.length)) {\n console.log('this_getBxUiState_stateCode', stateCode, this.getBxUiState(stateCode));\n this.callBxMethods({\n bxMethodName: 'CallCardSetUiState',\n bxFuncParams: {\n uiState: this.getBxUiState(stateCode)\n },\n callback: function callback(e) {\n console.log(e, \"CallCardSetUiState method done \" + e);\n }\n });\n } else if (!((_window6 = window) != null && _window6.alovoice_wsphone) && !(stateCode != null && stateCode.length) && !!funcName && this.onSipStateChange[funcName] !== 'undefined') {\n this.onSipStateChange[funcName](funcParam);\n }\n };\n _proto.bxLog = function bxLog() {\n for (var _len = arguments.length, datas = new Array(_len), _key = 0; _key < _len; _key++) {\n datas[_key] = arguments[_key];\n }\n console.log(\"%c BXLOG:\", datas, 'background-color: red;');\n };\n _proto.onSessionEvent = function onSessionEvent(_ref5) {\n var type = _ref5.type,\n event = _ref5.event;\n };\n _proto.selectUser = function selectUser() {\n var _this5 = this;\n BX.Runtime.loadExtension('ui.entity-selector').then(function (exports) {\n var Dialog = exports.Dialog,\n TagSelector = exports.TagSelector;\n var dialog = new BX.UI.EntitySelector.Dialog({\n // targetNode: button,\n enableSearch: true,\n multiple: false,\n context: 'MY_MODULE_CONTEXT',\n entities: [{\n id: 'user',\n // пользователи\n options: {\n selectFields: ['ufPhoneInner']\n }\n }, {\n id: 'department' // структура компании: выбор только пользователей\n }],\n\n events: {\n '_Item:onSelect': function _ItemOnSelect(event) {\n var _event$getData = event.getData(),\n item = _event$getData.item;\n var dialog = event.getTarget();\n var selectedItems = dialog.getSelectedItems();\n if (item.customData.get('ufPhoneInner')) {\n _this5.transferButtonClick(item.customData.get('ufPhoneInner'));\n }\n },\n get 'Item:onSelect'() {\n return this['_Item:onSelect'];\n },\n set 'Item:onSelect'(value) {\n this['_Item:onSelect'] = value;\n }\n }\n });\n dialog.show();\n });\n }\n\n // call_connected;\n ;\n _proto.setSipStateChangeCallback = function setSipStateChangeCallback(callback, funcName) {\n this.onSipStateChange[funcName] = callback.bind(this);\n };\n _proto.sipHangUp = function sipHangUp() {\n console.log('sipHangUp');\n };\n _proto.sipUnRegister = function sipUnRegister() {\n console.log('sipUnRegister');\n };\n _proto.sipTransfer = function sipTransfer() {\n console.log('sipTransfer');\n };\n _proto.initialized = function initialized(phoneNumber) {\n this.sipBxState = null;\n this.callDirection = 'out';\n var phoneNumberString = phoneNumber.toString();\n if (phoneNumberString.length) {\n this.onSipStateChange.phoneModal(false);\n this.options.extraHeaders = [\"X-ALOVOICE-EXTNUM: \" + this.extnum];\n this.callSession = this.ua.call('sip:' + phoneNumberString + '@' + this.sipDomain, this.options);\n // this.callSession.connection.addEventListener('addstream', (event) => {\n // \tconsole.log('--== ss OUT STREAM: ');\n // \tthis.remoteAudio.srcObject = event.stream;\n // \tthis.remoteAudio.play();\n // });\n } else {\n react_hot_toast__WEBPACK_IMPORTED_MODULE_0__.toast.error('Do not correct number', {\n style: {\n zIndex: '99999999999999999'\n }\n });\n }\n // this.onSipStateChange.phoneModal(false);\n };\n _proto.skipButtonClick = function skipButtonClick() {\n this.onSoundType({\n type: 'ring',\n bool: false\n });\n this.hangupButtonClick();\n };\n _proto.answerButtonClick = function answerButtonClick() {\n var _this$callSession3,\n _this6 = this;\n this.onSoundType({\n type: 'ring',\n bool: false\n });\n (_this$callSession3 = this.callSession) == null ? void 0 : _this$callSession3.answer(this.options);\n this.callSession.connection.addEventListener('addstream', function (event) {\n _this6.remoteAudio.srcObject = event.stream;\n _this6.remoteAudio.play();\n });\n };\n _proto.sipSendDTMF = function sipSendDTMF(code) {\n this.callSession.sendDTMF(code);\n };\n _proto.addCommentButtonClick = function addCommentButtonClick() {\n console.log('addCommentButtonClick');\n };\n _proto.muteButtonClick = function muteButtonClick() {\n var _this$callSession$isM = this.callSession.isMuted(),\n audio = _this$callSession$isM.audio;\n if (audio) {\n this.callSession.unmute();\n console.log('muteButtonClick_unmute');\n this.onSipStateChange['setCallEvents']({\n callMute: false\n });\n } else {\n this.callSession.mute();\n console.log('muteButtonClick_mute');\n this.onSipStateChange['setCallEvents']({\n callMute: true\n });\n }\n };\n _proto.holdButtonClick = function holdButtonClick() {\n var _this$callSession$isO = this.callSession.isOnHold(),\n local = _this$callSession$isO.local;\n console.log('local: ', local);\n if (local) {\n this.callSession.unhold();\n this.onSipStateChange['setCallEvents']({\n callHold: false\n });\n } else {\n this.callSession.hold();\n this.onSipStateChange['setCallEvents']({\n callHold: true\n });\n }\n };\n _proto.closeButtonClick = function closeButtonClick() {\n this.hangupButtonClick();\n };\n _proto.hangupButtonClick = function hangupButtonClick() {\n this.onSoundType({\n type: 'ring',\n bool: false\n });\n this.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n console.log('hangupButtonClick========-----------', this.callSession._status);\n if (this.callSession && this.callSession._status != '8') this.callSession.terminate();\n };\n _proto.transferButtonClick = function transferButtonClick(number) {\n this.callSession.refer(number, this.options);\n };\n _proto.cancelTransferButtonClick = function cancelTransferButtonClick() {\n console.log('cancelTransferButtonClick');\n };\n _proto.completeTransferButtonClick = function completeTransferButtonClick() {\n console.log('completeTransferButtonClick');\n };\n _proto.nextButtonClick = function nextButtonClick() {\n console.log('nextButtonClick');\n };\n _proto.entityChanged = function entityChanged() {\n console.log('entityChanged');\n };\n _proto.qualityMeterClick = function qualityMeterClick() {\n console.log('qualityMeterClick');\n };\n _proto.dialpadButtonClick = function dialpadButtonClick(c) {\n console.log('dialpadButtonClick');\n this.sipSendDTMF(c);\n };\n _proto.notifyAdminButtonClick = function notifyAdminButtonClick() {\n console.log('notifyAdminButtonClick');\n };\n _proto.stateLog = function stateLog(state) {\n var stColor = state && state.slice(0, 4) == 'call' ? 'blue' : 'green';\n if (state && state.slice(0, 8) == 'register') {\n stColor = 'yellow';\n }\n var css = 'color:' + stColor + '; font-size: 20px;';\n console.log(' ---onSessionEvent EVENT: %c %s', css, state);\n };\n return BoxDialer;\n}();\n\n//# sourceURL=webpack://boxdialer/./src/lib/boxDIaler.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BoxDialer: () => (/* binding */ BoxDialer)\n/* harmony export */ });\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _sounds_ringtone_wav__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../sounds/ringtone.wav */ \"./src/sounds/ringtone.wav\");\n/* harmony import */ var _sounds_ringbacktone_wav__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../sounds/ringbacktone.wav */ \"./src/sounds/ringbacktone.wav\");\n/* harmony import */ var _sounds_dtmf_wav__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../sounds/dtmf.wav */ \"./src/sounds/dtmf.wav\");\n/* harmony import */ var jssip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! jssip */ \"./node_modules/jssip/lib-es5/JsSIP.js\");\n/* harmony import */ var jssip__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(jssip__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _img_tug_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../img/tug.png */ \"./src/img/tug.png\");\n/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../package.json */ \"./package.json\");\n/** @format */\n\n\n\n\n\n\n\n\nvar BoxDialer = /*#__PURE__*/function () {\n function BoxDialer() {\n var _this = this;\n this.sTransferNumber = void 0;\n this.oRingTone = void 0;\n this.oRingbackTone = void 0;\n this.oSipStack = void 0;\n this.oSipSessionRegister = void 0;\n this.oSipSessionCall = void 0;\n this.oSipSessionCallSecond = void 0;\n this.oSipSessionTransferCall = void 0;\n this.videoRemote = void 0;\n this.videoLocal = void 0;\n this.remoteAudio = void 0;\n this.bFullScreen = false;\n this.oNotifICall = void 0;\n this.bDisableVideo = false;\n this.viewVideoLocal = void 0;\n this.viewVideoRemote = void 0;\n this.viewLocalScreencast = void 0;\n // <video> (webrtc) or <div> (webrtc4all)\n this.oConfigCall = void 0;\n this.callDirection = void 0;\n this.oReadyStateTimer = void 0;\n this.ringtone = void 0;\n this.ringbacktone = void 0;\n this.sipState = void 0;\n this.sipBxState = void 0;\n this.soundBool = void 0;\n this.onSipStateChange = {};\n this.callEvetsBoxDialer = void 0;\n this.musicContext = void 0;\n this.gainNode = void 0;\n this.gainNode = void 0;\n this.oscillator1 = void 0;\n this.oscillator2 = void 0;\n this.extnum = void 0;\n this.timer = {\n time: 0,\n type: null\n };\n this.innerTimer = {\n time: 0,\n type: null\n };\n this.options = void 0;\n this.socket = void 0;\n this.ua = void 0;\n this.testTimer = void 0;\n this.testInnerTimer = void 0;\n this.callSession = void 0;\n this.sipDomain = void 0;\n this.player = void 0;\n this.strmTrack = void 0;\n this.isRestarting = void 0;\n this.globalHistoryData = void 0;\n this.sipRegister = function (_ref) {\n var number = _ref.number,\n secret = _ref.secret,\n wsurl = _ref.wsurl,\n isIce = _ref.isIce;\n try {\n var _window;\n if ((_window = window) != null && _window.alovoice_setversion && _package_json__WEBPACK_IMPORTED_MODULE_6__ != null && _package_json__WEBPACK_IMPORTED_MODULE_6__.version) {\n window.alovoice_setversion(_package_json__WEBPACK_IMPORTED_MODULE_6__ == null ? void 0 : _package_json__WEBPACK_IMPORTED_MODULE_6__.version);\n }\n if (_this.options) {\n var _BX;\n if (typeof BX !== 'undefined') (_BX = BX) == null || (_BX = _BX.localStorage) == null ? void 0 : _BX.remove('viExternalCard');\n _this.socket = new jssip__WEBPACK_IMPORTED_MODULE_4__.WebSocketInterface(\"wss://\" + wsurl + \"/ws\");\n _this.callSession = false;\n _this.sipDomain = wsurl;\n console.log('ua_configure ', {\n sockets: [_this.socket],\n uri: \"sip:\" + number + \"@\" + wsurl,\n password: secret,\n stun_server: 'stun:stun.l.google.com:19302'\n });\n _this.ua = new jssip__WEBPACK_IMPORTED_MODULE_4__.UA({\n sockets: [_this.socket],\n uri: \"sip:\" + number + \"@\" + wsurl,\n password: secret,\n stun_server: 'stun:stun.l.google.com:19302',\n register_expires: 60\n });\n if (typeof BX !== 'undefined') {\n console.log('setting_my_call =============================-----------');\n window.localStorage.setItem(BX.bitrix_sessid() + '_mycall', _this.ua.configuration.instance_id);\n window.localStorage.setItem('mycall', _this.ua.configuration.instance_id);\n }\n _this.ua.on('connected', function (e) {\n console.log('%c sip_register [connected]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('disconnected', function (e) {\n _this.onSipStateChange.dynamicValue('pending');\n console.log('%c sip_register [disconnected]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('registered', function (e) {\n _this.onSipStateChange.dynamicValue('connected');\n console.log('%c sip_register [registered]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('unregistered', function (e) {\n console.log('%c sip_register [unregistered]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('registrationFailed', function (e) {\n console.log('%c sip_register [registrationFailed]: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('connecting', function (e) {\n console.log('%c connecting: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('registrationExpiring', function (e) {\n console.log('%c registrationExpiring: ', 'font-size: 22px; color: yellow;', e);\n _this.ua.register();\n });\n _this.ua.on('newMessage', function (e) {\n console.log('%c newMessage: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('sipEvent', function (e) {\n console.log('%c sipEvent: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('newOptions', function (e) {\n console.log('%c newOptions: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.ua.on('newRTCSession', function (data) {\n var _this$callSession;\n console.log('%c newRTCSession: ', 'font-size: 22px; color: yellow;', data);\n _this.callSession = data.session;\n if (_this.callSession && _this.callSession.connection) {\n _this.callSession.connection.onaddstream = function (e) {\n _this.strmTrack = e.stream.getAudioTracks();\n if (_this.strmTrack[0]) {\n _this.remoteAudio.srcObject = new MediaStream([_this.strmTrack[0]]);\n _this.remoteAudio.play();\n }\n };\n }\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: true,\n callType: 'incoming'\n }\n });\n _this.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connectingIncoming',\n from: _this == null || (_this$callSession = _this.callSession) == null || (_this$callSession = _this$callSession._remote_identity) == null || (_this$callSession = _this$callSession._uri) == null ? void 0 : _this$callSession.user\n });\n if (_this.callSession.direction === 'incoming') {\n var _this$globalHistoryDa, _this$globalHistoryDa2;\n var second;\n console.log('auto_answer is work: ', (_this$globalHistoryDa = _this.globalHistoryData) == null ? void 0 : _this$globalHistoryDa.autoAnswer);\n if ((_this$globalHistoryDa2 = _this.globalHistoryData) != null && _this$globalHistoryDa2.autoAnswer) {\n var _this$globalHistoryDa3;\n switch ((_this$globalHistoryDa3 = _this.globalHistoryData) == null ? void 0 : _this$globalHistoryDa3.autoAnswerSecond) {\n case 1:\n second = 1000;\n break;\n case
40:\n second = 3000;\n break;\n case 100:\n second = 6
000;\n break;\n default:\n second = 0;\n }\n console.log('auto_answer second: ', second);\n setTimeout(function () {\n console.log('auto_answer run boxDialer.answerButtonClick()');\n _this.answerButtonClick();\n }, second);\n }\n _this.showNotification(function () {\n _this.answerButtonClick();\n });\n _this.onSoundType({\n type: 'ring',\n bool: true\n });\n _this.setGuiPhoneState({\n funcName: 'modalState',\n stateCode: 'connectingIncoming',\n funcParam: {\n bool: true,\n callType: 'incoming'\n }\n });\n\n // window.innerCallBegin();\n\n _this.callSession.on('progress', function (e) {\n console.log('%c progress: ', 'font-size: 22px; color: yellow;', e);\n _this.setGuiPhoneState({\n stateCode: 'incoming'\n });\n });\n // incoming call here\n _this.callSession.on('accepted', function () {\n console.log('%c newRTCSession accepted: ', 'font-size: 22px; color: yellow;', e);\n // the call has answered\n _this.onSoundType({\n type: 'ring',\n bool: false\n });\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: true,\n callType: 'connected'\n }\n });\n _this.onSipStateChange.innerCallerModal({\n bool: false,\n type: '',\n from: ''\n });\n });\n _this.callSession.on('confirmed', function () {\n var _this$callSession2;\n console.log('%c newRTCSession confirmed: ', 'font-size: 22px; color: yellow;');\n // this handler will be called for incoming calls too\n console.log('%c incoming confirmed', 'font-size: 22px; color: yellow;');\n _this.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connected',\n from: _this == null || (_this$callSession2 = _this.callSession) == null || (_this$callSession2 = _this$callSession2._remote_identity) == null || (_this$callSession2 = _this$callSession2._uri) == null ? void 0 : _this$callSession2.user\n });\n _this.startInnerTimer();\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: true,\n callType: 'connected'\n }\n });\n });\n _this.callSession.on('ended', function () {\n console.log('%c newRTCSession ended: ', 'font-size: 22px; color: yellow;');\n // the call has ended\n console.log('%c incoming end', 'font-size: 22px; color: yellow;');\n _this.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n _this.stopInnerTimer();\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n _this.closeBxCall();\n _this.hangupButtonClick();\n _this.removeViExternalCard();\n });\n _this.callSession.on('failed', function () {\n // unable to establish the call\n console.log('%c incoming faile ', 'font-size: 22px; color: yellow;');\n _this.onSipStateChange.innerCallerModal({\n bool: false,\n type: null\n });\n _this.stopInnerTimer();\n _this.onSoundType({\n type: 'ring',\n bool: false\n });\n _this.closeBxCall();\n _this.hangupButtonClick();\n _this.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n });\n _this.callSession.on('connecting', function (e) {\n console.log('%c connecting: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('sending', function (e) {\n console.log('%c sending: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('newDTMF', function (e) {\n console.log('%c newDTMF: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('newInfo', function (e) {\n console.log('%c newInfo: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('hold', function (e) {\n console.log('%c ___________hold: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('unhold', function (e) {\n console.log('%c ___________unhold: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('muted', function (e) {\n console.log('%c muted: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('unmuted', function (e) {\n console.log('%c unmuted: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('reinvite', function (e) {\n console.log('%c reinvite: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('update', function (e) {\n console.log('%c update: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('refer', function (e) {\n console.log('%c refer: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('replaces', function (e) {\n console.log('%c replaces: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('sdp', function (e) {\n console.log('%c sdp: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('icecandidate', function (e) {\n console.log('%c icecandidate: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('getusermediafailed', function (e) {\n console.log('%c getusermediafailed: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('peerconnection: createofferfailed', function (e) {\n console.log('%c peerconnection: createofferfailed: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('peerconnection: setlocaldescriptionfailed', function (e) {\n console.log('%c peerconnection: setlocaldescriptionfailed: ', 'font-size: 22px; color: yellow;', e);\n });\n _this.callSession.on('peerconnection: setremotedescriptionfailed', function (e) {\n console.log('%c peerconnection: setremotedescriptionfailed: ', 'font-size: 22px; color: yellow;', e);\n });\n }\n });\n _this.ua.start();\n }\n } catch (err) {\n console.log(\"jsSip_error: \", err);\n }\n };\n this.played = false;\n document.body.addEventListener('click', function () {\n _this.played = true;\n });\n this.isRestarting = false;\n this.videoRemote = document.createElement('video');\n this.videoLocal = document.createElement('video');\n this.remoteAudio = document.createElement('audio');\n this.remoteAudio.autoplay = true;\n document.body.appendChild(this.videoRemote);\n document.body.appendChild(this.videoLocal);\n document.body.appendChild(this.remoteAudio);\n this.ringtone = new Audio(_sounds_ringtone_wav__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n this.waitRingTone = new Audio(_sounds_ringbacktone_wav__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n this.pickSound = new Audio(_sounds_dtmf_wav__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n this.ringtone.loop = true;\n this.waitRingTone.loop = true;\n this.callEvetsBoxDialer = {\n callHold: false,\n callMute: null\n };\n this.options = {\n eventHandlers: this.uaEvents(),\n mediaConstraints: {\n audio: true,\n video: false\n }\n };\n }\n var _proto = BoxDialer.prototype;\n _proto.setGlobalHistoryData = function setGlobalHistoryData(data) {\n console.log('setGlobalHistoryData: ', data);\n this.globalHistoryData = data;\n };\n _proto.dialTone = function dialTone(freq1, freq2) {\n // merger = context.createChannelMerger(2);\n // setTimeout(() => {\n // \tconsole.log('-= sTOPING BY TIMEOUT');\n // \tthis.stop();\n // }, 1000);\n // if (this.oscillator1 || this.oscillator2) return;\n // console.log('Begin dialTone:', this.oscillator1, this.oscillator2);\n // this.oscillator1 = this.musicContext.createOscillator();\n // // this.oscillator1.type = null;\n // this.oscillator1.frequency.value = freq1;\n // this.gainNode = this.musicContext.createGain\n // \t? this.musicContext.createGain()\n // \t: this.musicContext.createGainNode();\n // this.oscillator1.connect(this.gainNode, 0, 0);\n // this.gainNode.connect(this.musicContext.destination);\n // this.gainNode.gain.value = 0.1;\n // this.oscillator1.start\n // \t? this.oscillator1.start(0)\n // \t: this.oscillator1.noteOn(0);\n // // this.gainNode.connect(merger,0,1);\n // this.oscillator2 = this.musicContext.createOscillator();\n // // this.oscillator2.type = null;\n // this.oscillator2.frequency.value = freq2;\n // this.gainNode = this.musicContext.createGain\n // \t? this.musicContext.createGain()\n // \t: this.musicContext.createGainNode();\n // this.oscillator2.connect(this.gainNode);\n // this.gainNode.connect(this.musicContext.destination);\n // // this.gainNode.connect(merger,0,0);\n // this.gainNode.gain.value = 0.1;\n // this.oscillator2.start\n // \t? this.oscillator2.start(0)\n // \t: this.oscillator2.noteOn(0);\n };\n _proto.start = function start() {\n // if (typeof this.oscillator1 != 'undefined') this.oscillator1.disconnect();\n // if (typeof this.oscillator2 != 'undefined') this.oscillator2.disconnect();\n // oscOn(\n // \tparseFloat(document.getElementById('freq').value),\n // \tparseFloat(document.getElementById('freq2').value),\n // );\n };\n _proto.stop = function stop() {\n // console.log('STOP', this.oscillator1, this.oscillator2);\n // console.log('FUNC', this.oscillator1?.disconnect, this.oscillator1?.stop);\n // this.oscillator1?.disconnect();\n // this.oscillator2?.disconnect();\n // this.oscillator1?.stop();\n // this.oscillator2?.stop();\n // this.oscillator1 = null;\n // this.oscillator2 = null;\n };\n _proto.uaEvents = function uaEvents() {\n var _this2 = this;\n return {\n progress: function progress(e) {\n var _this2$callSession;\n console.log('%c progress', 'font-size: 22px; color: green;', e);\n // this.hangupButtonClick();\n // this.closeBxCall();\n\n // window.innerCallBegin(true);\n _this2.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connectingOutgoing',\n from: _this2 == null || (_this2$callSession = _this2.callSession) == null || (_this2$callSession = _this2$callSession._remote_identity) == null || (_this2$callSession = _this2$callSession._uri) == null ? void 0 : _this2$callSession.user\n });\n _this2.setGuiPhoneState({\n funcName: 'modalState',\n stateCode: 'connectingOutgoing',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n },\n failed: function failed(e) {\n console.log('%c failed', 'font-size: 22px; color: green;', e);\n if (e != null && e.cause) {\n react_hot_toast__WEBPACK_IMPORTED_MODULE_0__.toast.error(e == null ? void 0 : e.cause);\n }\n // console.log('call failed with cause: ' + e.data);\n _this2.closeBxCall();\n _this2.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n _this2.stopInnerTimer();\n if (e.cause == 'User Denied Media Access') {\n console.log('User_Danied_Media_Access');\n react_hot_toast__WEBPACK_IMPORTED_MODULE_0__.toast.error('Your micrafon is OFF', {\n style: {\n zIndex: '99999999999999999'\n }\n });\n window.navigator.mediaDevices.getUserMedia({\n audio: true\n }).then(function (stream) {\n console.log('User_Danied_Media_Access', 'You let me use your mic!');\n })[\"catch\"](function (err) {\n console.log('User_Danied_Media_Access', 'No mic for you!');\n });\n }\n },\n ended: function ended(e) {\n console.log('%c ended', 'font-size: 22px; color: green;');\n _this2.closeBxCall();\n _this2.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n _this2.stopInnerTimer();\n _this2.setGuiPhoneState({\n funcName: 'modalState',\n funcParam: {\n bool: false,\n callType: ''\n }\n });\n _this2.removeViExternalCard();\n },\n confirmed: function confirmed(e) {\n var _this2$callSession2;\n console.log('%c confirmed', 'font-size: 22px; color: green;', e);\n // console.log(`%c BXLOG:`, datas, 'background-color: red;');\n _this2.onSipStateChange.innerCallerModal({\n bool: true,\n type: 'connected',\n from: _this2 == null || (_this2$callSession2 = _this2.callSession) == null || (_this2$callSession2 = _this2$callSession2._remote_identity) == null || (_this2$callSession2 = _this2$callSession2._uri) == null ? void 0 : _this2$callSession2.user\n });\n _this2.startInnerTimer();\n _this2.setGuiPhoneState({\n funcName: 'modalState',\n stateCode: 'connected',\n funcParam: {\n bool: true,\n callType: 'connected',\n callFromName: 'Test'\n }\n });\n }\n };\n };\n _proto.isUaRunning = function isUaRunning() {\n return Boolean(typeof window.BX !== 'undefined') && Boolean(window.localStorage.getItem(BX.bitrix_sessid() + '_mycall')) && Boolean(window.localStorage.getItem('mycall'));\n };\n _proto.removeViExternalCard = function removeViExternalCard() {\n // if (\n // \ttypeof BX !== 'undefined' &&\n // \twindow.localStorage.getItem(BX.bitrix_sessid() + '_mycall') &&\n // \twindow.localStorage.getItem('mycall')\n // ) {\n // \tBX?.localStorage?.remove('viExternalCard');\n // } else if (typeof BX !== 'undefined') {\n // \tBX?.localStorage?.remove('viExternalCard');\n // }\n };\n _proto.startTimer = function startTimer() {\n var _this3 = this;\n this.testTimer = setInterval(function () {\n _this3.timer.time = _this3.timer.time + 1;\n _this3.onSipStateChange.setDndTimer(_this3.timer.time);\n }, 1000);\n };\n _proto.stopTimer = function stopTimer() {\n clearInterval(this.testTimer);\n this.timer.time = 0;\n this.onSipStateChange.setDndTimer(this.timer.time);\n };\n _proto.startInnerTimer = function startInnerTimer() {\n var _this4 = this;\n this.testInnerTimer = setInterval(function () {\n _this4.innerTimer.time = _this4.innerTimer.time + 1;\n _this4.onSipStateChange.innerTimer(_this4.innerTimer.time);\n }, 1000);\n };\n _proto.stopInnerTimer = function stopInnerTimer() {\n clearInterval(this.testInnerTimer);\n this.innerTimer.time = 0;\n this.onSipStateChange.innerTimer(this.innerTimer.time);\n };\n _proto.showNotification = function showNotification(cbk) {\n var callerId = this.callSession._remote_identity._uri.user;\n var greeting = new Notification(\"\\u0417\\u0432\\u043E\\u043D\\u043E\\u043A \\u043E\\u0442 \" + callerId, {\n body: 'Answer Call',\n icon: _img_tug_png__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n });\n greeting.addEventListener('click', cbk);\n };\n _proto.onSoundType = function onSoundType(_ref2) {\n var type = _ref2.type,\n bool = _ref2.bool;\n this.ringtone.remove();\n this.waitRingTone.remove();\n this.pickSound.remove();\n if (this.played) {\n switch (type) {\n case 'ring':\n if (bool) {\n this.ringtone.pause();\n this.ringtone.remove();\n this.ringtone.play();\n } else {\n this.ringtone.pause();\n this.ringtone.remove();\n }\n break;\n case 'wait':\n if (bool) {\n this.waitRingTone.pause();\n this.waitRingTone.remove();\n console.log(this.waitRingTone, 'sound waitRingTone');\n this.waitRingTone.play();\n } else {\n this.waitRingTone.pause();\n this.waitRingTone.remove();\n }\n break;\n case 'pick':\n if (bool) {\n this.pickSound.remove();\n this.pickSound.pause();\n this.pickSound.play();\n } else {\n this.pickSound.pause();\n this.pickSound.remove();\n }\n break;\n default:\n console.error('onSoundType: Such a sound does not exist');\n break;\n }\n }\n };\n _proto.getBxUiState = function getBxUiState(sipState) {\n // if (sipState && !!sipState.length) sipState = this.sipState;\n var uiStates = {\n incoming: '1',\n transferIncoming: '2',\n outgoing: '3',\n connectingIncoming: '4',\n connectingOutgoing: '5',\n connected: '6',\n transferring: '7',\n transferFailed: '8',\n transferConnected: '9',\n idle: '10',\n error: '11',\n moneyError: '12',\n sipPhoneError: '13',\n redial: '14',\n externalCard: '15'\n };\n console.log('getBxUiState_inset: ', sipState, uiStates[sipState]);\n this.sipBxState = uiStates[sipState];\n return sipState && uiStates[sipState] ? uiStates[sipState] : '';\n };\n _proto.callBxMethods = function callBxMethods(_ref3) {\n var bxMethodName = _ref3.bxMethodName,\n bxFuncParams = _ref3.bxFuncParams,\n callback = _ref3.callback;\n if (window.BX24 && window.BX24.placement) {\n var _window2;\n (_window2 = window) == null ? void 0 : _window2.BX24.placement.call(bxMethodName, bxFuncParams, callback);\n } else if (window.alovoicePhone && window.alovoicePhone.callMethods) {\n window.alovoicePhone.callMethods[bxMethodName](bxFuncParams, callback);\n }\n if (bxFuncParams.uiState == '5') {\n this.removeViExternalCard();\n }\n };\n _proto.closeBxCall = function closeBxCall() {\n if (window.BX24 && window.BX24.placement) {\n var _window3;\n (_window3 = window) == null ? void 0 : _window3.BX24.placement.call('CallCardClose', {}, function () {});\n } else if (window.alovoicePhone && window.alovoicePhone.callMethods && window.alovoicePhone.bodClose) {\n var _window4;\n (_window4 = window) == null || (_window4 = _window4.alovoicePhone) == null ? void 0 : _window4.bodClose();\n }\n };\n _proto.setGuiPhoneState = function setGuiPhoneState(_ref4) {\n var _window5, _window6;\n var stateCode = _ref4.stateCode,\n funcName = _ref4.funcName,\n funcParam = _ref4.funcParam;\n if ((_window5 = window) != null && _window5.alovoice_wsphone && !!(stateCode != null && stateCode.length)) {\n console.log('this_getBxUiState_stateCode', stateCode, this.getBxUiState(stateCode));\n this.callBxMethods({\n bxMethodName: 'CallCardSetUiState',\n bxFuncParams: {\n uiState: this.getBxUiState(stateCode)\n },\n callback: function callback(e) {\n console.log(e, \"CallCardSetUiState method done \" + e);\n }\n });\n } else if (!((_window6 = window) != null && _window6.alovoice_wsphone) && !(stateCode != null && stateCode.length) && !!funcName && this.onSipStateChange[funcName] !== 'undefined') {\n this.onSipStateChange[funcName](funcParam);\n }\n };\n _proto.bxLog = function bxLog() {\n for (var _len = arguments.length, datas = new Array(_len), _key = 0; _key < _len; _key++) {\n datas[_key] = arguments[_key];\n }\n console.log(\"%c BXLOG:\", datas, 'background-color: red;');\n };\n _proto.onSessionEvent = function onSessionEvent(_ref5) {\n var type = _ref5.type,\n event = _ref5.event;\n };\n _proto.selectUser = function selectUser() {\n var _this5 = this;\n BX.Runtime.loadExtension('ui.entity-selector').then(function (exports) {\n var Dialog = exports.Dialog,\n TagSelector = exports.TagSelector;\n var dialog = new BX.UI.EntitySelector.Dialog({\n // targetNode: button,\n enableSearch: true,\n multiple: false,\n context: 'MY_MODULE_CONTEXT',\n entities: [{\n id: 'user',\n // пользователи\n options: {\n selectFields: ['ufPhoneInner']\n }\n }, {\n id: 'department' // структура компании: выбор только пользователей\n }],\n\n events: {\n '_Item:onSelect': function _ItemOnSelect(event) {\n var _event$getData = event.getData(),\n item = _event$getData.item;\n var dialog = event.getTarget();\n var selectedItems = dialog.getSelectedItems();\n if (item.customData.get('ufPhoneInner')) {\n _this5.transferButtonClick(item.customData.get('ufPhoneInner'));\n }\n },\n get 'Item:onSelect'() {\n return this['_Item:onSelect'];\n },\n set 'Item:onSelect'(value) {\n this['_Item:onSelect'] = value;\n }\n }\n });\n dialog.show();\n });\n }\n\n // call_connected;\n ;\n _proto.setSipStateChangeCallback = function setSipStateChangeCallback(callback, funcName) {\n this.onSipStateChange[funcName] = callback.bind(this);\n };\n _proto.sipHangUp = function sipHangUp() {\n console.log('sipHangUp');\n };\n _proto.sipUnRegister = function sipUnRegister() {\n console.log('sipUnRegister');\n };\n _proto.sipTransfer = function sipTransfer() {\n console.log('sipTransfer');\n };\n _proto.initialized = function initialized(phoneNumber) {\n this.sipBxState = null;\n this.callDirection = 'out';\n var phoneNumberString = phoneNumber.toString();\n if (phoneNumberString.length) {\n this.onSipStateChange.phoneModal(false);\n this.options.extraHeaders = [\"X-ALOVOICE-EXTNUM: \" + this.extnum];\n this.callSession = this.ua.call('sip:' + phoneNumberString + '@' + this.sipDomain, this.options);\n // this.callSession.connection.addEventListener('addstream', (event) => {\n // \tconsole.log('--== ss OUT STREAM: ');\n // \tthis.remoteAudio.srcObject = event.stream;\n // \tthis.remoteAudio.play();\n // });\n } else {\n react_hot_toast__WEBPACK_IMPORTED_MODULE_0__.toast.error('Do not correct number', {\n style: {\n zIndex: '99999999999999999'\n }\n });\n }\n // this.onSipStateChange.phoneModal(false);\n };\n _proto.skipButtonClick = function skipButtonClick() {\n this.onSoundType({\n type: 'ring',\n bool: false\n });\n this.hangupButtonClick();\n };\n _proto.answerButtonClick = function answerButtonClick() {\n var _this$callSession3,\n _this6 = this;\n this.onSoundType({\n type: 'ring',\n bool: false\n });\n (_this$callSession3 = this.callSession) == null ? void 0 : _this$callSession3.answer(this.options);\n this.callSession.connection.addEventListener('addstream', function (event) {\n _this6.remoteAudio.srcObject = event.stream;\n _this6.remoteAudio.play();\n });\n };\n _proto.sipSendDTMF = function sipSendDTMF(code) {\n this.callSession.sendDTMF(code);\n };\n _proto.addCommentButtonClick = function addCommentButtonClick() {\n console.log('addCommentButtonClick');\n };\n _proto.muteButtonClick = function muteButtonClick() {\n var _this$callSession$isM = this.callSession.isMuted(),\n audio = _this$callSession$isM.audio;\n if (audio) {\n this.callSession.unmute();\n console.log('muteButtonClick_unmute');\n this.onSipStateChange['setCallEvents']({\n callMute: false\n });\n } else {\n this.callSession.mute();\n console.log('muteButtonClick_mute');\n this.onSipStateChange['setCallEvents']({\n callMute: true\n });\n }\n };\n _proto.holdButtonClick = function holdButtonClick() {\n var _this$callSession$isO = this.callSession.isOnHold(),\n local = _this$callSession$isO.local;\n console.log('local: ', local);\n if (local) {\n this.callSession.unhold();\n this.onSipStateChange['setCallEvents']({\n callHold: false\n });\n } else {\n this.callSession.hold();\n this.onSipStateChange['setCallEvents']({\n callHold: true\n });\n }\n };\n _proto.closeButtonClick = function closeButtonClick() {\n this.hangupButtonClick();\n };\n _proto.hangupButtonClick = function hangupButtonClick() {\n this.onSoundType({\n type: 'ring',\n bool: false\n });\n this.onSipStateChange.innerCallerModal({\n bool: false,\n type: null,\n from: ''\n });\n console.log('hangupButtonClick========-----------', this.callSession._status);\n if (this.callSession && this.callSession._status != '8') this.callSession.terminate();\n };\n _proto.transferButtonClick = function transferButtonClick(number) {\n this.callSession.refer(number, this.options);\n };\n _proto.cancelTransferButtonClick = function cancelTransferButtonClick() {\n console.log('cancelTransferButtonClick');\n };\n _proto.completeTransferButtonClick = function completeTransferButtonClick() {\n console.log('completeTransferButtonClick');\n };\n _proto.nextButtonClick = function nextButtonClick() {\n console.log('nextButtonClick');\n };\n _proto.entityChanged = function entityChanged() {\n console.log('entityChanged');\n };\n _proto.qualityMeterClick = function qualityMeterClick() {\n console.log('qualityMeterClick');\n };\n _proto.dialpadButtonClick = function dialpadButtonClick(c) {\n console.log('dialpadButtonClick');\n this.sipSendDTMF(c);\n };\n _proto.notifyAdminButtonClick = function notifyAdminButtonClick() {\n console.log('notifyAdminButtonClick');\n };\n _proto.stateLog = function stateLog(state) {\n var stColor = state && state.slice(0, 4) == 'call' ? 'blue' : 'green';\n if (state && state.slice(0, 8) == 'register') {\n stColor = 'yellow';\n }\n var css = 'color:' + stColor + '; font-size: 20px;';\n console.log(' ---onSessionEvent EVENT: %c %s', css, state);\n };\n return BoxDialer;\n}();\n\n//# sourceURL=webpack://boxdialer/./src/lib/boxDIaler.js?");
/***/ }),
...
...
@@ -3503,7 +3503,7 @@ eval("module.exports = JSON.parse('{\"name\":\"jssip\",\"title\":\"JsSIP\",\"des
/***/ ((module) => {
"use strict";
eval("module.exports = JSON.parse('{\"name\":\"boxdialer\",\"version\":\"4.8.6
5
\",\"description\":\"\",\"main\":\"src/boxDialer.js\",\"scripts\":{\"dev\":\"webpack serve --mode=development\",\"build:dev\":\"webpack --env=development --watch \",\"build:prod\":\"webpack --env=production\"},\"keywords\":[],\"author\":\"\",\"license\":\"ISC\",\"dependencies\":{\"@emotion/react\":\"^11.11.1\",\"@emotion/styled\":\"^11.11.0\",\"@eo-locale/react\":\"^1.7.3\",\"@headlessui/react\":\"^1.7.17\",\"@heroicons/react\":\"^2.0.18\",\"@mui/icons-material\":\"^5.14.3\",\"@mui/material\":\"^5.14.5\",\"date-fns\":\"^2.30.0\",\"i\":\"^0.3.7\",\"jssip\":\"^3.10.0\",\"npm\":\"^10.1.0\",\"react\":\"^18.2.0\",\"react-dom\":\"^18.2.0\",\"react-hot-toast\":\"^2.4.1\",\"styled-components\":\"^5.3.5\",\"zustand\":\"^4.4.6\"},\"devDependencies\":{\"@babel/core\":\"^7.22.10\",\"@babel/preset-env\":\"^7.22.10\",\"@babel/preset-react\":\"^7.22.5\",\"autoprefixer\":\"^9.8.8\",\"babel-loader\":\"^9.1.3\",\"css-loader\":\"^6.8.1\",\"file-loader\":\"^6.2.0\",\"html-webpack-plugin\":\"^5.5.3\",\"postcss\":\"^7.0.39\",\"postcss-loader\":\"^7.3.3\",\"style-loader\":\"^3.3.3\",\"webpack\":\"^5.88.2\",\"webpack-cli\":\"^5.1.4\",\"webpack-dev-server\":\"^4.15.1\"}}');\n\n//# sourceURL=webpack://boxdialer/./package.json?");
eval("module.exports = JSON.parse('{\"name\":\"boxdialer\",\"version\":\"4.8.6
4
\",\"description\":\"\",\"main\":\"src/boxDialer.js\",\"scripts\":{\"dev\":\"webpack serve --mode=development\",\"build:dev\":\"webpack --env=development --watch \",\"build:prod\":\"webpack --env=production\"},\"keywords\":[],\"author\":\"\",\"license\":\"ISC\",\"dependencies\":{\"@emotion/react\":\"^11.11.1\",\"@emotion/styled\":\"^11.11.0\",\"@eo-locale/react\":\"^1.7.3\",\"@headlessui/react\":\"^1.7.17\",\"@heroicons/react\":\"^2.0.18\",\"@mui/icons-material\":\"^5.14.3\",\"@mui/material\":\"^5.14.5\",\"date-fns\":\"^2.30.0\",\"i\":\"^0.3.7\",\"jssip\":\"^3.10.0\",\"npm\":\"^10.1.0\",\"react\":\"^18.2.0\",\"react-dom\":\"^18.2.0\",\"react-hot-toast\":\"^2.4.1\",\"styled-components\":\"^5.3.5\",\"zustand\":\"^4.4.6\"},\"devDependencies\":{\"@babel/core\":\"^7.22.10\",\"@babel/preset-env\":\"^7.22.10\",\"@babel/preset-react\":\"^7.22.5\",\"autoprefixer\":\"^9.8.8\",\"babel-loader\":\"^9.1.3\",\"css-loader\":\"^6.8.1\",\"file-loader\":\"^6.2.0\",\"html-webpack-plugin\":\"^5.5.3\",\"postcss\":\"^7.0.39\",\"postcss-loader\":\"^7.3.3\",\"style-loader\":\"^3.3.3\",\"webpack\":\"^5.88.2\",\"webpack-cli\":\"^5.1.4\",\"webpack-dev-server\":\"^4.15.1\"}}');\n\n//# sourceURL=webpack://boxdialer/./package.json?");
/***/ })
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment