@telegenta/webclient 2.0.11 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/babel.config.js +0 -0
- package/browser/telegenta.min.js +1 -1
- package/demos/add_phone_number.html +0 -0
- package/demos/calldata_available.html +0 -0
- package/demos/embedded_config.html +94 -94
- package/demos/event_client.html +225 -225
- package/demos/phone_client.html +557 -557
- package/demos/styles.css +0 -0
- package/demos/telegenta.min.js +1 -0
- package/docs/EventClient.html +1 -1
- package/docs/Phone.html +1 -1
- package/docs/Session.html +1 -1
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +0 -0
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/global.html +1 -1
- package/docs/index.html +1 -1
- package/docs/scripts/linenumber.js +0 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
- package/docs/scripts/prettify/lang-css.js +0 -0
- package/docs/scripts/prettify/prettify.js +0 -0
- package/docs/styles/jsdoc-default.css +0 -0
- package/docs/styles/prettify-jsdoc.css +0 -0
- package/docs/styles/prettify-tomorrow.css +0 -0
- package/embedded_client/embedded_phone.js +0 -0
- package/embedded_client/index.html +0 -0
- package/embedded_client/server.php +0 -0
- package/embedded_client/styles.css +0 -0
- package/embedded_client/tiny_rest_client.php +0 -0
- package/embedded_client/webphone_sprites.png +0 -0
- package/es5/event-client.js +175 -220
- package/es5/index.js +0 -0
- package/es5/phone-client.js +774 -1177
- package/package.json +1 -1
- package/src/event-client.js +1 -1
- package/src/index.js +0 -0
- package/src/phone-client.js +1 -1
- package/webpack.config.js +0 -0
package/package.json
CHANGED
package/src/event-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _0x26cf=['disconnect','_socket','NoActiveSession','close','readyState','subscribe','InvalidParameter','You\x20must\x20specify\x20both\x20event\x20spec\x20and\x20callback\x20function','event_name','sendRequest','then','Subscription\x20to\x20\x27','\x27\x20was\x20successful,\x20ID\x20=\x20','push','log','\x27\x20failed:\x20','You\x20must\x20specify\x20subscription\x20id','isConnected','info','Unsubscribe\x20id:\x20','unsubscribe','Unsubscribe\x20to\x20\x27','\x27\x20was\x20successful','warning','Remote\x20unsubscribe\x20to\x20\x27','fireEvent','Event\x20','\x20was\x20successful','\x20failed:\x20','_removeSubscription','Removed\x20local\x20subscription:\x20','_connectServer','Connecting\x20to\x20event\x20server:\x20','_serverAddress','Unable\x20to\x20connect,\x20already\x20connecting','Unable\x20to\x20connect,\x20already\x20connected','Unable\x20to\x20connect,\x20socket\x20is\x20still\x20closing','open','_reconnectRetrySeconds','addEventListener','message','receiveMessage','data','ping','_reconnectServer','catch','Disconnected\x20from\x20event\x20service','error','floor','Reconnecting\x20in\x20','\x20secs','Auto\x20reconnect\x20disabled\x20(disconnecting?)','_handleIncomingEvent','Received\x20event\x20for\x20subcription\x20id\x20','\x20payload:\x20','stringify','payload','Callback\x20had\x20unhandled\x20exception\x20','resolve','reject','Invalid\x20subscription\x20id\x20for\x20event:\x20','wss://api.telegenta.com/es/','specification','callback','doCallback','apply','_previousSubscriptions','_activeSubscriptions','_pingTimerObj','_autoReconnect','LogHandler','LOGLVL','ERROR','_requestor','event','connect'];(function(_0x58d96e,_0x4efa09){var _0x19dafb=function(_0x5d72d9){while(--_0x5d72d9){_0x58d96e['push'](_0x58d96e['shift']());}};_0x19dafb(++_0x4efa09);}(_0x26cf,0x16d));var _0x5f41=function(_0x4a7d5a,_0x5d39ed){_0x4a7d5a=_0x4a7d5a-0x0;var _0x35c1fd=_0x26cf[_0x4a7d5a];return _0x35c1fd;};'use strict';import{Exceptions,Logger,Requestor}from'@telegenta/common';const PING_INTERVAL=0x32;const ES_DEFAULT_SERVER_URL=_0x5f41('0x0');const RETRY_INTERVAL_START=0x1+Math['random']();const RETRY_MAX_BACKOFF=0x12c;class EventSubscription{constructor(_0x39629b,_0x2ba0f1,_0xe05c14){this['id']=_0x39629b;this[_0x5f41('0x1')]=_0x2ba0f1;this[_0x5f41('0x2')]=_0xe05c14;}[_0x5f41('0x3')](_0x414fe3,_0x23f65a){return this[_0x5f41('0x2')][_0x5f41('0x4')](_0x414fe3,[_0x23f65a]);}}export class EventClient{constructor(_0x198b97=null){this['_socket']=null;this[_0x5f41('0x5')]=[];this[_0x5f41('0x6')]=[];this[_0x5f41('0x7')]=null;this[_0x5f41('0x8')]=![];this['_reconnectRetrySeconds']=RETRY_INTERVAL_START;this['log']=_0x198b97?_0x198b97:new Logger[(_0x5f41('0x9'))](Logger[_0x5f41('0xa')][_0x5f41('0xb')]);this['_requestor']=new Requestor(this['log']);this[_0x5f41('0xc')]['on'](_0x5f41('0xd'),_0x221354=>{this['_handleIncomingEvent'](_0x221354);});}[_0x5f41('0xe')](_0xc1772f=null){if(!_0xc1772f){_0xc1772f=ES_DEFAULT_SERVER_URL;}this['_serverAddress']=_0xc1772f;this[_0x5f41('0x5')]=[];this[_0x5f41('0x6')]=[];return this['_connectServer']();}[_0x5f41('0xf')](){if(this[_0x5f41('0x10')]['readyState']!==0x1){throw new Exceptions[(_0x5f41('0x11'))]();}this[_0x5f41('0x6')]=[];this[_0x5f41('0x8')]=![];this[_0x5f41('0x10')][_0x5f41('0x12')]();}['isConnected'](){if(this[_0x5f41('0x10')]){return this[_0x5f41('0x10')][_0x5f41('0x13')]===0x1;}else{return![];}}[_0x5f41('0x14')](_0x1c9058,_0x2e5135){if(!_0x1c9058||!_0x2e5135){throw new Exceptions[(_0x5f41('0x15'))](_0x5f41('0x16'));}if(!_0x1c9058['hasOwnProperty'](_0x5f41('0x17'))){throw new Exceptions[(_0x5f41('0x15'))]('Your\x20event\x20specification\x20must\x20contain\x20event\x20name');}if(!this['isConnected']()){throw new Exceptions[(_0x5f41('0x11'))]();}const _0x46915b=this;return new Promise(function(_0x3ac380,_0x4aab71){_0x46915b[_0x5f41('0xc')][_0x5f41('0x18')](_0x46915b[_0x5f41('0x10')],_0x5f41('0x14'),_0x1c9058)[_0x5f41('0x19')](function(_0x168a5c){_0x46915b['log']['debug'](_0x5f41('0x1a')+_0x1c9058['event_name']+_0x5f41('0x1b')+_0x168a5c);_0x46915b['_activeSubscriptions'][_0x5f41('0x1c')](new EventSubscription(_0x168a5c,_0x1c9058,_0x2e5135));_0x3ac380(_0x168a5c);},function(_0x55cef6){_0x46915b[_0x5f41('0x1d')]['warning'](_0x5f41('0x1a')+_0x1c9058[_0x5f41('0x17')]+_0x5f41('0x1e')+_0x55cef6);_0x4aab71(_0x55cef6);});});}['unsubscribe'](_0x4148dd){if(!_0x4148dd){throw new Exceptions[(_0x5f41('0x15'))](_0x5f41('0x1f'));}if(!this[_0x5f41('0x20')]()){throw new Exceptions[(_0x5f41('0x11'))]();}this[_0x5f41('0x1d')][_0x5f41('0x21')](_0x5f41('0x22')+_0x4148dd);const _0x8135e=this;return new Promise(function(_0x42bdcb,_0x159dbc){_0x8135e[_0x5f41('0xc')][_0x5f41('0x18')](_0x8135e[_0x5f41('0x10')],_0x5f41('0x23'),{'id':_0x4148dd})['then'](_0x2100fe=>{_0x8135e[_0x5f41('0x1d')][_0x5f41('0x21')](_0x5f41('0x24')+_0x4148dd+_0x5f41('0x25'));_0x8135e['_removeSubscription'](_0x4148dd);_0x42bdcb(_0x2100fe);},_0x3b5189=>{_0x8135e[_0x5f41('0x1d')][_0x5f41('0x26')](_0x5f41('0x27')+_0x4148dd+_0x5f41('0x1e')+_0x3b5189);_0x159dbc(_0x3b5189);});});}[_0x5f41('0x28')](_0x5e87c0,_0x322a2f){if(!this[_0x5f41('0x20')]()){throw new Exceptions['NoActiveSession']();}return new Promise((_0x518d32,_0x3f07bb)=>{this['_requestor'][_0x5f41('0x18')](this[_0x5f41('0x10')],_0x5e87c0,_0x322a2f)[_0x5f41('0x19')](_0x3facb5=>{this['log'][_0x5f41('0x21')](_0x5f41('0x29')+_0x5e87c0+_0x5f41('0x2a'));_0x518d32(_0x3facb5);},_0x5d633f=>{this[_0x5f41('0x1d')][_0x5f41('0x26')](_0x5f41('0x29')+_0x5e87c0+_0x5f41('0x2b')+_0x5d633f);_0x3f07bb(_0x5d633f);});});}[_0x5f41('0x2c')](_0x207ba2){for(let _0xf85798 in this[_0x5f41('0x6')]){if(this[_0x5f41('0x6')][_0xf85798]['id']===_0x207ba2){this[_0x5f41('0x1d')]['debug'](_0x5f41('0x2d')+_0x207ba2);this[_0x5f41('0x6')]['splice'](_0xf85798,0x1);return!![];}}this[_0x5f41('0x1d')]['warning']('Unable\x20to\x20remove\x20subscription\x20'+_0x207ba2+'\x20locally,\x20not\x20found?');return![];}[_0x5f41('0x2e')](){this[_0x5f41('0x1d')][_0x5f41('0x21')](_0x5f41('0x2f')+this[_0x5f41('0x30')]);const _0x274a25=this;return new Promise(function(_0xe351c8,_0x4696ae){if(_0x274a25[_0x5f41('0x10')]){switch(_0x274a25[_0x5f41('0x10')][_0x5f41('0x13')]){case 0x0:_0x4696ae(_0x5f41('0x31'));return;case 0x1:_0x4696ae(_0x5f41('0x32'));return;case 0x2:_0x4696ae(_0x5f41('0x33'));return;}}_0x274a25[_0x5f41('0x10')]=new WebSocket(_0x274a25['_serverAddress']);let _0x34582e=![];_0x274a25[_0x5f41('0x10')]['addEventListener'](_0x5f41('0x34'),function(){_0x274a25[_0x5f41('0x1d')][_0x5f41('0x21')]('Successfully\x20connected\x20to\x20event\x20service');_0x34582e=!![];_0x274a25['_autoReconnect']=!![];_0x274a25[_0x5f41('0x35')]=RETRY_INTERVAL_START;_0x274a25[_0x5f41('0x10')][_0x5f41('0x36')](_0x5f41('0x37'),function(_0x3cc0ce){_0x274a25[_0x5f41('0xc')][_0x5f41('0x38')](_0x274a25[_0x5f41('0x10')],_0x3cc0ce[_0x5f41('0x39')]);});clearTimeout(_0x274a25[_0x5f41('0x7')]);_0x274a25[_0x5f41('0x7')]=setInterval(function(){_0x274a25[_0x5f41('0xc')][_0x5f41('0x3a')](_0x274a25[_0x5f41('0x10')])[_0x5f41('0x19')](function(){},function(_0x4eeed4){_0x274a25[_0x5f41('0x1d')][_0x5f41('0x26')]('Ping\x20failed:\x20'+_0x4eeed4);_0x274a25[_0x5f41('0x3b')]();});},PING_INTERVAL*0x3e8);_0x274a25[_0x5f41('0x5')]=_0x274a25[_0x5f41('0x6')];_0x274a25[_0x5f41('0x6')]=[];for(let _0x4a07ca of _0x274a25[_0x5f41('0x5')]){_0x274a25[_0x5f41('0x14')](_0x4a07ca[_0x5f41('0x1')],_0x4a07ca[_0x5f41('0x2')])[_0x5f41('0x3c')](function(_0x2430a1){_0x274a25[_0x5f41('0x1d')]['error']('Resubscribing\x20to\x20'+_0x4a07ca['specification'][_0x5f41('0x17')]+'\x20failed:\x20'+_0x2430a1);});}_0xe351c8();});_0x274a25[_0x5f41('0x10')]['addEventListener'](_0x5f41('0x12'),function(){_0x274a25[_0x5f41('0x1d')][_0x5f41('0x21')](_0x5f41('0x3d'));clearTimeout(_0x274a25['_pingTimerObj']);_0x274a25[_0x5f41('0x3b')]();});_0x274a25['_socket'][_0x5f41('0x36')]('error',function(_0x5278a9){_0x274a25[_0x5f41('0x1d')][_0x5f41('0x3e')]('Websocket\x20connection\x20error');if(!_0x34582e){_0x4696ae('Unable\x20to\x20connect:\x20'+_0x5278a9);}});});}[_0x5f41('0x3b')](){if(this[_0x5f41('0x8')]){const _0x24937b=Math[_0x5f41('0x3f')](this[_0x5f41('0x35')]);this['log'][_0x5f41('0x21')](_0x5f41('0x40')+_0x24937b+_0x5f41('0x41'));const _0x4108e7=this;setTimeout(function(){_0x4108e7[_0x5f41('0x2e')]()[_0x5f41('0x19')](function(){_0x4108e7[_0x5f41('0x1d')]['info']('Reconnect\x20attempt\x20successful');},function(){_0x4108e7[_0x5f41('0x1d')][_0x5f41('0x26')]('Reconnect\x20attempt\x20failed');});if(_0x4108e7[_0x5f41('0x35')]<=RETRY_MAX_BACKOFF){_0x4108e7[_0x5f41('0x35')]=_0x4108e7['_reconnectRetrySeconds']*0x2;}},_0x4108e7['_reconnectRetrySeconds']*0x3e8);}else{this[_0x5f41('0x1d')][_0x5f41('0x21')](_0x5f41('0x42'));}}[_0x5f41('0x43')](_0x9c1810){const _0x5b7540=_0x9c1810['data']['subscription_id'];for(let _0x4addd8 of this[_0x5f41('0x6')]){if(_0x4addd8['id']===_0x5b7540){this[_0x5f41('0x1d')]['debug'](_0x5f41('0x44')+_0x4addd8['id']+_0x5f41('0x45')+JSON[_0x5f41('0x46')](_0x9c1810['data'][_0x5f41('0x47')]));try{_0x4addd8[_0x5f41('0x2')](_0x9c1810[_0x5f41('0x39')][_0x5f41('0x47')]);}catch(_0x1cc940){this[_0x5f41('0x1d')][_0x5f41('0x26')](_0x5f41('0x48')+_0x1cc940);_0x9c1810[_0x5f41('0x49')]();}_0x9c1810[_0x5f41('0x49')]();return;}}_0x9c1810[_0x5f41('0x4a')](_0x5f41('0x4b')+_0x5b7540);}}
|
|
1
|
+
'use strict';const a0_0x3a92ef=a0_0x488e;(function(_0x12d3b3,_0x32fdfc){const _0x5a3514=a0_0x488e,_0x3c9baf=_0x12d3b3();while(!![]){try{const _0x43507d=-parseInt(_0x5a3514(0x1b0))/0x1*(parseInt(_0x5a3514(0x179))/0x2)+parseInt(_0x5a3514(0x1c9))/0x3+-parseInt(_0x5a3514(0x1c7))/0x4*(-parseInt(_0x5a3514(0x1a4))/0x5)+-parseInt(_0x5a3514(0x199))/0x6+-parseInt(_0x5a3514(0x1c1))/0x7*(-parseInt(_0x5a3514(0x1c6))/0x8)+parseInt(_0x5a3514(0x195))/0x9+parseInt(_0x5a3514(0x1c8))/0xa*(parseInt(_0x5a3514(0x1a5))/0xb);if(_0x43507d===_0x32fdfc)break;else _0x3c9baf['push'](_0x3c9baf['shift']());}catch(_0x2f5b4c){_0x3c9baf['push'](_0x3c9baf['shift']());}}}(a0_0x4c0a,0xe39ca));import{Exceptions,Logger,Requestor}from'@telegenta/common';function a0_0x488e(_0x47c6e3,_0x5aa6aa){const _0x4c0a77=a0_0x4c0a();return a0_0x488e=function(_0x488e02,_0x3106bd){_0x488e02=_0x488e02-0x177;let _0x3b5d7b=_0x4c0a77[_0x488e02];return _0x3b5d7b;},a0_0x488e(_0x47c6e3,_0x5aa6aa);}const PING_INTERVAL=0x32,ES_DEFAULT_SERVER_URL=a0_0x3a92ef(0x196),RETRY_INTERVAL_START=0x1+Math[a0_0x3a92ef(0x188)](),RETRY_MAX_BACKOFF=0x12c;class EventSubscription{constructor(_0x4fba20,_0x7c38f5,_0x59affb){const _0xf29903=a0_0x3a92ef;this['id']=_0x4fba20,this[_0xf29903(0x19b)]=_0x7c38f5,this[_0xf29903(0x17c)]=_0x59affb;}[a0_0x3a92ef(0x186)](_0x53b5b2,_0x509ac7){const _0x44d374=a0_0x3a92ef;return this[_0x44d374(0x17c)][_0x44d374(0x1b3)](_0x53b5b2,[_0x509ac7]);}}function a0_0x4c0a(){const _0x485ce7=['resolve','Remote\x20unsubscribe\x20to\x20\x27','Invalid\x20subscription\x20id\x20for\x20event:\x20','ping','close','_connectServer','warning','Unsubscribe\x20id:\x20','info','error','1lZHOWt','\x27\x20was\x20successful,\x20ID\x20=\x20','\x27\x20failed:\x20','apply','\x20payload:\x20','_serverAddress','Received\x20event\x20for\x20subcription\x20id\x20','Connecting\x20to\x20event\x20server:\x20','\x20failed:\x20','Your\x20event\x20specification\x20must\x20contain\x20event\x20name','_reconnectRetrySeconds','floor','_removeSubscription','_previousSubscriptions','Auto\x20reconnect\x20disabled\x20(disconnecting?)','Unable\x20to\x20connect,\x20already\x20connected','ERROR','56OrigyO','_pingTimerObj','_reconnectServer','connect','unsubscribe','662456BZpuJo','6008DSHkUD','18990UxdhWi','464130plrEsI','data','subscribe','splice','Subscription\x20to\x20\x27','hasOwnProperty','log','Unsubscribe\x20to\x20\x27','1725680DTpKOJ','Unable\x20to\x20connect,\x20already\x20connecting','open','callback','catch','event_name','_activeSubscriptions','reject','readyState','Disconnected\x20from\x20event\x20service','Unable\x20to\x20remove\x20subscription\x20','sendRequest','_socket','doCallback','stringify','random','InvalidParameter','isConnected','Callback\x20had\x20unhandled\x20exception\x20','Successfully\x20connected\x20to\x20event\x20service','addEventListener','then','NoActiveSession','event','receiveMessage','Unable\x20to\x20connect,\x20socket\x20is\x20still\x20closing','Reconnecting\x20in\x20','Resubscribing\x20to\x20','5429817MaKzsW','wss://api.telegenta.com/es/','LogHandler','_autoReconnect','8159778JjsSOL','Reconnect\x20attempt\x20successful','specification','You\x20must\x20specify\x20subscription\x20id','Event\x20','_requestor','payload','debug','Websocket\x20connection\x20error','push','You\x20must\x20specify\x20both\x20event\x20spec\x20and\x20callback\x20function','1855QvgqTM','6820qcAMGe'];a0_0x4c0a=function(){return _0x485ce7;};return a0_0x4c0a();}export class EventClient{constructor(_0x1844da=null){const _0x1e3a95=a0_0x3a92ef;this[_0x1e3a95(0x185)]=null,this[_0x1e3a95(0x1bd)]=[],this[_0x1e3a95(0x17f)]=[],this[_0x1e3a95(0x1c2)]=null,this['_autoReconnect']=![],this[_0x1e3a95(0x1ba)]=RETRY_INTERVAL_START,this[_0x1e3a95(0x177)]=_0x1844da?_0x1844da:new Logger[(_0x1e3a95(0x197))](Logger['LOGLVL'][_0x1e3a95(0x1c0)]),this[_0x1e3a95(0x19e)]=new Requestor(this[_0x1e3a95(0x177)]),this[_0x1e3a95(0x19e)]['on'](_0x1e3a95(0x190),_0x1f294f=>{this['_handleIncomingEvent'](_0x1f294f);});}[a0_0x3a92ef(0x1c4)](_0x38cd76=null){const _0x427f96=a0_0x3a92ef;return!_0x38cd76&&(_0x38cd76=ES_DEFAULT_SERVER_URL),this['_serverAddress']=_0x38cd76,this[_0x427f96(0x1bd)]=[],this[_0x427f96(0x17f)]=[],this[_0x427f96(0x1ab)]();}['disconnect'](){const _0x2d8b68=a0_0x3a92ef;if(this[_0x2d8b68(0x185)]['readyState']!==0x1)throw new Exceptions[(_0x2d8b68(0x18f))]();this[_0x2d8b68(0x17f)]=[],this['_autoReconnect']=![],this[_0x2d8b68(0x185)][_0x2d8b68(0x1aa)]();}[a0_0x3a92ef(0x18a)](){const _0x5d06a4=a0_0x3a92ef;return this['_socket']?this[_0x5d06a4(0x185)]['readyState']===0x1:![];}[a0_0x3a92ef(0x1cb)](_0x359a76,_0x56d21a){const _0x56507c=a0_0x3a92ef;if(!_0x359a76||!_0x56d21a)throw new Exceptions['InvalidParameter'](_0x56507c(0x1a3));if(!_0x359a76[_0x56507c(0x1ce)](_0x56507c(0x17e)))throw new Exceptions['InvalidParameter'](_0x56507c(0x1b9));if(!this['isConnected']())throw new Exceptions['NoActiveSession']();const _0x5a31a9=this;return new Promise(function(_0x26a73e,_0x41e16b){const _0x59862d=_0x56507c;_0x5a31a9[_0x59862d(0x19e)][_0x59862d(0x184)](_0x5a31a9[_0x59862d(0x185)],_0x59862d(0x1cb),_0x359a76)['then'](function(_0x4e69fa){const _0x32a3c2=_0x59862d;_0x5a31a9[_0x32a3c2(0x177)][_0x32a3c2(0x1a0)](_0x32a3c2(0x1cd)+_0x359a76[_0x32a3c2(0x17e)]+_0x32a3c2(0x1b1)+_0x4e69fa),_0x5a31a9['_activeSubscriptions'][_0x32a3c2(0x1a2)](new EventSubscription(_0x4e69fa,_0x359a76,_0x56d21a)),_0x26a73e(_0x4e69fa);},function(_0x1db867){const _0x23a90a=_0x59862d;_0x5a31a9[_0x23a90a(0x177)][_0x23a90a(0x1ac)](_0x23a90a(0x1cd)+_0x359a76[_0x23a90a(0x17e)]+_0x23a90a(0x1b2)+_0x1db867),_0x41e16b(_0x1db867);});});}[a0_0x3a92ef(0x1c5)](_0x52d30a){const _0x10d0af=a0_0x3a92ef;if(!_0x52d30a)throw new Exceptions[(_0x10d0af(0x189))](_0x10d0af(0x19c));if(!this[_0x10d0af(0x18a)]())throw new Exceptions[(_0x10d0af(0x18f))]();this['log'][_0x10d0af(0x1ae)](_0x10d0af(0x1ad)+_0x52d30a);const _0x284315=this;return new Promise(function(_0x20375e,_0x3f48ba){const _0x2d1127=_0x10d0af;_0x284315[_0x2d1127(0x19e)][_0x2d1127(0x184)](_0x284315['_socket'],_0x2d1127(0x1c5),{'id':_0x52d30a})[_0x2d1127(0x18e)](_0x29a9c2=>{const _0x101a81=_0x2d1127;_0x284315[_0x101a81(0x177)][_0x101a81(0x1ae)](_0x101a81(0x178)+_0x52d30a+'\x27\x20was\x20successful'),_0x284315[_0x101a81(0x1bc)](_0x52d30a),_0x20375e(_0x29a9c2);},_0x5b72=>{const _0x289da8=_0x2d1127;_0x284315['log'][_0x289da8(0x1ac)](_0x289da8(0x1a7)+_0x52d30a+_0x289da8(0x1b2)+_0x5b72),_0x3f48ba(_0x5b72);});});}['fireEvent'](_0x4e07b2,_0x1425fb){const _0x2b8b60=a0_0x3a92ef;if(!this['isConnected']())throw new Exceptions[(_0x2b8b60(0x18f))]();return new Promise((_0x21b926,_0x43c4b8)=>{const _0x5c44de=_0x2b8b60;this[_0x5c44de(0x19e)][_0x5c44de(0x184)](this[_0x5c44de(0x185)],_0x4e07b2,_0x1425fb)[_0x5c44de(0x18e)](_0x3ddee3=>{const _0x195a11=_0x5c44de;this[_0x195a11(0x177)][_0x195a11(0x1ae)]('Event\x20'+_0x4e07b2+'\x20was\x20successful'),_0x21b926(_0x3ddee3);},_0x2de057=>{const _0x38e8bf=_0x5c44de;this[_0x38e8bf(0x177)][_0x38e8bf(0x1ac)](_0x38e8bf(0x19d)+_0x4e07b2+'\x20failed:\x20'+_0x2de057),_0x43c4b8(_0x2de057);});});}['_removeSubscription'](_0x3bdf69){const _0x17968d=a0_0x3a92ef;for(let _0x246fdb in this['_activeSubscriptions']){if(this[_0x17968d(0x17f)][_0x246fdb]['id']===_0x3bdf69)return this['log'][_0x17968d(0x1a0)]('Removed\x20local\x20subscription:\x20'+_0x3bdf69),this[_0x17968d(0x17f)][_0x17968d(0x1cc)](_0x246fdb,0x1),!![];}return this[_0x17968d(0x177)][_0x17968d(0x1ac)](_0x17968d(0x183)+_0x3bdf69+'\x20locally,\x20not\x20found?'),![];}[a0_0x3a92ef(0x1ab)](){const _0x1a1223=a0_0x3a92ef;this[_0x1a1223(0x177)]['info'](_0x1a1223(0x1b7)+this[_0x1a1223(0x1b5)]);const _0x4b4af8=this;return new Promise(function(_0x29fa7b,_0x1f1a7e){const _0x516214=_0x1a1223;if(_0x4b4af8[_0x516214(0x185)])switch(_0x4b4af8[_0x516214(0x185)][_0x516214(0x181)]){case 0x0:_0x1f1a7e(_0x516214(0x17a));return;case 0x1:_0x1f1a7e(_0x516214(0x1bf));return;case 0x2:_0x1f1a7e(_0x516214(0x192));return;}_0x4b4af8['_socket']=new WebSocket(_0x4b4af8['_serverAddress']);let _0x3897eb=![];_0x4b4af8[_0x516214(0x185)][_0x516214(0x18d)](_0x516214(0x17b),function(){const _0x5128b4=_0x516214;_0x4b4af8[_0x5128b4(0x177)][_0x5128b4(0x1ae)](_0x5128b4(0x18c)),_0x3897eb=!![],_0x4b4af8[_0x5128b4(0x198)]=!![],_0x4b4af8['_reconnectRetrySeconds']=RETRY_INTERVAL_START,_0x4b4af8[_0x5128b4(0x185)][_0x5128b4(0x18d)]('message',function(_0x36a2b7){const _0x1a692c=_0x5128b4;_0x4b4af8['_requestor'][_0x1a692c(0x191)](_0x4b4af8[_0x1a692c(0x185)],_0x36a2b7[_0x1a692c(0x1ca)]);}),clearTimeout(_0x4b4af8['_pingTimerObj']),_0x4b4af8[_0x5128b4(0x1c2)]=setInterval(function(){const _0x4c14e3=_0x5128b4;_0x4b4af8['_requestor'][_0x4c14e3(0x1a9)](_0x4b4af8[_0x4c14e3(0x185)])[_0x4c14e3(0x18e)](function(){},function(_0x49f44b){const _0x1f256f=_0x4c14e3;_0x4b4af8['log'][_0x1f256f(0x1ac)]('Ping\x20failed:\x20'+_0x49f44b),_0x4b4af8[_0x1f256f(0x1c3)]();});},PING_INTERVAL*0x3e8),_0x4b4af8['_previousSubscriptions']=_0x4b4af8['_activeSubscriptions'],_0x4b4af8[_0x5128b4(0x17f)]=[];for(let _0x4954be of _0x4b4af8[_0x5128b4(0x1bd)]){_0x4b4af8['subscribe'](_0x4954be[_0x5128b4(0x19b)],_0x4954be[_0x5128b4(0x17c)])[_0x5128b4(0x17d)](function(_0x2049f8){const _0x578b26=_0x5128b4;_0x4b4af8[_0x578b26(0x177)][_0x578b26(0x1af)](_0x578b26(0x194)+_0x4954be['specification'][_0x578b26(0x17e)]+_0x578b26(0x1b8)+_0x2049f8);});}_0x29fa7b();}),_0x4b4af8[_0x516214(0x185)][_0x516214(0x18d)](_0x516214(0x1aa),function(){const _0x1f4b3b=_0x516214;_0x4b4af8[_0x1f4b3b(0x177)][_0x1f4b3b(0x1ae)](_0x1f4b3b(0x182)),clearTimeout(_0x4b4af8['_pingTimerObj']),_0x4b4af8['_reconnectServer']();}),_0x4b4af8[_0x516214(0x185)]['addEventListener'](_0x516214(0x1af),function(_0x16fff2){const _0x15a513=_0x516214;_0x4b4af8[_0x15a513(0x177)][_0x15a513(0x1af)](_0x15a513(0x1a1)),!_0x3897eb&&_0x1f1a7e('Unable\x20to\x20connect:\x20'+_0x16fff2);});});}[a0_0x3a92ef(0x1c3)](){const _0x32265b=a0_0x3a92ef;if(this['_autoReconnect']){const _0x72029b=Math[_0x32265b(0x1bb)](this['_reconnectRetrySeconds']);this[_0x32265b(0x177)][_0x32265b(0x1ae)](_0x32265b(0x193)+_0x72029b+'\x20secs');const _0x2ddcc4=this;setTimeout(function(){const _0x3652f9=_0x32265b;_0x2ddcc4['_connectServer']()[_0x3652f9(0x18e)](function(){const _0x489ec1=_0x3652f9;_0x2ddcc4[_0x489ec1(0x177)]['info'](_0x489ec1(0x19a));},function(){const _0x3f13c0=_0x3652f9;_0x2ddcc4[_0x3f13c0(0x177)][_0x3f13c0(0x1ac)]('Reconnect\x20attempt\x20failed');}),_0x2ddcc4[_0x3652f9(0x1ba)]<=RETRY_MAX_BACKOFF&&(_0x2ddcc4['_reconnectRetrySeconds']=_0x2ddcc4[_0x3652f9(0x1ba)]*0x2);},_0x2ddcc4[_0x32265b(0x1ba)]*0x3e8);}else this['log'][_0x32265b(0x1ae)](_0x32265b(0x1be));}['_handleIncomingEvent'](_0x325c99){const _0x1255e8=a0_0x3a92ef,_0x58dab0=_0x325c99[_0x1255e8(0x1ca)]['subscription_id'];for(let _0x5b893c of this[_0x1255e8(0x17f)]){if(_0x5b893c['id']===_0x58dab0){this[_0x1255e8(0x177)][_0x1255e8(0x1a0)](_0x1255e8(0x1b6)+_0x5b893c['id']+_0x1255e8(0x1b4)+JSON[_0x1255e8(0x187)](_0x325c99[_0x1255e8(0x1ca)][_0x1255e8(0x19f)]));try{_0x5b893c['callback'](_0x325c99[_0x1255e8(0x1ca)]['payload']);}catch(_0x5d702d){this[_0x1255e8(0x177)][_0x1255e8(0x1ac)](_0x1255e8(0x18b)+_0x5d702d),_0x325c99[_0x1255e8(0x1a6)]();}_0x325c99[_0x1255e8(0x1a6)]();return;}}_0x325c99[_0x1255e8(0x180)](_0x1255e8(0x1a8)+_0x58dab0);}}
|
package/src/index.js
CHANGED
|
File without changes
|
package/src/phone-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _0x571f=['muteStateChange','holdStateChange','Exception\x20in\x20hold\x20state\x20change\x20event:\x20','whisperModeChange','Exception\x20in\x20whisper\x20mode\x20change\x20event:\x20','toISOString','callQualityReport','callEnded','Exception\x20in\x20callEnded\x20event:\x20','ontrack','Start\x20media\x20output\x20(track):','_mediaPermission','_mediaPermissionError','_UA','_connectionState','_isStarted','_eventClient','_options','_sessionCounter','_activeSessions','_remoteAudioElement','autoplay','_toneAudioElement','AUDIO','_toneTimer','_repeatToneActive','_repeatToneSequence','_toneGainProcessor','log','LogHandler','INFO','level','DEBUG','debug','JsSIP:*','disable','info','Get\x20media\x20permission','getUserMedia','then','error','start','_checkMediaPermission','warning','Phone\x20already\x20started,\x20stopping\x20first','stop','assign','_initToneGenerator','provisionToken','Using\x20provisioning\x20token\x20authorization','wssServer','wss_server','eventServer','authorizationUsername','wss_username','wss_password','wss_token','Using\x20manual\x20specified\x20credentials','InvalidOptions','Missing\x20username','password','callToken','useCallDataInfoEvent','Enabled\x20event\x20service\x20because\x20\x27useCallDataInfoEvent\x27\x20is\x20enabled','connectEventService','connect','Connected\x20to\x20event\x20server','calldata_available','subscribe','_fireCallDataInfoEvent','Event\x20callback\x20failed:\x20','Subscription\x20successful\x20ID\x20=\x20','Subscribe\x20failed:\x20','Unable\x20to\x20connect\x20to\x20event\x20server:\x20','UnableToConnect','Unable\x20to\x20connect\x20phone\x20websocket:\x20','Starting\x20phone','@telegenta.com','New\x20RTCSession','remote','newInboundSession','playRingOnIncoming','_startRepeatTone','autoBusyIncoming','keys','length','Autorejecting\x20incoming\x20call\x20','uuid','\x20because\x20there\x20is\x20already\x20active\x20calls','reject','Busy','_addSession','_setSessionState','INCOMING','_fireIncomingCallEvent','CONNECTING','connected','_setConnectionState','CONNECTED','disconnected','registered','REGISTERED','unregistered','UNREGISTERED','registrationFailed','REGISTRATION_FAILED','NotReady','Phone\x20is\x20not\x20started','Event\x20client\x20not\x20running,\x20not\x20stopping','disconnect','Unable\x20to\x20disconnect\x20event\x20client','call','_checkForConnectingCalls','NotAllowed','Unable\x20to\x20make\x20new\x20calls\x20while\x20others\x20are\x20connecting','holdAllCalls','trim','replace','Calling\x20number:\x20','split','sip:','Initiating\x20listen\x20to\x20call\x20with\x20uuid\x20','\x20on\x20media\x20switch\x20','listen-','getSessionByUUID','hasOwnProperty','options','push','hasMediaPermission','hasMediaPermissionError','browserSupported','browserIsFirefox','browserIsOpera','browserIsSafari','remoteAudioElement','playTone','Playing\x20tone\x20','\x20/\x20','\x20for\x20','\x20ms','_oscillator1','frequency','value','_oscillator2','gain','toneVolume','stopTone','Repeating\x20tone\x20sequence\x20started','_doRepeatTone','Playing\x20repeated\x20tone,\x20pos\x20=\x20','_repeatToneSequencePos','_endRepeatTone','webkitAudioContext','Audio\x20API\x20not\x20supported\x20by\x20this\x20browser','_toneStreamNode','createMediaStreamDestination','srcObject','stream','createOscillator','state','ACTIVE','hold','__containerId','Adding\x20new\x20session\x20','\x20sessions:','emit','sessionCreated','Exception\x20in\x20sessionCreated\x20event:\x20','Removing\x20session\x20','sessionRemoved','Exception\x20in\x20sessionRemoved\x20event:\x20','Session\x20','_removeSession','autoRemoveSessionTime','INITIALIZING','Connection\x20state:\x20','connectionStateChange','incomingCall','Exception\x20in\x20incomingCall\x20event:\x20','recordings','answerDuration','durationStr','createDurationString','duration','answerDurationStr','activeDurationStr','activeDuration','callDataInfo','Exception\x20in\x20callDataInfo\x20event:\x20','_callUUID','_webRTCSession','_sessionState','_isOnHold','_isMuted','_isRecording','_recordingError','_callBeginTime','_callAnswerTime','_callEndTime','_durationUpdTimerObj','_originatingNumber','_destinationNumber','_callDisposition','_localNumberName','_isListenCall','_currentReport','_answerCallTimeout','_answerCallTimer','_mediaSwitch','createUUID','Created\x20new\x20outbound\x20session\x20to:\x20','destinationNumber','X-Call-token:\x20','_phone','X-Max-cost:\x20','maximumCallCost','extraHeaders','X-CID-Number-Id:\x20','explicitCallerId','X-Short-CID-Id:\x20','explicitShortCallerId','X-Meta-Info:\x20','toString','substr','record','InvalidParameter','Recording\x20enabled\x20and\x20kept\x20for\x20','\x20days','X-Record:\x20','mediaSwitchURI','X-RMS:\x20','getOtherSessions','X-RMS:\x20sip:','Other\x20sessions\x20exist\x20but\x20media\x20switch\x20address\x20is\x20invalid','_initWebRTCSession','answerCallTimeout','_setAnswerCallTimeout','request','getHeader','X-P-UUID','X-DID-NAME','from','uri','user','Incoming\x20call\x20from\x20','X-MS','Media\x20switch\x20handling\x20call:\x20','session','sessions','candidate','type','relatedPort','Accepting\x20ICE\x20candidate:\x20','_iceCandidateTimer','ready','ICE\x20Timeout\x20(','iceGatherTimeout','\x20ms)\x20reached','connecting','_startRTCPStatsUpdateTimer','sending','CALLING','progress','originator','PROGRESS','response','status_code','Answer\x20call\x20timeout\x20after\x20','accepted','X-Recording','Call\x20is\x20being\x20prerecorded','No\x20call\x20recording\x20started\x20yet','ended','now','TERMINATED','failed','message','reason_phrase','FAILED','cause','dtmf','Session\x20DTMF','newInfo','New\x20session\x20info','_fireHoldStateEvent','ON_HOLD','unhold','muted','Microphone\x20muted','_fireMuteStateEvent','unmuted','Microphone\x20unmuted','reinvite','Session\x20reinvite','Session\x20update','getusermediafailed','Getusermedia\x20failed','connection','_handleRemoteAudio','WebRTCSession\x20object:','hangup','Hanging\x20up\x20call','terminate','Hanging\x20up\x20call\x20with\x20disposition\x20','_manualDisposition','X-HDISP:\x20','answer','stun:stun.l.google.com:19302','Rejected\x20call','Rejecting\x20call','direction','LISTEN','incoming','INBOUND','Call\x20direction\x20is\x20OUTBOUND','OUTBOUND','Unknown\x20call\x20direction:\x20','startRecording','Record:\x20on','Request\x20start\x20recording','once','succeeded','Recording\x20started\x20successfully','Recording\x20start\x20failed:\x20','sendInfo','application/info','stopRecording','Record:\x20off','Request\x20stop\x20recording','Recording\x20stopped\x20successfully','Exception\x20in\x20recordingStateChange\x20event:\x20','recordingStateChange','isRecording','muteMic','Mute\x20microphone','mute','unmuteMic','Unmute\x20microphone','unmute','isMuted','Hold\x20call','isOnHold','sendDTMF','Invalid\x20DTMF\x20code','Sending\x20DTMF:\x20','Mic\x20already\x20muted,\x20just\x20sending\x20DTMF','Mute\x20mic\x20while\x20sending\x20DTMF','Unmute\x20mic\x20after\x20DTMF','transfer','Transferring\x20','\x20=>\x20','refer','requestSucceeded','Transfer\x20completed\x20successfully','requestFailed','Transfer\x20rejected:\x20','Transfer\x20failed:\x20','playback','Event\x20service\x20not\x20enabled','Playback\x20media\x20file\x20','\x20hangup\x20after\x20','call_command','PLAYBACK','setWhisperMode','Call\x20is\x20not\x20correct\x20type\x20(listen)','Invalid\x20mode','_fireWhisperModeChangeEvent','_startDurationUpdateTimer','Exception\x20in\x20call\x20duration\x20update\x20event:\x20','_rtcpStatsTimer','getStats','values','outbound-rtp','outboundPacketsSent','packetsSent','outboundBytesSent','bytesSent','inbound-rtp','inboundPacketsReceived','packetsReceived','bytesReceived','inboundBytesReceived','inboundPacketsLost','packetsLost','inboundJitter','jitter','remote-inbound-rtp','outboundPacketsLost','outboundJitter','roundTripTime','_calcReportMetrics','callQualityReportUpdate','Exception\x20in\x20call\x20quality\x20report\x20update\x20event:\x20','outboundPacketLossPct','inboundPacketLossPct','effectiveLatency','rFactor','Bad','qualityString','Fair','Good','Excellent','Error','Session\x20state:\x20','sessionStateChange','NORMAL','_callFinished','Unavailable','TEMP_UNAVAIL','playSignalTones','INVALID_NUMBER','Canceled','NO_ANSWER','Rejected','REJECTED','BARRED','BUSY','Call\x20finished','_fireCallEndedEvent','_sessionTerminated','Setting\x20answer\x20call\x20timeout\x20to:\x20'];(function(_0x7ebfd7,_0x4048a2){var _0x38b4df=function(_0x3fa5a8){while(--_0x3fa5a8){_0x7ebfd7['push'](_0x7ebfd7['shift']());}};_0x38b4df(++_0x4048a2);}(_0x571f,0x1b0));var _0x2b52=function(_0x538dac,_0x480a7e){_0x538dac=_0x538dac-0x0;var _0x3a6337=_0x571f[_0x538dac];return _0x3a6337;};import _0x1a44b7 from'events';import _0x1f9aab from'jssip';import{Logger,Exceptions,Tools}from'@telegenta/common';import{EventClient}from'./event-client';import _0x574636 from'camelcase-keys';const options={'wssServer':'wss://api.telegenta.com/sip/','eventServer':'wss://api.telegenta.com/es/','provisionToken':null,'authorizationUsername':null,'password':null,'callToken':null,'register':!![],'iceGatherTimeout':0xbb8,'playSignalTones':!![],'logger':null,'logLevel':0x3,'connectEventService':![],'useCallDataInfoEvent':![],'toneVolume':0.3,'autoBusyIncoming':!![],'autoRemoveSessionTime':0xbb8,'playRingOnIncoming':!![],'playCallInitializedTone':![]};const DTMF_FREQUENCY_TABLE={'1':[0x4b9,0x2b9],'2':[0x538,0x2b9],'3':[0x5c5,0x2b9],'a':[0x661,0x2b9],'4':[0x4b9,0x302],'5':[0x538,0x302],'6':[0x5c5,0x302],'b':[0x661,0x302],'7':[0x4b9,0x354],'8':[0x538,0x354],'9':[0x5c5,0x354],'c':[0x661,0x354],'*':[0x4b9,0x3ad],'0':[0x538,0x3ad],'#':[0x5c5,0x3ad],'d':[0x661,0x3ad]};const ST_TEMP_UNAVAIL=[{'d':0xfa,'f1':0x1a9,'f2':0x0,'g':0xfa}];const ST_BUSY=[{'d':0x1f4,'f1':0x1a9,'f2':0x0,'g':0x1f4}];const ST_INVALID_NUMBER=[{'d':0x14d,'f1':0x3b6,'f2':0x0,'g':0x0},{'d':0x14d,'f1':0x578,'f2':0x0,'g':0x0},{'d':0x14d,'f1':0x708,'f2':0x0,'g':0x3e8}];const ST_CALLINIT=[{'d':0xc8,'f1':0x1f4,'f2':0x0,'g':0x0},{'d':0xc8,'f1':0x2bc,'f2':0x0,'g':0x1388}];const ST_RINGBACK=[{'d':0x3e8,'f1':0x1a9,'f2':0x0,'g':0xfa0}];const ST_INCOMING=[{'d':0x96,'f1':0x190,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x258,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x190,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x258,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x190,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x258,'f2':0x0,'g':0xbb8}];export class Phone extends _0x1a44b7{constructor(logger=null){super();this[_0x2b52('0x0')]=![];this[_0x2b52('0x1')]=![];this[_0x2b52('0x2')]=null;this[_0x2b52('0x3')]=null;this[_0x2b52('0x4')]=![];this[_0x2b52('0x5')]=null;this[_0x2b52('0x6')]=null;this[_0x2b52('0x7')]=0x0;this[_0x2b52('0x8')]={};this[_0x2b52('0x9')]=document['createElement']('AUDIO');this[_0x2b52('0x9')][_0x2b52('0xa')]=!![];this[_0x2b52('0xb')]=document['createElement'](_0x2b52('0xc'));this[_0x2b52('0xb')][_0x2b52('0xa')]=!![];this[_0x2b52('0xd')]=null;this[_0x2b52('0xe')]=![];this[_0x2b52('0xf')]=[];this['_repeatToneSequencePos']=0x0;this[_0x2b52('0x10')]=null;this['_oscillator1']=null;this['_oscillator2']=null;this[_0x2b52('0x11')]=logger?logger:new Logger[(_0x2b52('0x12'))](Logger['LOGLVL'][_0x2b52('0x13')]);if(this[_0x2b52('0x11')][_0x2b52('0x14')]===Logger['LOGLVL'][_0x2b52('0x15')]){_0x1f9aab[_0x2b52('0x16')]['disable'](_0x2b52('0x17'));}else{_0x1f9aab[_0x2b52('0x16')][_0x2b52('0x18')]('JsSIP:*');}}['prepareMedia'](){this['log'][_0x2b52('0x19')](_0x2b52('0x1a'));const self=this;const constraints={'audio':!![],'video':![]};return new Promise(function(resolve,reject){navigator['mediaDevices'][_0x2b52('0x1b')](constraints)[_0x2b52('0x1c')](()=>{self['_mediaPermission']=!![];self[_0x2b52('0x1')]=![];self[_0x2b52('0x11')][_0x2b52('0x19')]('Media\x20permission\x20granted');resolve();},err=>{self[_0x2b52('0x0')]=![];self['_mediaPermissionError']=!![];self['log'][_0x2b52('0x1d')]('Denied\x20media\x20permission:\x20'+err);reject(err);});});}[_0x2b52('0x1e')](phoneOptions){this[_0x2b52('0x1f')]();if(this[_0x2b52('0x4')]){this[_0x2b52('0x11')][_0x2b52('0x20')](_0x2b52('0x21'));this[_0x2b52('0x22')]();}this[_0x2b52('0x6')]=Object[_0x2b52('0x23')](options,phoneOptions);this[_0x2b52('0x24')]();if(this[_0x2b52('0x6')]['provisionToken']){let pt=null;try{pt=JSON['parse'](atob(this[_0x2b52('0x6')][_0x2b52('0x25')]));}catch(_0x46f239){throw new Exceptions['InvalidOptions'](_0x2b52('0x25'),'Invalid\x20token');}this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x26'));this[_0x2b52('0x6')][_0x2b52('0x27')]=pt[_0x2b52('0x28')];this[_0x2b52('0x6')][_0x2b52('0x29')]=pt['event_server'];this[_0x2b52('0x6')][_0x2b52('0x2a')]=pt[_0x2b52('0x2b')];this[_0x2b52('0x6')]['password']=pt[_0x2b52('0x2c')];this['_options']['callToken']=pt[_0x2b52('0x2d')];}else{this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x2e'));if(!this[_0x2b52('0x6')][_0x2b52('0x2a')]){throw new Exceptions[(_0x2b52('0x2f'))](_0x2b52('0x2a'),_0x2b52('0x30'));}if(!this[_0x2b52('0x6')]['password']){throw new Exceptions[(_0x2b52('0x2f'))](_0x2b52('0x31'),'Missing\x20password');}if(!this[_0x2b52('0x6')]['callToken']){throw new Exceptions[(_0x2b52('0x2f'))](_0x2b52('0x32'),'Missing\x20call\x20token');}}if(this[_0x2b52('0x6')][_0x2b52('0x33')]&&!this[_0x2b52('0x6')]['connectEventService']){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x34'));this[_0x2b52('0x6')][_0x2b52('0x35')]=!![];}if(this[_0x2b52('0x6')]['connectEventService']){this[_0x2b52('0x5')]=new EventClient(this[_0x2b52('0x11')]);this[_0x2b52('0x5')][_0x2b52('0x36')](this[_0x2b52('0x6')]['eventServer'])['then'](()=>{this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x37'));if(this[_0x2b52('0x6')][_0x2b52('0x33')]){let eventSpec={'event_name':_0x2b52('0x38'),'call_token':this['_options'][_0x2b52('0x32')]};this[_0x2b52('0x5')][_0x2b52('0x39')](eventSpec,data=>{try{this['log'][_0x2b52('0x16')]('Received\x20remote\x20call\x20data\x20info');this[_0x2b52('0x11')]['debug'](data);this[_0x2b52('0x3a')](data);}catch(_0x5884cb){this[_0x2b52('0x11')]['error'](_0x2b52('0x3b')+_0x5884cb);}})['then'](subscriptionId=>{this['log']['info'](_0x2b52('0x3c')+subscriptionId);},reason=>{this['log']['error'](_0x2b52('0x3d')+reason);});}},reason=>{this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x3e')+reason);});}let wsSocket=null;try{wsSocket=new _0x1f9aab['WebSocketInterface'](this[_0x2b52('0x6')][_0x2b52('0x27')]);}catch(_0x57272f){throw new Exceptions[(_0x2b52('0x3f'))](_0x2b52('0x40')+_0x57272f);}this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x41'));this[_0x2b52('0x11')][_0x2b52('0x16')](this[_0x2b52('0x6')]);this[_0x2b52('0x2')]=new _0x1f9aab['UA']({'sockets':[wsSocket],'authorization_user':this[_0x2b52('0x6')][_0x2b52('0x2a')],'password':this['_options'][_0x2b52('0x31')],'register':this['_options']['register'],'display_name':this[_0x2b52('0x6')]['authorizationUsername'],'uri':this[_0x2b52('0x6')][_0x2b52('0x2a')]+_0x2b52('0x42'),'session_timers':![]});const self=this;this['_UA']['on']('newRTCSession',function(data){self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x43'));if(data['originator']===_0x2b52('0x44')){const session=new Session(self);session[_0x2b52('0x45')](data);if(self['_options'][_0x2b52('0x46')]){self[_0x2b52('0x47')](ST_INCOMING);}if(self['_options'][_0x2b52('0x48')]){if(Object[_0x2b52('0x49')](self[_0x2b52('0x8')])[_0x2b52('0x4a')]>0x0){self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x4b')+session[_0x2b52('0x4c')]+_0x2b52('0x4d'));session[_0x2b52('0x4e')](0x1e6,_0x2b52('0x4f'));return;}else{self[_0x2b52('0x11')][_0x2b52('0x16')]('There\x20are\x20no\x20other\x20sessions,\x20adding\x20incoming\x20call');}}self[_0x2b52('0x50')](session);session[_0x2b52('0x51')](_0x2b52('0x52'));self[_0x2b52('0x53')](session);}});this[_0x2b52('0x2')]['on']('connecting',function(){self['_setConnectionState'](_0x2b52('0x54'));});this[_0x2b52('0x2')]['on'](_0x2b52('0x55'),function(){self[_0x2b52('0x56')](_0x2b52('0x57'));});this[_0x2b52('0x2')]['on'](_0x2b52('0x58'),function(){self[_0x2b52('0x56')]('DISCONNECTED');});this[_0x2b52('0x2')]['on'](_0x2b52('0x59'),function(){self['_setConnectionState'](_0x2b52('0x5a'));});this['_UA']['on'](_0x2b52('0x5b'),function(){self[_0x2b52('0x56')](_0x2b52('0x5c'));});this[_0x2b52('0x2')]['on'](_0x2b52('0x5d'),function(){self['_setConnectionState'](_0x2b52('0x5e'));});this[_0x2b52('0x2')][_0x2b52('0x1e')]();this[_0x2b52('0x4')]=!![];this[_0x2b52('0x11')][_0x2b52('0x19')]('Successfully\x20started\x20phone');}[_0x2b52('0x22')](){if(!this[_0x2b52('0x4')]){throw new Exceptions[(_0x2b52('0x5f'))](_0x2b52('0x60'));}this[_0x2b52('0x2')]['removeAllListeners']();this[_0x2b52('0x2')][_0x2b52('0x22')]();delete this[_0x2b52('0x2')];if(!this[_0x2b52('0x5')]){this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x61'));return;}try{this[_0x2b52('0x5')][_0x2b52('0x62')]();delete this['_eventClient'];}catch(_0x56956c){this[_0x2b52('0x11')]['warning'](_0x2b52('0x63'));}this[_0x2b52('0x4')]=![];this[_0x2b52('0x11')][_0x2b52('0x19')]('Phone\x20client\x20successfully\x20stopped');}[_0x2b52('0x64')](number,params={}){if(!this[_0x2b52('0x4')]){throw new Exceptions[(_0x2b52('0x5f'))](_0x2b52('0x60'));}if(this[_0x2b52('0x65')]()){throw Exceptions[_0x2b52('0x66')](_0x2b52('0x67'));}this[_0x2b52('0x68')]();const callParams=Object[_0x2b52('0x23')]({'record':![],'maximumCallCost':0x0,'answerCallTimeout':0x0,'explicitCallerId':null,'explicitShortCallerId':null,'metaInfo':null,'_isListenCall':![]},params);number=number[_0x2b52('0x69')]()[_0x2b52('0x6a')](/ |\(|\)/g,'');this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x6b')+number);let session=new Session(this);session['newOutboundSession'](number,callParams);this[_0x2b52('0x50')](session);return session;}['listen'](listenKey){const s=listenKey[_0x2b52('0x6c')]('@');let callUUID=s[0x0];let mediaSwitch=_0x2b52('0x6d')+s[0x1];this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x6e')+callUUID+_0x2b52('0x6f')+mediaSwitch);return this[_0x2b52('0x64')](_0x2b52('0x70')+callUUID,{'mediaSwitchURI':mediaSwitch,'_isListenCall':!![]});}[_0x2b52('0x71')](uuid){for(let key in this[_0x2b52('0x8')]){if(this['_activeSessions'][_0x2b52('0x72')](key)){if(this[_0x2b52('0x8')][key][_0x2b52('0x4c')]===uuid){return this[_0x2b52('0x8')][key];}}}return null;}get[_0x2b52('0x73')](){return this['_options'];}get['sessions'](){let s=[];for(let key in this[_0x2b52('0x8')]){if(this[_0x2b52('0x8')][_0x2b52('0x72')](key)){s[_0x2b52('0x74')](this[_0x2b52('0x8')][key]);}}return s;}get[_0x2b52('0x75')](){return this[_0x2b52('0x0')];}get[_0x2b52('0x76')](){return this[_0x2b52('0x1')];}get['isStarted'](){return this[_0x2b52('0x4')];}get[_0x2b52('0x77')](){return Tools['browserIsChrome']()||Tools[_0x2b52('0x78')]()||Tools[_0x2b52('0x79')]()||Tools[_0x2b52('0x7a')]();}get[_0x2b52('0x7b')](){return this[_0x2b52('0x9')];}[_0x2b52('0x7c')](duration,freq1,freq2=0x0,callback=null){this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x7d')+freq1+_0x2b52('0x7e')+freq2+_0x2b52('0x7f')+duration+_0x2b52('0x80'));this[_0x2b52('0x81')][_0x2b52('0x82')][_0x2b52('0x83')]=freq1;this[_0x2b52('0x84')][_0x2b52('0x82')][_0x2b52('0x83')]=freq2;this[_0x2b52('0x10')][_0x2b52('0x85')][_0x2b52('0x83')]=this['_options'][_0x2b52('0x86')];const self=this;this['_toneTimer']=setTimeout(function(){self[_0x2b52('0x87')]();if(callback){callback();}},duration);}[_0x2b52('0x87')](){this[_0x2b52('0x81')][_0x2b52('0x82')][_0x2b52('0x83')]=0x0;this[_0x2b52('0x84')]['frequency'][_0x2b52('0x83')]=0x0;this['_toneGainProcessor'][_0x2b52('0x85')][_0x2b52('0x83')]=0x0;clearTimeout(this[_0x2b52('0xd')]);}[_0x2b52('0x47')](sequences){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x88'));this['log'][_0x2b52('0x16')](sequences);this[_0x2b52('0xf')]=sequences;this['_repeatToneSequencePos']=0x0;this[_0x2b52('0xe')]=!![];this[_0x2b52('0x89')]();}[_0x2b52('0x89')](){if(this[_0x2b52('0xe')]){this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x8a')+this['_repeatToneSequencePos']);let toneDef=this[_0x2b52('0xf')][this[_0x2b52('0x8b')]];this[_0x2b52('0x8b')]++;if(this[_0x2b52('0x8b')]===this[_0x2b52('0xf')][_0x2b52('0x4a')]){this[_0x2b52('0x8b')]=0x0;}const self=this;this[_0x2b52('0x7c')](toneDef['d'],toneDef['f1'],toneDef['f2'],function(){setTimeout(self[_0x2b52('0x89')]['bind'](self),toneDef['g']);});}}[_0x2b52('0x8c')](){if(this[_0x2b52('0xe')]){this[_0x2b52('0x11')][_0x2b52('0x19')]('Repeating\x20tone\x20stopped');this['_repeatToneActive']=![];this[_0x2b52('0x87')]();}}['_initToneGenerator'](){const AudioContext=window['AudioContext']||window[_0x2b52('0x8d')]||![];if(!AudioContext){throw new Exceptions['NotAllowed'](_0x2b52('0x8e'));}const ctx=new AudioContext();this[_0x2b52('0x8f')]=ctx[_0x2b52('0x90')]();this[_0x2b52('0xb')][_0x2b52('0x91')]=this[_0x2b52('0x8f')][_0x2b52('0x92')];this[_0x2b52('0x10')]=ctx['createGain']();this[_0x2b52('0x10')]['gain'][_0x2b52('0x83')]=0x0;this['_toneGainProcessor'][_0x2b52('0x36')](this[_0x2b52('0x8f')]);this[_0x2b52('0x81')]=ctx[_0x2b52('0x93')]();this['_oscillator1']['connect'](this[_0x2b52('0x10')]);this[_0x2b52('0x81')][_0x2b52('0x82')][_0x2b52('0x83')]=0x0;this[_0x2b52('0x81')][_0x2b52('0x1e')]();this['_oscillator2']=ctx[_0x2b52('0x93')]();this[_0x2b52('0x84')]['connect'](this[_0x2b52('0x10')]);this['_oscillator2'][_0x2b52('0x82')][_0x2b52('0x83')]=0x0;this[_0x2b52('0x84')][_0x2b52('0x1e')]();}['holdAllCalls'](){this[_0x2b52('0x11')]['info']('Holding\x20all\x20active\x20sessions');if(this[_0x2b52('0x65')]()){throw Exceptions[_0x2b52('0x66')]('A\x20session\x20is\x20currently\x20connecting');}for(let key in this[_0x2b52('0x8')]){if(this['_activeSessions'][_0x2b52('0x72')](key)){let session=this[_0x2b52('0x8')][key];if(session[_0x2b52('0x94')]===_0x2b52('0x95')){session[_0x2b52('0x96')]();}}}}['_addSession'](session){this[_0x2b52('0x7')]++;session[_0x2b52('0x97')]=this[_0x2b52('0x7')];this['log'][_0x2b52('0x19')](_0x2b52('0x98')+session[_0x2b52('0x97')]+':\x20'+session[_0x2b52('0x4c')]);this['_activeSessions'][session[_0x2b52('0x97')]]=session;this['log'][_0x2b52('0x16')]('We\x20now\x20have\x20'+Object[_0x2b52('0x49')](this['_activeSessions'])['length']+_0x2b52('0x99'));this[_0x2b52('0x11')][_0x2b52('0x16')](this['_activeSessions']);try{this[_0x2b52('0x9a')](_0x2b52('0x9b'),{'session':session});}catch(_0x48e4f5){this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x9c')+_0x48e4f5);}}['_removeSession'](session){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x9d')+session[_0x2b52('0x97')]+':\x20'+session[_0x2b52('0x4c')]);try{this['emit'](_0x2b52('0x9e'),{'session':session});}catch(_0x2847a2){this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x9f')+_0x2847a2);}delete this['_activeSessions'][session[_0x2b52('0x97')]];this[_0x2b52('0x11')][_0x2b52('0x16')]('We\x20now\x20have\x20'+Object[_0x2b52('0x49')](this['_activeSessions'])[_0x2b52('0x4a')]+'\x20sessions');this[_0x2b52('0x11')][_0x2b52('0x16')](this['_activeSessions']);this[_0x2b52('0x8c')]();}['_sessionTerminated'](session){this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xa0')+session[_0x2b52('0x4c')]+'\x20terminated,\x20removing\x20in\x20'+this[_0x2b52('0x6')]['autoRemoveSessionTime']+_0x2b52('0x80'));const self=this;setTimeout(function(){self[_0x2b52('0xa1')](session);},this[_0x2b52('0x6')][_0x2b52('0xa2')]);}[_0x2b52('0x65')](){for(let key in this[_0x2b52('0x8')]){if(this[_0x2b52('0x8')][_0x2b52('0x72')](key)){let session=this[_0x2b52('0x8')][key];if(session[_0x2b52('0x94')]===_0x2b52('0xa3')||session[_0x2b52('0x94')]==='CALLING'||session[_0x2b52('0x94')]==='PROGRESS'||session[_0x2b52('0x94')]==='INCOMING'){return!![];}}}return![];}[_0x2b52('0x56')](state){this[_0x2b52('0x11')]['info'](_0x2b52('0xa4')+state);this[_0x2b52('0x3')]=state;try{this['emit'](_0x2b52('0xa5'),{'state':state});}catch(_0x46efb6){this[_0x2b52('0x11')]['error']('Exception\x20in\x20connectionStateChange\x20event:\x20'+_0x46efb6);}}[_0x2b52('0x53')](session){try{this[_0x2b52('0x9a')](_0x2b52('0xa6'),session);}catch(_0x1fb729){this['log'][_0x2b52('0x1d')](_0x2b52('0xa7')+_0x1fb729);}}[_0x2b52('0x3a')](eventData=null){let e;e=_0x574636(eventData);e[_0x2b52('0xa8')]=_0x574636(eventData[_0x2b52('0xa8')]);e['duration']=e['duration']*0x3e8;e['answerDuration']=e[_0x2b52('0xa9')]*0x3e8;e['activeDuration']=e['activeDuration']*0x3e8;e[_0x2b52('0xaa')]=Tools[_0x2b52('0xab')](e[_0x2b52('0xac')]);e[_0x2b52('0xad')]=e[_0x2b52('0xa9')]?Tools[_0x2b52('0xab')](e['answerDuration']):'';e[_0x2b52('0xae')]=e['activeDuration']?Tools['createDurationString'](e[_0x2b52('0xaf')]):'';try{this[_0x2b52('0x9a')](_0x2b52('0xb0'),e);}catch(_0x14d3a3){this['log'][_0x2b52('0x1d')](_0x2b52('0xb1')+_0x14d3a3);}}[_0x2b52('0x1f')](){if(!this[_0x2b52('0x0')]){throw new Exceptions['MediaNotPrepared']();}}}export class Session extends _0x1a44b7{constructor(phone){super();this['_phone']=phone;this[_0x2b52('0x11')]=phone[_0x2b52('0x11')];this[_0x2b52('0xb2')]=null;this[_0x2b52('0xb3')]=null;this[_0x2b52('0xb4')]=null;this['_iceCandidateTimer']=null;this[_0x2b52('0xb5')]=![];this[_0x2b52('0xb6')]=![];this[_0x2b52('0xb7')]=![];this[_0x2b52('0xb8')]=null;this[_0x2b52('0xb9')]=null;this[_0x2b52('0xba')]=null;this[_0x2b52('0xbb')]=null;this[_0x2b52('0xbc')]=null;this[_0x2b52('0xbd')]=null;this[_0x2b52('0xbe')]=null;this[_0x2b52('0xbf')]=null;this[_0x2b52('0xc0')]=null;this[_0x2b52('0xc1')]=![];this['_whisperMode']=null;this['_manualDisposition']=null;this['_rtcpStatsTimer']=null;this[_0x2b52('0xc2')]=null;this[_0x2b52('0xc3')]=0x0;this[_0x2b52('0xc4')]=null;this[_0x2b52('0xc5')]=null;}['newOutboundSession'](number,callParams){this[_0x2b52('0xb2')]=Tools[_0x2b52('0xc6')]();this['log'][_0x2b52('0x16')](_0x2b52('0xc7')+number+'\x20['+this[_0x2b52('0xb2')]+']');this[_0x2b52('0xc8')]=number;let options={'mediaConstraints':{'audio':!![],'video':![]},'pcConfig':{'iceServers':[{'urls':['stun:stun.l.google.com:19302']}]},'extraHeaders':[_0x2b52('0xc9')+this[_0x2b52('0xca')]['options']['callToken'],'X-P-UUID:\x20'+this[_0x2b52('0xb2')],_0x2b52('0xcb')+callParams[_0x2b52('0xcc')]]};if(callParams['explicitCallerId']){options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xce')+callParams[_0x2b52('0xcf')]);}if(callParams['explicitShortCallerId']){options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xd0')+callParams[_0x2b52('0xd1')]);}if(callParams['metaInfo']){options[_0x2b52('0xcd')]['push'](_0x2b52('0xd2')+encodeURI(callParams['metaInfo'][_0x2b52('0xd3')]()[_0x2b52('0xd4')](0x0,0xff)));}if(callParams['record']){if(isNaN(callParams[_0x2b52('0xd5')])){throw new Exceptions[(_0x2b52('0xd6'))]('Record\x20parameter\x20must\x20be\x20a\x20number');}this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xd7')+callParams[_0x2b52('0xd5')]+_0x2b52('0xd8'));options[_0x2b52('0xcd')]['push'](_0x2b52('0xd9')+callParams[_0x2b52('0xd5')]);this['_isRecording']=!![];}else{this[_0x2b52('0xb7')]=![];}this['_isListenCall']=callParams[_0x2b52('0xc1')];if(callParams[_0x2b52('0xda')]){this[_0x2b52('0x11')][_0x2b52('0x16')]('Requesting\x20specific\x20media\x20switch\x20'+callParams[_0x2b52('0xda')]);options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xdb')+callParams[_0x2b52('0xda')]);}else{const otherSessions=this[_0x2b52('0xdc')]();if(otherSessions[_0x2b52('0x4a')]>0x0){if(otherSessions[0x0]['_mediaSwitch']){this['log'][_0x2b52('0x16')]('Requesting\x20call\x20grouping\x20on\x20media\x20switch\x20'+otherSessions[0x0][_0x2b52('0xc5')]);options[_0x2b52('0xcd')][_0x2b52('0x74')](_0x2b52('0xdd')+otherSessions[0x0][_0x2b52('0xc5')]);}else{this[_0x2b52('0x11')][_0x2b52('0x20')](_0x2b52('0xde'));}}else{this[_0x2b52('0x11')][_0x2b52('0x16')]('No\x20other\x20active\x20calls,\x20no\x20media\x20switch\x20grouping\x20requested');}}const uri='sip:'+number+_0x2b52('0x42');try{this[_0x2b52('0xdf')](this[_0x2b52('0xca')]['_UA'][_0x2b52('0x64')](uri,options));}catch(_0x947053){this['log'][_0x2b52('0x1d')]('Error\x20starting\x20call:',_0x947053);return null;}if(callParams[_0x2b52('0xe0')]){this[_0x2b52('0xe1')](callParams[_0x2b52('0xe0')]);}}[_0x2b52('0x45')](newSessionRequest){this[_0x2b52('0xb2')]=newSessionRequest[_0x2b52('0xe2')][_0x2b52('0xe3')](_0x2b52('0xe4'),0x0);this[_0x2b52('0xbe')]=newSessionRequest[_0x2b52('0xe2')]['getHeader']('X-DID',0x0);this[_0x2b52('0xc0')]=unescape(newSessionRequest[_0x2b52('0xe2')][_0x2b52('0xe3')](_0x2b52('0xe5'),0x0));this['_originName']=newSessionRequest[_0x2b52('0xe2')][_0x2b52('0xe6')]['display_name'];this[_0x2b52('0xbd')]=newSessionRequest['request'][_0x2b52('0xe6')][_0x2b52('0xe7')][_0x2b52('0xe8')];this['log'][_0x2b52('0x19')](_0x2b52('0xe9')+this[_0x2b52('0xbd')]+'\x20['+this[_0x2b52('0xb2')]+']');this[_0x2b52('0x11')][_0x2b52('0x16')](newSessionRequest);this[_0x2b52('0xc5')]=newSessionRequest['request'][_0x2b52('0xe3')](_0x2b52('0xea'));this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xeb')+this[_0x2b52('0xc5')]);this[_0x2b52('0xdf')](newSessionRequest[_0x2b52('0xec')]);}[_0x2b52('0xdc')](){const allSessions=this[_0x2b52('0xca')][_0x2b52('0xed')];let s=[];for(let key in allSessions){if(allSessions[key]){if(allSessions[key]['__containerId']!==this[_0x2b52('0x97')]){s[_0x2b52('0x74')](allSessions[key]);}}}return s;}['_initWebRTCSession'](webRTCSession){this['_webRTCSession']=webRTCSession;this['_callBeginTime']=Date['now']();const self=this;this[_0x2b52('0xb3')]['on']('icecandidate',function(event){const c=event['candidate'];self[_0x2b52('0x11')][_0x2b52('0x16')]('Got\x20ICE\x20candidate:\x20'+c[_0x2b52('0xee')]);if(c[_0x2b52('0xef')]==='srflx'&&c['relatedAddress']!==null&&c[_0x2b52('0xf0')]!==null){self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0xf1')+c[_0x2b52('0xee')]);if(self[_0x2b52('0xf2')]!=null)clearTimeout(self[_0x2b52('0xf2')]);event[_0x2b52('0xf3')]();}else{if(self['_iceCandidateTimer']!=null)clearTimeout(self[_0x2b52('0xf2')]);self[_0x2b52('0xf2')]=setTimeout(function(data){self['log'][_0x2b52('0x16')](_0x2b52('0xf4')+self[_0x2b52('0xca')][_0x2b52('0x73')][_0x2b52('0xf5')]+_0x2b52('0xf6'));data['ready']();},self[_0x2b52('0xca')][_0x2b52('0x73')]['iceGatherTimeout'],event);}});this['_webRTCSession']['on'](_0x2b52('0xf7'),function(){self['_startDurationUpdateTimer']();self[_0x2b52('0xf8')]();self[_0x2b52('0x51')]('INITIALIZING');});this[_0x2b52('0xb3')]['on'](_0x2b52('0xf9'),function(){if(self[_0x2b52('0xca')][_0x2b52('0x73')]['playCallInitializedTone']){self['_phone'][_0x2b52('0x47')](ST_CALLINIT);}self[_0x2b52('0x51')](_0x2b52('0xfa'));});this[_0x2b52('0xb3')]['on'](_0x2b52('0xfb'),function(data){if(data[_0x2b52('0xfc')]==='remote'){self[_0x2b52('0x51')](_0x2b52('0xfd'),{'code':data[_0x2b52('0xfe')][_0x2b52('0xff')]});self[_0x2b52('0xca')][_0x2b52('0x8c')]();if(data[_0x2b52('0xfe')][_0x2b52('0xff')]===0xb4){self[_0x2b52('0xca')][_0x2b52('0x47')](ST_RINGBACK);}if(self[_0x2b52('0xc3')]){self['_answerCallTimer']=setTimeout(function(){self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x100')+self[_0x2b52('0xc3')]+'\x20seconds');try{self['hangup']();}catch(_0x37f186){self['log'][_0x2b52('0x19')]('No\x20active\x20session,\x20ignoring\x20answer\x20call\x20timeout');}},self[_0x2b52('0xc3')]*0x3e8);}}});this['_webRTCSession']['on'](_0x2b52('0x101'),function(data){self[_0x2b52('0xca')][_0x2b52('0x8c')]();self[_0x2b52('0xba')]=Date['now']();if(self[_0x2b52('0xc3')]){clearTimeout(self[_0x2b52('0xc4')]);self[_0x2b52('0xc3')]=0x0;}if(data['originator']==='remote'){const recState=data[_0x2b52('0xfe')]['getHeader'](_0x2b52('0x102'));if(recState==='true'){self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x103'));}else{self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x104'));}self[_0x2b52('0xc5')]=data[_0x2b52('0xfe')][_0x2b52('0xe3')](_0x2b52('0xea'));self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0xeb')+self['_mediaSwitch']);}});this[_0x2b52('0xb3')]['on']('confirmed',function(){self[_0x2b52('0x51')](_0x2b52('0x95'));});this[_0x2b52('0xb3')]['on'](_0x2b52('0x105'),function(){self[_0x2b52('0xca')]['_endRepeatTone']();self[_0x2b52('0xbb')]=Date[_0x2b52('0x106')]();if(self[_0x2b52('0xc3')]){clearTimeout(self[_0x2b52('0xc4')]);}self[_0x2b52('0x51')](_0x2b52('0x107'));});this[_0x2b52('0xb3')]['on'](_0x2b52('0x108'),function(data){self[_0x2b52('0xca')][_0x2b52('0x8c')]();self[_0x2b52('0xbb')]=Date[_0x2b52('0x106')]();if(self[_0x2b52('0xc3')]){clearTimeout(self['_answerCallTimer']);}let m;if(data[_0x2b52('0x109')]){m=data['message'][_0x2b52('0xff')]+'\x20'+data['message'][_0x2b52('0x10a')];}else{m='';}self['_setSessionState'](_0x2b52('0x10b'),{'cause':data[_0x2b52('0x10c')],'message':m});});this[_0x2b52('0xb3')]['on'](_0x2b52('0x10d'),function(data){self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x10e'),data);});this[_0x2b52('0xb3')]['on'](_0x2b52('0x10f'),function(data){self['log'][_0x2b52('0x16')](_0x2b52('0x110'),data);});this[_0x2b52('0xb3')]['on']('hold',function(){self['_isOnHold']=!![];self[_0x2b52('0x111')]();self['_setSessionState'](_0x2b52('0x112'));});this['_webRTCSession']['on'](_0x2b52('0x113'),function(){self['_isOnHold']=![];self[_0x2b52('0x111')]();self[_0x2b52('0x51')](_0x2b52('0x95'));});this[_0x2b52('0xb3')]['on'](_0x2b52('0x114'),function(data){self['log']['debug'](_0x2b52('0x115'),data);self[_0x2b52('0xb6')]=!![];self[_0x2b52('0x116')]();});this['_webRTCSession']['on'](_0x2b52('0x117'),function(data){self[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x118'),data);self[_0x2b52('0xb6')]=![];self[_0x2b52('0x116')]();});this['_webRTCSession']['on'](_0x2b52('0x119'),function(data){self[_0x2b52('0x11')]['debug'](_0x2b52('0x11a'),data);});this[_0x2b52('0xb3')]['on']('update',function(data){self['log']['debug'](_0x2b52('0x11b'),data);});this['_webRTCSession']['on'](_0x2b52('0x11c'),function(data){self[_0x2b52('0x11')]['error'](_0x2b52('0x11d'),data);});if(self[_0x2b52('0xb3')][_0x2b52('0x11e')]){self[_0x2b52('0x11f')](self[_0x2b52('0xb3')]);}this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x120'));this[_0x2b52('0x11')][_0x2b52('0x16')](this);}[_0x2b52('0x121')](disposition=null){if(!disposition){this['log'][_0x2b52('0x19')](_0x2b52('0x122'));this['_webRTCSession'][_0x2b52('0x123')]();}else{this[_0x2b52('0x11')]['info'](_0x2b52('0x124')+disposition);this[_0x2b52('0x125')]=disposition;this['_webRTCSession'][_0x2b52('0x123')]({'extraHeaders':[_0x2b52('0x126')+disposition]});}}[_0x2b52('0x127')](metaInfo=null){let options={'mediaConstraints':{'audio':!![],'video':![]},'pcConfig':{'iceServers':[{'urls':[_0x2b52('0x128')]}]},'extraHeaders':[_0x2b52('0xc9')+this[_0x2b52('0xca')][_0x2b52('0x73')][_0x2b52('0x32')]]};if(metaInfo){options['extraHeaders'][_0x2b52('0x74')](_0x2b52('0xd2')+encodeURI(metaInfo['toString']()[_0x2b52('0xd4')](0x0,0xff)));}this['_webRTCSession']['answer'](options);this['_handleRemoteAudio'](this[_0x2b52('0xb3')]);}[_0x2b52('0x4e')](statusCode=0x25b,reasonPhrase=_0x2b52('0x129')){this['log'][_0x2b52('0x19')](_0x2b52('0x12a'));this['_webRTCSession']['terminate']({'status_code':statusCode,'reason_phrase':reasonPhrase});}get[_0x2b52('0x4c')](){return this[_0x2b52('0xb2')];}get[_0x2b52('0xc8')](){return this[_0x2b52('0xbe')];}get['localNumberName'](){return this[_0x2b52('0xc0')];}get['originatingNumber'](){return this[_0x2b52('0xbd')];}set[_0x2b52('0xc8')](number){this['log'][_0x2b52('0x16')]('Setting\x20destination\x20number\x20to:\x20'+number);this[_0x2b52('0xbe')]=number;}get[_0x2b52('0x94')](){return this[_0x2b52('0xb4')];}get[_0x2b52('0x12b')](){if(this[_0x2b52('0xc1')]){this[_0x2b52('0x11')][_0x2b52('0x16')]('Call\x20direction\x20is\x20LISTEN');return _0x2b52('0x12c');}else if(this[_0x2b52('0xb3')]['direction']===_0x2b52('0x12d')){this['log'][_0x2b52('0x16')]('Call\x20direction\x20is\x20INBOUND');return _0x2b52('0x12e');}else if(this['_webRTCSession']['direction']==='outgoing'){this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x12f'));return _0x2b52('0x130');}else{this[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x131')+this[_0x2b52('0xb3')][_0x2b52('0x12b')]);return'UNKNOWN';}}[_0x2b52('0x132')](){const opt={'extraHeaders':[_0x2b52('0x133')]};this[_0x2b52('0x11')][_0x2b52('0x16')](_0x2b52('0x134'));const self=this;this[_0x2b52('0xb3')][_0x2b52('0x135')](_0x2b52('0x10f'),data=>{if(data[_0x2b52('0xfc')]==='local'){data[_0x2b52('0x19')]['on'](_0x2b52('0x136'),function(){self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x137'));self['_isRecording']=!![];try{self[_0x2b52('0x9a')]('recordingStateChange',{'state':!![],'error':null});}catch(_0x542ae6){self[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20recordingStateChange\x20event:\x20'+_0x542ae6);}});data[_0x2b52('0x19')]['on']('failed',function(data){self[_0x2b52('0xb8')]=data['response'][_0x2b52('0x10a')];self[_0x2b52('0x11')]['error'](_0x2b52('0x138')+self[_0x2b52('0xb8')]);self['_fireRecordingStateEvent']();});}});this[_0x2b52('0xb3')][_0x2b52('0x139')](_0x2b52('0x13a'),null,opt);}[_0x2b52('0x13b')](){const opt={'extraHeaders':[_0x2b52('0x13c')]};this[_0x2b52('0x11')]['debug'](_0x2b52('0x13d'));const self=this;this['_webRTCSession']['once'](_0x2b52('0x10f'),data=>{data['info']['on'](_0x2b52('0x136'),function(){self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x13e'));self[_0x2b52('0xb7')]=![];try{self[_0x2b52('0x9a')]('recordingStateChange',{'state':![],'error':null});}catch(_0x5d2fdc){self['log'][_0x2b52('0x1d')](_0x2b52('0x13f')+_0x5d2fdc);}});data['info']['on'](_0x2b52('0x108'),function(data){self[_0x2b52('0x11')][_0x2b52('0x1d')]('Recording\x20stopped\x20failed:\x20'+data[_0x2b52('0xfe')][_0x2b52('0x10a')]);try{self[_0x2b52('0x9a')](_0x2b52('0x140'),{'state':self['_isRecording'],'error':data[_0x2b52('0xfe')][_0x2b52('0x10a')]});}catch(_0x37fc8f){self[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20recordingStateChange\x20event:\x20'+_0x37fc8f);}});});this['_webRTCSession'][_0x2b52('0x139')]('application/info',null,opt);}['toggleRecording'](){if(!this[_0x2b52('0xb7')]){this[_0x2b52('0x132')]();return!![];}else{this[_0x2b52('0x13b')]();return![];}}get[_0x2b52('0x141')](){return this[_0x2b52('0xb7')];}[_0x2b52('0x142')](){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x143'));this['_webRTCSession'][_0x2b52('0x144')]();}[_0x2b52('0x145')](){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x146'));this[_0x2b52('0xb3')][_0x2b52('0x147')]();}['toggleMute'](){if(!this[_0x2b52('0xb6')]){this[_0x2b52('0x142')]();}else{this[_0x2b52('0x145')]();}}get[_0x2b52('0x148')](){return this[_0x2b52('0xb6')];}[_0x2b52('0x96')](){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x149'));this[_0x2b52('0xb3')][_0x2b52('0x96')]();}[_0x2b52('0x113')](){this[_0x2b52('0x11')][_0x2b52('0x19')]('Uncall\x20call');this[_0x2b52('0xca')][_0x2b52('0x68')]();this[_0x2b52('0xb3')][_0x2b52('0x113')]();}['toggleHold'](){if(!this['_isOnHold']){this[_0x2b52('0x96')]();}else{this['unhold']();}}get[_0x2b52('0x14a')](){return this['_isOnHold'];}[_0x2b52('0x14b')](code,playLocal=!![]){if(!(code in DTMF_FREQUENCY_TABLE)){throw new Exceptions[(_0x2b52('0xd6'))](_0x2b52('0x14c'));}this[_0x2b52('0x11')]['info'](_0x2b52('0x14d')+code);this[_0x2b52('0xb3')][_0x2b52('0x14b')](code);if(playLocal){const f=DTMF_FREQUENCY_TABLE[code];if(this[_0x2b52('0xb6')]){this['log'][_0x2b52('0x16')](_0x2b52('0x14e'));this[_0x2b52('0xca')][_0x2b52('0x7c')](0x1f4,f[0x0],f[0x1]);}else{this[_0x2b52('0x11')]['debug'](_0x2b52('0x14f'));this[_0x2b52('0xb3')][_0x2b52('0x144')]();const self=this;this[_0x2b52('0xca')]['playTone'](0x1f4,f[0x0],f[0x1],function(){self[_0x2b52('0x11')]['debug'](_0x2b52('0x150'));self['_webRTCSession'][_0x2b52('0x147')]();});}}}[_0x2b52('0x151')](dstSession){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x152')+this[_0x2b52('0x4c')]+_0x2b52('0x153')+dstSession[_0x2b52('0x4c')]);const referSubscriber=this[_0x2b52('0xb3')][_0x2b52('0x154')](this[_0x2b52('0xb3')]['_request']['ruri'],{'replaces':dstSession[_0x2b52('0xb3')]});const self=this;referSubscriber['on'](_0x2b52('0x155'),function(){self[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x156'));});referSubscriber['on'](_0x2b52('0x157'),function(cause){self[_0x2b52('0x11')]['error'](_0x2b52('0x158')+cause);});referSubscriber['on'](_0x2b52('0x108'),function(cause){self['log'][_0x2b52('0x1d')](_0x2b52('0x159')+cause);});}[_0x2b52('0x15a')](media_file_id,hangup_after=![]){if(!this[_0x2b52('0xca')]['_options'][_0x2b52('0x35')]){throw new Exceptions[(_0x2b52('0x66'))](_0x2b52('0x15b'));}this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x15c')+media_file_id+_0x2b52('0x15d')+hangup_after);const p=this[_0x2b52('0xca')][_0x2b52('0x5')]['fireEvent'](_0x2b52('0x15e'),{'call_uuid':this[_0x2b52('0x4c')],'call_command':_0x2b52('0x15a'),'media_file_id':media_file_id,'hangup_after':hangup_after});if(hangup_after){this['_phone'][_0x2b52('0x9')][_0x2b52('0x91')]=null;p[_0x2b52('0x1c')](()=>{this['_setSessionState'](_0x2b52('0x15f'));});}return p;}[_0x2b52('0x160')](mode=0x0){if(!this[_0x2b52('0x12b')]==='LISTEN'){throw new Exceptions[(_0x2b52('0x66'))](_0x2b52('0x161'));}if(mode<0x0||mode>0x2){throw new Exceptions['InvalidOptions'](_0x2b52('0x162'));}let t_dtmf_mode;if(mode===0x0){t_dtmf_mode=0x0;}if(mode===0x1){t_dtmf_mode=0x2;}if(mode===0x2){t_dtmf_mode=0x3;}this['sendDTMF'](t_dtmf_mode,![]);this['_whisperMode']=mode;this[_0x2b52('0x163')]();}[_0x2b52('0x164')](){const self=this;if(!this['_durationUpdTimerObj']){this[_0x2b52('0xbc')]=setInterval(function(){const activeDuration=self[_0x2b52('0xba')]?Date[_0x2b52('0x106')]()-self[_0x2b52('0xba')]:null;const e={'uuid':self[_0x2b52('0xb2')],'beginTime':self['_callBeginTime'],'answerTime':self[_0x2b52('0xba')],'endTime':self[_0x2b52('0xbb')],'duration':Date[_0x2b52('0x106')]()-self[_0x2b52('0xb9')],'durationStr':Tools[_0x2b52('0xab')](Date[_0x2b52('0x106')]()-self[_0x2b52('0xb9')]),'activeDuration':activeDuration,'activeDurationStr':activeDuration?Tools[_0x2b52('0xab')](activeDuration):''};try{self['emit']('callDurationUpdate',e);}catch(_0x84d80f){self[_0x2b52('0x11')][_0x2b52('0x1d')](_0x2b52('0x165')+_0x84d80f);}},0x3e8);}}[_0x2b52('0xf8')](){if(!this[_0x2b52('0x166')]){const emptyReport={'outboundPacketsSent':0x0,'outboundBytesSent':0x0,'outboundPacketsLost':0x0,'outboundJitter':0x0,'inboundPacketsReceived':0x0,'inboundBytesReceived':0x0,'inboundPacketsLost':0x0,'inboundJitter':0x0,'roundTripTime':0x0};this[_0x2b52('0xc2')]=Object['assign']({},emptyReport);this['_rtcpStatsTimer']=setInterval(()=>{this[_0x2b52('0xb3')]['_connection'][_0x2b52('0x167')]()[_0x2b52('0x1c')](data=>{let totalReport=Object[_0x2b52('0x23')]({},emptyReport);let deltaReport=Object[_0x2b52('0x23')]({},emptyReport);for(let report of data[_0x2b52('0x168')]()){switch(report[_0x2b52('0xef')]){case _0x2b52('0x169'):totalReport[_0x2b52('0x16a')]=report[_0x2b52('0x16b')];deltaReport['outboundPacketsSent']=report[_0x2b52('0x16b')]-this['_currentReport'][_0x2b52('0x16a')];totalReport[_0x2b52('0x16c')]=report[_0x2b52('0x16d')];deltaReport['outboundBytesSent']=report[_0x2b52('0x16d')]-this[_0x2b52('0xc2')][_0x2b52('0x16c')];break;case _0x2b52('0x16e'):totalReport[_0x2b52('0x16f')]=report['packetsReceived'];deltaReport[_0x2b52('0x16f')]=report[_0x2b52('0x170')]-this[_0x2b52('0xc2')][_0x2b52('0x16f')];totalReport['inboundBytesReceived']=report[_0x2b52('0x171')];deltaReport[_0x2b52('0x172')]=report[_0x2b52('0x171')]-this[_0x2b52('0xc2')][_0x2b52('0x172')];totalReport[_0x2b52('0x173')]=report[_0x2b52('0x174')];deltaReport[_0x2b52('0x173')]=report[_0x2b52('0x174')]-this[_0x2b52('0xc2')]['inboundPacketsLost'];totalReport[_0x2b52('0x175')]=report[_0x2b52('0x176')]*0x3e8;deltaReport['inboundJitter']=report[_0x2b52('0x176')]*0x3e8;break;case _0x2b52('0x177'):totalReport[_0x2b52('0x178')]=report[_0x2b52('0x174')];deltaReport[_0x2b52('0x178')]=report[_0x2b52('0x174')]-this[_0x2b52('0xc2')][_0x2b52('0x178')];totalReport[_0x2b52('0x179')]=report[_0x2b52('0x176')]*0x3e8;deltaReport['outboundJitter']=report[_0x2b52('0x176')]*0x3e8;totalReport[_0x2b52('0x17a')]=report[_0x2b52('0x17a')]*0x3e8;deltaReport[_0x2b52('0x17a')]=report[_0x2b52('0x17a')]*0x3e8;break;default:break;}}this[_0x2b52('0xc2')]=this[_0x2b52('0x17b')](totalReport);if(totalReport[_0x2b52('0x17a')]){const finalReport={'total':this[_0x2b52('0xc2')],'delta':this[_0x2b52('0x17b')](deltaReport)};try{this[_0x2b52('0x9a')](_0x2b52('0x17c'),finalReport);}catch(_0x5a116e){this[_0x2b52('0x11')]['error'](_0x2b52('0x17d')+_0x5a116e);}}});},0x1388);}}[_0x2b52('0x17b')](report){report[_0x2b52('0x17e')]=report['outboundPacketsLost']/report[_0x2b52('0x16a')];report[_0x2b52('0x17f')]=report['inboundPacketsLost']/report[_0x2b52('0x16f')];report[_0x2b52('0x180')]=report[_0x2b52('0x17a')]+(report[_0x2b52('0x175')]+report[_0x2b52('0x179')])+0xa;const lossRate=(report[_0x2b52('0x17e')]+report[_0x2b52('0x17f')])*0x64;const lossEffect=0x5f*lossRate/(lossRate+0xa);const latencyEffect=report[_0x2b52('0x180')]*0.1;report[_0x2b52('0x181')]=Math['max'](0x0,0x64-lossEffect-latencyEffect);report['mos']=0x1+0.035*report['rFactor']+0.000007*report[_0x2b52('0x181')]*(report['rFactor']-0x3c)*(0x64-report[_0x2b52('0x181')]);switch(!![]){case report['rFactor']<0x32:report['qualityString']=_0x2b52('0x182');break;case report['rFactor']<0x46:report[_0x2b52('0x183')]='Poor';break;case report[_0x2b52('0x181')]<0x50:report['qualityString']=_0x2b52('0x184');break;case report[_0x2b52('0x181')]<0x5a:report[_0x2b52('0x183')]=_0x2b52('0x185');break;case report[_0x2b52('0x181')]<=0x64:report[_0x2b52('0x183')]=_0x2b52('0x186');break;default:report[_0x2b52('0x183')]=_0x2b52('0x187');}return report;}[_0x2b52('0x51')](state,info=null){this['log'][_0x2b52('0x16')](_0x2b52('0x188')+state);if(info){this[_0x2b52('0x11')][_0x2b52('0x16')](info);}this['_sessionState']=state;try{this[_0x2b52('0x9a')](_0x2b52('0x189'),Object[_0x2b52('0x23')]({'state':state,'uuid':this['_callUUID']},info));}catch(_0x57aa89){this[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20sessionStateChange\x20event:'+_0x57aa89);}if(state===_0x2b52('0x107')){this[_0x2b52('0xbf')]=this['_manualDisposition']||_0x2b52('0x18a');this[_0x2b52('0x18b')]();}if(state==='FAILED'){if(info['cause']===_0x2b52('0x18c')){this[_0x2b52('0xbf')]=_0x2b52('0x18d');if(this[_0x2b52('0xca')][_0x2b52('0x73')][_0x2b52('0x18e')]){this[_0x2b52('0xca')]['_startRepeatTone'](ST_TEMP_UNAVAIL);}}if(info['cause']==='Not\x20Found'){this['_callDisposition']=_0x2b52('0x18f');if(this['_phone']['options'][_0x2b52('0x18e')]){this[_0x2b52('0xca')]['_startRepeatTone'](ST_INVALID_NUMBER);}}if(info['cause']===_0x2b52('0x190')){this[_0x2b52('0xbf')]=this[_0x2b52('0x125')]||_0x2b52('0x191');}if(info['cause']===_0x2b52('0x192')){if(this['direction']==='INBOUND'){this[_0x2b52('0xbf')]=_0x2b52('0x193');}else{this[_0x2b52('0xbf')]=_0x2b52('0x194');}}if(info[_0x2b52('0x10c')]===_0x2b52('0x4f')){this[_0x2b52('0xbf')]=_0x2b52('0x195');if(this['_phone'][_0x2b52('0x73')][_0x2b52('0x18e')]){this[_0x2b52('0xca')]['_startRepeatTone'](ST_BUSY);}}if(this['_webRTCSession'][_0x2b52('0x12b')]===_0x2b52('0x12d')){}this[_0x2b52('0x18b')]();}}['_callFinished'](){this[_0x2b52('0x11')][_0x2b52('0x19')](_0x2b52('0x196'));this[_0x2b52('0x197')]();clearInterval(this[_0x2b52('0xbc')]);clearInterval(this['_rtcpStatsTimer']);this['_phone'][_0x2b52('0x198')](this);}[_0x2b52('0xe1')](timeout){this['log']['debug'](_0x2b52('0x199')+timeout);this[_0x2b52('0xc3')]=timeout;}['_fireRecordingStateEvent'](){try{this[_0x2b52('0x9a')](_0x2b52('0x140'),{'state':this[_0x2b52('0xb7')],'error':this[_0x2b52('0xb8')]});}catch(_0x4eaf6e){this[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20recording\x20state\x20change\x20event:\x20'+_0x4eaf6e);}}['_fireMuteStateEvent'](){try{this['emit'](_0x2b52('0x19a'),{'state':this[_0x2b52('0xb6')]});}catch(_0x1288e8){this[_0x2b52('0x11')][_0x2b52('0x1d')]('Exception\x20in\x20mute\x20state\x20change\x20event:\x20'+_0x1288e8);}}[_0x2b52('0x111')](){try{this['emit'](_0x2b52('0x19b'),{'state':this[_0x2b52('0xb5')]});}catch(_0x2fc4e0){this['log'][_0x2b52('0x1d')](_0x2b52('0x19c')+_0x2fc4e0);}}[_0x2b52('0x163')](){try{this[_0x2b52('0x9a')](_0x2b52('0x19d'),{'mode':this['_whisperMode']});}catch(_0x1cc8a1){this['log'][_0x2b52('0x1d')](_0x2b52('0x19e')+_0x1cc8a1);}}[_0x2b52('0x197')](){let e;e={'uuid':this[_0x2b52('0xb2')],'direction':this[_0x2b52('0x12b')],'disposition':this[_0x2b52('0xbf')],'originatingNumber':this[_0x2b52('0xbd')],'destinationNumber':this[_0x2b52('0xbe')],'duration':this[_0x2b52('0xbb')]-this[_0x2b52('0xb9')],'answerDuration':this[_0x2b52('0xba')]?this[_0x2b52('0xba')]-this[_0x2b52('0xb9')]:null,'activeDuration':this[_0x2b52('0xba')]?this[_0x2b52('0xbb')]-this[_0x2b52('0xba')]:null,'startTime':new Date(this[_0x2b52('0xb9')])['toISOString'](),'endTime':new Date(this[_0x2b52('0xbb')])[_0x2b52('0x19f')](),'answerTime':this['_callAnswerTime']?new Date(this[_0x2b52('0xba')])[_0x2b52('0x19f')]():null};e['durationStr']=Tools['createDurationString'](e['duration']);e[_0x2b52('0xad')]=e[_0x2b52('0xa9')]?Tools['createDurationString'](e[_0x2b52('0xa9')]):'';e[_0x2b52('0xae')]=e[_0x2b52('0xaf')]?Tools['createDurationString'](e[_0x2b52('0xaf')]):'';e[_0x2b52('0x1a0')]=this['_currentReport'];try{this['emit'](_0x2b52('0x1a1'),e);}catch(_0x5dc5dd){this[_0x2b52('0x11')]['error'](_0x2b52('0x1a2')+_0x5dc5dd);}}['_handleRemoteAudio'](session){this[_0x2b52('0xca')][_0x2b52('0x8c')]();const self=this;session[_0x2b52('0x11e')][_0x2b52('0x1a3')]=function(event){self[_0x2b52('0x11')]['debug'](_0x2b52('0x1a4'));self['log'][_0x2b52('0x16')](event);self[_0x2b52('0xca')][_0x2b52('0x9')][_0x2b52('0x91')]=event['streams'][0x0];};}}
|
|
1
|
+
const a0_0x35184d=a0_0x2d29;(function(_0x1a3c78,_0x1542f9){const _0x2ebe6c=a0_0x2d29,_0x53f287=_0x1a3c78();while(!![]){try{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);if(_0xfed1c5===_0x1542f9)break;else _0x53f287['push'](_0x53f287['shift']());}catch(_0x566ab1){_0x53f287['push'](_0x53f287['shift']());}}}(a0_0x29ff,0x44d7e));function a0_0x2d29(_0x3cab44,_0x4a422b){const _0x29ff42=a0_0x29ff();return a0_0x2d29=function(_0x2d29a8,_0x31a60e){_0x2d29a8=_0x2d29a8-0xc4;let _0x1624f7=_0x29ff42[_0x2d29a8];return _0x1624f7;},a0_0x2d29(_0x3cab44,_0x4a422b);}import a0_0x4095b9 from'events';import a0_0x2f050e from'jssip';import{Logger,Exceptions,Tools}from'@telegenta/common';import{EventClient}from'./event-client';import a0_0x5d67e8 from'camelcase-keys';const options={'wssServer':a0_0x35184d(0x272),'eventServer':a0_0x35184d(0x11b),'provisionToken':null,'authorizationUsername':null,'password':null,'callToken':null,'register':!![],'iceGatherTimeout':0xbb8,'playSignalTones':!![],'logger':null,'logLevel':0x3,'connectEventService':![],'useCallDataInfoEvent':![],'toneVolume':0.3,'autoBusyIncoming':!![],'autoRemoveSessionTime':0xbb8,'playRingOnIncoming':!![],'playCallInitializedTone':![]},DTMF_FREQUENCY_TABLE={'1':[0x4b9,0x2b9],'2':[0x538,0x2b9],'3':[0x5c5,0x2b9],'a':[0x661,0x2b9],'4':[0x4b9,0x302],'5':[0x538,0x302],'6':[0x5c5,0x302],'b':[0x661,0x302],'7':[0x4b9,0x354],'8':[0x538,0x354],'9':[0x5c5,0x354],'c':[0x661,0x354],'*':[0x4b9,0x3ad],'0':[0x538,0x3ad],'#':[0x5c5,0x3ad],'d':[0x661,0x3ad]},ST_TEMP_UNAVAIL=[{'d':0xfa,'f1':0x1a9,'f2':0x0,'g':0xfa}],ST_BUSY=[{'d':0x1f4,'f1':0x1a9,'f2':0x0,'g':0x1f4}],ST_INVALID_NUMBER=[{'d':0x14d,'f1':0x3b6,'f2':0x0,'g':0x0},{'d':0x14d,'f1':0x578,'f2':0x0,'g':0x0},{'d':0x14d,'f1':0x708,'f2':0x0,'g':0x3e8}],ST_CALLINIT=[{'d':0xc8,'f1':0x1f4,'f2':0x0,'g':0x0},{'d':0xc8,'f1':0x2bc,'f2':0x0,'g':0x1388}],ST_RINGBACK=[{'d':0x3e8,'f1':0x1a9,'f2':0x0,'g':0xfa0}],ST_INCOMING=[{'d':0x96,'f1':0x190,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x258,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x190,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x258,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x190,'f2':0x0,'g':0x0},{'d':0x96,'f1':0x258,'f2':0x0,'g':0xbb8}];function a0_0x29ff(){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'];a0_0x29ff=function(){return _0x1775a6;};return a0_0x29ff();}export class Phone extends a0_0x4095b9{constructor(_0xb08040=null){const _0x3cbff1=a0_0x35184d;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 Logger[(_0x3cbff1(0x17c))](Logger[_0x3cbff1(0x166)][_0x3cbff1(0x113)]),this[_0x3cbff1(0x277)][_0x3cbff1(0x179)]===Logger[_0x3cbff1(0x166)]['DEBUG']?a0_0x2f050e['debug'][_0x3cbff1(0x170)](_0x3cbff1(0x1df)):a0_0x2f050e[_0x3cbff1(0xcf)][_0x3cbff1(0x170)](_0x3cbff1(0x1df));}[a0_0x35184d(0x26c)](){const _0x38669a=a0_0x35184d;this[_0x38669a(0x277)]['info']('Get\x20media\x20permission');const _0x47ad25=this,_0x4bad14={'audio':!![],'video':![]};return new Promise(function(_0x444a23,_0x113cb4){const _0x5113c5=_0x38669a;navigator[_0x5113c5(0x1e6)][_0x5113c5(0x15c)](_0x4bad14)[_0x5113c5(0x1a5)](()=>{const _0x21627b=_0x5113c5;_0x47ad25[_0x21627b(0x15f)]=!![],_0x47ad25[_0x21627b(0x1e8)]=![],_0x47ad25[_0x21627b(0x277)][_0x21627b(0x258)]('Media\x20permission\x20granted'),_0x444a23();},_0x1dca8f=>{const _0x465e28=_0x5113c5;_0x47ad25['_mediaPermission']=![],_0x47ad25[_0x465e28(0x1e8)]=!![],_0x47ad25['log']['error']('Denied\x20media\x20permission:\x20'+_0x1dca8f),_0x113cb4(_0x1dca8f);});});}[a0_0x35184d(0xd2)](_0x2c9d9e){const _0x3e19bf=a0_0x35184d;this[_0x3e19bf(0x12a)]();this['_isStarted']&&(this[_0x3e19bf(0x277)][_0x3e19bf(0x250)](_0x3e19bf(0x18b)),this['stop']());this['_options']=Object['assign'](options,_0x2c9d9e),this['_initToneGenerator']();if(this[_0x3e19bf(0x154)][_0x3e19bf(0x1ea)]){let _0x424c81=null;try{_0x424c81=JSON[_0x3e19bf(0x132)](atob(this[_0x3e19bf(0x154)][_0x3e19bf(0x1ea)]));}catch(_0x103359){throw new Exceptions[(_0x3e19bf(0x194))](_0x3e19bf(0x1ea),'Invalid\x20token');}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)];}else{this['log'][_0x3e19bf(0x258)](_0x3e19bf(0x1b3));if(!this[_0x3e19bf(0x154)][_0x3e19bf(0x236)])throw new Exceptions[(_0x3e19bf(0x194))](_0x3e19bf(0x236),_0x3e19bf(0x11f));if(!this[_0x3e19bf(0x154)][_0x3e19bf(0x14b)])throw new Exceptions[(_0x3e19bf(0x194))]('password','Missing\x20password');if(!this['_options'][_0x3e19bf(0x1ba)])throw new Exceptions[(_0x3e19bf(0x194))]('callToken',_0x3e19bf(0xd4));}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']=!![]);this[_0x3e19bf(0x154)][_0x3e19bf(0x1ac)]&&(this[_0x3e19bf(0x18d)]=new EventClient(this[_0x3e19bf(0x277)]),this[_0x3e19bf(0x18d)][_0x3e19bf(0x1eb)](this[_0x3e19bf(0x154)]['eventServer'])['then'](()=>{const _0x47dad1=_0x3e19bf;this['log'][_0x47dad1(0x258)](_0x47dad1(0x1d6));if(this[_0x47dad1(0x154)][_0x47dad1(0x1a1)]){let _0x2ecd0c={'event_name':_0x47dad1(0x18e),'call_token':this[_0x47dad1(0x154)][_0x47dad1(0x1ba)]};this[_0x47dad1(0x18d)][_0x47dad1(0x138)](_0x2ecd0c,_0x314bc4=>{const _0x16d66a=_0x47dad1;try{this['log']['debug'](_0x16d66a(0x121)),this[_0x16d66a(0x277)][_0x16d66a(0xcf)](_0x314bc4),this['_fireCallDataInfoEvent'](_0x314bc4);}catch(_0x5d3bda){this[_0x16d66a(0x277)]['error'](_0x16d66a(0x1ee)+_0x5d3bda);}})[_0x47dad1(0x1a5)](_0x58f97d=>{const _0x2295a7=_0x47dad1;this['log'][_0x2295a7(0x258)](_0x2295a7(0x23e)+_0x58f97d);},_0x14ce53=>{const _0x4f46ae=_0x47dad1;this[_0x4f46ae(0x277)][_0x4f46ae(0x247)](_0x4f46ae(0x1fd)+_0x14ce53);});}},_0x278fa6=>{const _0x4db0c2=_0x3e19bf;this[_0x4db0c2(0x277)][_0x4db0c2(0x247)](_0x4db0c2(0x1f2)+_0x278fa6);}));let _0x504113=null;try{_0x504113=new a0_0x2f050e[(_0x3e19bf(0x270))](this[_0x3e19bf(0x154)]['wssServer']);}catch(_0x55dea5){throw new Exceptions[(_0x3e19bf(0x169))](_0x3e19bf(0x26e)+_0x55dea5);}this[_0x3e19bf(0x277)][_0x3e19bf(0x258)](_0x3e19bf(0x225)),this[_0x3e19bf(0x277)][_0x3e19bf(0xcf)](this[_0x3e19bf(0x154)]),this['_UA']=new a0_0x2f050e['UA']({'sockets':[_0x504113],'authorization_user':this['_options'][_0x3e19bf(0x236)],'password':this['_options'][_0x3e19bf(0x14b)],'register':this[_0x3e19bf(0x154)][_0x3e19bf(0x276)],'display_name':this[_0x3e19bf(0x154)][_0x3e19bf(0x236)],'uri':this[_0x3e19bf(0x154)][_0x3e19bf(0x236)]+_0x3e19bf(0x17b),'session_timers':![]});const _0x48b7b2=this;this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0x173),function(_0x42f2f5){const _0x404c8b=_0x3e19bf;_0x48b7b2[_0x404c8b(0x277)]['debug'](_0x404c8b(0x1db));if(_0x42f2f5[_0x404c8b(0x1e0)]===_0x404c8b(0xc4)){const _0x5e4924=new Session(_0x48b7b2);_0x5e4924[_0x404c8b(0x196)](_0x42f2f5);_0x48b7b2[_0x404c8b(0x154)]['playRingOnIncoming']&&_0x48b7b2[_0x404c8b(0x157)](ST_INCOMING);if(_0x48b7b2[_0x404c8b(0x154)][_0x404c8b(0xdd)]){if(Object[_0x404c8b(0x259)](_0x48b7b2[_0x404c8b(0x129)])['length']>0x0){_0x48b7b2[_0x404c8b(0x277)][_0x404c8b(0x258)]('Autorejecting\x20incoming\x20call\x20'+_0x5e4924[_0x404c8b(0x108)]+_0x404c8b(0x144)),_0x5e4924[_0x404c8b(0x187)](0x1e6,'Busy');return;}else _0x48b7b2['log']['debug']('There\x20are\x20no\x20other\x20sessions,\x20adding\x20incoming\x20call');}_0x48b7b2[_0x404c8b(0x17e)](_0x5e4924),_0x5e4924[_0x404c8b(0x1e1)](_0x404c8b(0x192)),_0x48b7b2[_0x404c8b(0x140)](_0x5e4924);}}),this[_0x3e19bf(0x15e)]['on']('connecting',function(){const _0x4e3946=_0x3e19bf;_0x48b7b2[_0x4e3946(0x1b9)](_0x4e3946(0x251));}),this['_UA']['on'](_0x3e19bf(0x210),function(){const _0x90aac=_0x3e19bf;_0x48b7b2[_0x90aac(0x1b9)](_0x90aac(0x151));}),this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0xdb),function(){const _0x38734c=_0x3e19bf;_0x48b7b2[_0x38734c(0x1b9)](_0x38734c(0x244));}),this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0x14e),function(){_0x48b7b2['_setConnectionState']('REGISTERED');}),this[_0x3e19bf(0x15e)]['on'](_0x3e19bf(0x10a),function(){const _0x41d417=_0x3e19bf;_0x48b7b2[_0x41d417(0x1b9)](_0x41d417(0x265));}),this['_UA']['on']('registrationFailed',function(){const _0x42aab0=_0x3e19bf;_0x48b7b2[_0x42aab0(0x1b9)](_0x42aab0(0xf8));}),this[_0x3e19bf(0x15e)]['start'](),this['_isStarted']=!![],this['log'][_0x3e19bf(0x258)](_0x3e19bf(0x168));}[a0_0x35184d(0x1bb)](){const _0x5f53d7=a0_0x35184d;if(!this[_0x5f53d7(0x1c8)])throw new Exceptions[(_0x5f53d7(0x14c))]('Phone\x20is\x20not\x20started');this['_UA'][_0x5f53d7(0x1ae)](),this[_0x5f53d7(0x15e)][_0x5f53d7(0x1bb)](),delete this[_0x5f53d7(0x15e)];if(!this[_0x5f53d7(0x18d)]){this[_0x5f53d7(0x277)][_0x5f53d7(0xcf)]('Event\x20client\x20not\x20running,\x20not\x20stopping');return;}try{this[_0x5f53d7(0x18d)][_0x5f53d7(0x1d1)](),delete this[_0x5f53d7(0x18d)];}catch(_0x2f9732){this[_0x5f53d7(0x277)][_0x5f53d7(0x250)](_0x5f53d7(0x106));}this[_0x5f53d7(0x1c8)]=![],this[_0x5f53d7(0x277)][_0x5f53d7(0x258)](_0x5f53d7(0x19c));}[a0_0x35184d(0x274)](_0x3c9f9f,_0x290d21={}){const _0x4acb00=a0_0x35184d;if(!this['_isStarted'])throw new Exceptions[(_0x4acb00(0x14c))](_0x4acb00(0x131));if(this['_checkForConnectingCalls']())throw Exceptions['NotAllowed'](_0x4acb00(0x149));this[_0x4acb00(0x175)]();const _0x1e0866=Object[_0x4acb00(0x17f)]({'record':![],'maximumCallCost':0x0,'answerCallTimeout':0x0,'explicitCallerId':null,'explicitShortCallerId':null,'metaInfo':null,'_isListenCall':![]},_0x290d21);_0x3c9f9f=_0x3c9f9f['trim']()[_0x4acb00(0x20e)](/ |\(|\)/g,''),this['log'][_0x4acb00(0x258)](_0x4acb00(0x1ef)+_0x3c9f9f);let _0x7def15=new Session(this);return _0x7def15[_0x4acb00(0x199)](_0x3c9f9f,_0x1e0866),this[_0x4acb00(0x17e)](_0x7def15),_0x7def15;}[a0_0x35184d(0x13a)](_0x522c08){const _0x162aa5=a0_0x35184d,_0x1b67e0=_0x522c08[_0x162aa5(0x109)]('@');let _0x55ec63=_0x1b67e0[0x0],_0x133dda='sip:'+_0x1b67e0[0x1];return this['log'][_0x162aa5(0xcf)]('Initiating\x20listen\x20to\x20call\x20with\x20uuid\x20'+_0x55ec63+_0x162aa5(0x219)+_0x133dda),this[_0x162aa5(0x274)]('listen-'+_0x55ec63,{'mediaSwitchURI':_0x133dda,'_isListenCall':!![]});}[a0_0x35184d(0x1ad)](_0x505885){const _0x2921e4=a0_0x35184d;for(let _0x1ae5f5 in this[_0x2921e4(0x129)]){if(this[_0x2921e4(0x129)][_0x2921e4(0x10c)](_0x1ae5f5)){if(this[_0x2921e4(0x129)][_0x1ae5f5][_0x2921e4(0x108)]===_0x505885)return this[_0x2921e4(0x129)][_0x1ae5f5];}}return null;}get[a0_0x35184d(0x22c)](){const _0x4d58db=a0_0x35184d;return this[_0x4d58db(0x154)];}get[a0_0x35184d(0x24c)](){const _0x9589bf=a0_0x35184d;let _0x379812=[];for(let _0x2a145d in this['_activeSessions']){this[_0x9589bf(0x129)]['hasOwnProperty'](_0x2a145d)&&_0x379812[_0x9589bf(0xfd)](this[_0x9589bf(0x129)][_0x2a145d]);}return _0x379812;}get['hasMediaPermission'](){return this['_mediaPermission'];}get[a0_0x35184d(0x24b)](){const _0x1c346b=a0_0x35184d;return this[_0x1c346b(0x1e8)];}get['isStarted'](){const _0x564d34=a0_0x35184d;return this[_0x564d34(0x1c8)];}get[a0_0x35184d(0x25f)](){const _0x4cd77b=a0_0x35184d;return Tools[_0x4cd77b(0x1ca)]()||Tools['browserIsFirefox']()||Tools['browserIsOpera']()||Tools['browserIsSafari']();}get[a0_0x35184d(0x209)](){const _0x2bf85b=a0_0x35184d;return this[_0x2bf85b(0x1f7)];}[a0_0x35184d(0x158)](_0x1bd8e5,_0x2fc88c,_0x990bef=0x0,_0x2eeacb=null){const _0x13df61=a0_0x35184d;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)];const _0x531960=this;this[_0x13df61(0x223)]=setTimeout(function(){const _0x5271f8=_0x13df61;_0x531960[_0x5271f8(0x213)](),_0x2eeacb&&_0x2eeacb();},_0x1bd8e5);}[a0_0x35184d(0x213)](){const _0x512f0e=a0_0x35184d;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)]);}['_startRepeatTone'](_0x5138b6){const _0x31991c=a0_0x35184d;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)]();}[a0_0x35184d(0x1ce)](){const _0x551500=a0_0x35184d;if(this[_0x551500(0xd5)]){this[_0x551500(0x277)][_0x551500(0xcf)](_0x551500(0x233)+this[_0x551500(0x159)]);let _0xa278a7=this[_0x551500(0x136)][this[_0x551500(0x159)]];this[_0x551500(0x159)]++;this[_0x551500(0x159)]===this[_0x551500(0x136)][_0x551500(0x200)]&&(this[_0x551500(0x159)]=0x0);const _0x581b1f=this;this[_0x551500(0x158)](_0xa278a7['d'],_0xa278a7['f1'],_0xa278a7['f2'],function(){const _0x1496f8=_0x551500;setTimeout(_0x581b1f[_0x1496f8(0x1ce)][_0x1496f8(0xfa)](_0x581b1f),_0xa278a7['g']);});}}[a0_0x35184d(0xe5)](){const _0x4ab483=a0_0x35184d;this[_0x4ab483(0xd5)]&&(this[_0x4ab483(0x277)][_0x4ab483(0x258)](_0x4ab483(0x1b7)),this[_0x4ab483(0xd5)]=![],this[_0x4ab483(0x213)]());}[a0_0x35184d(0x148)](){const _0x12e171=a0_0x35184d,_0x2400c2=window['AudioContext']||window['webkitAudioContext']||![];if(!_0x2400c2)throw new Exceptions[(_0x12e171(0x16d))](_0x12e171(0x208));const _0x4083df=new _0x2400c2();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)]();}[a0_0x35184d(0x175)](){const _0x422c16=a0_0x35184d;this['log'][_0x422c16(0x258)](_0x422c16(0x141));if(this[_0x422c16(0xfe)]())throw Exceptions[_0x422c16(0x16d)]('A\x20session\x20is\x20currently\x20connecting');for(let _0x4da42e in this[_0x422c16(0x129)]){if(this[_0x422c16(0x129)][_0x422c16(0x10c)](_0x4da42e)){let _0x38e2b6=this['_activeSessions'][_0x4da42e];_0x38e2b6[_0x422c16(0xd8)]===_0x422c16(0x103)&&_0x38e2b6[_0x422c16(0x1c7)]();}}}[a0_0x35184d(0x17e)](_0x2fbd93){const _0x145d82=a0_0x35184d;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)]);try{this[_0x145d82(0x1af)](_0x145d82(0x15d),{'session':_0x2fbd93});}catch(_0x295d5d){this[_0x145d82(0x277)][_0x145d82(0x247)](_0x145d82(0xcc)+_0x295d5d);}}[a0_0x35184d(0x189)](_0x264167){const _0x157e01=a0_0x35184d;this[_0x157e01(0x277)][_0x157e01(0x258)]('Removing\x20session\x20'+_0x264167[_0x157e01(0x105)]+':\x20'+_0x264167[_0x157e01(0x108)]);try{this[_0x157e01(0x1af)](_0x157e01(0x125),{'session':_0x264167});}catch(_0x26e238){this[_0x157e01(0x277)][_0x157e01(0x247)](_0x157e01(0x139)+_0x26e238);}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)]();}['_sessionTerminated'](_0x387d07){const _0x494738=a0_0x35184d;this[_0x494738(0x277)]['debug'](_0x494738(0x190)+_0x387d07[_0x494738(0x108)]+'\x20terminated,\x20removing\x20in\x20'+this['_options'][_0x494738(0x25e)]+_0x494738(0x1c5));const _0x41f3d7=this;setTimeout(function(){_0x41f3d7['_removeSession'](_0x387d07);},this['_options']['autoRemoveSessionTime']);}[a0_0x35184d(0xfe)](){const _0x1d889c=a0_0x35184d;for(let _0x1f4fc6 in this[_0x1d889c(0x129)]){if(this[_0x1d889c(0x129)][_0x1d889c(0x10c)](_0x1f4fc6)){let _0x5e5385=this[_0x1d889c(0x129)][_0x1f4fc6];if(_0x5e5385[_0x1d889c(0xd8)]==='INITIALIZING'||_0x5e5385[_0x1d889c(0xd8)]===_0x1d889c(0x1f0)||_0x5e5385[_0x1d889c(0xd8)]===_0x1d889c(0x10e)||_0x5e5385['state']===_0x1d889c(0x192))return!![];}}return![];}[a0_0x35184d(0x1b9)](_0x1ddbb5){const _0x3effc4=a0_0x35184d;this['log'][_0x3effc4(0x258)](_0x3effc4(0x114)+_0x1ddbb5),this[_0x3effc4(0x18f)]=_0x1ddbb5;try{this[_0x3effc4(0x1af)](_0x3effc4(0x156),{'state':_0x1ddbb5});}catch(_0x2bc6dc){this[_0x3effc4(0x277)][_0x3effc4(0x247)](_0x3effc4(0x107)+_0x2bc6dc);}}['_fireIncomingCallEvent'](_0x353f5b){const _0x5d5410=a0_0x35184d;try{this[_0x5d5410(0x1af)](_0x5d5410(0x20f),_0x353f5b);}catch(_0x2389f8){this['log'][_0x5d5410(0x247)](_0x5d5410(0x10d)+_0x2389f8);}}[a0_0x35184d(0x184)](_0xedd94a=null){const _0x421366=a0_0x35184d;let _0x36d1fa;_0x36d1fa=a0_0x5d67e8(_0xedd94a),_0x36d1fa['recordings']=a0_0x5d67e8(_0xedd94a[_0x421366(0x254)]),_0x36d1fa[_0x421366(0x1a4)]=_0x36d1fa[_0x421366(0x1a4)]*0x3e8,_0x36d1fa['answerDuration']=_0x36d1fa['answerDuration']*0x3e8,_0x36d1fa['activeDuration']=_0x36d1fa[_0x421366(0x1fa)]*0x3e8,_0x36d1fa['durationStr']=Tools[_0x421366(0x16b)](_0x36d1fa[_0x421366(0x1a4)]),_0x36d1fa[_0x421366(0xc8)]=_0x36d1fa[_0x421366(0x12d)]?Tools[_0x421366(0x16b)](_0x36d1fa[_0x421366(0x12d)]):'',_0x36d1fa[_0x421366(0xf7)]=_0x36d1fa[_0x421366(0x1fa)]?Tools[_0x421366(0x16b)](_0x36d1fa[_0x421366(0x1fa)]):'';try{this[_0x421366(0x1af)](_0x421366(0x102),_0x36d1fa);}catch(_0x3259ca){this[_0x421366(0x277)][_0x421366(0x247)]('Exception\x20in\x20callDataInfo\x20event:\x20'+_0x3259ca);}}['_checkMediaPermission'](){const _0x46efd0=a0_0x35184d;if(!this[_0x46efd0(0x15f)])throw new Exceptions[(_0x46efd0(0xf4))]();}}export class Session extends a0_0x4095b9{constructor(_0xc7e78a){const _0x33de8e=a0_0x35184d;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;}['newOutboundSession'](_0x489345,_0x1ad14a){const _0x41b825=a0_0x35184d;this['_callUUID']=Tools[_0x41b825(0x26a)](),this[_0x41b825(0x277)][_0x41b825(0xcf)](_0x41b825(0x13e)+_0x489345+'\x20['+this['_callUUID']+']'),this[_0x41b825(0xd3)]=_0x489345;let _0x472d3b={'mediaConstraints':{'audio':!![],'video':![]},'pcConfig':{'iceServers':[{'urls':[_0x41b825(0x167)]}]},'extraHeaders':[_0x41b825(0x1bd)+this[_0x41b825(0x171)][_0x41b825(0x22c)][_0x41b825(0x1ba)],_0x41b825(0x162)+this[_0x41b825(0x14a)],_0x41b825(0x195)+_0x1ad14a[_0x41b825(0x1a2)]]};_0x1ad14a[_0x41b825(0x1e2)]&&_0x472d3b[_0x41b825(0x226)][_0x41b825(0xfd)]('X-CID-Number-Id:\x20'+_0x1ad14a['explicitCallerId']);_0x1ad14a[_0x41b825(0x224)]&&_0x472d3b[_0x41b825(0x226)][_0x41b825(0xfd)]('X-Short-CID-Id:\x20'+_0x1ad14a[_0x41b825(0x224)]);_0x1ad14a['metaInfo']&&_0x472d3b['extraHeaders']['push'](_0x41b825(0x1e7)+encodeURI(_0x1ad14a['metaInfo'][_0x41b825(0x227)]()[_0x41b825(0x26b)](0x0,0xff)));if(_0x1ad14a[_0x41b825(0x1b4)]){if(isNaN(_0x1ad14a[_0x41b825(0x1b4)]))throw new Exceptions['InvalidParameter'](_0x41b825(0x172));this[_0x41b825(0x277)][_0x41b825(0xcf)](_0x41b825(0x1de)+_0x1ad14a['record']+_0x41b825(0x246)),_0x472d3b['extraHeaders'][_0x41b825(0xfd)](_0x41b825(0x1f9)+_0x1ad14a[_0x41b825(0x1b4)]),this[_0x41b825(0x117)]=!![];}else this['_isRecording']=![];this[_0x41b825(0x1ec)]=_0x1ad14a['_isListenCall'];if(_0x1ad14a['mediaSwitchURI'])this[_0x41b825(0x277)][_0x41b825(0xcf)](_0x41b825(0x1f1)+_0x1ad14a[_0x41b825(0x174)]),_0x472d3b[_0x41b825(0x226)]['push'](_0x41b825(0x23a)+_0x1ad14a[_0x41b825(0x174)]);else{const _0x3e4138=this[_0x41b825(0x1d8)]();_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');}const _0x31c3a9=_0x41b825(0x12c)+_0x489345+_0x41b825(0x17b);try{this[_0x41b825(0x10b)](this[_0x41b825(0x171)][_0x41b825(0x15e)][_0x41b825(0x274)](_0x31c3a9,_0x472d3b));}catch(_0x2006de){return this['log'][_0x41b825(0x247)](_0x41b825(0x20d),_0x2006de),null;}_0x1ad14a[_0x41b825(0x237)]&&this[_0x41b825(0x1bc)](_0x1ad14a[_0x41b825(0x237)]);}[a0_0x35184d(0x196)](_0x1f720f){const _0x2c15ec=a0_0x35184d;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)]);}[a0_0x35184d(0x1d8)](){const _0x59615b=a0_0x35184d,_0x3f47f3=this[_0x59615b(0x171)][_0x59615b(0x24c)];let _0x285ec1=[];for(let _0xd48dea in _0x3f47f3){_0x3f47f3[_0xd48dea]&&(_0x3f47f3[_0xd48dea][_0x59615b(0x105)]!==this[_0x59615b(0x105)]&&_0x285ec1[_0x59615b(0xfd)](_0x3f47f3[_0xd48dea]));}return _0x285ec1;}[a0_0x35184d(0x10b)](_0x4e7a5f){const _0x327ece=a0_0x35184d;this[_0x327ece(0x214)]=_0x4e7a5f,this[_0x327ece(0xef)]=Date[_0x327ece(0x21f)]();const _0x3737d9=this;this[_0x327ece(0x214)]['on'](_0x327ece(0x1b0),function(_0x214824){const _0x1711a3=_0x327ece,_0x5f093d=_0x214824[_0x1711a3(0x145)];_0x3737d9[_0x1711a3(0x277)][_0x1711a3(0xcf)](_0x1711a3(0x115)+_0x5f093d[_0x1711a3(0x145)]);if(_0x5f093d['type']===_0x1711a3(0xf9)&&_0x5f093d[_0x1711a3(0x13d)]!==null&&_0x5f093d['relatedPort']!==null){_0x3737d9['log']['info'](_0x1711a3(0x124)+_0x5f093d[_0x1711a3(0x145)]);if(_0x3737d9['_iceCandidateTimer']!=null)clearTimeout(_0x3737d9[_0x1711a3(0xec)]);_0x214824[_0x1711a3(0xf2)]();}else{if(_0x3737d9[_0x1711a3(0xec)]!=null)clearTimeout(_0x3737d9[_0x1711a3(0xec)]);_0x3737d9[_0x1711a3(0xec)]=setTimeout(function(_0x56b7ca){const _0x1243f7=_0x1711a3;_0x3737d9[_0x1243f7(0x277)]['debug'](_0x1243f7(0x232)+_0x3737d9['_phone']['options'][_0x1243f7(0x12e)]+_0x1243f7(0x147)),_0x56b7ca[_0x1243f7(0xf2)]();},_0x3737d9[_0x1711a3(0x171)][_0x1711a3(0x22c)][_0x1711a3(0x12e)],_0x214824);}}),this[_0x327ece(0x214)]['on']('connecting',function(){const _0x143d7a=_0x327ece;_0x3737d9['_startDurationUpdateTimer'](),_0x3737d9[_0x143d7a(0xcb)](),_0x3737d9[_0x143d7a(0x1e1)]('INITIALIZING');}),this[_0x327ece(0x214)]['on']('sending',function(){const _0x26ef8f=_0x327ece;_0x3737d9[_0x26ef8f(0x171)][_0x26ef8f(0x22c)]['playCallInitializedTone']&&_0x3737d9[_0x26ef8f(0x171)][_0x26ef8f(0x157)](ST_CALLINIT),_0x3737d9[_0x26ef8f(0x1e1)](_0x26ef8f(0x1f0));}),this[_0x327ece(0x214)]['on']('progress',function(_0x7361e4){const _0x2542a7=_0x327ece;_0x7361e4[_0x2542a7(0x1e0)]==='remote'&&(_0x3737d9['_setSessionState']('PROGRESS',{'code':_0x7361e4['response'][_0x2542a7(0x153)]}),_0x3737d9[_0x2542a7(0x171)][_0x2542a7(0xe5)](),_0x7361e4[_0x2542a7(0x22f)][_0x2542a7(0x153)]===0xb4&&_0x3737d9[_0x2542a7(0x171)]['_startRepeatTone'](ST_RINGBACK),_0x3737d9['_answerCallTimeout']&&(_0x3737d9[_0x2542a7(0x234)]=setTimeout(function(){const _0x35ccda=_0x2542a7;_0x3737d9[_0x35ccda(0x277)][_0x35ccda(0x258)](_0x35ccda(0x1f5)+_0x3737d9[_0x35ccda(0xfb)]+_0x35ccda(0x1d2));try{_0x3737d9['hangup']();}catch(_0x9afee0){_0x3737d9[_0x35ccda(0x277)]['info'](_0x35ccda(0x25a));}},_0x3737d9[_0x2542a7(0xfb)]*0x3e8)));}),this[_0x327ece(0x214)]['on'](_0x327ece(0xc6),function(_0x5a7f3a){const _0x4286ad=_0x327ece;_0x3737d9[_0x4286ad(0x171)][_0x4286ad(0xe5)](),_0x3737d9[_0x4286ad(0x12f)]=Date[_0x4286ad(0x21f)]();_0x3737d9[_0x4286ad(0xfb)]&&(clearTimeout(_0x3737d9[_0x4286ad(0x234)]),_0x3737d9[_0x4286ad(0xfb)]=0x0);if(_0x5a7f3a[_0x4286ad(0x1e0)]===_0x4286ad(0xc4)){const _0x266816=_0x5a7f3a[_0x4286ad(0x22f)][_0x4286ad(0xf3)]('X-Recording');_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)]);}}),this['_webRTCSession']['on']('confirmed',function(){const _0x1b6c83=_0x327ece;_0x3737d9[_0x1b6c83(0x1e1)](_0x1b6c83(0x103));}),this['_webRTCSession']['on'](_0x327ece(0x104),function(){const _0x3f6830=_0x327ece;_0x3737d9[_0x3f6830(0x171)]['_endRepeatTone'](),_0x3737d9[_0x3f6830(0x230)]=Date[_0x3f6830(0x21f)](),_0x3737d9['_answerCallTimeout']&&clearTimeout(_0x3737d9[_0x3f6830(0x234)]),_0x3737d9[_0x3f6830(0x1e1)](_0x3f6830(0x183));}),this[_0x327ece(0x214)]['on']('failed',function(_0x376898){const _0x3c807d=_0x327ece;_0x3737d9[_0x3c807d(0x171)][_0x3c807d(0xe5)](),_0x3737d9['_callEndTime']=Date[_0x3c807d(0x21f)]();_0x3737d9[_0x3c807d(0xfb)]&&clearTimeout(_0x3737d9[_0x3c807d(0x234)]);let _0x4d39ff;_0x376898[_0x3c807d(0x24a)]?_0x4d39ff=_0x376898[_0x3c807d(0x24a)][_0x3c807d(0x153)]+'\x20'+_0x376898['message'][_0x3c807d(0x239)]:_0x4d39ff='',_0x3737d9['_setSessionState'](_0x3c807d(0x19f),{'cause':_0x376898[_0x3c807d(0x20c)],'message':_0x4d39ff});}),this['_webRTCSession']['on'](_0x327ece(0x24f),function(_0x518ccb){const _0x570226=_0x327ece;_0x3737d9[_0x570226(0x277)][_0x570226(0xcf)]('Session\x20DTMF',_0x518ccb);}),this[_0x327ece(0x214)]['on'](_0x327ece(0x218),function(_0x3cbdd0){const _0x337911=_0x327ece;_0x3737d9[_0x337911(0x277)][_0x337911(0xcf)]('New\x20session\x20info',_0x3cbdd0);}),this[_0x327ece(0x214)]['on'](_0x327ece(0x1c7),function(){const _0x1b2ee7=_0x327ece;_0x3737d9['_isOnHold']=!![],_0x3737d9[_0x1b2ee7(0x23d)](),_0x3737d9['_setSessionState'](_0x1b2ee7(0xca));}),this['_webRTCSession']['on'](_0x327ece(0x185),function(){const _0x232b5d=_0x327ece;_0x3737d9[_0x232b5d(0x12b)]=![],_0x3737d9[_0x232b5d(0x23d)](),_0x3737d9[_0x232b5d(0x1e1)](_0x232b5d(0x103));}),this[_0x327ece(0x214)]['on'](_0x327ece(0x215),function(_0xc3017a){const _0x195e1f=_0x327ece;_0x3737d9[_0x195e1f(0x277)][_0x195e1f(0xcf)]('Microphone\x20muted',_0xc3017a),_0x3737d9[_0x195e1f(0x1dd)]=!![],_0x3737d9[_0x195e1f(0x24e)]();}),this['_webRTCSession']['on']('unmuted',function(_0x41ece5){const _0x2620eb=_0x327ece;_0x3737d9[_0x2620eb(0x277)][_0x2620eb(0xcf)]('Microphone\x20unmuted',_0x41ece5),_0x3737d9[_0x2620eb(0x1dd)]=![],_0x3737d9['_fireMuteStateEvent']();}),this['_webRTCSession']['on'](_0x327ece(0x119),function(_0x135dc9){const _0x27d8e=_0x327ece;_0x3737d9[_0x27d8e(0x277)][_0x27d8e(0xcf)](_0x27d8e(0x186),_0x135dc9);}),this[_0x327ece(0x214)]['on'](_0x327ece(0x256),function(_0x560fb6){const _0x2ec07d=_0x327ece;_0x3737d9['log']['debug'](_0x2ec07d(0x18a),_0x560fb6);}),this['_webRTCSession']['on'](_0x327ece(0x1ab),function(_0x330581){const _0x266a70=_0x327ece;_0x3737d9[_0x266a70(0x277)][_0x266a70(0x247)](_0x266a70(0x198),_0x330581);}),_0x3737d9[_0x327ece(0x214)]['connection']&&_0x3737d9[_0x327ece(0x1cc)](_0x3737d9[_0x327ece(0x214)]),this[_0x327ece(0x277)][_0x327ece(0xcf)](_0x327ece(0x11d)),this[_0x327ece(0x277)][_0x327ece(0xcf)](this);}[a0_0x35184d(0x1da)](_0x9c04b8=null){const _0xc6240b=a0_0x35184d;!_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)]({'extraHeaders':['X-HDISP:\x20'+_0x9c04b8]}));}[a0_0x35184d(0x235)](_0xb41583=null){const _0x153906=a0_0x35184d;let _0x33c89b={'mediaConstraints':{'audio':!![],'video':![]},'pcConfig':{'iceServers':[{'urls':['stun:stun.l.google.com:19302']}]},'extraHeaders':['X-Call-token:\x20'+this['_phone']['options'][_0x153906(0x1ba)]]};_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']);}[a0_0x35184d(0x187)](_0x39c653=0x25b,_0xa28556=a0_0x35184d(0x19b)){const _0x1c32d9=a0_0x35184d;this['log'][_0x1c32d9(0x258)](_0x1c32d9(0xd0)),this[_0x1c32d9(0x214)]['terminate']({'status_code':_0x39c653,'reason_phrase':_0xa28556});}get[a0_0x35184d(0x108)](){const _0x5db6cb=a0_0x35184d;return this[_0x5db6cb(0x14a)];}get[a0_0x35184d(0xd3)](){const _0x19835d=a0_0x35184d;return this[_0x19835d(0x1c6)];}get[a0_0x35184d(0x1cd)](){const _0x9e7eb8=a0_0x35184d;return this[_0x9e7eb8(0x1be)];}get['originatingNumber'](){const _0x2f86cd=a0_0x35184d;return this[_0x2f86cd(0x134)];}set[a0_0x35184d(0xd3)](_0x352858){const _0x3e6914=a0_0x35184d;this[_0x3e6914(0x277)][_0x3e6914(0xcf)](_0x3e6914(0x11c)+_0x352858),this['_destinationNumber']=_0x352858;}get[a0_0x35184d(0xd8)](){const _0x289148=a0_0x35184d;return this[_0x289148(0x13c)];}get[a0_0x35184d(0x126)](){const _0x37de0f=a0_0x35184d;if(this['_isListenCall'])return this[_0x37de0f(0x277)]['debug']('Call\x20direction\x20is\x20LISTEN'),_0x37de0f(0x1d5);else{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));}}[a0_0x35184d(0x16c)](){const _0x2e33ed=a0_0x35184d,_0x468080={'extraHeaders':['Record:\x20on']};this[_0x2e33ed(0x277)][_0x2e33ed(0xcf)](_0x2e33ed(0x1b5));const _0x5ac582=this;this[_0x2e33ed(0x214)]['once'](_0x2e33ed(0x218),_0x24058f=>{const _0x59a152=_0x2e33ed;_0x24058f['originator']===_0x59a152(0x133)&&(_0x24058f[_0x59a152(0x258)]['on'](_0x59a152(0x240),function(){const _0x3a8d95=_0x59a152;_0x5ac582[_0x3a8d95(0x277)]['info']('Recording\x20started\x20successfully'),_0x5ac582[_0x3a8d95(0x117)]=!![];try{_0x5ac582[_0x3a8d95(0x1af)](_0x3a8d95(0x1c2),{'state':!![],'error':null});}catch(_0x290181){_0x5ac582[_0x3a8d95(0x277)]['error'](_0x3a8d95(0x24d)+_0x290181);}}),_0x24058f[_0x59a152(0x258)]['on'](_0x59a152(0x161),function(_0x1e5787){const _0x33b11f=_0x59a152;_0x5ac582[_0x33b11f(0x120)]=_0x1e5787[_0x33b11f(0x22f)][_0x33b11f(0x239)],_0x5ac582[_0x33b11f(0x277)][_0x33b11f(0x247)]('Recording\x20start\x20failed:\x20'+_0x5ac582[_0x33b11f(0x120)]),_0x5ac582[_0x33b11f(0x177)]();}));}),this[_0x2e33ed(0x214)][_0x2e33ed(0x1e5)](_0x2e33ed(0x181),null,_0x468080);}['stopRecording'](){const _0x18f638=a0_0x35184d,_0x56b212={'extraHeaders':[_0x18f638(0x118)]};this[_0x18f638(0x277)][_0x18f638(0xcf)](_0x18f638(0x25c));const _0x162e9a=this;this['_webRTCSession'][_0x18f638(0x263)](_0x18f638(0x218),_0x197195=>{const _0x1f0de5=_0x18f638;_0x197195['info']['on'](_0x1f0de5(0x240),function(){const _0x336a64=_0x1f0de5;_0x162e9a[_0x336a64(0x277)][_0x336a64(0x258)]('Recording\x20stopped\x20successfully'),_0x162e9a[_0x336a64(0x117)]=![];try{_0x162e9a[_0x336a64(0x1af)]('recordingStateChange',{'state':![],'error':null});}catch(_0x2711bd){_0x162e9a['log'][_0x336a64(0x247)](_0x336a64(0x24d)+_0x2711bd);}}),_0x197195['info']['on']('failed',function(_0x17c6f1){const _0x29611f=_0x1f0de5;_0x162e9a['log']['error'](_0x29611f(0x155)+_0x17c6f1[_0x29611f(0x22f)]['reason_phrase']);try{_0x162e9a[_0x29611f(0x1af)](_0x29611f(0x1c2),{'state':_0x162e9a[_0x29611f(0x117)],'error':_0x17c6f1[_0x29611f(0x22f)][_0x29611f(0x239)]});}catch(_0x86e83a){_0x162e9a[_0x29611f(0x277)]['error'](_0x29611f(0x24d)+_0x86e83a);}});}),this[_0x18f638(0x214)][_0x18f638(0x1e5)](_0x18f638(0x181),null,_0x56b212);}['toggleRecording'](){const _0x55d403=a0_0x35184d;return!this[_0x55d403(0x117)]?(this[_0x55d403(0x16c)](),!![]):(this[_0x55d403(0x160)](),![]);}get[a0_0x35184d(0x1e3)](){const _0x46d2b5=a0_0x35184d;return this[_0x46d2b5(0x117)];}[a0_0x35184d(0x231)](){const _0x38a9df=a0_0x35184d;this[_0x38a9df(0x277)][_0x38a9df(0x258)](_0x38a9df(0x1ed)),this[_0x38a9df(0x214)][_0x38a9df(0x22a)]();}[a0_0x35184d(0x26f)](){const _0x57bdf6=a0_0x35184d;this[_0x57bdf6(0x277)][_0x57bdf6(0x258)](_0x57bdf6(0x1f4)),this['_webRTCSession'][_0x57bdf6(0xf6)]();}['toggleMute'](){const _0x1e5511=a0_0x35184d;!this[_0x1e5511(0x1dd)]?this['muteMic']():this['unmuteMic']();}get[a0_0x35184d(0x243)](){const _0xdebb45=a0_0x35184d;return this[_0xdebb45(0x1dd)];}['hold'](){const _0x2c024d=a0_0x35184d;this[_0x2c024d(0x277)][_0x2c024d(0x258)](_0x2c024d(0xdc)),this[_0x2c024d(0x214)][_0x2c024d(0x1c7)]();}[a0_0x35184d(0x185)](){const _0x50a9fb=a0_0x35184d;this[_0x50a9fb(0x277)]['info']('Uncall\x20call'),this[_0x50a9fb(0x171)][_0x50a9fb(0x175)](),this['_webRTCSession'][_0x50a9fb(0x185)]();}[a0_0x35184d(0x25b)](){const _0x5dc077=a0_0x35184d;!this[_0x5dc077(0x12b)]?this[_0x5dc077(0x1c7)]():this[_0x5dc077(0x185)]();}get[a0_0x35184d(0x1ff)](){const _0x2337f8=a0_0x35184d;return this[_0x2337f8(0x12b)];}[a0_0x35184d(0x264)](_0x520a56,_0xf1da67=!![]){const _0x4121b8=a0_0x35184d;if(!(_0x520a56 in DTMF_FREQUENCY_TABLE))throw new Exceptions[(_0x4121b8(0x266))](_0x4121b8(0x1b6));this[_0x4121b8(0x277)][_0x4121b8(0x258)](_0x4121b8(0x1bf)+_0x520a56),this[_0x4121b8(0x214)][_0x4121b8(0x264)](_0x520a56);if(_0xf1da67){const _0x32ca07=DTMF_FREQUENCY_TABLE[_0x520a56];if(this[_0x4121b8(0x1dd)])this[_0x4121b8(0x277)][_0x4121b8(0xcf)](_0x4121b8(0x19d)),this[_0x4121b8(0x171)][_0x4121b8(0x158)](0x1f4,_0x32ca07[0x0],_0x32ca07[0x1]);else{this[_0x4121b8(0x277)][_0x4121b8(0xcf)](_0x4121b8(0xc7)),this[_0x4121b8(0x214)]['mute']();const _0x27567f=this;this['_phone'][_0x4121b8(0x158)](0x1f4,_0x32ca07[0x0],_0x32ca07[0x1],function(){const _0x573577=_0x4121b8;_0x27567f[_0x573577(0x277)][_0x573577(0xcf)]('Unmute\x20mic\x20after\x20DTMF'),_0x27567f[_0x573577(0x214)][_0x573577(0xf6)]();});}}}[a0_0x35184d(0x163)](_0x58160c){const _0x5d5cf9=a0_0x35184d;this[_0x5d5cf9(0x277)]['info'](_0x5d5cf9(0x176)+this[_0x5d5cf9(0x108)]+_0x5d5cf9(0x15a)+_0x58160c[_0x5d5cf9(0x108)]);const _0x46b7ba=this['_webRTCSession']['refer'](this[_0x5d5cf9(0x214)][_0x5d5cf9(0x101)][_0x5d5cf9(0xed)],{'replaces':_0x58160c[_0x5d5cf9(0x214)]}),_0x4b7ee4=this;_0x46b7ba['on'](_0x5d5cf9(0x21e),function(){const _0x199abc=_0x5d5cf9;_0x4b7ee4['log'][_0x199abc(0x258)](_0x199abc(0xce));}),_0x46b7ba['on'](_0x5d5cf9(0x1fe),function(_0x2d20b2){const _0x26e6b0=_0x5d5cf9;_0x4b7ee4[_0x26e6b0(0x277)][_0x26e6b0(0x247)](_0x26e6b0(0x1e9)+_0x2d20b2);}),_0x46b7ba['on'](_0x5d5cf9(0x161),function(_0x59d684){const _0x12168c=_0x5d5cf9;_0x4b7ee4[_0x12168c(0x277)]['error'](_0x12168c(0x178)+_0x59d684);});}[a0_0x35184d(0x271)](_0x3de786,_0x53bfb1=![]){const _0x26b660=a0_0x35184d;if(!this[_0x26b660(0x171)][_0x26b660(0x154)][_0x26b660(0x1ac)])throw new Exceptions['NotAllowed'](_0x26b660(0x135));this[_0x26b660(0x277)]['info']('Playback\x20media\x20file\x20'+_0x3de786+'\x20hangup\x20after\x20'+_0x53bfb1);const _0x2ec2a9=this[_0x26b660(0x171)]['_eventClient'][_0x26b660(0x1b2)](_0x26b660(0xe7),{'call_uuid':this[_0x26b660(0x108)],'call_command':'playback','media_file_id':_0x3de786,'hangup_after':_0x53bfb1});return _0x53bfb1&&(this[_0x26b660(0x171)]['_remoteAudioElement'][_0x26b660(0xeb)]=null,this[_0x26b660(0x214)]['mute'](),_0x2ec2a9['then'](()=>{const _0x184bd6=_0x26b660;this[_0x184bd6(0x1e1)](_0x184bd6(0x111));})),_0x2ec2a9;}[a0_0x35184d(0x11a)](_0x3038c4=0x0){const _0x582d5f=a0_0x35184d;if(!this['direction']===_0x582d5f(0x1d5))throw new Exceptions[(_0x582d5f(0x16d))](_0x582d5f(0x203));if(_0x3038c4<0x0||_0x3038c4>0x2)throw new Exceptions[(_0x582d5f(0x194))]('Invalid\x20mode');let _0x11b105;_0x3038c4===0x0&&(_0x11b105=0x0),_0x3038c4===0x1&&(_0x11b105=0x2),_0x3038c4===0x2&&(_0x11b105=0x3),this['sendDTMF'](_0x11b105,![]),this['_whisperMode']=_0x3038c4,this[_0x582d5f(0x217)]();}[a0_0x35184d(0x1d4)](){const _0x34be96=a0_0x35184d,_0x48cffe=this;!this['_durationUpdTimerObj']&&(this[_0x34be96(0x116)]=setInterval(function(){const _0x387caf=_0x34be96,_0x375d05=_0x48cffe[_0x387caf(0x12f)]?Date[_0x387caf(0x21f)]()-_0x48cffe[_0x387caf(0x12f)]:null,_0x4c3e97={'uuid':_0x48cffe['_callUUID'],'beginTime':_0x48cffe[_0x387caf(0xef)],'answerTime':_0x48cffe[_0x387caf(0x12f)],'endTime':_0x48cffe[_0x387caf(0x230)],'duration':Date[_0x387caf(0x21f)]()-_0x48cffe['_callBeginTime'],'durationStr':Tools['createDurationString'](Date[_0x387caf(0x21f)]()-_0x48cffe[_0x387caf(0xef)]),'activeDuration':_0x375d05,'activeDurationStr':_0x375d05?Tools[_0x387caf(0x16b)](_0x375d05):''};try{_0x48cffe['emit'](_0x387caf(0x1c9),_0x4c3e97);}catch(_0x35584f){_0x48cffe[_0x387caf(0x277)][_0x387caf(0x247)](_0x387caf(0x197)+_0x35584f);}},0x3e8));}[a0_0x35184d(0xcb)](){const _0x1a4f61=a0_0x35184d;if(!this[_0x1a4f61(0x1a3)]){const _0x30e52e={'outboundPacketsSent':0x0,'outboundBytesSent':0x0,'outboundPacketsLost':0x0,'outboundJitter':0x0,'inboundPacketsReceived':0x0,'inboundBytesReceived':0x0,'inboundPacketsLost':0x0,'inboundJitter':0x0,'roundTripTime':0x0};this[_0x1a4f61(0x267)]=Object[_0x1a4f61(0x17f)]({},_0x30e52e),this[_0x1a4f61(0x1a3)]=setInterval(()=>{const _0x1b0703=_0x1a4f61;this[_0x1b0703(0x214)][_0x1b0703(0x273)][_0x1b0703(0x204)]()[_0x1b0703(0x1a5)](_0x50aa2d=>{const _0x1a6192=_0x1b0703;let _0x7ff17c=Object[_0x1a6192(0x17f)]({},_0x30e52e),_0x235051=Object['assign']({},_0x30e52e);for(let _0x2770cf of _0x50aa2d[_0x1a6192(0x15b)]()){switch(_0x2770cf['type']){case _0x1a6192(0x22e):_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)];break;case _0x1a6192(0x110):_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;break;case _0x1a6192(0xe0):_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;break;default:break;}}this['_currentReport']=this[_0x1a6192(0x10f)](_0x7ff17c);if(_0x7ff17c[_0x1a6192(0xe8)]){const _0x416aee={'total':this[_0x1a6192(0x267)],'delta':this[_0x1a6192(0x10f)](_0x235051)};try{this[_0x1a6192(0x1af)](_0x1a6192(0x1c3),_0x416aee);}catch(_0x12436f){this[_0x1a6192(0x277)]['error'](_0x1a6192(0x1fc)+_0x12436f);}}});},0x1388);}}[a0_0x35184d(0x10f)](_0x3349d4){const _0x2bdc76=a0_0x35184d;_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;const _0xe8010b=(_0x3349d4[_0x2bdc76(0xea)]+_0x3349d4[_0x2bdc76(0x188)])*0x64,_0xc6948d=0x5f*_0xe8010b/(_0xe8010b+0xa),_0x15a781=_0x3349d4[_0x2bdc76(0x22d)]*0.1;_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']);switch(!![]){case _0x3349d4['rFactor']<0x32:_0x3349d4['qualityString']=_0x2bdc76(0xc5);break;case _0x3349d4['rFactor']<0x46:_0x3349d4['qualityString']=_0x2bdc76(0x13b);break;case _0x3349d4['rFactor']<0x50:_0x3349d4[_0x2bdc76(0x130)]=_0x2bdc76(0x128);break;case _0x3349d4[_0x2bdc76(0x275)]<0x5a:_0x3349d4[_0x2bdc76(0x130)]=_0x2bdc76(0x16a);break;case _0x3349d4['rFactor']<=0x64:_0x3349d4[_0x2bdc76(0x130)]='Excellent';break;default:_0x3349d4['qualityString']=_0x2bdc76(0x212);}return _0x3349d4;}[a0_0x35184d(0x1e1)](_0x2a3c7b,_0x1224b6=null){const _0x154ce8=a0_0x35184d;this['log'][_0x154ce8(0xcf)](_0x154ce8(0x1fb)+_0x2a3c7b);_0x1224b6&&this[_0x154ce8(0x277)][_0x154ce8(0xcf)](_0x1224b6);this[_0x154ce8(0x13c)]=_0x2a3c7b;try{this[_0x154ce8(0x1af)](_0x154ce8(0x249),Object['assign']({'state':_0x2a3c7b,'uuid':this[_0x154ce8(0x14a)]},_0x1224b6));}catch(_0x4a4a3e){this[_0x154ce8(0x277)]['error'](_0x154ce8(0x14f)+_0x4a4a3e);}_0x2a3c7b===_0x154ce8(0x183)&&(this['_callDisposition']=this['_manualDisposition']||_0x154ce8(0x21c),this[_0x154ce8(0xd7)]());if(_0x2a3c7b===_0x154ce8(0x19f)){_0x1224b6[_0x154ce8(0x20c)]===_0x154ce8(0x16f)&&(this[_0x154ce8(0x1d3)]=_0x154ce8(0x18c),this[_0x154ce8(0x171)][_0x154ce8(0x22c)]['playSignalTones']&&this[_0x154ce8(0x171)][_0x154ce8(0x157)](ST_TEMP_UNAVAIL));_0x1224b6[_0x154ce8(0x20c)]===_0x154ce8(0x245)&&(this[_0x154ce8(0x1d3)]=_0x154ce8(0x21d),this['_phone'][_0x154ce8(0x22c)][_0x154ce8(0xe6)]&&this['_phone'][_0x154ce8(0x157)](ST_INVALID_NUMBER));_0x1224b6['cause']===_0x154ce8(0x1aa)&&(this[_0x154ce8(0x1d3)]=this[_0x154ce8(0x25d)]||_0x154ce8(0x260));_0x1224b6[_0x154ce8(0x20c)]===_0x154ce8(0xe9)&&(this[_0x154ce8(0x126)]==='INBOUND'?this[_0x154ce8(0x1d3)]='REJECTED':this[_0x154ce8(0x1d3)]=_0x154ce8(0x241));_0x1224b6[_0x154ce8(0x20c)]===_0x154ce8(0x1c4)&&(this[_0x154ce8(0x1d3)]='BUSY',this[_0x154ce8(0x171)][_0x154ce8(0x22c)][_0x154ce8(0xe6)]&&this[_0x154ce8(0x171)][_0x154ce8(0x157)](ST_BUSY));if(this[_0x154ce8(0x214)][_0x154ce8(0x126)]===_0x154ce8(0x193)){}this[_0x154ce8(0xd7)]();}}[a0_0x35184d(0xd7)](){const _0x3af1d8=a0_0x35184d;this['log'][_0x3af1d8(0x258)]('Call\x20finished'),this[_0x3af1d8(0x255)](),clearInterval(this[_0x3af1d8(0x116)]),clearInterval(this[_0x3af1d8(0x1a3)]),this[_0x3af1d8(0x171)][_0x3af1d8(0xf1)](this);}['_setAnswerCallTimeout'](_0x9d53d4){const _0x2d7dde=a0_0x35184d;this[_0x2d7dde(0x277)][_0x2d7dde(0xcf)](_0x2d7dde(0x248)+_0x9d53d4),this[_0x2d7dde(0xfb)]=_0x9d53d4;}[a0_0x35184d(0x177)](){const _0x18c465=a0_0x35184d;try{this[_0x18c465(0x1af)](_0x18c465(0x1c2),{'state':this[_0x18c465(0x117)],'error':this['_recordingError']});}catch(_0x4f5a20){this[_0x18c465(0x277)][_0x18c465(0x247)]('Exception\x20in\x20recording\x20state\x20change\x20event:\x20'+_0x4f5a20);}}[a0_0x35184d(0x24e)](){const _0x292031=a0_0x35184d;try{this[_0x292031(0x1af)](_0x292031(0x1cf),{'state':this['_isMuted']});}catch(_0x1b55a){this['log'][_0x292031(0x247)](_0x292031(0x1f6)+_0x1b55a);}}[a0_0x35184d(0x23d)](){const _0x17279d=a0_0x35184d;try{this[_0x17279d(0x1af)]('holdStateChange',{'state':this[_0x17279d(0x12b)]});}catch(_0x22c4f7){this[_0x17279d(0x277)][_0x17279d(0x247)](_0x17279d(0x268)+_0x22c4f7);}}['_fireWhisperModeChangeEvent'](){const _0x24e3aa=a0_0x35184d;try{this[_0x24e3aa(0x1af)](_0x24e3aa(0x1c0),{'mode':this[_0x24e3aa(0x1b1)]});}catch(_0x301208){this[_0x24e3aa(0x277)][_0x24e3aa(0x247)](_0x24e3aa(0xd9)+_0x301208);}}[a0_0x35184d(0x255)](){const _0x359f8d=a0_0x35184d;let _0x4a6871;_0x4a6871={'uuid':this[_0x359f8d(0x14a)],'direction':this[_0x359f8d(0x126)],'disposition':this[_0x359f8d(0x1d3)],'originatingNumber':this['_originatingNumber'],'destinationNumber':this[_0x359f8d(0x1c6)],'duration':this['_callEndTime']-this[_0x359f8d(0xef)],'answerDuration':this[_0x359f8d(0x12f)]?this['_callAnswerTime']-this[_0x359f8d(0xef)]:null,'activeDuration':this[_0x359f8d(0x12f)]?this[_0x359f8d(0x230)]-this[_0x359f8d(0x12f)]:null,'startTime':new Date(this[_0x359f8d(0xef)])[_0x359f8d(0x137)](),'endTime':new Date(this[_0x359f8d(0x230)])[_0x359f8d(0x137)](),'answerTime':this[_0x359f8d(0x12f)]?new Date(this[_0x359f8d(0x12f)])['toISOString']():null},_0x4a6871['durationStr']=Tools[_0x359f8d(0x16b)](_0x4a6871[_0x359f8d(0x1a4)]),_0x4a6871[_0x359f8d(0xc8)]=_0x4a6871[_0x359f8d(0x12d)]?Tools[_0x359f8d(0x16b)](_0x4a6871[_0x359f8d(0x12d)]):'',_0x4a6871[_0x359f8d(0xf7)]=_0x4a6871[_0x359f8d(0x1fa)]?Tools[_0x359f8d(0x16b)](_0x4a6871[_0x359f8d(0x1fa)]):'',_0x4a6871['callQualityReport']=this[_0x359f8d(0x267)];try{this[_0x359f8d(0x1af)](_0x359f8d(0x1a9),_0x4a6871);}catch(_0x138a2b){this[_0x359f8d(0x277)]['error'](_0x359f8d(0x220)+_0x138a2b);}}[a0_0x35184d(0x1cc)](_0x4f7c43){const _0x327370=a0_0x35184d;this['_phone']['_endRepeatTone']();const _0x52f8db=this;_0x4f7c43[_0x327370(0x1cb)][_0x327370(0x20a)]=function(_0x3d1579){const _0x282f74=_0x327370;_0x52f8db[_0x282f74(0x277)]['debug'](_0x282f74(0xe1)),_0x52f8db['log'][_0x282f74(0xcf)](_0x3d1579),_0x52f8db[_0x282f74(0x171)][_0x282f74(0x1f7)][_0x282f74(0xeb)]=_0x3d1579[_0x282f74(0x1f8)][0x0];};}}
|
package/webpack.config.js
CHANGED
|
File without changes
|