@telegenta/webclient 2.0.10 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +0 -0
  2. package/babel.config.js +0 -0
  3. package/browser/telegenta.min.js +1 -1
  4. package/demos/add_phone_number.html +0 -0
  5. package/demos/calldata_available.html +0 -0
  6. package/demos/embedded_config.html +94 -94
  7. package/demos/event_client.html +225 -225
  8. package/demos/phone_client.html +557 -557
  9. package/demos/styles.css +0 -0
  10. package/demos/telegenta.min.js +1 -0
  11. package/docs/EventClient.html +1 -1
  12. package/docs/Phone.html +1 -1
  13. package/docs/Session.html +1 -1
  14. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  15. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -0
  16. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  17. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  18. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -0
  19. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  20. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  21. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -0
  22. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  23. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  24. package/docs/fonts/OpenSans-Light-webfont.svg +0 -0
  25. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  26. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  27. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -0
  28. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  29. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  30. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -0
  31. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  32. package/docs/global.html +1 -1
  33. package/docs/index.html +1 -1
  34. package/docs/scripts/linenumber.js +0 -0
  35. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  36. package/docs/scripts/prettify/lang-css.js +0 -0
  37. package/docs/scripts/prettify/prettify.js +0 -0
  38. package/docs/styles/jsdoc-default.css +0 -0
  39. package/docs/styles/prettify-jsdoc.css +0 -0
  40. package/docs/styles/prettify-tomorrow.css +0 -0
  41. package/embedded_client/embedded_phone.js +0 -0
  42. package/embedded_client/index.html +0 -0
  43. package/embedded_client/server.php +0 -0
  44. package/embedded_client/styles.css +0 -0
  45. package/embedded_client/tiny_rest_client.php +0 -0
  46. package/embedded_client/webphone_sprites.png +0 -0
  47. package/es5/event-client.js +175 -219
  48. package/es5/index.js +0 -0
  49. package/es5/phone-client.js +771 -1173
  50. package/package.json +1 -1
  51. package/src/event-client.js +1 -1
  52. package/src/index.js +0 -0
  53. package/src/phone-client.js +1 -1
  54. package/webpack.config.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegenta/webclient",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "description": "Webphone and event client library",
5
5
  "main": "es5/index.js",
6
6
  "browser": "browser/telegenta.min.js",
@@ -1 +1 @@
1
- var _0x3970=['\x20payload:\x20','payload','Callback\x20had\x20unhandled\x20exception\x20','resolve','reject','Invalid\x20subscription\x20id\x20for\x20event:\x20','wss://api.telegenta.com/es/','random','specification','callback','doCallback','apply','_socket','_previousSubscriptions','_activeSubscriptions','_autoReconnect','_reconnectRetrySeconds','log','LogHandler','LOGLVL','_requestor','event','_serverAddress','_connectServer','disconnect','readyState','NoActiveSession','close','isConnected','subscribe','You\x20must\x20specify\x20both\x20event\x20spec\x20and\x20callback\x20function','hasOwnProperty','event_name','InvalidParameter','Your\x20event\x20specification\x20must\x20contain\x20event\x20name','Subscription\x20to\x20\x27','push','warning','\x27\x20failed:\x20','unsubscribe','You\x20must\x20specify\x20subscription\x20id','info','Unsubscribe\x20id:\x20','sendRequest','then','Unsubscribe\x20to\x20\x27','\x27\x20was\x20successful','Remote\x20unsubscribe\x20to\x20\x27','fireEvent','Event\x20','\x20failed:\x20','_removeSubscription','debug','splice','\x20locally,\x20not\x20found?','Connecting\x20to\x20event\x20server:\x20','Unable\x20to\x20connect,\x20already\x20connected','Unable\x20to\x20connect,\x20socket\x20is\x20still\x20closing','addEventListener','message','receiveMessage','data','_pingTimerObj','Ping\x20failed:\x20','_reconnectServer','catch','error','Resubscribing\x20to\x20','Disconnected\x20from\x20event\x20service','Websocket\x20connection\x20error','Unable\x20to\x20connect:\x20','floor','Reconnecting\x20in\x20','\x20secs','Reconnect\x20attempt\x20successful','Reconnect\x20attempt\x20failed','subscription_id','Received\x20event\x20for\x20subcription\x20id\x20'];(function(_0x4cdfa8,_0x5bcf47){var _0x1ec0a5=function(_0x34ade6){while(--_0x34ade6){_0x4cdfa8['push'](_0x4cdfa8['shift']());}};_0x1ec0a5(++_0x5bcf47);}(_0x3970,0xf0));var _0xd3f1=function(_0x581502,_0x5594da){_0x581502=_0x581502-0x0;var _0x54037e=_0x3970[_0x581502];return _0x54037e;};'use strict';import{Exceptions,Logger,Requestor}from'@telegenta/common';const PING_INTERVAL=0x32;const ES_DEFAULT_SERVER_URL=_0xd3f1('0x0');const RETRY_INTERVAL_START=0x1+Math[_0xd3f1('0x1')]();const RETRY_MAX_BACKOFF=0x12c;class EventSubscription{constructor(_0x3e187f,_0x5d82b1,_0x329ea3){this['id']=_0x3e187f;this[_0xd3f1('0x2')]=_0x5d82b1;this[_0xd3f1('0x3')]=_0x329ea3;}[_0xd3f1('0x4')](_0x19969f,_0x5f2b7c){return this[_0xd3f1('0x3')][_0xd3f1('0x5')](_0x19969f,[_0x5f2b7c]);}}export class EventClient{constructor(_0x3f07c5=null){this[_0xd3f1('0x6')]=null;this[_0xd3f1('0x7')]=[];this[_0xd3f1('0x8')]=[];this['_pingTimerObj']=null;this[_0xd3f1('0x9')]=![];this[_0xd3f1('0xa')]=RETRY_INTERVAL_START;this[_0xd3f1('0xb')]=_0x3f07c5?_0x3f07c5:new Logger[(_0xd3f1('0xc'))](Logger[_0xd3f1('0xd')]['ERROR']);this[_0xd3f1('0xe')]=new Requestor(this[_0xd3f1('0xb')]);this['_requestor']['on'](_0xd3f1('0xf'),_0x16c22c=>{this['_handleIncomingEvent'](_0x16c22c);});}['connect'](_0x2b27d1=null){if(!_0x2b27d1){_0x2b27d1=ES_DEFAULT_SERVER_URL;}this[_0xd3f1('0x10')]=_0x2b27d1;this[_0xd3f1('0x7')]=[];this[_0xd3f1('0x8')]=[];return this[_0xd3f1('0x11')]();}[_0xd3f1('0x12')](){if(this[_0xd3f1('0x6')][_0xd3f1('0x13')]!==0x1){throw new Exceptions[(_0xd3f1('0x14'))]();}this[_0xd3f1('0x8')]=[];this[_0xd3f1('0x9')]=![];this[_0xd3f1('0x6')][_0xd3f1('0x15')]();}[_0xd3f1('0x16')](){if(this[_0xd3f1('0x6')]){return this['_socket'][_0xd3f1('0x13')]===0x1;}else{return![];}}[_0xd3f1('0x17')](_0x43b4b8,_0xd67385){if(!_0x43b4b8||!_0xd67385){throw new Exceptions['InvalidParameter'](_0xd3f1('0x18'));}if(!_0x43b4b8[_0xd3f1('0x19')](_0xd3f1('0x1a'))){throw new Exceptions[(_0xd3f1('0x1b'))](_0xd3f1('0x1c'));}if(!this[_0xd3f1('0x16')]()){throw new Exceptions[(_0xd3f1('0x14'))]();}const _0x214c49=this;return new Promise(function(_0x5d5231,_0x40cee2){_0x214c49[_0xd3f1('0xe')]['sendRequest'](_0x214c49[_0xd3f1('0x6')],'subscribe',_0x43b4b8)['then'](function(_0x44acd7){_0x214c49[_0xd3f1('0xb')]['debug'](_0xd3f1('0x1d')+_0x43b4b8['event_name']+'\x27\x20was\x20successful,\x20ID\x20=\x20'+_0x44acd7);_0x214c49[_0xd3f1('0x8')][_0xd3f1('0x1e')](new EventSubscription(_0x44acd7,_0x43b4b8,_0xd67385));_0x5d5231(_0x44acd7);},function(_0x3cc2e2){_0x214c49[_0xd3f1('0xb')][_0xd3f1('0x1f')](_0xd3f1('0x1d')+_0x43b4b8[_0xd3f1('0x1a')]+_0xd3f1('0x20')+_0x3cc2e2);_0x40cee2(_0x3cc2e2);});});}[_0xd3f1('0x21')](_0x4e04b9){if(!_0x4e04b9){throw new Exceptions[(_0xd3f1('0x1b'))](_0xd3f1('0x22'));}if(!this[_0xd3f1('0x16')]()){throw new Exceptions[(_0xd3f1('0x14'))]();}this[_0xd3f1('0xb')][_0xd3f1('0x23')](_0xd3f1('0x24')+_0x4e04b9);const _0x83bc6=this;return new Promise(function(_0x174ff1,_0x29ebf2){_0x83bc6[_0xd3f1('0xe')][_0xd3f1('0x25')](_0x83bc6[_0xd3f1('0x6')],_0xd3f1('0x21'),{'id':_0x4e04b9})[_0xd3f1('0x26')](_0x4de5ee=>{_0x83bc6[_0xd3f1('0xb')][_0xd3f1('0x23')](_0xd3f1('0x27')+_0x4e04b9+_0xd3f1('0x28'));_0x83bc6['_removeSubscription'](_0x4e04b9);_0x174ff1(_0x4de5ee);},_0x149e82=>{_0x83bc6[_0xd3f1('0xb')]['warning'](_0xd3f1('0x29')+_0x4e04b9+_0xd3f1('0x20')+_0x149e82);_0x29ebf2(_0x149e82);});});}[_0xd3f1('0x2a')](_0x1ba96b,_0x51457a){if(!this[_0xd3f1('0x16')]()){throw new Exceptions[(_0xd3f1('0x14'))]();}return new Promise((_0x37e3df,_0x3d8172)=>{this[_0xd3f1('0xe')][_0xd3f1('0x25')](this['_socket'],_0x1ba96b,_0x51457a)[_0xd3f1('0x26')](_0x197850=>{this['log'][_0xd3f1('0x23')](_0xd3f1('0x2b')+_0x1ba96b+'\x20was\x20successful');_0x37e3df(_0x197850);},_0x1f34e0=>{this[_0xd3f1('0xb')][_0xd3f1('0x1f')](_0xd3f1('0x2b')+_0x1ba96b+_0xd3f1('0x2c')+_0x1f34e0);_0x3d8172(_0x1f34e0);});});}[_0xd3f1('0x2d')](_0x555e9e){for(let _0x471c2c in this[_0xd3f1('0x8')]){if(this[_0xd3f1('0x8')][_0x471c2c]['id']===_0x555e9e){this[_0xd3f1('0xb')][_0xd3f1('0x2e')]('Removed\x20local\x20subscription:\x20'+_0x555e9e);this[_0xd3f1('0x8')][_0xd3f1('0x2f')](_0x471c2c,0x1);return!![];}}this['log']['warning']('Unable\x20to\x20remove\x20subscription\x20'+_0x555e9e+_0xd3f1('0x30'));return![];}['_connectServer'](){this[_0xd3f1('0xb')][_0xd3f1('0x23')](_0xd3f1('0x31')+this['_serverAddress']);const _0x484469=this;return new Promise(function(_0x1e35ec,_0x2b2486){if(_0x484469['_socket']){switch(_0x484469[_0xd3f1('0x6')][_0xd3f1('0x13')]){case 0x0:_0x2b2486('Unable\x20to\x20connect,\x20already\x20connecting');return;case 0x1:_0x2b2486(_0xd3f1('0x32'));return;case 0x2:_0x2b2486(_0xd3f1('0x33'));return;}}_0x484469[_0xd3f1('0x6')]=new WebSocket(_0x484469[_0xd3f1('0x10')]);let _0x1e5c1b=![];_0x484469[_0xd3f1('0x6')]['addEventListener']('open',function(){_0x484469[_0xd3f1('0xb')]['info']('Successfully\x20connected\x20to\x20event\x20service');_0x1e5c1b=!![];_0x484469[_0xd3f1('0x9')]=!![];_0x484469[_0xd3f1('0xa')]=RETRY_INTERVAL_START;_0x484469[_0xd3f1('0x6')][_0xd3f1('0x34')](_0xd3f1('0x35'),function(_0x209346){_0x484469[_0xd3f1('0xe')][_0xd3f1('0x36')](_0x484469['_socket'],_0x209346[_0xd3f1('0x37')]);});clearTimeout(_0x484469['_pingTimerObj']);_0x484469[_0xd3f1('0x38')]=setInterval(function(){_0x484469[_0xd3f1('0xe')]['ping'](_0x484469['_socket'])[_0xd3f1('0x26')](function(){},function(_0x4af516){_0x484469['log']['warning'](_0xd3f1('0x39')+_0x4af516);_0x484469[_0xd3f1('0x3a')]();});},PING_INTERVAL*0x3e8);_0x484469[_0xd3f1('0x7')]=_0x484469[_0xd3f1('0x8')];_0x484469[_0xd3f1('0x8')]=[];for(let _0x514ab4 of _0x484469[_0xd3f1('0x7')]){_0x484469['subscribe'](_0x514ab4['specification'],_0x514ab4['callback'])[_0xd3f1('0x3b')](function(_0x3cde53){_0x484469[_0xd3f1('0xb')][_0xd3f1('0x3c')](_0xd3f1('0x3d')+_0x514ab4['specification'][_0xd3f1('0x1a')]+_0xd3f1('0x2c')+_0x3cde53);});}_0x1e35ec();});_0x484469[_0xd3f1('0x6')][_0xd3f1('0x34')](_0xd3f1('0x15'),function(){_0x484469[_0xd3f1('0xb')][_0xd3f1('0x23')](_0xd3f1('0x3e'));clearTimeout(_0x484469[_0xd3f1('0x38')]);_0x484469[_0xd3f1('0x3a')]();});_0x484469['_socket'][_0xd3f1('0x34')](_0xd3f1('0x3c'),function(_0x190a08){_0x484469[_0xd3f1('0xb')]['error'](_0xd3f1('0x3f'));if(!_0x1e5c1b){_0x2b2486(_0xd3f1('0x40')+_0x190a08);}});});}[_0xd3f1('0x3a')](){if(this[_0xd3f1('0x9')]){const _0x59f89f=Math[_0xd3f1('0x41')](this[_0xd3f1('0xa')]);this['log'][_0xd3f1('0x23')](_0xd3f1('0x42')+_0x59f89f+_0xd3f1('0x43'));const _0x34a5e7=this;setTimeout(function(){_0x34a5e7[_0xd3f1('0x11')]()[_0xd3f1('0x26')](function(){_0x34a5e7[_0xd3f1('0xb')][_0xd3f1('0x23')](_0xd3f1('0x44'));},function(){_0x34a5e7[_0xd3f1('0xb')][_0xd3f1('0x1f')](_0xd3f1('0x45'));});if(_0x34a5e7[_0xd3f1('0xa')]<=RETRY_MAX_BACKOFF){_0x34a5e7[_0xd3f1('0xa')]=_0x34a5e7[_0xd3f1('0xa')]*0x2;}},_0x34a5e7[_0xd3f1('0xa')]*0x3e8);}else{this[_0xd3f1('0xb')][_0xd3f1('0x23')]('Auto\x20reconnect\x20disabled\x20(disconnecting?)');}}['_handleIncomingEvent'](_0x45a77b){const _0x2e9781=_0x45a77b['data'][_0xd3f1('0x46')];for(let _0x5a8ee1 of this[_0xd3f1('0x8')]){if(_0x5a8ee1['id']===_0x2e9781){this[_0xd3f1('0xb')][_0xd3f1('0x2e')](_0xd3f1('0x47')+_0x5a8ee1['id']+_0xd3f1('0x48')+JSON['stringify'](_0x45a77b[_0xd3f1('0x37')][_0xd3f1('0x49')]));try{_0x5a8ee1[_0xd3f1('0x3')](_0x45a77b[_0xd3f1('0x37')][_0xd3f1('0x49')]);}catch(_0x39fe4b){this['log'][_0xd3f1('0x1f')](_0xd3f1('0x4a')+_0x39fe4b);_0x45a77b[_0xd3f1('0x4b')]();}_0x45a77b[_0xd3f1('0x4b')]();return;}}_0x45a77b[_0xd3f1('0x4c')](_0xd3f1('0x4d')+_0x2e9781);}}
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
@@ -1 +1 @@
1
- var _0x29bc=['playSignalTones','Canceled','NO_ANSWER','Rejected','REJECTED','BARRED','Busy','BUSY','Call\x20finished','_fireCallEndedEvent','_setAnswerCallTimeout','Setting\x20answer\x20call\x20timeout\x20to:\x20','Exception\x20in\x20recording\x20state\x20change\x20event:\x20','muteStateChange','Exception\x20in\x20hold\x20state\x20change\x20event:\x20','whisperModeChange','Exception\x20in\x20whisper\x20mode\x20change\x20event:\x20','toISOString','callQualityReport','callEnded','Exception\x20in\x20callEnded\x20event:\x20','Start\x20media\x20output\x20(track):','wss://api.telegenta.com/sip/','_mediaPermission','_mediaPermissionError','_UA','_eventClient','_options','_sessionCounter','_remoteAudioElement','createElement','AUDIO','_toneAudioElement','autoplay','_toneTimer','_repeatToneSequence','_repeatToneSequencePos','_toneGainProcessor','_oscillator1','_oscillator2','log','LogHandler','LOGLVL','INFO','level','DEBUG','debug','disable','JsSIP:*','prepareMedia','info','Get\x20media\x20permission','mediaDevices','getUserMedia','then','Media\x20permission\x20granted','error','_isStarted','warning','Phone\x20already\x20started,\x20stopping\x20first','stop','assign','_initToneGenerator','parse','InvalidOptions','provisionToken','Invalid\x20token','eventServer','event_server','authorizationUsername','wss_username','password','wss_password','callToken','wss_token','Using\x20manual\x20specified\x20credentials','Missing\x20username','Missing\x20password','Missing\x20call\x20token','useCallDataInfoEvent','connectEventService','Enabled\x20event\x20service\x20because\x20\x27useCallDataInfoEvent\x27\x20is\x20enabled','connect','Connected\x20to\x20event\x20server','subscribe','_fireCallDataInfoEvent','Event\x20callback\x20failed:\x20','Subscription\x20successful\x20ID\x20=\x20','Unable\x20to\x20connect\x20to\x20event\x20server:\x20','WebSocketInterface','wssServer','Unable\x20to\x20connect\x20phone\x20websocket:\x20','Starting\x20phone','register','newRTCSession','New\x20RTCSession','originator','remote','_startRepeatTone','autoBusyIncoming','keys','length','uuid','\x20because\x20there\x20is\x20already\x20active\x20calls','reject','There\x20are\x20no\x20other\x20sessions,\x20adding\x20incoming\x20call','_addSession','INCOMING','_fireIncomingCallEvent','connecting','connected','CONNECTED','disconnected','DISCONNECTED','registered','_setConnectionState','REGISTERED','unregistered','UNREGISTERED','registrationFailed','REGISTRATION_FAILED','start','Successfully\x20started\x20phone','NotReady','Phone\x20is\x20not\x20started','removeAllListeners','Event\x20client\x20not\x20running,\x20not\x20stopping','disconnect','Phone\x20client\x20successfully\x20stopped','call','_checkForConnectingCalls','NotAllowed','Unable\x20to\x20make\x20new\x20calls\x20while\x20others\x20are\x20connecting','trim','replace','Calling\x20number:\x20','newOutboundSession','listen','sip:','Initiating\x20listen\x20to\x20call\x20with\x20uuid\x20','\x20on\x20media\x20switch\x20','listen-','_activeSessions','hasOwnProperty','sessions','push','hasMediaPermission','isStarted','browserIsChrome','browserIsOpera','remoteAudioElement','Playing\x20tone\x20','\x20/\x20','\x20for\x20','\x20ms','value','frequency','gain','toneVolume','stopTone','Repeating\x20tone\x20sequence\x20started','_repeatToneActive','_doRepeatTone','playTone','_endRepeatTone','Repeating\x20tone\x20stopped','AudioContext','webkitAudioContext','Audio\x20API\x20not\x20supported\x20by\x20this\x20browser','_toneStreamNode','createMediaStreamDestination','srcObject','stream','createGain','createOscillator','A\x20session\x20is\x20currently\x20connecting','ACTIVE','hold','__containerId','Adding\x20new\x20session\x20','We\x20now\x20have\x20','\x20sessions:','emit','sessionCreated','_removeSession','sessionRemoved','Exception\x20in\x20sessionRemoved\x20event:\x20','\x20sessions','_sessionTerminated','\x20terminated,\x20removing\x20in\x20','autoRemoveSessionTime','state','INITIALIZING','Connection\x20state:\x20','_connectionState','connectionStateChange','Exception\x20in\x20connectionStateChange\x20event:\x20','Exception\x20in\x20incomingCall\x20event:\x20','recordings','duration','answerDuration','activeDuration','durationStr','createDurationString','answerDurationStr','activeDurationStr','callDataInfo','_checkMediaPermission','MediaNotPrepared','_phone','_callUUID','_sessionState','_isOnHold','_isMuted','_isRecording','_recordingError','_callAnswerTime','_durationUpdTimerObj','_originatingNumber','_callDisposition','_localNumberName','_isListenCall','_rtcpStatsTimer','_currentReport','_answerCallTimeout','_answerCallTimer','_mediaSwitch','Created\x20new\x20outbound\x20session\x20to:\x20','destinationNumber','stun:stun.l.google.com:19302','options','X-P-UUID:\x20','explicitCallerId','X-CID-Number-Id:\x20','explicitShortCallerId','extraHeaders','metaInfo','record','Record\x20parameter\x20must\x20be\x20a\x20number','Recording\x20enabled\x20and\x20kept\x20for\x20','X-Record:\x20','mediaSwitchURI','Requesting\x20specific\x20media\x20switch\x20','X-RMS:\x20','getOtherSessions','Requesting\x20call\x20grouping\x20on\x20media\x20switch\x20','Other\x20sessions\x20exist\x20but\x20media\x20switch\x20address\x20is\x20invalid','No\x20other\x20active\x20calls,\x20no\x20media\x20switch\x20grouping\x20requested','_initWebRTCSession','answerCallTimeout','newInboundSession','request','getHeader','X-P-UUID','_destinationNumber','X-DID','X-DID-NAME','_originName','display_name','from','user','Incoming\x20call\x20from\x20','X-MS','Media\x20switch\x20handling\x20call:\x20','_webRTCSession','icecandidate','candidate','Got\x20ICE\x20candidate:\x20','type','srflx','relatedAddress','relatedPort','Accepting\x20ICE\x20candidate:\x20','_iceCandidateTimer','ready','ICE\x20Timeout\x20(','iceGatherTimeout','_startDurationUpdateTimer','_startRTCPStatsUpdateTimer','_setSessionState','sending','playCallInitializedTone','CALLING','progress','PROGRESS','response','status_code','Answer\x20call\x20timeout\x20after\x20','\x20seconds','accepted','now','X-Recording','true','Call\x20is\x20being\x20prerecorded','confirmed','ended','TERMINATED','failed','_callEndTime','message','reason_phrase','FAILED','cause','dtmf','Session\x20DTMF','newInfo','New\x20session\x20info','unhold','_fireHoldStateEvent','muted','Microphone\x20muted','_fireMuteStateEvent','unmuted','Microphone\x20unmuted','reinvite','update','Session\x20update','Getusermedia\x20failed','connection','_handleRemoteAudio','WebRTCSession\x20object:','hangup','Hanging\x20up\x20call','terminate','Hanging\x20up\x20call\x20with\x20disposition\x20','_manualDisposition','X-HDISP:\x20','answer','X-Meta-Info:\x20','substr','Rejected\x20call','Rejecting\x20call','localNumberName','Setting\x20destination\x20number\x20to:\x20','Call\x20direction\x20is\x20LISTEN','Call\x20direction\x20is\x20INBOUND','INBOUND','outgoing','Unknown\x20call\x20direction:\x20','direction','UNKNOWN','startRecording','Record:\x20on','once','local','succeeded','Recording\x20started\x20successfully','recordingStateChange','Exception\x20in\x20recordingStateChange\x20event:\x20','Recording\x20start\x20failed:\x20','_fireRecordingStateEvent','sendInfo','application/info','stopRecording','Record:\x20off','Request\x20stop\x20recording','Recording\x20stopped\x20failed:\x20','Mute\x20microphone','mute','Unmute\x20microphone','unmute','toggleMute','muteMic','unmuteMic','isMuted','Hold\x20call','holdAllCalls','sendDTMF','InvalidParameter','Invalid\x20DTMF\x20code','Sending\x20DTMF:\x20','Mic\x20already\x20muted,\x20just\x20sending\x20DTMF','Mute\x20mic\x20while\x20sending\x20DTMF','transfer','Transferring\x20','\x20=>\x20','refer','_request','ruri','Transfer\x20completed\x20successfully','requestFailed','Transfer\x20rejected:\x20','Transfer\x20failed:\x20','playback','\x20hangup\x20after\x20','call_command','PLAYBACK','setWhisperMode','Call\x20is\x20not\x20correct\x20type\x20(listen)','Invalid\x20mode','_whisperMode','_fireWhisperModeChangeEvent','_callBeginTime','callDurationUpdate','Exception\x20in\x20call\x20duration\x20update\x20event:\x20','getStats','values','outboundPacketsSent','packetsSent','outboundBytesSent','bytesSent','inbound-rtp','inboundPacketsReceived','packetsReceived','inboundBytesReceived','bytesReceived','inboundPacketsLost','packetsLost','inboundJitter','jitter','remote-inbound-rtp','outboundPacketsLost','outboundJitter','roundTripTime','_calcReportMetrics','callQualityReportUpdate','Exception\x20in\x20call\x20quality\x20report\x20update\x20event:\x20','outboundPacketLossPct','inboundPacketLossPct','effectiveLatency','max','mos','rFactor','qualityString','Bad','Poor','Excellent','Error','Session\x20state:\x20','sessionStateChange','NORMAL','_callFinished','Unavailable','Not\x20Found','INVALID_NUMBER'];(function(_0x304ee7,_0x279221){var _0x2fc1cc=function(_0x5c9401){while(--_0x5c9401){_0x304ee7['push'](_0x304ee7['shift']());}};_0x2fc1cc(++_0x279221);}(_0x29bc,0x1c9));var _0x1c61=function(_0x323b13,_0x157b23){_0x323b13=_0x323b13-0x0;var _0x177a2e=_0x29bc[_0x323b13];return _0x177a2e;};import _0x2492de from'events';import _0x2d8f05 from'jssip';import{Logger,Exceptions,Tools}from'@telegenta/common';import{EventClient}from'./event-client';import _0x4b81bb from'camelcase-keys';const options={'wssServer':_0x1c61('0x0'),'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 _0x2492de{constructor(logger=null){super();this[_0x1c61('0x1')]=![];this[_0x1c61('0x2')]=![];this[_0x1c61('0x3')]=null;this['_connectionState']=null;this['_isStarted']=![];this[_0x1c61('0x4')]=null;this[_0x1c61('0x5')]=null;this[_0x1c61('0x6')]=0x0;this['_activeSessions']={};this[_0x1c61('0x7')]=document[_0x1c61('0x8')](_0x1c61('0x9'));this['_remoteAudioElement']['autoplay']=!![];this[_0x1c61('0xa')]=document[_0x1c61('0x8')](_0x1c61('0x9'));this[_0x1c61('0xa')][_0x1c61('0xb')]=!![];this[_0x1c61('0xc')]=null;this['_repeatToneActive']=![];this[_0x1c61('0xd')]=[];this[_0x1c61('0xe')]=0x0;this[_0x1c61('0xf')]=null;this[_0x1c61('0x10')]=null;this[_0x1c61('0x11')]=null;this[_0x1c61('0x12')]=logger?logger:new Logger[(_0x1c61('0x13'))](Logger[_0x1c61('0x14')][_0x1c61('0x15')]);if(this[_0x1c61('0x12')][_0x1c61('0x16')]===Logger[_0x1c61('0x14')][_0x1c61('0x17')]){_0x2d8f05[_0x1c61('0x18')][_0x1c61('0x19')](_0x1c61('0x1a'));}else{_0x2d8f05[_0x1c61('0x18')][_0x1c61('0x19')]('JsSIP:*');}}[_0x1c61('0x1b')](){this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x1d'));const self=this;const constraints={'audio':!![],'video':![]};return new Promise(function(resolve,reject){navigator[_0x1c61('0x1e')][_0x1c61('0x1f')](constraints)[_0x1c61('0x20')](()=>{self['_mediaPermission']=!![];self[_0x1c61('0x2')]=![];self[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x21'));resolve();},err=>{self[_0x1c61('0x1')]=![];self[_0x1c61('0x2')]=!![];self[_0x1c61('0x12')][_0x1c61('0x22')]('Denied\x20media\x20permission:\x20'+err);reject(err);});});}['start'](phoneOptions){this['_checkMediaPermission']();if(this[_0x1c61('0x23')]){this[_0x1c61('0x12')][_0x1c61('0x24')](_0x1c61('0x25'));this[_0x1c61('0x26')]();}this['_options']=Object[_0x1c61('0x27')](options,phoneOptions);this[_0x1c61('0x28')]();if(this[_0x1c61('0x5')]['provisionToken']){let pt=null;try{pt=JSON[_0x1c61('0x29')](atob(this['_options']['provisionToken']));}catch(_0x39753a){throw new Exceptions[(_0x1c61('0x2a'))](_0x1c61('0x2b'),_0x1c61('0x2c'));}this[_0x1c61('0x12')][_0x1c61('0x1c')]('Using\x20provisioning\x20token\x20authorization');this['_options']['wssServer']=pt['wss_server'];this[_0x1c61('0x5')][_0x1c61('0x2d')]=pt[_0x1c61('0x2e')];this[_0x1c61('0x5')][_0x1c61('0x2f')]=pt[_0x1c61('0x30')];this['_options'][_0x1c61('0x31')]=pt[_0x1c61('0x32')];this[_0x1c61('0x5')][_0x1c61('0x33')]=pt[_0x1c61('0x34')];}else{this[_0x1c61('0x12')]['info'](_0x1c61('0x35'));if(!this['_options'][_0x1c61('0x2f')]){throw new Exceptions['InvalidOptions'](_0x1c61('0x2f'),_0x1c61('0x36'));}if(!this['_options'][_0x1c61('0x31')]){throw new Exceptions['InvalidOptions'](_0x1c61('0x31'),_0x1c61('0x37'));}if(!this[_0x1c61('0x5')][_0x1c61('0x33')]){throw new Exceptions[(_0x1c61('0x2a'))](_0x1c61('0x33'),_0x1c61('0x38'));}}if(this[_0x1c61('0x5')][_0x1c61('0x39')]&&!this[_0x1c61('0x5')][_0x1c61('0x3a')]){this[_0x1c61('0x12')]['info'](_0x1c61('0x3b'));this[_0x1c61('0x5')]['connectEventService']=!![];}if(this[_0x1c61('0x5')]['connectEventService']){this['_eventClient']=new EventClient(this[_0x1c61('0x12')]);this[_0x1c61('0x4')][_0x1c61('0x3c')](this[_0x1c61('0x5')]['eventServer'])[_0x1c61('0x20')](()=>{this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x3d'));if(this[_0x1c61('0x5')][_0x1c61('0x39')]){let eventSpec={'event_name':'calldata_available','call_token':this['_options'][_0x1c61('0x33')]};this[_0x1c61('0x4')][_0x1c61('0x3e')](eventSpec,data=>{try{this['log'][_0x1c61('0x18')]('Received\x20remote\x20call\x20data\x20info');this[_0x1c61('0x12')]['debug'](data);this[_0x1c61('0x3f')](data);}catch(_0x34dc65){this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x40')+_0x34dc65);}})[_0x1c61('0x20')](subscriptionId=>{this[_0x1c61('0x12')]['info'](_0x1c61('0x41')+subscriptionId);},reason=>{this[_0x1c61('0x12')][_0x1c61('0x22')]('Subscribe\x20failed:\x20'+reason);});}},reason=>{this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x42')+reason);});}let wsSocket=null;try{wsSocket=new _0x2d8f05[(_0x1c61('0x43'))](this[_0x1c61('0x5')][_0x1c61('0x44')]);}catch(_0x1dbde2){throw new Exceptions['UnableToConnect'](_0x1c61('0x45')+_0x1dbde2);}this['log'][_0x1c61('0x1c')](_0x1c61('0x46'));this[_0x1c61('0x12')][_0x1c61('0x18')](this[_0x1c61('0x5')]);this['_UA']=new _0x2d8f05['UA']({'sockets':[wsSocket],'authorization_user':this[_0x1c61('0x5')][_0x1c61('0x2f')],'password':this[_0x1c61('0x5')][_0x1c61('0x31')],'register':this[_0x1c61('0x5')][_0x1c61('0x47')],'display_name':this[_0x1c61('0x5')][_0x1c61('0x2f')],'uri':this['_options'][_0x1c61('0x2f')]+'@telegenta.com','session_timers':![]});const self=this;this[_0x1c61('0x3')]['on'](_0x1c61('0x48'),function(data){self['log'][_0x1c61('0x18')](_0x1c61('0x49'));if(data[_0x1c61('0x4a')]===_0x1c61('0x4b')){const session=new Session(self);session['newInboundSession'](data);if(self[_0x1c61('0x5')]['playRingOnIncoming']){self[_0x1c61('0x4c')](ST_INCOMING);}if(self[_0x1c61('0x5')][_0x1c61('0x4d')]){if(Object[_0x1c61('0x4e')](self['_activeSessions'])[_0x1c61('0x4f')]>0x0){self[_0x1c61('0x12')][_0x1c61('0x1c')]('Autorejecting\x20incoming\x20call\x20'+session[_0x1c61('0x50')]+_0x1c61('0x51'));session[_0x1c61('0x52')]();return;}else{self['log']['debug'](_0x1c61('0x53'));}}self[_0x1c61('0x54')](session);session['_setSessionState'](_0x1c61('0x55'));self[_0x1c61('0x56')](session);}});this[_0x1c61('0x3')]['on'](_0x1c61('0x57'),function(){self['_setConnectionState']('CONNECTING');});this[_0x1c61('0x3')]['on'](_0x1c61('0x58'),function(){self['_setConnectionState'](_0x1c61('0x59'));});this[_0x1c61('0x3')]['on'](_0x1c61('0x5a'),function(){self['_setConnectionState'](_0x1c61('0x5b'));});this[_0x1c61('0x3')]['on'](_0x1c61('0x5c'),function(){self[_0x1c61('0x5d')](_0x1c61('0x5e'));});this[_0x1c61('0x3')]['on'](_0x1c61('0x5f'),function(){self[_0x1c61('0x5d')](_0x1c61('0x60'));});this[_0x1c61('0x3')]['on'](_0x1c61('0x61'),function(){self[_0x1c61('0x5d')](_0x1c61('0x62'));});this[_0x1c61('0x3')][_0x1c61('0x63')]();this['_isStarted']=!![];this['log'][_0x1c61('0x1c')](_0x1c61('0x64'));}[_0x1c61('0x26')](){if(!this[_0x1c61('0x23')]){throw new Exceptions[(_0x1c61('0x65'))](_0x1c61('0x66'));}this[_0x1c61('0x3')][_0x1c61('0x67')]();this[_0x1c61('0x3')][_0x1c61('0x26')]();delete this[_0x1c61('0x3')];if(!this[_0x1c61('0x4')]){this['log'][_0x1c61('0x18')](_0x1c61('0x68'));return;}try{this[_0x1c61('0x4')][_0x1c61('0x69')]();delete this[_0x1c61('0x4')];}catch(_0xbe9d19){this[_0x1c61('0x12')][_0x1c61('0x24')]('Unable\x20to\x20disconnect\x20event\x20client');}this[_0x1c61('0x23')]=![];this['log'][_0x1c61('0x1c')](_0x1c61('0x6a'));}[_0x1c61('0x6b')](number,params={}){if(!this[_0x1c61('0x23')]){throw new Exceptions[(_0x1c61('0x65'))](_0x1c61('0x66'));}if(this[_0x1c61('0x6c')]()){throw Exceptions[_0x1c61('0x6d')](_0x1c61('0x6e'));}this['holdAllCalls']();const callParams=Object[_0x1c61('0x27')]({'record':![],'maximumCallCost':0x0,'answerCallTimeout':0x0,'explicitCallerId':null,'explicitShortCallerId':null,'metaInfo':null,'_isListenCall':![]},params);number=number[_0x1c61('0x6f')]()[_0x1c61('0x70')](/ |\(|\)/g,'');this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x71')+number);let session=new Session(this);session[_0x1c61('0x72')](number,callParams);this['_addSession'](session);return session;}[_0x1c61('0x73')](listenKey){const s=listenKey['split']('@');let callUUID=s[0x0];let mediaSwitch=_0x1c61('0x74')+s[0x1];this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x75')+callUUID+_0x1c61('0x76')+mediaSwitch);return this[_0x1c61('0x6b')](_0x1c61('0x77')+callUUID,{'mediaSwitchURI':mediaSwitch,'_isListenCall':!![]});}['getSessionByUUID'](uuid){for(let key in this[_0x1c61('0x78')]){if(this[_0x1c61('0x78')][_0x1c61('0x79')](key)){if(this['_activeSessions'][key][_0x1c61('0x50')]===uuid){return this[_0x1c61('0x78')][key];}}}return null;}get['options'](){return this['_options'];}get[_0x1c61('0x7a')](){let s=[];for(let key in this['_activeSessions']){if(this[_0x1c61('0x78')][_0x1c61('0x79')](key)){s[_0x1c61('0x7b')](this['_activeSessions'][key]);}}return s;}get[_0x1c61('0x7c')](){return this[_0x1c61('0x1')];}get['hasMediaPermissionError'](){return this['_mediaPermissionError'];}get[_0x1c61('0x7d')](){return this[_0x1c61('0x23')];}get['browserSupported'](){return Tools[_0x1c61('0x7e')]()||Tools['browserIsFirefox']()||Tools[_0x1c61('0x7f')]()||Tools['browserIsSafari']();}get[_0x1c61('0x80')](){return this['_remoteAudioElement'];}['playTone'](duration,freq1,freq2=0x0,callback=null){this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x81')+freq1+_0x1c61('0x82')+freq2+_0x1c61('0x83')+duration+_0x1c61('0x84'));this[_0x1c61('0x10')]['frequency'][_0x1c61('0x85')]=freq1;this[_0x1c61('0x11')][_0x1c61('0x86')][_0x1c61('0x85')]=freq2;this[_0x1c61('0xf')][_0x1c61('0x87')]['value']=this[_0x1c61('0x5')][_0x1c61('0x88')];const self=this;this[_0x1c61('0xc')]=setTimeout(function(){self['stopTone']();if(callback){callback();}},duration);}[_0x1c61('0x89')](){this['_oscillator1']['frequency']['value']=0x0;this[_0x1c61('0x11')]['frequency'][_0x1c61('0x85')]=0x0;this[_0x1c61('0xf')][_0x1c61('0x87')][_0x1c61('0x85')]=0x0;clearTimeout(this[_0x1c61('0xc')]);}[_0x1c61('0x4c')](sequences){this[_0x1c61('0x12')]['info'](_0x1c61('0x8a'));this[_0x1c61('0x12')][_0x1c61('0x18')](sequences);this['_repeatToneSequence']=sequences;this[_0x1c61('0xe')]=0x0;this[_0x1c61('0x8b')]=!![];this[_0x1c61('0x8c')]();}[_0x1c61('0x8c')](){if(this['_repeatToneActive']){this[_0x1c61('0x12')][_0x1c61('0x18')]('Playing\x20repeated\x20tone,\x20pos\x20=\x20'+this[_0x1c61('0xe')]);let toneDef=this[_0x1c61('0xd')][this[_0x1c61('0xe')]];this[_0x1c61('0xe')]++;if(this['_repeatToneSequencePos']===this[_0x1c61('0xd')][_0x1c61('0x4f')]){this[_0x1c61('0xe')]=0x0;}const self=this;this[_0x1c61('0x8d')](toneDef['d'],toneDef['f1'],toneDef['f2'],function(){setTimeout(self['_doRepeatTone']['bind'](self),toneDef['g']);});}}[_0x1c61('0x8e')](){if(this[_0x1c61('0x8b')]){this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x8f'));this[_0x1c61('0x8b')]=![];this[_0x1c61('0x89')]();}}[_0x1c61('0x28')](){const AudioContext=window[_0x1c61('0x90')]||window[_0x1c61('0x91')]||![];if(!AudioContext){throw new Exceptions[(_0x1c61('0x6d'))](_0x1c61('0x92'));}const ctx=new AudioContext();this[_0x1c61('0x93')]=ctx[_0x1c61('0x94')]();this[_0x1c61('0xa')][_0x1c61('0x95')]=this['_toneStreamNode'][_0x1c61('0x96')];this[_0x1c61('0xf')]=ctx[_0x1c61('0x97')]();this['_toneGainProcessor'][_0x1c61('0x87')][_0x1c61('0x85')]=0x0;this['_toneGainProcessor'][_0x1c61('0x3c')](this[_0x1c61('0x93')]);this[_0x1c61('0x10')]=ctx[_0x1c61('0x98')]();this[_0x1c61('0x10')]['connect'](this['_toneGainProcessor']);this['_oscillator1'][_0x1c61('0x86')][_0x1c61('0x85')]=0x0;this[_0x1c61('0x10')][_0x1c61('0x63')]();this[_0x1c61('0x11')]=ctx[_0x1c61('0x98')]();this[_0x1c61('0x11')][_0x1c61('0x3c')](this['_toneGainProcessor']);this[_0x1c61('0x11')][_0x1c61('0x86')][_0x1c61('0x85')]=0x0;this['_oscillator2'][_0x1c61('0x63')]();}['holdAllCalls'](){this[_0x1c61('0x12')][_0x1c61('0x1c')]('Holding\x20all\x20active\x20sessions');if(this[_0x1c61('0x6c')]()){throw Exceptions[_0x1c61('0x6d')](_0x1c61('0x99'));}for(let key in this['_activeSessions']){if(this[_0x1c61('0x78')][_0x1c61('0x79')](key)){let session=this[_0x1c61('0x78')][key];if(session['state']===_0x1c61('0x9a')){session[_0x1c61('0x9b')]();}}}}[_0x1c61('0x54')](session){this['_sessionCounter']++;session[_0x1c61('0x9c')]=this[_0x1c61('0x6')];this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x9d')+session[_0x1c61('0x9c')]+':\x20'+session[_0x1c61('0x50')]);this[_0x1c61('0x78')][session[_0x1c61('0x9c')]]=session;this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x9e')+Object[_0x1c61('0x4e')](this[_0x1c61('0x78')])['length']+_0x1c61('0x9f'));this[_0x1c61('0x12')][_0x1c61('0x18')](this['_activeSessions']);try{this[_0x1c61('0xa0')](_0x1c61('0xa1'),{'session':session});}catch(_0x8cea96){this[_0x1c61('0x12')]['error']('Exception\x20in\x20sessionCreated\x20event:\x20'+_0x8cea96);}}[_0x1c61('0xa2')](session){this['log'][_0x1c61('0x1c')]('Removing\x20session\x20'+session[_0x1c61('0x9c')]+':\x20'+session[_0x1c61('0x50')]);try{this['emit'](_0x1c61('0xa3'),{'session':session});}catch(_0x41cf12){this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0xa4')+_0x41cf12);}delete this[_0x1c61('0x78')][session[_0x1c61('0x9c')]];this['log'][_0x1c61('0x18')](_0x1c61('0x9e')+Object[_0x1c61('0x4e')](this[_0x1c61('0x78')])['length']+_0x1c61('0xa5'));this[_0x1c61('0x12')]['debug'](this[_0x1c61('0x78')]);this['_endRepeatTone']();}[_0x1c61('0xa6')](session){this[_0x1c61('0x12')][_0x1c61('0x18')]('Session\x20'+session['uuid']+_0x1c61('0xa7')+this[_0x1c61('0x5')][_0x1c61('0xa8')]+'\x20ms');const self=this;setTimeout(function(){self[_0x1c61('0xa2')](session);},this['_options']['autoRemoveSessionTime']);}[_0x1c61('0x6c')](){for(let key in this['_activeSessions']){if(this['_activeSessions'][_0x1c61('0x79')](key)){let session=this[_0x1c61('0x78')][key];if(session[_0x1c61('0xa9')]===_0x1c61('0xaa')||session[_0x1c61('0xa9')]==='CALLING'||session[_0x1c61('0xa9')]==='PROGRESS'||session[_0x1c61('0xa9')]===_0x1c61('0x55')){return!![];}}}return![];}[_0x1c61('0x5d')](state){this['log'][_0x1c61('0x1c')](_0x1c61('0xab')+state);this[_0x1c61('0xac')]=state;try{this['emit'](_0x1c61('0xad'),{'state':state});}catch(_0x21e592){this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0xae')+_0x21e592);}}[_0x1c61('0x56')](session){try{this[_0x1c61('0xa0')]('incomingCall',session);}catch(_0x2645d6){this[_0x1c61('0x12')]['error'](_0x1c61('0xaf')+_0x2645d6);}}[_0x1c61('0x3f')](eventData=null){let e;e=_0x4b81bb(eventData);e[_0x1c61('0xb0')]=_0x4b81bb(eventData['recordings']);e[_0x1c61('0xb1')]=e[_0x1c61('0xb1')]*0x3e8;e[_0x1c61('0xb2')]=e[_0x1c61('0xb2')]*0x3e8;e[_0x1c61('0xb3')]=e[_0x1c61('0xb3')]*0x3e8;e[_0x1c61('0xb4')]=Tools[_0x1c61('0xb5')](e['duration']);e[_0x1c61('0xb6')]=e[_0x1c61('0xb2')]?Tools[_0x1c61('0xb5')](e[_0x1c61('0xb2')]):'';e[_0x1c61('0xb7')]=e[_0x1c61('0xb3')]?Tools[_0x1c61('0xb5')](e[_0x1c61('0xb3')]):'';try{this[_0x1c61('0xa0')](_0x1c61('0xb8'),e);}catch(_0x151956){this[_0x1c61('0x12')][_0x1c61('0x22')]('Exception\x20in\x20callDataInfo\x20event:\x20'+_0x151956);}}[_0x1c61('0xb9')](){if(!this[_0x1c61('0x1')]){throw new Exceptions[(_0x1c61('0xba'))]();}}}export class Session extends _0x2492de{constructor(phone){super();this[_0x1c61('0xbb')]=phone;this['log']=phone[_0x1c61('0x12')];this[_0x1c61('0xbc')]=null;this['_webRTCSession']=null;this[_0x1c61('0xbd')]=null;this['_iceCandidateTimer']=null;this[_0x1c61('0xbe')]=![];this[_0x1c61('0xbf')]=![];this[_0x1c61('0xc0')]=![];this[_0x1c61('0xc1')]=null;this['_callBeginTime']=null;this[_0x1c61('0xc2')]=null;this['_callEndTime']=null;this[_0x1c61('0xc3')]=null;this[_0x1c61('0xc4')]=null;this['_destinationNumber']=null;this[_0x1c61('0xc5')]=null;this[_0x1c61('0xc6')]=null;this[_0x1c61('0xc7')]=![];this['_whisperMode']=null;this['_manualDisposition']=null;this[_0x1c61('0xc8')]=null;this[_0x1c61('0xc9')]=null;this[_0x1c61('0xca')]=0x0;this[_0x1c61('0xcb')]=null;this[_0x1c61('0xcc')]=null;}[_0x1c61('0x72')](number,callParams){this[_0x1c61('0xbc')]=Tools['createUUID']();this[_0x1c61('0x12')]['debug'](_0x1c61('0xcd')+number+'\x20['+this[_0x1c61('0xbc')]+']');this[_0x1c61('0xce')]=number;let options={'mediaConstraints':{'audio':!![],'video':![]},'pcConfig':{'iceServers':[{'urls':[_0x1c61('0xcf')]}]},'extraHeaders':['X-Call-token:\x20'+this[_0x1c61('0xbb')][_0x1c61('0xd0')][_0x1c61('0x33')],_0x1c61('0xd1')+this[_0x1c61('0xbc')],'X-Max-cost:\x20'+callParams['maximumCallCost']]};if(callParams[_0x1c61('0xd2')]){options['extraHeaders'][_0x1c61('0x7b')](_0x1c61('0xd3')+callParams[_0x1c61('0xd2')]);}if(callParams[_0x1c61('0xd4')]){options[_0x1c61('0xd5')][_0x1c61('0x7b')]('X-Short-CID-Id:\x20'+callParams['explicitShortCallerId']);}if(callParams[_0x1c61('0xd6')]){options['extraHeaders'][_0x1c61('0x7b')]('X-Meta-Info:\x20'+encodeURI(callParams[_0x1c61('0xd6')]['toString']()['substr'](0x0,0xff)));}if(callParams[_0x1c61('0xd7')]){if(isNaN(callParams[_0x1c61('0xd7')])){throw new Exceptions['InvalidParameter'](_0x1c61('0xd8'));}this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0xd9')+callParams[_0x1c61('0xd7')]+'\x20days');options['extraHeaders'][_0x1c61('0x7b')](_0x1c61('0xda')+callParams[_0x1c61('0xd7')]);this[_0x1c61('0xc0')]=!![];}else{this[_0x1c61('0xc0')]=![];}this['_isListenCall']=callParams[_0x1c61('0xc7')];if(callParams[_0x1c61('0xdb')]){this['log'][_0x1c61('0x18')](_0x1c61('0xdc')+callParams[_0x1c61('0xdb')]);options[_0x1c61('0xd5')][_0x1c61('0x7b')](_0x1c61('0xdd')+callParams[_0x1c61('0xdb')]);}else{const otherSessions=this[_0x1c61('0xde')]();if(otherSessions[_0x1c61('0x4f')]>0x0){if(otherSessions[0x0]['_mediaSwitch']){this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0xdf')+otherSessions[0x0][_0x1c61('0xcc')]);options[_0x1c61('0xd5')]['push']('X-RMS:\x20sip:'+otherSessions[0x0][_0x1c61('0xcc')]);}else{this[_0x1c61('0x12')][_0x1c61('0x24')](_0x1c61('0xe0'));}}else{this[_0x1c61('0x12')]['debug'](_0x1c61('0xe1'));}}const uri=_0x1c61('0x74')+number+'@telegenta.com';try{this[_0x1c61('0xe2')](this['_phone'][_0x1c61('0x3')]['call'](uri,options));}catch(_0x25b745){this[_0x1c61('0x12')][_0x1c61('0x22')]('Error\x20starting\x20call:',_0x25b745);return null;}if(callParams[_0x1c61('0xe3')]){this['_setAnswerCallTimeout'](callParams[_0x1c61('0xe3')]);}}[_0x1c61('0xe4')](newSessionRequest){this[_0x1c61('0xbc')]=newSessionRequest[_0x1c61('0xe5')][_0x1c61('0xe6')](_0x1c61('0xe7'),0x0);this[_0x1c61('0xe8')]=newSessionRequest[_0x1c61('0xe5')][_0x1c61('0xe6')](_0x1c61('0xe9'),0x0);this[_0x1c61('0xc6')]=unescape(newSessionRequest[_0x1c61('0xe5')][_0x1c61('0xe6')](_0x1c61('0xea'),0x0));this[_0x1c61('0xeb')]=newSessionRequest['request']['from'][_0x1c61('0xec')];this['_originatingNumber']=newSessionRequest[_0x1c61('0xe5')][_0x1c61('0xed')]['uri'][_0x1c61('0xee')];this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0xef')+this['_originatingNumber']+'\x20['+this[_0x1c61('0xbc')]+']');this[_0x1c61('0x12')][_0x1c61('0x18')](newSessionRequest);this[_0x1c61('0xcc')]=newSessionRequest['request'][_0x1c61('0xe6')](_0x1c61('0xf0'));this[_0x1c61('0x12')]['debug'](_0x1c61('0xf1')+this[_0x1c61('0xcc')]);this[_0x1c61('0xe2')](newSessionRequest['session']);}[_0x1c61('0xde')](){const allSessions=this[_0x1c61('0xbb')][_0x1c61('0x7a')];let s=[];for(let key in allSessions){if(allSessions[key]){if(allSessions[key][_0x1c61('0x9c')]!==this[_0x1c61('0x9c')]){s['push'](allSessions[key]);}}}return s;}[_0x1c61('0xe2')](webRTCSession){this[_0x1c61('0xf2')]=webRTCSession;this['_callBeginTime']=Date['now']();const self=this;this[_0x1c61('0xf2')]['on'](_0x1c61('0xf3'),function(event){const c=event[_0x1c61('0xf4')];self[_0x1c61('0x12')]['debug'](_0x1c61('0xf5')+c[_0x1c61('0xf4')]);if(c[_0x1c61('0xf6')]===_0x1c61('0xf7')&&c[_0x1c61('0xf8')]!==null&&c[_0x1c61('0xf9')]!==null){self[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0xfa')+c['candidate']);if(self[_0x1c61('0xfb')]!=null)clearTimeout(self['_iceCandidateTimer']);event[_0x1c61('0xfc')]();}else{if(self[_0x1c61('0xfb')]!=null)clearTimeout(self[_0x1c61('0xfb')]);self[_0x1c61('0xfb')]=setTimeout(function(data){self[_0x1c61('0x12')]['debug'](_0x1c61('0xfd')+self[_0x1c61('0xbb')][_0x1c61('0xd0')][_0x1c61('0xfe')]+'\x20ms)\x20reached');data[_0x1c61('0xfc')]();},self[_0x1c61('0xbb')][_0x1c61('0xd0')][_0x1c61('0xfe')],event);}});this[_0x1c61('0xf2')]['on'](_0x1c61('0x57'),function(){self[_0x1c61('0xff')]();self[_0x1c61('0x100')]();self[_0x1c61('0x101')](_0x1c61('0xaa'));});this['_webRTCSession']['on'](_0x1c61('0x102'),function(){if(self[_0x1c61('0xbb')][_0x1c61('0xd0')][_0x1c61('0x103')]){self[_0x1c61('0xbb')][_0x1c61('0x4c')](ST_CALLINIT);}self[_0x1c61('0x101')](_0x1c61('0x104'));});this['_webRTCSession']['on'](_0x1c61('0x105'),function(data){if(data[_0x1c61('0x4a')]==='remote'){self[_0x1c61('0x101')](_0x1c61('0x106'),{'code':data[_0x1c61('0x107')][_0x1c61('0x108')]});self[_0x1c61('0xbb')][_0x1c61('0x8e')]();if(data[_0x1c61('0x107')][_0x1c61('0x108')]===0xb4){self[_0x1c61('0xbb')][_0x1c61('0x4c')](ST_RINGBACK);}if(self['_answerCallTimeout']){self[_0x1c61('0xcb')]=setTimeout(function(){self[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x109')+self[_0x1c61('0xca')]+_0x1c61('0x10a'));try{self['hangup']();}catch(_0x382687){self['log']['info']('No\x20active\x20session,\x20ignoring\x20answer\x20call\x20timeout');}},self[_0x1c61('0xca')]*0x3e8);}}});this[_0x1c61('0xf2')]['on'](_0x1c61('0x10b'),function(data){self['_phone'][_0x1c61('0x8e')]();self[_0x1c61('0xc2')]=Date[_0x1c61('0x10c')]();if(self[_0x1c61('0xca')]){clearTimeout(self[_0x1c61('0xcb')]);self['_answerCallTimeout']=0x0;}if(data['originator']===_0x1c61('0x4b')){const recState=data[_0x1c61('0x107')]['getHeader'](_0x1c61('0x10d'));if(recState===_0x1c61('0x10e')){self[_0x1c61('0x12')]['debug'](_0x1c61('0x10f'));}else{self[_0x1c61('0x12')][_0x1c61('0x18')]('No\x20call\x20recording\x20started\x20yet');}self[_0x1c61('0xcc')]=data[_0x1c61('0x107')][_0x1c61('0xe6')]('X-MS');self['log']['debug'](_0x1c61('0xf1')+self[_0x1c61('0xcc')]);}});this[_0x1c61('0xf2')]['on'](_0x1c61('0x110'),function(){self['_setSessionState'](_0x1c61('0x9a'));});this['_webRTCSession']['on'](_0x1c61('0x111'),function(){self[_0x1c61('0xbb')][_0x1c61('0x8e')]();self['_callEndTime']=Date[_0x1c61('0x10c')]();if(self[_0x1c61('0xca')]){clearTimeout(self[_0x1c61('0xcb')]);}self['_setSessionState'](_0x1c61('0x112'));});this['_webRTCSession']['on'](_0x1c61('0x113'),function(data){self[_0x1c61('0xbb')]['_endRepeatTone']();self[_0x1c61('0x114')]=Date[_0x1c61('0x10c')]();if(self[_0x1c61('0xca')]){clearTimeout(self[_0x1c61('0xcb')]);}let m;if(data[_0x1c61('0x115')]){m=data[_0x1c61('0x115')]['status_code']+'\x20'+data[_0x1c61('0x115')][_0x1c61('0x116')];}else{m='';}self['_setSessionState'](_0x1c61('0x117'),{'cause':data[_0x1c61('0x118')],'message':m});});this['_webRTCSession']['on'](_0x1c61('0x119'),function(data){self[_0x1c61('0x12')]['debug'](_0x1c61('0x11a'),data);});this[_0x1c61('0xf2')]['on'](_0x1c61('0x11b'),function(data){self[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x11c'),data);});this[_0x1c61('0xf2')]['on'](_0x1c61('0x9b'),function(){self[_0x1c61('0xbe')]=!![];self['_fireHoldStateEvent']();self[_0x1c61('0x101')]('ON_HOLD');});this[_0x1c61('0xf2')]['on'](_0x1c61('0x11d'),function(){self[_0x1c61('0xbe')]=![];self[_0x1c61('0x11e')]();self[_0x1c61('0x101')](_0x1c61('0x9a'));});this['_webRTCSession']['on'](_0x1c61('0x11f'),function(data){self[_0x1c61('0x12')]['debug'](_0x1c61('0x120'),data);self[_0x1c61('0xbf')]=!![];self[_0x1c61('0x121')]();});this[_0x1c61('0xf2')]['on'](_0x1c61('0x122'),function(data){self[_0x1c61('0x12')]['debug'](_0x1c61('0x123'),data);self[_0x1c61('0xbf')]=![];self[_0x1c61('0x121')]();});this[_0x1c61('0xf2')]['on'](_0x1c61('0x124'),function(data){self[_0x1c61('0x12')]['debug']('Session\x20reinvite',data);});this[_0x1c61('0xf2')]['on'](_0x1c61('0x125'),function(data){self[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x126'),data);});this[_0x1c61('0xf2')]['on']('getusermediafailed',function(data){self[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x127'),data);});if(self[_0x1c61('0xf2')][_0x1c61('0x128')]){self[_0x1c61('0x129')](self['_webRTCSession']);}this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x12a'));this['log'][_0x1c61('0x18')](this);}[_0x1c61('0x12b')](disposition=null){if(!disposition){this[_0x1c61('0x12')]['info'](_0x1c61('0x12c'));this[_0x1c61('0xf2')][_0x1c61('0x12d')]();}else{this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x12e')+disposition);this[_0x1c61('0x12f')]=disposition;this[_0x1c61('0xf2')]['terminate']({'extraHeaders':[_0x1c61('0x130')+disposition]});}}[_0x1c61('0x131')](metaInfo=null){let options={'mediaConstraints':{'audio':!![],'video':![]},'pcConfig':{'iceServers':[{'urls':['stun:stun.l.google.com:19302']}]},'extraHeaders':['X-Call-token:\x20'+this[_0x1c61('0xbb')][_0x1c61('0xd0')][_0x1c61('0x33')]]};if(metaInfo){options['extraHeaders'][_0x1c61('0x7b')](_0x1c61('0x132')+encodeURI(metaInfo['toString']()[_0x1c61('0x133')](0x0,0xff)));}this['_webRTCSession'][_0x1c61('0x131')](options);this['_handleRemoteAudio'](this['_webRTCSession']);}['reject'](statusCode=0x25b,reasonPhrase=_0x1c61('0x134')){this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x135'));this['_webRTCSession'][_0x1c61('0x12d')]({'status_code':statusCode,'reason_phrase':reasonPhrase});}get[_0x1c61('0x50')](){return this[_0x1c61('0xbc')];}get[_0x1c61('0xce')](){return this[_0x1c61('0xe8')];}get[_0x1c61('0x136')](){return this[_0x1c61('0xc6')];}get['originatingNumber'](){return this['_originatingNumber'];}set[_0x1c61('0xce')](number){this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x137')+number);this[_0x1c61('0xe8')]=number;}get[_0x1c61('0xa9')](){return this[_0x1c61('0xbd')];}get['direction'](){if(this[_0x1c61('0xc7')]){this['log']['debug'](_0x1c61('0x138'));return'LISTEN';}else if(this[_0x1c61('0xf2')]['direction']==='incoming'){this[_0x1c61('0x12')]['debug'](_0x1c61('0x139'));return _0x1c61('0x13a');}else if(this[_0x1c61('0xf2')]['direction']===_0x1c61('0x13b')){this[_0x1c61('0x12')][_0x1c61('0x18')]('Call\x20direction\x20is\x20OUTBOUND');return'OUTBOUND';}else{this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x13c')+this[_0x1c61('0xf2')][_0x1c61('0x13d')]);return _0x1c61('0x13e');}}[_0x1c61('0x13f')](){const opt={'extraHeaders':[_0x1c61('0x140')]};this[_0x1c61('0x12')]['debug']('Request\x20start\x20recording');const self=this;this[_0x1c61('0xf2')][_0x1c61('0x141')](_0x1c61('0x11b'),data=>{if(data[_0x1c61('0x4a')]===_0x1c61('0x142')){data[_0x1c61('0x1c')]['on'](_0x1c61('0x143'),function(){self['log']['info'](_0x1c61('0x144'));self[_0x1c61('0xc0')]=!![];try{self['emit'](_0x1c61('0x145'),{'state':!![],'error':null});}catch(_0xb324df){self[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x146')+_0xb324df);}});data[_0x1c61('0x1c')]['on'](_0x1c61('0x113'),function(data){self[_0x1c61('0xc1')]=data[_0x1c61('0x107')][_0x1c61('0x116')];self[_0x1c61('0x12')]['error'](_0x1c61('0x147')+self[_0x1c61('0xc1')]);self[_0x1c61('0x148')]();});}});this[_0x1c61('0xf2')][_0x1c61('0x149')](_0x1c61('0x14a'),null,opt);}[_0x1c61('0x14b')](){const opt={'extraHeaders':[_0x1c61('0x14c')]};this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x14d'));const self=this;this['_webRTCSession'][_0x1c61('0x141')](_0x1c61('0x11b'),data=>{data[_0x1c61('0x1c')]['on'](_0x1c61('0x143'),function(){self[_0x1c61('0x12')][_0x1c61('0x1c')]('Recording\x20stopped\x20successfully');self[_0x1c61('0xc0')]=![];try{self['emit'](_0x1c61('0x145'),{'state':![],'error':null});}catch(_0x1ad1d7){self[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x146')+_0x1ad1d7);}});data[_0x1c61('0x1c')]['on'](_0x1c61('0x113'),function(data){self[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x14e')+data[_0x1c61('0x107')][_0x1c61('0x116')]);try{self[_0x1c61('0xa0')](_0x1c61('0x145'),{'state':self[_0x1c61('0xc0')],'error':data['response']['reason_phrase']});}catch(_0x9dc1de){self[_0x1c61('0x12')]['error']('Exception\x20in\x20recordingStateChange\x20event:\x20'+_0x9dc1de);}});});this[_0x1c61('0xf2')][_0x1c61('0x149')](_0x1c61('0x14a'),null,opt);}['toggleRecording'](){if(!this[_0x1c61('0xc0')]){this['startRecording']();return!![];}else{this[_0x1c61('0x14b')]();return![];}}get['isRecording'](){return this[_0x1c61('0xc0')];}['muteMic'](){this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x14f'));this['_webRTCSession'][_0x1c61('0x150')]();}['unmuteMic'](){this['log'][_0x1c61('0x1c')](_0x1c61('0x151'));this[_0x1c61('0xf2')][_0x1c61('0x152')]();}[_0x1c61('0x153')](){if(!this[_0x1c61('0xbf')]){this[_0x1c61('0x154')]();}else{this[_0x1c61('0x155')]();}}get[_0x1c61('0x156')](){return this[_0x1c61('0xbf')];}[_0x1c61('0x9b')](){this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x157'));this[_0x1c61('0xf2')][_0x1c61('0x9b')]();}[_0x1c61('0x11d')](){this[_0x1c61('0x12')][_0x1c61('0x1c')]('Uncall\x20call');this[_0x1c61('0xbb')][_0x1c61('0x158')]();this[_0x1c61('0xf2')][_0x1c61('0x11d')]();}['toggleHold'](){if(!this['_isOnHold']){this['hold']();}else{this[_0x1c61('0x11d')]();}}get['isOnHold'](){return this[_0x1c61('0xbe')];}[_0x1c61('0x159')](code,playLocal=!![]){if(!(code in DTMF_FREQUENCY_TABLE)){throw new Exceptions[(_0x1c61('0x15a'))](_0x1c61('0x15b'));}this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x15c')+code);this[_0x1c61('0xf2')]['sendDTMF'](code);if(playLocal){const f=DTMF_FREQUENCY_TABLE[code];if(this['_isMuted']){this[_0x1c61('0x12')]['debug'](_0x1c61('0x15d'));this[_0x1c61('0xbb')][_0x1c61('0x8d')](0x1f4,f[0x0],f[0x1]);}else{this['log'][_0x1c61('0x18')](_0x1c61('0x15e'));this['_webRTCSession']['mute']();const self=this;this[_0x1c61('0xbb')][_0x1c61('0x8d')](0x1f4,f[0x0],f[0x1],function(){self['log']['debug']('Unmute\x20mic\x20after\x20DTMF');self[_0x1c61('0xf2')][_0x1c61('0x152')]();});}}}[_0x1c61('0x15f')](dstSession){this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x160')+this[_0x1c61('0x50')]+_0x1c61('0x161')+dstSession[_0x1c61('0x50')]);const referSubscriber=this[_0x1c61('0xf2')][_0x1c61('0x162')](this[_0x1c61('0xf2')][_0x1c61('0x163')][_0x1c61('0x164')],{'replaces':dstSession[_0x1c61('0xf2')]});const self=this;referSubscriber['on']('requestSucceeded',function(){self[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x165'));});referSubscriber['on'](_0x1c61('0x166'),function(cause){self[_0x1c61('0x12')]['error'](_0x1c61('0x167')+cause);});referSubscriber['on'](_0x1c61('0x113'),function(cause){self[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x168')+cause);});}[_0x1c61('0x169')](media_file_id,hangup_after=![]){if(!this['_phone']['_options'][_0x1c61('0x3a')]){throw new Exceptions[(_0x1c61('0x6d'))]('Event\x20service\x20not\x20enabled');}this[_0x1c61('0x12')][_0x1c61('0x1c')]('Playback\x20media\x20file\x20'+media_file_id+_0x1c61('0x16a')+hangup_after);const p=this[_0x1c61('0xbb')][_0x1c61('0x4')]['fireEvent'](_0x1c61('0x16b'),{'call_uuid':this[_0x1c61('0x50')],'call_command':'playback','media_file_id':media_file_id,'hangup_after':hangup_after});if(hangup_after){this[_0x1c61('0xbb')][_0x1c61('0x7')]['srcObject']=null;p[_0x1c61('0x20')](()=>{this[_0x1c61('0x101')](_0x1c61('0x16c'));});}return p;}[_0x1c61('0x16d')](mode=0x0){if(!this[_0x1c61('0x13d')]==='LISTEN'){throw new Exceptions[(_0x1c61('0x6d'))](_0x1c61('0x16e'));}if(mode<0x0||mode>0x2){throw new Exceptions['InvalidOptions'](_0x1c61('0x16f'));}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[_0x1c61('0x159')](t_dtmf_mode,![]);this[_0x1c61('0x170')]=mode;this[_0x1c61('0x171')]();}[_0x1c61('0xff')](){const self=this;if(!this['_durationUpdTimerObj']){this['_durationUpdTimerObj']=setInterval(function(){const activeDuration=self['_callAnswerTime']?Date['now']()-self[_0x1c61('0xc2')]:null;const e={'uuid':self['_callUUID'],'beginTime':self['_callBeginTime'],'answerTime':self[_0x1c61('0xc2')],'endTime':self['_callEndTime'],'duration':Date[_0x1c61('0x10c')]()-self[_0x1c61('0x172')],'durationStr':Tools[_0x1c61('0xb5')](Date[_0x1c61('0x10c')]()-self[_0x1c61('0x172')]),'activeDuration':activeDuration,'activeDurationStr':activeDuration?Tools[_0x1c61('0xb5')](activeDuration):''};try{self['emit'](_0x1c61('0x173'),e);}catch(_0x4733c6){self['log'][_0x1c61('0x22')](_0x1c61('0x174')+_0x4733c6);}},0x3e8);}}[_0x1c61('0x100')](){if(!this[_0x1c61('0xc8')]){const emptyReport={'outboundPacketsSent':0x0,'outboundBytesSent':0x0,'outboundPacketsLost':0x0,'outboundJitter':0x0,'inboundPacketsReceived':0x0,'inboundBytesReceived':0x0,'inboundPacketsLost':0x0,'inboundJitter':0x0,'roundTripTime':0x0};this[_0x1c61('0xc9')]=Object[_0x1c61('0x27')]({},emptyReport);this['_rtcpStatsTimer']=setInterval(()=>{this[_0x1c61('0xf2')]['_connection'][_0x1c61('0x175')]()[_0x1c61('0x20')](data=>{let totalReport=Object[_0x1c61('0x27')]({},emptyReport);let deltaReport=Object[_0x1c61('0x27')]({},emptyReport);for(let report of data[_0x1c61('0x176')]()){switch(report[_0x1c61('0xf6')]){case'outbound-rtp':totalReport[_0x1c61('0x177')]=report['packetsSent'];deltaReport[_0x1c61('0x177')]=report[_0x1c61('0x178')]-this[_0x1c61('0xc9')][_0x1c61('0x177')];totalReport[_0x1c61('0x179')]=report[_0x1c61('0x17a')];deltaReport[_0x1c61('0x179')]=report['bytesSent']-this[_0x1c61('0xc9')][_0x1c61('0x179')];break;case _0x1c61('0x17b'):totalReport[_0x1c61('0x17c')]=report[_0x1c61('0x17d')];deltaReport['inboundPacketsReceived']=report[_0x1c61('0x17d')]-this['_currentReport']['inboundPacketsReceived'];totalReport[_0x1c61('0x17e')]=report['bytesReceived'];deltaReport[_0x1c61('0x17e')]=report[_0x1c61('0x17f')]-this['_currentReport'][_0x1c61('0x17e')];totalReport[_0x1c61('0x180')]=report[_0x1c61('0x181')];deltaReport[_0x1c61('0x180')]=report[_0x1c61('0x181')]-this[_0x1c61('0xc9')][_0x1c61('0x180')];totalReport[_0x1c61('0x182')]=report[_0x1c61('0x183')]*0x3e8;deltaReport['inboundJitter']=report[_0x1c61('0x183')]*0x3e8;break;case _0x1c61('0x184'):totalReport[_0x1c61('0x185')]=report[_0x1c61('0x181')];deltaReport['outboundPacketsLost']=report[_0x1c61('0x181')]-this[_0x1c61('0xc9')][_0x1c61('0x185')];totalReport['outboundJitter']=report[_0x1c61('0x183')]*0x3e8;deltaReport[_0x1c61('0x186')]=report[_0x1c61('0x183')]*0x3e8;totalReport['roundTripTime']=report[_0x1c61('0x187')]*0x3e8;deltaReport['roundTripTime']=report[_0x1c61('0x187')]*0x3e8;break;default:break;}}this[_0x1c61('0xc9')]=this[_0x1c61('0x188')](totalReport);if(totalReport[_0x1c61('0x187')]){const finalReport={'total':this[_0x1c61('0xc9')],'delta':this[_0x1c61('0x188')](deltaReport)};try{this['emit'](_0x1c61('0x189'),finalReport);}catch(_0xabaf97){this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x18a')+_0xabaf97);}}});},0x1388);}}[_0x1c61('0x188')](report){report[_0x1c61('0x18b')]=report[_0x1c61('0x185')]/report[_0x1c61('0x177')];report[_0x1c61('0x18c')]=report[_0x1c61('0x180')]/report[_0x1c61('0x17c')];report[_0x1c61('0x18d')]=report[_0x1c61('0x187')]+(report[_0x1c61('0x182')]+report[_0x1c61('0x186')])+0xa;const lossRate=(report[_0x1c61('0x18b')]+report[_0x1c61('0x18c')])*0x64;const lossEffect=0x5f*lossRate/(lossRate+0xa);const latencyEffect=report[_0x1c61('0x18d')]*0.1;report['rFactor']=Math[_0x1c61('0x18e')](0x0,0x64-lossEffect-latencyEffect);report[_0x1c61('0x18f')]=0x1+0.035*report[_0x1c61('0x190')]+0.000007*report['rFactor']*(report[_0x1c61('0x190')]-0x3c)*(0x64-report['rFactor']);switch(!![]){case report[_0x1c61('0x190')]<0x32:report[_0x1c61('0x191')]=_0x1c61('0x192');break;case report[_0x1c61('0x190')]<0x46:report[_0x1c61('0x191')]=_0x1c61('0x193');break;case report[_0x1c61('0x190')]<0x50:report[_0x1c61('0x191')]='Fair';break;case report[_0x1c61('0x190')]<0x5a:report[_0x1c61('0x191')]='Good';break;case report[_0x1c61('0x190')]<=0x64:report[_0x1c61('0x191')]=_0x1c61('0x194');break;default:report['qualityString']=_0x1c61('0x195');}return report;}[_0x1c61('0x101')](state,info=null){this['log'][_0x1c61('0x18')](_0x1c61('0x196')+state);if(info){this[_0x1c61('0x12')][_0x1c61('0x18')](info);}this[_0x1c61('0xbd')]=state;try{this['emit'](_0x1c61('0x197'),Object[_0x1c61('0x27')]({'state':state,'uuid':this['_callUUID']},info));}catch(_0x34112c){this[_0x1c61('0x12')][_0x1c61('0x22')]('Exception\x20in\x20sessionStateChange\x20event:'+_0x34112c);}if(state==='TERMINATED'){this[_0x1c61('0xc5')]=this[_0x1c61('0x12f')]||_0x1c61('0x198');this[_0x1c61('0x199')]();}if(state===_0x1c61('0x117')){if(info[_0x1c61('0x118')]===_0x1c61('0x19a')){this[_0x1c61('0xc5')]='TEMP_UNAVAIL';if(this['_phone'][_0x1c61('0xd0')]['playSignalTones']){this[_0x1c61('0xbb')][_0x1c61('0x4c')](ST_TEMP_UNAVAIL);}}if(info[_0x1c61('0x118')]===_0x1c61('0x19b')){this['_callDisposition']=_0x1c61('0x19c');if(this[_0x1c61('0xbb')]['options'][_0x1c61('0x19d')]){this['_phone'][_0x1c61('0x4c')](ST_INVALID_NUMBER);}}if(info[_0x1c61('0x118')]===_0x1c61('0x19e')){this[_0x1c61('0xc5')]=this[_0x1c61('0x12f')]||_0x1c61('0x19f');}if(info['cause']===_0x1c61('0x1a0')){if(this['direction']===_0x1c61('0x13a')){this[_0x1c61('0xc5')]=_0x1c61('0x1a1');}else{this[_0x1c61('0xc5')]=_0x1c61('0x1a2');}}if(info[_0x1c61('0x118')]===_0x1c61('0x1a3')){this['_callDisposition']=_0x1c61('0x1a4');if(this[_0x1c61('0xbb')][_0x1c61('0xd0')][_0x1c61('0x19d')]){this[_0x1c61('0xbb')]['_startRepeatTone'](ST_BUSY);}}if(this[_0x1c61('0xf2')][_0x1c61('0x13d')]==='incoming'){}this['_callFinished']();}}[_0x1c61('0x199')](){this[_0x1c61('0x12')][_0x1c61('0x1c')](_0x1c61('0x1a5'));this[_0x1c61('0x1a6')]();clearInterval(this[_0x1c61('0xc3')]);clearInterval(this['_rtcpStatsTimer']);this[_0x1c61('0xbb')][_0x1c61('0xa6')](this);}[_0x1c61('0x1a7')](timeout){this[_0x1c61('0x12')][_0x1c61('0x18')](_0x1c61('0x1a8')+timeout);this[_0x1c61('0xca')]=timeout;}['_fireRecordingStateEvent'](){try{this['emit'](_0x1c61('0x145'),{'state':this[_0x1c61('0xc0')],'error':this[_0x1c61('0xc1')]});}catch(_0x121aa2){this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x1a9')+_0x121aa2);}}[_0x1c61('0x121')](){try{this['emit'](_0x1c61('0x1aa'),{'state':this['_isMuted']});}catch(_0x41497b){this[_0x1c61('0x12')][_0x1c61('0x22')]('Exception\x20in\x20mute\x20state\x20change\x20event:\x20'+_0x41497b);}}['_fireHoldStateEvent'](){try{this[_0x1c61('0xa0')]('holdStateChange',{'state':this[_0x1c61('0xbe')]});}catch(_0x5f1f79){this['log'][_0x1c61('0x22')](_0x1c61('0x1ab')+_0x5f1f79);}}[_0x1c61('0x171')](){try{this[_0x1c61('0xa0')](_0x1c61('0x1ac'),{'mode':this[_0x1c61('0x170')]});}catch(_0x2f64ef){this[_0x1c61('0x12')][_0x1c61('0x22')](_0x1c61('0x1ad')+_0x2f64ef);}}[_0x1c61('0x1a6')](){let e;e={'uuid':this[_0x1c61('0xbc')],'direction':this['direction'],'disposition':this['_callDisposition'],'originatingNumber':this[_0x1c61('0xc4')],'destinationNumber':this['_destinationNumber'],'duration':this[_0x1c61('0x114')]-this[_0x1c61('0x172')],'answerDuration':this[_0x1c61('0xc2')]?this['_callAnswerTime']-this['_callBeginTime']:null,'activeDuration':this[_0x1c61('0xc2')]?this[_0x1c61('0x114')]-this[_0x1c61('0xc2')]:null,'startTime':new Date(this[_0x1c61('0x172')])[_0x1c61('0x1ae')](),'endTime':new Date(this[_0x1c61('0x114')])[_0x1c61('0x1ae')](),'answerTime':this['_callAnswerTime']?new Date(this[_0x1c61('0xc2')])['toISOString']():null};e[_0x1c61('0xb4')]=Tools[_0x1c61('0xb5')](e['duration']);e[_0x1c61('0xb6')]=e[_0x1c61('0xb2')]?Tools[_0x1c61('0xb5')](e[_0x1c61('0xb2')]):'';e[_0x1c61('0xb7')]=e[_0x1c61('0xb3')]?Tools['createDurationString'](e[_0x1c61('0xb3')]):'';e[_0x1c61('0x1af')]=this[_0x1c61('0xc9')];try{this['emit'](_0x1c61('0x1b0'),e);}catch(_0x934f69){this[_0x1c61('0x12')]['error'](_0x1c61('0x1b1')+_0x934f69);}}[_0x1c61('0x129')](session){this[_0x1c61('0xbb')][_0x1c61('0x8e')]();const self=this;session['connection']['ontrack']=function(event){self[_0x1c61('0x12')]['debug'](_0x1c61('0x1b2'));self[_0x1c61('0x12')][_0x1c61('0x18')](event);self[_0x1c61('0xbb')][_0x1c61('0x7')][_0x1c61('0x95')]=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