Built motion from commit 06eb8eb0.|2.6.31
[motion2.git] / server / services / ami / dialer / utils / index.js
index d4feb64..23a14d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x365c=['Intervals','NULL_INTERVAL','isEmpty','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','toString','error','[decrementOriginate]\x20queue\x20originate\x20value','length','checkContactEmpty','erlangb','[checkContactLowerLimitOriginate]\x20','checkContactLowerLimitOriginate','createdAt','tags','undefined','XMD-','toUpperCase','setXMDContactVariables','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','ivr','type','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','isNil','Interval'];(function(_0x570195,_0x5a30b3){var _0xbf388c=function(_0x1a23af){while(--_0x1a23af){_0x570195['push'](_0x570195['shift']());}};_0xbf388c(++_0x5a30b3);}(_0x365c,0x1d5));var _0xc365=function(_0x193068,_0x26e0a1){_0x193068=_0x193068-0x0;var _0x3a9b16=_0x365c[_0x193068];return _0x3a9b16;};'use strict';var _=require('lodash');var moment=require(_0xc365('0x0'));var util=require(_0xc365('0x1'));var logger=require(_0xc365('0x2'))(_0xc365('0x3'));var timezones=require(_0xc365('0x4'))[_0xc365('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xc365('0x6'),'BLACKLIST':_0xc365('0x7'),'CONTACTS_RESCHEDULED':_0xc365('0x8'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xc365('0x9'),'EMPTY_INTERVAL':_0xc365('0xa'),'INACTIVE':_0xc365('0xb'),'NO_AGENTS_LOGGED':_0xc365('0xc'),'NO_AVAILABLE_CONTACTS':_0xc365('0xd'),'NULL_INTERVAL':_0xc365('0xe'),'OVERTIME_INTERVAL':_0xc365('0xf'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xc365('0x10'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0xc365('0x11'),'UNKNOWN_TIMEZONE':_0xc365('0x12'),'UNREACHABLE_TRUNK':_0xc365('0x13')};exports[_0xc365('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x16beec){return _0x16beec[_0xc365('0x15')]==='preview';}exports[_0xc365('0x16')]=isPreviewCampaign;function isIVRCampaign(_0x246cf1){return _0x246cf1['type']===_0xc365('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0xd3f92e){return _0xd3f92e[_0xc365('0x18')]==='outbound';}exports[_0xc365('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x4c8e9e){return _0x4c8e9e[_0xc365('0x1a')];}exports[_0xc365('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0xe3bf3f){return _0xe3bf3f[_0xc365('0x1c')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0xf545a2,_0xf0ed9a){var _0x45a3b6=moment(_0xf545a2)[_0xc365('0x1d')](0x0);var _0x3ae039=moment(_0xf0ed9a)[_0xc365('0x1d')](0x0);return _0x45a3b6[_0xc365('0x1e')](_0x3ae039,_0xc365('0x1f'));}exports[_0xc365('0x20')]=getSeconds;function hasQueueCampaignDataChanged(_0x1d2287,_0x3880a6){var _0xd83b7=![];var _0xd88334=_0x1d2287['dialMethod']!==_0x3880a6[_0xc365('0x15')]||_0x1d2287[_0xc365('0x1a')]!==_0x3880a6[_0xc365('0x1a')]||_0x1d2287[_0xc365('0x21')]!==_0x3880a6[_0xc365('0x21')];var _0x135f24=_0x1d2287['available']!==_0x3880a6[_0xc365('0x22')]||_0x1d2287[_0xc365('0x23')]!==_0x3880a6['loggedIn']||_0x1d2287[_0xc365('0x24')]!==_0x3880a6[_0xc365('0x24')]||_0x1d2287['paused']!==_0x3880a6[_0xc365('0x25')]||_0x1d2287[_0xc365('0x26')]!==_0x3880a6['talking']||_0x1d2287['pTalking']!==_0x3880a6[_0xc365('0x27')]||_0x1d2287[_0xc365('0x28')]!==_0x3880a6[_0xc365('0x28')]||_0x1d2287[_0xc365('0x29')]!==_0x3880a6[_0xc365('0x29')]||_0x1d2287['originated']!==_0x3880a6[_0xc365('0x2a')];if(_0x1d2287['Trunk']&&_0x3880a6[_0xc365('0x2b')]){_0xd83b7=_0x1d2287[_0xc365('0x2b')][_0xc365('0x2c')]!==_0x3880a6['Trunk'][_0xc365('0x2c')]||_0x1d2287['Trunk'][_0xc365('0x1c')]!==_0x3880a6['Trunk']['active'];}return _0xd88334||_0x135f24||_0xd83b7;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x257602){var _0x5abb2d=null;var _0x14ddc0=_0x257602['dialTimezone'];if(_[_0xc365('0x2d')](_0x257602['dialGlobalInterval'])||_[_0xc365('0x2d')](_0x257602[_0xc365('0x2e')])||_[_0xc365('0x2d')](_0x257602[_0xc365('0x2e')][_0xc365('0x2f')])){_0x5abb2d=CAMPAIGN_STATUS[_0xc365('0x30')];}else if(_[_0xc365('0x31')](_0x257602[_0xc365('0x32')])||_[_0xc365('0x31')](_0x257602[_0xc365('0x2e')][_0xc365('0x2f')])){_0x5abb2d=CAMPAIGN_STATUS[_0xc365('0x33')];}else if(_0x14ddc0&&!timezones[_0x14ddc0]){_0x5abb2d=CAMPAIGN_STATUS[_0xc365('0x34')];}return _0x5abb2d;}function checkAnyValidTrunk(_0xd24fd9,_0x4b41af){var _0x1a87d6=null;var _0x54de97=_0xc365('0x35');var _0x294f5d=[_0xc365('0x36'),_0xc365('0x37')];var _0x26f0e0=!![];if(_0xd24fd9[_0xc365('0x2b')]&&_0xd24fd9[_0xc365('0x2b')][_0xc365('0x1c')]){_0x54de97+=_0xd24fd9[_0xc365('0x2b')]['name'];_0x1a87d6=_0x4b41af[_0x54de97];_0x26f0e0=_0x294f5d['includes'](_0x1a87d6[_0xc365('0x38')]);}else if(_0xd24fd9['TrunkBackup']&&_0xd24fd9[_0xc365('0x39')][_0xc365('0x1c')]){_0x54de97+=_0xd24fd9['TrunkBackup'][_0xc365('0x2c')];_0x1a87d6=_0x4b41af[_0x54de97];_0x26f0e0=_0x294f5d[_0xc365('0x3a')](_0x1a87d6['status']);}return _0x26f0e0;}function getQueueCampaignStatusMessage(_0x2792bf,_0x102fbd){var _0x54656f=CAMPAIGN_STATUS['ACTIVE'];var _0x3ef0da=isPreviewCampaign(_0x2792bf);if(!isQueueCampaignActive(_0x2792bf)){if(_0x3ef0da){_0x54656f=CAMPAIGN_STATUS[_0xc365('0x3b')];}else{if(_0x2792bf['originated']===0x0&&_0x2792bf['talking']===0x0&&_0x2792bf[_0xc365('0x28')]===0x0&&(_0x2792bf[_0xc365('0x27')]||0x0)===0x0){_0x54656f=CAMPAIGN_STATUS[_0xc365('0x3b')];}else{_0x54656f=CAMPAIGN_STATUS[_0xc365('0x3c')];}}}else if(_0x2792bf['loggedIn']===0x0){_0x54656f=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x2792bf,_0x102fbd)){_0x54656f=CAMPAIGN_STATUS[_0xc365('0x3d')];}else if(!isPreviewCampaign(_0x2792bf)){var _0x4c715e=checkAnyValidQueueCampaignInterval(_0x2792bf);if(_0x4c715e){_0x54656f=_0x4c715e;}}return _0x54656f;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5b88f){var _0x4ac3c3=CAMPAIGN_STATUS[_0xc365('0x3c')];if(_0x5b88f[_0xc365('0x2a')]===0x0&&_0x5b88f[_0xc365('0x26')]===0x0&&_0x5b88f['waiting']===0x0&&(_0x5b88f[_0xc365('0x27')]||0x0)===0x0){_0x4ac3c3=CAMPAIGN_STATUS[_0xc365('0x3b')];}return _0x4ac3c3;}exports[_0xc365('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x55bc44){var _0x3034df=_0x55bc44[_0xc365('0x3f')](/"(.*?)"/);return _0x3034df?_0x3034df[0x1]:_0x55bc44;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x96d764,_0x253599,_0x4f7d20){if(!_[_0xc365('0x40')](_0x4f7d20)&&typeof _0x4f7d20==='string'&&!_[_0xc365('0x31')](_0x4f7d20)){if(!_[_0xc365('0x40')](_0x253599)&&typeof _0x253599===_0xc365('0x41')&&!_[_0xc365('0x31')](_0x253599)){return util[_0xc365('0x42')](_0xc365('0x43'),_0x253599,_0x4f7d20);}return util[_0xc365('0x42')](_0xc365('0x43'),_0x4f7d20,_0x4f7d20);}if(!_[_0xc365('0x40')](_0x96d764)&&typeof _0x96d764==='string'&&!_[_0xc365('0x31')](_0x96d764)){return _0x96d764;}return _0xc365('0x44');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x3513e3,_0x3ec7f5){var _0x57d9f9;var _0x4a0b9f;var _0x479380;if(_0x3ec7f5<=0x0){_0x3ec7f5=0x1;}_0x57d9f9=new RegExp(_0xc365('0x45')+_0x3ec7f5+'}$');_0x4a0b9f=Math[_0xc365('0x46')](0xa,_0x3ec7f5-0x1);_0x479380=Math['pow'](0xa,_0x3ec7f5)-0x1;return util[_0xc365('0x42')]('%s',_[_0xc365('0x47')](_0x3513e3,_0x57d9f9,_['random'](_0x4a0b9f,_0x479380)[_0xc365('0x48')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x15bbcc,_0x127639){if(_0x15bbcc[_0xc365('0x2a')]&&_0x15bbcc['originated']>0x0){_0x15bbcc[_0xc365('0x2a')]-=0x1;}else{logger[_0xc365('0x49')](_0xc365('0x4a'),_0x127639);}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x55e770){return _0x55e770&&_0x55e770[_0xc365('0x4b')]>0x0;}exports[_0xc365('0x4c')]=checkContactEmpty;function erlangb(_0x253ff9,_0x5f1c32){if(_0x5f1c32===0x0){return 0x0;}var _0x47d68f=0x1;for(var _0x48f8ff=0x1;_0x48f8ff<=_0x5f1c32;_0x48f8ff+=0x1){_0x47d68f=0x1+_0x47d68f*_0x48f8ff/_0x253ff9;}return 0x1/_0x47d68f;}exports[_0xc365('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x2a7d04,_0x25f3f6,_0x12eb0d){if(_0x25f3f6>_0x12eb0d){for(var _0x57a088=0x0;_0x57a088<_0x25f3f6-_0x12eb0d;_0x57a088+=0x1){decrementOriginate(_0x2a7d04,_0xc365('0x4e'));}}}exports[_0xc365('0x4f')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x174042){var _0x1770d2={};var _0x11c222=['id',_0xc365('0x50'),_0xc365('0x51'),'updatedAt'];const _0x502367=0xfa;if(_0x174042){for(var _0x1e3a03 in _0x174042){if(typeof _0x174042[_0x1e3a03]!==_0xc365('0x52')){if(!_[_0xc365('0x2d')](_0x174042[_0x1e3a03])&&!_0x11c222['includes'](_0x1e3a03)){if(_0x1e3a03==='description'&&_0x174042[_0x1e3a03]['length']>_0x502367){_0x1770d2[_0xc365('0x53')+_0x1e3a03[_0xc365('0x54')]()]=_0x174042[_0x1e3a03][_0xc365('0x48')]()['substring'](0x0,_0x502367);}else{_0x1770d2['XMD-'+_0x1e3a03[_0xc365('0x54')]()]=_0x174042[_0x1e3a03];}}}}}return _0x1770d2;}exports[_0xc365('0x55')]=setXMDContactVariables;
\ No newline at end of file
+var _0x054f=['loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','TrunkBackup','status','ACTIVE','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','extractCalleridName','isUndefined','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','\x5cw{0,','pow','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value','length','checkContactEmpty','erlangb','[checkContactLowerLimitOriginate]\x20','tags','updatedAt','undefined','XMD-','substring','toUpperCase','setXMDContactVariables','util','../../../../config/logger','dialer','../../../../config/environment/shared','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','isIVRCampaign','isOutboundQueue','isQueueCampaignActive','active','diff','seconds','dialActive','available'];(function(_0xf39fd0,_0x9f4f32){var _0x459ebf=function(_0x43268f){while(--_0x43268f){_0xf39fd0['push'](_0xf39fd0['shift']());}};_0x459ebf(++_0x9f4f32);}(_0x054f,0x1cb));var _0xf054=function(_0x4bc5f5,_0x3fc086){_0x4bc5f5=_0x4bc5f5-0x0;var _0x54d2c5=_0x054f[_0x4bc5f5];return _0x54d2c5;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xf054('0x0'));var logger=require(_0xf054('0x1'))(_0xf054('0x2'));var timezones=require(_0xf054('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xf054('0x4'),'CONTACTS_RESCHEDULED':_0xf054('0x5'),'DEACTIVATED':_0xf054('0x6'),'DISACTIVED':_0xf054('0x7'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xf054('0x8'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xf054('0x9'),'NULL_INTERVAL':_0xf054('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xf054('0xb'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0xf054('0xc'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xf054('0xd')};exports[_0xf054('0xe')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1553f3){return _0x1553f3[_0xf054('0xf')]==='preview';}exports[_0xf054('0x10')]=isPreviewCampaign;function isIVRCampaign(_0x417dbf){return _0x417dbf[_0xf054('0x11')]===_0xf054('0x12');}exports[_0xf054('0x13')]=isIVRCampaign;function isOutboundQueue(_0x410c50){return _0x410c50['type']==='outbound';}exports[_0xf054('0x14')]=isOutboundQueue;function isQueueCampaignActive(_0x2d4e4d){return _0x2d4e4d['dialActive'];}exports[_0xf054('0x15')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5cc876){return _0x5cc876[_0xf054('0x16')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x401d6a,_0x4f0932){var _0x102c08=moment(_0x401d6a)['milliseconds'](0x0);var _0x5601e1=moment(_0x4f0932)['milliseconds'](0x0);return _0x102c08[_0xf054('0x17')](_0x5601e1,_0xf054('0x18'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x7f6094,_0x3799e6){var _0x42fd72=![];var _0x249e28=_0x7f6094[_0xf054('0xf')]!==_0x3799e6[_0xf054('0xf')]||_0x7f6094[_0xf054('0x19')]!==_0x3799e6[_0xf054('0x19')]||_0x7f6094['message']!==_0x3799e6['message'];var _0x1d3197=_0x7f6094['available']!==_0x3799e6[_0xf054('0x1a')]||_0x7f6094[_0xf054('0x1b')]!==_0x3799e6[_0xf054('0x1b')]||_0x7f6094[_0xf054('0x1c')]!==_0x3799e6[_0xf054('0x1c')]||_0x7f6094[_0xf054('0x1d')]!==_0x3799e6[_0xf054('0x1d')]||_0x7f6094['talking']!==_0x3799e6[_0xf054('0x1e')]||_0x7f6094[_0xf054('0x1f')]!==_0x3799e6['pTalking']||_0x7f6094[_0xf054('0x20')]!==_0x3799e6[_0xf054('0x20')]||_0x7f6094[_0xf054('0x21')]!==_0x3799e6[_0xf054('0x21')]||_0x7f6094[_0xf054('0x22')]!==_0x3799e6['originated'];if(_0x7f6094['Trunk']&&_0x3799e6[_0xf054('0x23')]){_0x42fd72=_0x7f6094['Trunk'][_0xf054('0x24')]!==_0x3799e6[_0xf054('0x23')][_0xf054('0x24')]||_0x7f6094[_0xf054('0x23')]['active']!==_0x3799e6['Trunk']['active'];}return _0x249e28||_0x1d3197||_0x42fd72;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x380146){var _0x339c08=null;var _0x5317ab=_0x380146[_0xf054('0x25')];if(_[_0xf054('0x26')](_0x380146[_0xf054('0x27')])||_[_0xf054('0x26')](_0x380146[_0xf054('0x28')])||_[_0xf054('0x26')](_0x380146[_0xf054('0x28')][_0xf054('0x29')])){_0x339c08=CAMPAIGN_STATUS[_0xf054('0x2a')];}else if(_[_0xf054('0x2b')](_0x380146[_0xf054('0x27')])||_[_0xf054('0x2b')](_0x380146['Interval']['Intervals'])){_0x339c08=CAMPAIGN_STATUS[_0xf054('0x2c')];}else if(_0x5317ab&&!timezones[_0x5317ab]){_0x339c08=CAMPAIGN_STATUS[_0xf054('0x2d')];}return _0x339c08;}function checkAnyValidTrunk(_0x23a8f4,_0x1c8a1f){var _0x55a827=null;var _0x1c31a8=_0xf054('0x2e');var _0x3e8409=[_0xf054('0x2f'),_0xf054('0x30')];var _0x57e572=!![];if(_0x23a8f4['Trunk']&&_0x23a8f4[_0xf054('0x23')][_0xf054('0x16')]){_0x1c31a8+=_0x23a8f4[_0xf054('0x23')]['name'];_0x55a827=_0x1c8a1f[_0x1c31a8];_0x57e572=_0x3e8409[_0xf054('0x31')](_0x55a827['status']);}else if(_0x23a8f4[_0xf054('0x32')]&&_0x23a8f4['TrunkBackup']['active']){_0x1c31a8+=_0x23a8f4[_0xf054('0x32')][_0xf054('0x24')];_0x55a827=_0x1c8a1f[_0x1c31a8];_0x57e572=_0x3e8409[_0xf054('0x31')](_0x55a827[_0xf054('0x33')]);}return _0x57e572;}function getQueueCampaignStatusMessage(_0x292499,_0x4317ed){var _0x1fe678=CAMPAIGN_STATUS[_0xf054('0x34')];var _0x243acd=isPreviewCampaign(_0x292499);if(!isQueueCampaignActive(_0x292499)){if(_0x243acd){_0x1fe678=CAMPAIGN_STATUS[_0xf054('0x35')];}else{if(_0x292499[_0xf054('0x22')]===0x0&&_0x292499['talking']===0x0&&_0x292499[_0xf054('0x20')]===0x0&&(_0x292499[_0xf054('0x1f')]||0x0)===0x0){_0x1fe678=CAMPAIGN_STATUS[_0xf054('0x35')];}else{_0x1fe678=CAMPAIGN_STATUS[_0xf054('0x36')];}}}else if(_0x292499[_0xf054('0x1b')]===0x0){_0x1fe678=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x292499,_0x4317ed)){_0x1fe678=CAMPAIGN_STATUS[_0xf054('0x37')];}else if(!isPreviewCampaign(_0x292499)){var _0x55e732=checkAnyValidQueueCampaignInterval(_0x292499);if(_0x55e732){_0x1fe678=_0x55e732;}}return _0x1fe678;}exports[_0xf054('0x38')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5d8e44){var _0x1b8d91=CAMPAIGN_STATUS['DISACTIVED'];if(_0x5d8e44['originated']===0x0&&_0x5d8e44[_0xf054('0x1e')]===0x0&&_0x5d8e44[_0xf054('0x20')]===0x0&&(_0x5d8e44['pTalking']||0x0)===0x0){_0x1b8d91=CAMPAIGN_STATUS[_0xf054('0x35')];}return _0x1b8d91;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2d7148){var _0x520cec=_0x2d7148['match'](/"(.*?)"/);return _0x520cec?_0x520cec[0x1]:_0x2d7148;}exports[_0xf054('0x39')]=extractCalleridName;function getCallerId(_0x431443,_0x119d99,_0x55cf87){if(!_[_0xf054('0x3a')](_0x55cf87)&&typeof _0x55cf87==='string'&&!_[_0xf054('0x2b')](_0x55cf87)){if(!_[_0xf054('0x3a')](_0x119d99)&&typeof _0x119d99==='string'&&!_['isEmpty'](_0x119d99)){return util[_0xf054('0x3b')](_0xf054('0x3c'),_0x119d99,_0x55cf87);}return util['format'](_0xf054('0x3c'),_0x55cf87,_0x55cf87);}if(!_[_0xf054('0x3a')](_0x431443)&&typeof _0x431443===_0xf054('0x3d')&&!_[_0xf054('0x2b')](_0x431443)){return _0x431443;}return _0xf054('0x3e');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x38b5e3,_0x146282){var _0x12a87e;var _0x4db53c;var _0xd1857a;if(_0x146282<=0x0){_0x146282=0x1;}_0x12a87e=new RegExp(_0xf054('0x3f')+_0x146282+'}$');_0x4db53c=Math['pow'](0xa,_0x146282-0x1);_0xd1857a=Math[_0xf054('0x40')](0xa,_0x146282)-0x1;return util[_0xf054('0x3b')]('%s',_['replace'](_0x38b5e3,_0x12a87e,_[_0xf054('0x41')](_0x4db53c,_0xd1857a)[_0xf054('0x42')]()));}exports[_0xf054('0x43')]=getCallerIdRandom;function decrementOriginate(_0x169e93,_0xb02c2c){if(_0x169e93[_0xf054('0x22')]&&_0x169e93[_0xf054('0x22')]>0x0){_0x169e93[_0xf054('0x22')]-=0x1;}else{logger[_0xf054('0x44')](_0xf054('0x45'),_0xb02c2c);}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x3d41e9){return _0x3d41e9&&_0x3d41e9[_0xf054('0x46')]>0x0;}exports[_0xf054('0x47')]=checkContactEmpty;function erlangb(_0x4358c0,_0x4e9929){if(_0x4e9929===0x0){return 0x0;}var _0x387a96=0x1;for(var _0xcc3094=0x1;_0xcc3094<=_0x4e9929;_0xcc3094+=0x1){_0x387a96=0x1+_0x387a96*_0xcc3094/_0x4358c0;}return 0x1/_0x387a96;}exports[_0xf054('0x48')]=erlangb;function checkContactLowerLimitOriginate(_0x16801f,_0x45f515,_0x46c06a){if(_0x45f515>_0x46c06a){for(var _0x37d34d=0x0;_0x37d34d<_0x45f515-_0x46c06a;_0x37d34d+=0x1){decrementOriginate(_0x16801f,_0xf054('0x49'));}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x269871){var _0x120b55={};var _0x2eb3f0=['id','createdAt',_0xf054('0x4a'),_0xf054('0x4b')];const _0x4e26e0=0xfa;if(_0x269871){for(var _0x34a524 in _0x269871){if(typeof _0x269871[_0x34a524]!==_0xf054('0x4c')){if(!_[_0xf054('0x26')](_0x269871[_0x34a524])&&!_0x2eb3f0['includes'](_0x34a524)){if(_0x34a524==='description'&&_0x269871[_0x34a524][_0xf054('0x46')]>_0x4e26e0){_0x120b55[_0xf054('0x4d')+_0x34a524['toUpperCase']()]=_0x269871[_0x34a524][_0xf054('0x42')]()[_0xf054('0x4e')](0x0,_0x4e26e0);}else{_0x120b55[_0xf054('0x4d')+_0x34a524[_0xf054('0x4f')]()]=_0x269871[_0x34a524];}}}}}return _0x120b55;}exports[_0xf054('0x50')]=setXMDContactVariables;
\ No newline at end of file