Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / services / ami / dialer / utils / index.js
index 9e071c5..0ff5036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f45=['getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','%s%s','toUpperCase','moment','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RUNNING','TIMEZONE_UNKNOW','dialMethod','preview','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','SIP/','reachable','unmonitored','includes','TrunkBackup','status','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK'];(function(_0x228ce2,_0x4d48f3){var _0x3bf15e=function(_0x3eaa78){while(--_0x3eaa78){_0x228ce2['push'](_0x228ce2['shift']());}};_0x3bf15e(++_0x4d48f3);}(_0x9f45,0x16b));var _0x59f4=function(_0x3d8b21,_0x32f40d){_0x3d8b21=_0x3d8b21-0x0;var _0x5889f8=_0x9f45[_0x3d8b21];return _0x5889f8;};'use strict';var _=require('lodash');var moment=require(_0x59f4('0x0'));var util=require('util');var logger=require(_0x59f4('0x1'))('dialer');var timezones=require(_0x59f4('0x2'))[_0x59f4('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x59f4('0x4'),'BLACKLIST':_0x59f4('0x5'),'CONTACTS_RESCHEDULED':_0x59f4('0x6'),'DEACTIVATED':_0x59f4('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x59f4('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x59f4('0x9'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0x59f4('0xa'),'OVERTIME_INTERVAL':_0x59f4('0xb'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x59f4('0xc'),'UNKNOWN_TIMEZONE':_0x59f4('0xd'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0xfee607){return _0xfee607[_0x59f4('0xe')]===_0x59f4('0xf');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x1608fb){return _0x1608fb[_0x59f4('0x10')]===_0x59f4('0x11');}exports[_0x59f4('0x12')]=isIVRCampaign;function isOutboundQueue(_0x11fc23){return _0x11fc23['type']===_0x59f4('0x13');}exports[_0x59f4('0x14')]=isOutboundQueue;function isQueueCampaignActive(_0x7e645c){return _0x7e645c[_0x59f4('0x15')];}exports[_0x59f4('0x16')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4f50d9){return _0x4f50d9['active'];}exports[_0x59f4('0x17')]=isIVRCampaignActive;function getSeconds(_0x169112,_0x1f5d5c){var _0x5a2796=moment(_0x169112)['milliseconds'](0x0);var _0x39a4ff=moment(_0x1f5d5c)[_0x59f4('0x18')](0x0);return _0x5a2796['diff'](_0x39a4ff,_0x59f4('0x19'));}exports[_0x59f4('0x1a')]=getSeconds;function hasQueueCampaignDataChanged(_0x4b3c66,_0x321905){var _0x26f1c4=![];var _0x242b0b=_0x4b3c66['dialMethod']!==_0x321905[_0x59f4('0xe')]||_0x4b3c66[_0x59f4('0x15')]!==_0x321905[_0x59f4('0x15')]||_0x4b3c66[_0x59f4('0x1b')]!==_0x321905[_0x59f4('0x1b')];var _0x107db9=_0x4b3c66[_0x59f4('0x1c')]!==_0x321905[_0x59f4('0x1c')]||_0x4b3c66[_0x59f4('0x1d')]!==_0x321905[_0x59f4('0x1d')]||_0x4b3c66[_0x59f4('0x1e')]!==_0x321905[_0x59f4('0x1e')]||_0x4b3c66[_0x59f4('0x1f')]!==_0x321905[_0x59f4('0x1f')]||_0x4b3c66[_0x59f4('0x20')]!==_0x321905['talking']||_0x4b3c66[_0x59f4('0x21')]!==_0x321905[_0x59f4('0x21')]||_0x4b3c66[_0x59f4('0x22')]!==_0x321905[_0x59f4('0x22')]||_0x4b3c66[_0x59f4('0x23')]!==_0x321905[_0x59f4('0x23')]||_0x4b3c66[_0x59f4('0x24')]!==_0x321905[_0x59f4('0x24')];if(_0x4b3c66['Trunk']&&_0x321905[_0x59f4('0x25')]){_0x26f1c4=_0x4b3c66[_0x59f4('0x25')][_0x59f4('0x26')]!==_0x321905[_0x59f4('0x25')][_0x59f4('0x26')]||_0x4b3c66[_0x59f4('0x25')][_0x59f4('0x27')]!==_0x321905[_0x59f4('0x25')][_0x59f4('0x27')];}return _0x242b0b||_0x107db9||_0x26f1c4;}exports[_0x59f4('0x28')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1a5749){var _0x3edee0=null;var _0x4c2b77=_0x1a5749[_0x59f4('0x29')];if(_[_0x59f4('0x2a')](_0x1a5749[_0x59f4('0x2b')])||_['isNil'](_0x1a5749[_0x59f4('0x2c')])||_[_0x59f4('0x2a')](_0x1a5749[_0x59f4('0x2c')][_0x59f4('0x2d')])){_0x3edee0=CAMPAIGN_STATUS[_0x59f4('0x2e')];}else if(_[_0x59f4('0x2f')](_0x1a5749[_0x59f4('0x2b')])||_[_0x59f4('0x2f')](_0x1a5749['Interval'][_0x59f4('0x2d')])){_0x3edee0=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x4c2b77&&!timezones[_0x4c2b77]){_0x3edee0=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x3edee0;}function checkAnyValidTrunk(_0x573e5f,_0x54f532){var _0x49318b=null;var _0x4a2d96=_0x59f4('0x30');var _0xd8eaa6=[_0x59f4('0x31'),_0x59f4('0x32')];var _0x343ec7=!![];if(_0x573e5f[_0x59f4('0x25')]&&_0x573e5f[_0x59f4('0x25')][_0x59f4('0x27')]){_0x4a2d96+=_0x573e5f[_0x59f4('0x25')]['name'];_0x49318b=_0x54f532[_0x4a2d96];_0x343ec7=_0xd8eaa6[_0x59f4('0x33')](_0x49318b['status']);}else if(_0x573e5f['TrunkBackup']&&_0x573e5f['TrunkBackup'][_0x59f4('0x27')]){_0x4a2d96+=_0x573e5f[_0x59f4('0x34')][_0x59f4('0x26')];_0x49318b=_0x54f532[_0x4a2d96];_0x343ec7=_0xd8eaa6[_0x59f4('0x33')](_0x49318b[_0x59f4('0x35')]);}return _0x343ec7;}function getQueueCampaignStatusMessage(_0x40d99a,_0x164bdb){var _0x2c88e2=CAMPAIGN_STATUS[_0x59f4('0x4')];var _0x52bec9=isPreviewCampaign(_0x40d99a);if(!isQueueCampaignActive(_0x40d99a)){if(_0x52bec9){_0x2c88e2=CAMPAIGN_STATUS[_0x59f4('0x36')];}else{if(_0x40d99a[_0x59f4('0x24')]===0x0&&_0x40d99a[_0x59f4('0x20')]===0x0&&_0x40d99a['waiting']===0x0&&(_0x40d99a[_0x59f4('0x21')]||0x0)===0x0){_0x2c88e2=CAMPAIGN_STATUS['INACTIVE'];}else{_0x2c88e2=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x40d99a[_0x59f4('0x1d')]===0x0){_0x2c88e2=CAMPAIGN_STATUS[_0x59f4('0x37')];}else if(!checkAnyValidTrunk(_0x40d99a,_0x164bdb)){_0x2c88e2=CAMPAIGN_STATUS[_0x59f4('0x38')];}else if(!isPreviewCampaign(_0x40d99a)){var _0xe02c7f=checkAnyValidQueueCampaignInterval(_0x40d99a);if(_0xe02c7f){_0x2c88e2=_0xe02c7f;}}return _0x2c88e2;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x4ad768){var _0x50ea46=CAMPAIGN_STATUS['DISACTIVED'];if(_0x4ad768['originated']===0x0&&_0x4ad768['talking']===0x0&&_0x4ad768[_0x59f4('0x22')]===0x0&&(_0x4ad768[_0x59f4('0x21')]||0x0)===0x0){_0x50ea46=CAMPAIGN_STATUS['INACTIVE'];}return _0x50ea46;}exports[_0x59f4('0x39')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x9d3f35){var _0x15992b=_0x9d3f35[_0x59f4('0x3a')](/"(.*?)"/);return _0x15992b?_0x15992b[0x1]:_0x9d3f35;}exports[_0x59f4('0x3b')]=extractCalleridName;function getCallerId(_0x208fcd,_0x3daba6,_0x54696d){if(!_[_0x59f4('0x3c')](_0x54696d)&&typeof _0x54696d===_0x59f4('0x3d')&&!_[_0x59f4('0x2f')](_0x54696d)){if(!_[_0x59f4('0x3c')](_0x3daba6)&&typeof _0x3daba6===_0x59f4('0x3d')&&!_['isEmpty'](_0x3daba6)){return util[_0x59f4('0x3e')](_0x59f4('0x3f'),_0x3daba6,_0x54696d);}return util[_0x59f4('0x3e')]('\x22%s\x22\x20<%s>',_0x54696d,_0x54696d);}if(!_[_0x59f4('0x3c')](_0x208fcd)&&typeof _0x208fcd===_0x59f4('0x3d')&&!_[_0x59f4('0x2f')](_0x208fcd)){return _0x208fcd;}return'\x22\x22\x20<>';}exports[_0x59f4('0x40')]=getCallerId;function getCallerIdRandom(_0x137699,_0x10cf46){var _0x308343;var _0xe5b22e;var _0x4e306d;if(_0x10cf46<=0x0){_0x10cf46=0x1;}_0x308343=new RegExp(_0x59f4('0x41')+_0x10cf46+'}$');_0xe5b22e=Math[_0x59f4('0x42')](0xa,_0x10cf46-0x1);_0x4e306d=Math[_0x59f4('0x42')](0xa,_0x10cf46)-0x1;return util['format']('%s',_[_0x59f4('0x43')](_0x137699,_0x308343,_[_0x59f4('0x44')](_0xe5b22e,_0x4e306d)[_0x59f4('0x45')]()));}exports[_0x59f4('0x46')]=getCallerIdRandom;function decrementOriginate(_0x2a1b2e){if(_0x2a1b2e[_0x59f4('0x24')]&&_0x2a1b2e[_0x59f4('0x24')]>0x0){_0x2a1b2e[_0x59f4('0x24')]-=0x1;}else{logger[_0x59f4('0x47')](_0x59f4('0x48'));}}exports[_0x59f4('0x49')]=decrementOriginate;function checkContactEmpty(_0x184352){return _0x184352&&_0x184352[_0x59f4('0x4a')]>0x0;}exports[_0x59f4('0x4b')]=checkContactEmpty;function erlangb(_0x18188e,_0x41b939){if(_0x41b939===0x0){return 0x0;}var _0x420edf=0x1;for(var _0x11ecba=0x1;_0x11ecba<=_0x41b939;_0x11ecba+=0x1){_0x420edf=0x1+_0x420edf*_0x11ecba/_0x18188e;}return 0x1/_0x420edf;}exports[_0x59f4('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x133c4a,_0x70ca7c,_0x32b3ac){if(_0x70ca7c>_0x32b3ac){for(var _0x1f731a=0x0;_0x1f731a<_0x70ca7c-_0x32b3ac;_0x1f731a+=0x1){decrementOriginate(_0x133c4a);}}}exports[_0x59f4('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x2d939f){var _0x59ef39={};var _0x21c4f9=['id',_0x59f4('0x4e'),_0x59f4('0x4f'),_0x59f4('0x50'),_0x59f4('0x51')];if(_0x2d939f){for(var _0x8b51b5 in _0x2d939f){if(typeof _0x2d939f[_0x8b51b5]!=='undefined'){if(!_['isNil'](_0x2d939f[_0x8b51b5])&&!_0x21c4f9[_0x59f4('0x33')](_0x8b51b5)){_0x59ef39[util[_0x59f4('0x3e')](_0x59f4('0x52'),'XMD-',_0x8b51b5[_0x59f4('0x53')]())]=_0x2d939f[_0x8b51b5];}}}}return _0x59ef39;}exports['setXMDContactVariables']=setXMDContactVariables;
\ No newline at end of file
+var _0x5d58=['moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','status','TrunkBackup','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','INACTIVE','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isEmpty','isUndefined','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','format','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','undefined','length','XMD-','toUpperCase','setXMDContactVariables','lodash'];(function(_0x4498a2,_0x143689){var _0x411aa8=function(_0x1a85dc){while(--_0x1a85dc){_0x4498a2['push'](_0x4498a2['shift']());}};_0x411aa8(++_0x143689);}(_0x5d58,0xb9));var _0x85d5=function(_0x461249,_0x823744){_0x461249=_0x461249-0x0;var _0x2adb9b=_0x5d58[_0x461249];return _0x2adb9b;};'use strict';var _=require(_0x85d5('0x0'));var moment=require(_0x85d5('0x1'));var util=require(_0x85d5('0x2'));var logger=require(_0x85d5('0x3'))(_0x85d5('0x4'));var timezones=require(_0x85d5('0x5'))[_0x85d5('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x85d5('0x7'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x85d5('0x8'),'DEACTIVATED':_0x85d5('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x85d5('0xa'),'INACTIVE':_0x85d5('0xb'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x85d5('0xc'),'NULL_INTERVAL':_0x85d5('0xd'),'OVERTIME_INTERVAL':_0x85d5('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x85d5('0xf'),'QUEUE_RECALL':_0x85d5('0x10'),'RECALL_TIMEOUT':_0x85d5('0x11'),'RUNNING':_0x85d5('0x12'),'UNKNOWN_TIMEZONE':_0x85d5('0x13'),'UNREACHABLE_TRUNK':_0x85d5('0x14')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x17e012){return _0x17e012[_0x85d5('0x15')]===_0x85d5('0x16');}exports[_0x85d5('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x4f9a6b){return _0x4f9a6b[_0x85d5('0x18')]===_0x85d5('0x19');}exports[_0x85d5('0x1a')]=isIVRCampaign;function isOutboundQueue(_0x3eb8ee){return _0x3eb8ee[_0x85d5('0x18')]===_0x85d5('0x1b');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x540726){return _0x540726[_0x85d5('0x1c')];}exports[_0x85d5('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x109873){return _0x109873[_0x85d5('0x1e')];}exports[_0x85d5('0x1f')]=isIVRCampaignActive;function getSeconds(_0x29d4a4,_0x219f55){var _0x99e54e=moment(_0x29d4a4)[_0x85d5('0x20')](0x0);var _0x464b55=moment(_0x219f55)[_0x85d5('0x20')](0x0);return _0x99e54e[_0x85d5('0x21')](_0x464b55,_0x85d5('0x22'));}exports[_0x85d5('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x4b31d8,_0x4f4845){var _0x285822=![];var _0x4763fa=_0x4b31d8[_0x85d5('0x15')]!==_0x4f4845['dialMethod']||_0x4b31d8[_0x85d5('0x1c')]!==_0x4f4845['dialActive']||_0x4b31d8[_0x85d5('0x24')]!==_0x4f4845['message'];var _0x16b944=_0x4b31d8[_0x85d5('0x25')]!==_0x4f4845[_0x85d5('0x25')]||_0x4b31d8[_0x85d5('0x26')]!==_0x4f4845[_0x85d5('0x26')]||_0x4b31d8[_0x85d5('0x27')]!==_0x4f4845[_0x85d5('0x27')]||_0x4b31d8[_0x85d5('0x28')]!==_0x4f4845['paused']||_0x4b31d8[_0x85d5('0x29')]!==_0x4f4845[_0x85d5('0x29')]||_0x4b31d8[_0x85d5('0x2a')]!==_0x4f4845[_0x85d5('0x2a')]||_0x4b31d8[_0x85d5('0x2b')]!==_0x4f4845[_0x85d5('0x2b')]||_0x4b31d8['inUse']!==_0x4f4845[_0x85d5('0x2c')]||_0x4b31d8[_0x85d5('0x2d')]!==_0x4f4845[_0x85d5('0x2d')];if(_0x4b31d8[_0x85d5('0x2e')]&&_0x4f4845[_0x85d5('0x2e')]){_0x285822=_0x4b31d8[_0x85d5('0x2e')][_0x85d5('0x2f')]!==_0x4f4845[_0x85d5('0x2e')][_0x85d5('0x2f')]||_0x4b31d8['Trunk'][_0x85d5('0x1e')]!==_0x4f4845[_0x85d5('0x2e')][_0x85d5('0x1e')];}return _0x4763fa||_0x16b944||_0x285822;}exports[_0x85d5('0x30')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x285c89){var _0x499766=null;var _0x10e7e5=_0x285c89[_0x85d5('0x31')];if(_[_0x85d5('0x32')](_0x285c89['dialGlobalInterval'])||_[_0x85d5('0x32')](_0x285c89[_0x85d5('0x33')])||_[_0x85d5('0x32')](_0x285c89['Interval'][_0x85d5('0x34')])){_0x499766=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x285c89[_0x85d5('0x35')])||_['isEmpty'](_0x285c89[_0x85d5('0x33')][_0x85d5('0x34')])){_0x499766=CAMPAIGN_STATUS[_0x85d5('0x36')];}else if(_0x10e7e5&&!timezones[_0x10e7e5]){_0x499766=CAMPAIGN_STATUS[_0x85d5('0x37')];}return _0x499766;}function checkAnyValidTrunk(_0x48cfc6,_0x369563){var _0x33343d=null;var _0x163090='SIP/';var _0x1c9a2b=[_0x85d5('0x38'),_0x85d5('0x39')];var _0x402354=!![];if(_0x48cfc6['Trunk']&&_0x48cfc6[_0x85d5('0x2e')][_0x85d5('0x1e')]){_0x163090+=_0x48cfc6[_0x85d5('0x2e')]['name'];_0x33343d=_0x369563[_0x163090];_0x402354=_0x1c9a2b[_0x85d5('0x3a')](_0x33343d[_0x85d5('0x3b')]);}else if(_0x48cfc6['TrunkBackup']&&_0x48cfc6[_0x85d5('0x3c')][_0x85d5('0x1e')]){_0x163090+=_0x48cfc6['TrunkBackup'][_0x85d5('0x2f')];_0x33343d=_0x369563[_0x163090];_0x402354=_0x1c9a2b[_0x85d5('0x3a')](_0x33343d[_0x85d5('0x3b')]);}return _0x402354;}function getQueueCampaignStatusMessage(_0x2355ba,_0x161cb5){var _0x50b0e2=CAMPAIGN_STATUS[_0x85d5('0x7')];var _0x1846ac=isPreviewCampaign(_0x2355ba);if(!isQueueCampaignActive(_0x2355ba)){if(_0x1846ac){_0x50b0e2=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x2355ba[_0x85d5('0x2d')]===0x0&&_0x2355ba[_0x85d5('0x29')]===0x0&&_0x2355ba[_0x85d5('0x2b')]===0x0&&(_0x2355ba[_0x85d5('0x2a')]||0x0)===0x0){_0x50b0e2=CAMPAIGN_STATUS['INACTIVE'];}else{_0x50b0e2=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x2355ba[_0x85d5('0x26')]===0x0){_0x50b0e2=CAMPAIGN_STATUS[_0x85d5('0x3d')];}else if(!checkAnyValidTrunk(_0x2355ba,_0x161cb5)){_0x50b0e2=CAMPAIGN_STATUS[_0x85d5('0x3e')];}else if(!isPreviewCampaign(_0x2355ba)){var _0x106c52=checkAnyValidQueueCampaignInterval(_0x2355ba);if(_0x106c52){_0x50b0e2=_0x106c52;}}return _0x50b0e2;}exports[_0x85d5('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x4dbf84){var _0x47287a=CAMPAIGN_STATUS[_0x85d5('0x40')];if(_0x4dbf84[_0x85d5('0x2d')]===0x0&&_0x4dbf84[_0x85d5('0x29')]===0x0&&_0x4dbf84[_0x85d5('0x2b')]===0x0&&(_0x4dbf84[_0x85d5('0x2a')]||0x0)===0x0){_0x47287a=CAMPAIGN_STATUS[_0x85d5('0x41')];}return _0x47287a;}exports[_0x85d5('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x43d54f){var _0xafa6b5=_0x43d54f[_0x85d5('0x43')](/"(.*?)"/);return _0xafa6b5?_0xafa6b5[0x1]:_0x43d54f;}exports[_0x85d5('0x44')]=extractCalleridName;function getCallerId(_0x241c81,_0x1ab242,_0xff88e0){if(!_['isUndefined'](_0xff88e0)&&typeof _0xff88e0==='string'&&!_[_0x85d5('0x45')](_0xff88e0)){if(!_[_0x85d5('0x46')](_0x1ab242)&&typeof _0x1ab242===_0x85d5('0x47')&&!_[_0x85d5('0x45')](_0x1ab242)){return util['format'](_0x85d5('0x48'),_0x1ab242,_0xff88e0);}return util['format'](_0x85d5('0x48'),_0xff88e0,_0xff88e0);}if(!_[_0x85d5('0x46')](_0x241c81)&&typeof _0x241c81===_0x85d5('0x47')&&!_['isEmpty'](_0x241c81)){return _0x241c81;}return _0x85d5('0x49');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x236a79,_0x566a96){var _0x583f17;var _0x5bd240;var _0x17c5c7;if(_0x566a96<=0x0){_0x566a96=0x1;}_0x583f17=new RegExp(_0x85d5('0x4a')+_0x566a96+'}$');_0x5bd240=Math[_0x85d5('0x4b')](0xa,_0x566a96-0x1);_0x17c5c7=Math[_0x85d5('0x4b')](0xa,_0x566a96)-0x1;return util[_0x85d5('0x4c')]('%s',_[_0x85d5('0x4d')](_0x236a79,_0x583f17,_['random'](_0x5bd240,_0x17c5c7)[_0x85d5('0x4e')]()));}exports[_0x85d5('0x4f')]=getCallerIdRandom;function decrementOriginate(_0x46676f){if(_0x46676f[_0x85d5('0x2d')]&&_0x46676f[_0x85d5('0x2d')]>0x0){_0x46676f[_0x85d5('0x2d')]-=0x1;}else{logger[_0x85d5('0x50')](_0x85d5('0x51'));}}exports[_0x85d5('0x52')]=decrementOriginate;function checkContactEmpty(_0x23f34d){return _0x23f34d&&_0x23f34d['length']>0x0;}exports[_0x85d5('0x53')]=checkContactEmpty;function erlangb(_0x2beacc,_0x2c6b52){if(_0x2c6b52===0x0){return 0x0;}var _0x3cc0e0=0x1;for(var _0x581bf1=0x1;_0x581bf1<=_0x2c6b52;_0x581bf1+=0x1){_0x3cc0e0=0x1+_0x3cc0e0*_0x581bf1/_0x2beacc;}return 0x1/_0x3cc0e0;}exports[_0x85d5('0x54')]=erlangb;function checkContactLowerLimitOriginate(_0x579d5a,_0xf0821a,_0x1a67d8){if(_0xf0821a>_0x1a67d8){for(var _0x2fcc49=0x0;_0x2fcc49<_0xf0821a-_0x1a67d8;_0x2fcc49+=0x1){decrementOriginate(_0x579d5a);}}}exports[_0x85d5('0x55')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x198a40){var _0xfb7bd8={};var _0x52d7ca=['id',_0x85d5('0x56'),_0x85d5('0x57'),'updatedAt'];const _0x2b7bbe=0xfa;if(_0x198a40){for(var _0x34369f in _0x198a40){if(typeof _0x198a40[_0x34369f]!==_0x85d5('0x58')){if(!_[_0x85d5('0x32')](_0x198a40[_0x34369f])&&!_0x52d7ca[_0x85d5('0x3a')](_0x34369f)){if(_0x34369f==='description'&&_0x198a40[_0x34369f][_0x85d5('0x59')]>_0x2b7bbe){_0xfb7bd8[_0x85d5('0x5a')+_0x34369f[_0x85d5('0x5b')]()]=_0x198a40[_0x34369f][_0x85d5('0x4e')]()['substring'](0x0,_0x2b7bbe);}else{_0xfb7bd8[_0x85d5('0x5a')+_0x34369f[_0x85d5('0x5b')]()]=_0x198a40[_0x34369f];}}}}}return _0xfb7bd8;}exports[_0x85d5('0x5c')]=setXMDContactVariables;
\ No newline at end of file