Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / services / ami / dialer / utils / index.js
index d663b58..8d0438d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d24=['RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','ivr','isIVRCampaign','type','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','unmonitored','includes','TrunkBackup','status','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','undefined','XMD-','toUpperCase','setXMDContactVariables','lodash','util','../../../../config/logger','timezones','BLACKLIST'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6d24,0x1a4));var _0x46d2=function(_0x515cff,_0x27d4a5){_0x515cff=_0x515cff-0x0;var _0x419c0e=_0x6d24[_0x515cff];return _0x419c0e;};'use strict';var _=require(_0x46d2('0x0'));var moment=require('moment');var util=require(_0x46d2('0x1'));var logger=require(_0x46d2('0x2'))('dialer');var timezones=require('../../../../config/environment/shared')[_0x46d2('0x3')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x46d2('0x4'),'CONTACTS_RESCHEDULED':_0x46d2('0x5'),'DEACTIVATED':_0x46d2('0x6'),'DISACTIVED':_0x46d2('0x7'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x46d2('0x8'),'NO_AVAILABLE_CONTACTS':_0x46d2('0x9'),'NULL_INTERVAL':_0x46d2('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x46d2('0xb'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x46d2('0xc'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x46d2('0xd'),'UNREACHABLE_TRUNK':_0x46d2('0xe')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x34e6d7){return _0x34e6d7[_0x46d2('0xf')]===_0x46d2('0x10');}exports[_0x46d2('0x11')]=isPreviewCampaign;function isIVRCampaign(_0x2bcc25){return _0x2bcc25['type']===_0x46d2('0x12');}exports[_0x46d2('0x13')]=isIVRCampaign;function isOutboundQueue(_0x47c7da){return _0x47c7da[_0x46d2('0x14')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x154fc6){return _0x154fc6[_0x46d2('0x15')];}exports[_0x46d2('0x16')]=isQueueCampaignActive;function isIVRCampaignActive(_0x1bb1b5){return _0x1bb1b5['active'];}exports[_0x46d2('0x17')]=isIVRCampaignActive;function getSeconds(_0x1c67a5,_0x169451){var _0x7cc1fd=moment(_0x1c67a5)[_0x46d2('0x18')](0x0);var _0x30bd14=moment(_0x169451)[_0x46d2('0x18')](0x0);return _0x7cc1fd[_0x46d2('0x19')](_0x30bd14,_0x46d2('0x1a'));}exports[_0x46d2('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x4a20d5,_0x38e2fe){var _0x475d5f=![];var _0xd72695=_0x4a20d5[_0x46d2('0xf')]!==_0x38e2fe[_0x46d2('0xf')]||_0x4a20d5[_0x46d2('0x15')]!==_0x38e2fe['dialActive']||_0x4a20d5[_0x46d2('0x1c')]!==_0x38e2fe[_0x46d2('0x1c')];var _0x12ab53=_0x4a20d5[_0x46d2('0x1d')]!==_0x38e2fe[_0x46d2('0x1d')]||_0x4a20d5[_0x46d2('0x1e')]!==_0x38e2fe[_0x46d2('0x1e')]||_0x4a20d5[_0x46d2('0x1f')]!==_0x38e2fe['loggedInDb']||_0x4a20d5[_0x46d2('0x20')]!==_0x38e2fe[_0x46d2('0x20')]||_0x4a20d5[_0x46d2('0x21')]!==_0x38e2fe[_0x46d2('0x21')]||_0x4a20d5[_0x46d2('0x22')]!==_0x38e2fe[_0x46d2('0x22')]||_0x4a20d5[_0x46d2('0x23')]!==_0x38e2fe[_0x46d2('0x23')]||_0x4a20d5['inUse']!==_0x38e2fe[_0x46d2('0x24')]||_0x4a20d5[_0x46d2('0x25')]!==_0x38e2fe[_0x46d2('0x25')];if(_0x4a20d5[_0x46d2('0x26')]&&_0x38e2fe[_0x46d2('0x26')]){_0x475d5f=_0x4a20d5[_0x46d2('0x26')][_0x46d2('0x27')]!==_0x38e2fe['Trunk'][_0x46d2('0x27')]||_0x4a20d5[_0x46d2('0x26')][_0x46d2('0x28')]!==_0x38e2fe[_0x46d2('0x26')]['active'];}return _0xd72695||_0x12ab53||_0x475d5f;}exports[_0x46d2('0x29')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3e8bd0){var _0x214f9f=null;var _0x46f2d2=_0x3e8bd0['dialTimezone'];if(_[_0x46d2('0x2a')](_0x3e8bd0[_0x46d2('0x2b')])||_[_0x46d2('0x2a')](_0x3e8bd0['Interval'])||_[_0x46d2('0x2a')](_0x3e8bd0[_0x46d2('0x2c')][_0x46d2('0x2d')])){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x2e')];}else if(_[_0x46d2('0x2f')](_0x3e8bd0['dialGlobalInterval'])||_[_0x46d2('0x2f')](_0x3e8bd0[_0x46d2('0x2c')][_0x46d2('0x2d')])){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x30')];}else if(_0x46f2d2&&!timezones[_0x46f2d2]){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x31')];}return _0x214f9f;}function checkAnyValidTrunk(_0x30bf33,_0x3ebc51){var _0x1cecb4=null;var _0x828f90='SIP/';var _0x475b4d=['reachable',_0x46d2('0x32')];var _0x5969ea=!![];if(_0x30bf33['Trunk']&&_0x30bf33['Trunk'][_0x46d2('0x28')]){_0x828f90+=_0x30bf33[_0x46d2('0x26')]['name'];_0x1cecb4=_0x3ebc51[_0x828f90];_0x5969ea=_0x475b4d[_0x46d2('0x33')](_0x1cecb4['status']);}else if(_0x30bf33[_0x46d2('0x34')]&&_0x30bf33[_0x46d2('0x34')][_0x46d2('0x28')]){_0x828f90+=_0x30bf33[_0x46d2('0x34')]['name'];_0x1cecb4=_0x3ebc51[_0x828f90];_0x5969ea=_0x475b4d['includes'](_0x1cecb4[_0x46d2('0x35')]);}return _0x5969ea;}function getQueueCampaignStatusMessage(_0x38efac,_0x4d271e){var _0x43f437=CAMPAIGN_STATUS[_0x46d2('0x36')];var _0x270333=isPreviewCampaign(_0x38efac);if(!isQueueCampaignActive(_0x38efac)){if(_0x270333){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x37')];}else{if(_0x38efac['originated']===0x0&&_0x38efac[_0x46d2('0x21')]===0x0&&_0x38efac['waiting']===0x0&&(_0x38efac[_0x46d2('0x22')]||0x0)===0x0){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x37')];}else{_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x38')];}}}else if(_0x38efac[_0x46d2('0x1e')]===0x0){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x39')];}else if(!checkAnyValidTrunk(_0x38efac,_0x4d271e)){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x3a')];}else if(!isPreviewCampaign(_0x38efac)){var _0x513cea=checkAnyValidQueueCampaignInterval(_0x38efac);if(_0x513cea){_0x43f437=_0x513cea;}}return _0x43f437;}exports[_0x46d2('0x3b')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3007c3){var _0x3767ed=CAMPAIGN_STATUS['DISACTIVED'];if(_0x3007c3[_0x46d2('0x25')]===0x0&&_0x3007c3[_0x46d2('0x21')]===0x0&&_0x3007c3[_0x46d2('0x23')]===0x0&&(_0x3007c3[_0x46d2('0x22')]||0x0)===0x0){_0x3767ed=CAMPAIGN_STATUS[_0x46d2('0x37')];}return _0x3767ed;}exports[_0x46d2('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5a248){var _0x15fa6f=_0x5a248[_0x46d2('0x3d')](/"(.*?)"/);return _0x15fa6f?_0x15fa6f[0x1]:_0x5a248;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x11d12b,_0x12b50c,_0x4e4c09){if(!_[_0x46d2('0x3e')](_0x4e4c09)&&typeof _0x4e4c09===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x4e4c09)){if(!_[_0x46d2('0x3e')](_0x12b50c)&&typeof _0x12b50c===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x12b50c)){return util[_0x46d2('0x40')](_0x46d2('0x41'),_0x12b50c,_0x4e4c09);}return util[_0x46d2('0x40')](_0x46d2('0x41'),_0x4e4c09,_0x4e4c09);}if(!_[_0x46d2('0x3e')](_0x11d12b)&&typeof _0x11d12b===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x11d12b)){return _0x11d12b;}return _0x46d2('0x42');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x4c08c5,_0x3d0c62){var _0x2a64bb;var _0xa56709;var _0xdc70d0;if(_0x3d0c62<=0x0){_0x3d0c62=0x1;}_0x2a64bb=new RegExp(_0x46d2('0x43')+_0x3d0c62+'}$');_0xa56709=Math[_0x46d2('0x44')](0xa,_0x3d0c62-0x1);_0xdc70d0=Math['pow'](0xa,_0x3d0c62)-0x1;return util[_0x46d2('0x40')]('%s',_[_0x46d2('0x45')](_0x4c08c5,_0x2a64bb,_['random'](_0xa56709,_0xdc70d0)[_0x46d2('0x46')]()));}exports[_0x46d2('0x47')]=getCallerIdRandom;function decrementOriginate(_0x38a25a){if(_0x38a25a[_0x46d2('0x25')]&&_0x38a25a[_0x46d2('0x25')]>0x0){_0x38a25a[_0x46d2('0x25')]-=0x1;}else{logger[_0x46d2('0x48')](_0x46d2('0x49'));}}exports[_0x46d2('0x4a')]=decrementOriginate;function checkContactEmpty(_0x3f0fc3){return _0x3f0fc3&&_0x3f0fc3[_0x46d2('0x4b')]>0x0;}exports[_0x46d2('0x4c')]=checkContactEmpty;function erlangb(_0x5a0634,_0x4d6993){if(_0x4d6993===0x0){return 0x0;}var _0x3c3679=0x1;for(var _0x571a9b=0x1;_0x571a9b<=_0x4d6993;_0x571a9b+=0x1){_0x3c3679=0x1+_0x3c3679*_0x571a9b/_0x5a0634;}return 0x1/_0x3c3679;}exports[_0x46d2('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x5e1382,_0x367e37,_0x23f507){if(_0x367e37>_0x23f507){for(var _0x4b5ab0=0x0;_0x4b5ab0<_0x367e37-_0x23f507;_0x4b5ab0+=0x1){decrementOriginate(_0x5e1382);}}}exports[_0x46d2('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xa5b2c0){var _0x11949b={};var _0x40265d=['id',_0x46d2('0x4f'),_0x46d2('0x50'),'tags','updatedAt'];if(_0xa5b2c0){for(var _0x2ef6a9 in _0xa5b2c0){if(typeof _0xa5b2c0[_0x2ef6a9]!==_0x46d2('0x51')){if(!_['isNil'](_0xa5b2c0[_0x2ef6a9])&&!_0x40265d[_0x46d2('0x33')](_0x2ef6a9)){_0x11949b[util['format']('%s%s',_0x46d2('0x52'),_0x2ef6a9[_0x46d2('0x53')]())]=_0xa5b2c0[_0x2ef6a9];}}}}return _0x11949b;}exports[_0x46d2('0x54')]=setXMDContactVariables;
\ No newline at end of file
+var _0xa3fb=['isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','message','available','loggedIn','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa3fb,0x193));var _0xba3f=function(_0x4446cc,_0x135a4c){_0x4446cc=_0x4446cc-0x0;var _0x20eb69=_0xa3fb[_0x4446cc];return _0x20eb69;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xba3f('0x0'));var logger=require(_0xba3f('0x1'))(_0xba3f('0x2'));var timezones=require(_0xba3f('0x3'))[_0xba3f('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xba3f('0x5'),'BLACKLIST':_0xba3f('0x6'),'CONTACTS_RESCHEDULED':_0xba3f('0x7'),'DEACTIVATED':_0xba3f('0x8'),'DISACTIVED':_0xba3f('0x9'),'EMPTY_INTERVAL':_0xba3f('0xa'),'INACTIVE':_0xba3f('0xb'),'NO_AGENTS_LOGGED':_0xba3f('0xc'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0xba3f('0xd'),'OVERTIME_INTERVAL':_0xba3f('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0xba3f('0xf'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xba3f('0x10'),'RUNNING':_0xba3f('0x11'),'UNKNOWN_TIMEZONE':_0xba3f('0x12'),'UNREACHABLE_TRUNK':_0xba3f('0x13')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2289ab){return _0x2289ab[_0xba3f('0x14')]===_0xba3f('0x15');}exports[_0xba3f('0x16')]=isPreviewCampaign;function isIVRCampaign(_0x3e1138){return _0x3e1138[_0xba3f('0x17')]===_0xba3f('0x18');}exports[_0xba3f('0x19')]=isIVRCampaign;function isOutboundQueue(_0x5ea041){return _0x5ea041[_0xba3f('0x17')]===_0xba3f('0x1a');}exports[_0xba3f('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x414d3a){return _0x414d3a[_0xba3f('0x1c')];}exports[_0xba3f('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3e04e3){return _0x3e04e3[_0xba3f('0x1e')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x1ce0af,_0x4ee00e){var _0x1efab7=moment(_0x1ce0af)[_0xba3f('0x1f')](0x0);var _0x598ca9=moment(_0x4ee00e)['milliseconds'](0x0);return _0x1efab7[_0xba3f('0x20')](_0x598ca9,_0xba3f('0x21'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x50ef10,_0x553f2f){var _0x102c78=![];var _0x12f931=_0x50ef10[_0xba3f('0x14')]!==_0x553f2f[_0xba3f('0x14')]||_0x50ef10[_0xba3f('0x1c')]!==_0x553f2f[_0xba3f('0x1c')]||_0x50ef10[_0xba3f('0x22')]!==_0x553f2f[_0xba3f('0x22')];var _0xf5f45e=_0x50ef10[_0xba3f('0x23')]!==_0x553f2f[_0xba3f('0x23')]||_0x50ef10['loggedIn']!==_0x553f2f[_0xba3f('0x24')]||_0x50ef10['loggedInDb']!==_0x553f2f['loggedInDb']||_0x50ef10[_0xba3f('0x25')]!==_0x553f2f[_0xba3f('0x25')]||_0x50ef10[_0xba3f('0x26')]!==_0x553f2f[_0xba3f('0x26')]||_0x50ef10[_0xba3f('0x27')]!==_0x553f2f[_0xba3f('0x27')]||_0x50ef10['waiting']!==_0x553f2f[_0xba3f('0x28')]||_0x50ef10[_0xba3f('0x29')]!==_0x553f2f[_0xba3f('0x29')]||_0x50ef10[_0xba3f('0x2a')]!==_0x553f2f[_0xba3f('0x2a')];if(_0x50ef10[_0xba3f('0x2b')]&&_0x553f2f[_0xba3f('0x2b')]){_0x102c78=_0x50ef10[_0xba3f('0x2b')][_0xba3f('0x2c')]!==_0x553f2f[_0xba3f('0x2b')]['name']||_0x50ef10[_0xba3f('0x2b')]['active']!==_0x553f2f[_0xba3f('0x2b')][_0xba3f('0x1e')];}return _0x12f931||_0xf5f45e||_0x102c78;}exports[_0xba3f('0x2d')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4acc38){var _0x5198b8=null;var _0xe568ba=_0x4acc38[_0xba3f('0x2e')];if(_[_0xba3f('0x2f')](_0x4acc38[_0xba3f('0x30')])||_['isNil'](_0x4acc38[_0xba3f('0x31')])||_[_0xba3f('0x2f')](_0x4acc38[_0xba3f('0x31')][_0xba3f('0x32')])){_0x5198b8=CAMPAIGN_STATUS[_0xba3f('0x33')];}else if(_[_0xba3f('0x34')](_0x4acc38[_0xba3f('0x30')])||_['isEmpty'](_0x4acc38[_0xba3f('0x31')][_0xba3f('0x32')])){_0x5198b8=CAMPAIGN_STATUS[_0xba3f('0x35')];}else if(_0xe568ba&&!timezones[_0xe568ba]){_0x5198b8=CAMPAIGN_STATUS[_0xba3f('0x36')];}return _0x5198b8;}function checkAnyValidTrunk(_0x3699c6,_0x1753d8){var _0x9df835=null;var _0x1119c2=_0xba3f('0x37');var _0xa7b89d=[_0xba3f('0x38'),_0xba3f('0x39')];var _0x320948=!![];if(_0x3699c6['Trunk']&&_0x3699c6[_0xba3f('0x2b')][_0xba3f('0x1e')]){_0x1119c2+=_0x3699c6['Trunk'][_0xba3f('0x2c')];_0x9df835=_0x1753d8[_0x1119c2];_0x320948=_0xa7b89d['includes'](_0x9df835['status']);}else if(_0x3699c6[_0xba3f('0x3a')]&&_0x3699c6[_0xba3f('0x3a')][_0xba3f('0x1e')]){_0x1119c2+=_0x3699c6[_0xba3f('0x3a')]['name'];_0x9df835=_0x1753d8[_0x1119c2];_0x320948=_0xa7b89d['includes'](_0x9df835[_0xba3f('0x3b')]);}return _0x320948;}function getQueueCampaignStatusMessage(_0xa98105,_0x45630f){var _0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x5')];var _0x1081c4=isPreviewCampaign(_0xa98105);if(!isQueueCampaignActive(_0xa98105)){if(_0x1081c4){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3c')];}else{if(_0xa98105['originated']===0x0&&_0xa98105[_0xba3f('0x26')]===0x0&&_0xa98105[_0xba3f('0x28')]===0x0&&(_0xa98105[_0xba3f('0x27')]||0x0)===0x0){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3c')];}else{_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3d')];}}}else if(_0xa98105[_0xba3f('0x24')]===0x0){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3e')];}else if(!checkAnyValidTrunk(_0xa98105,_0x45630f)){_0x3f1be8=CAMPAIGN_STATUS[_0xba3f('0x3f')];}else if(!isPreviewCampaign(_0xa98105)){var _0x1c18e1=checkAnyValidQueueCampaignInterval(_0xa98105);if(_0x1c18e1){_0x3f1be8=_0x1c18e1;}}return _0x3f1be8;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x51207b){var _0x5a230a=CAMPAIGN_STATUS['DISACTIVED'];if(_0x51207b[_0xba3f('0x2a')]===0x0&&_0x51207b[_0xba3f('0x26')]===0x0&&_0x51207b[_0xba3f('0x28')]===0x0&&(_0x51207b[_0xba3f('0x27')]||0x0)===0x0){_0x5a230a=CAMPAIGN_STATUS[_0xba3f('0x3c')];}return _0x5a230a;}exports[_0xba3f('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5a58ea){var _0x5802cd=_0x5a58ea[_0xba3f('0x41')](/"(.*?)"/);return _0x5802cd?_0x5802cd[0x1]:_0x5a58ea;}exports[_0xba3f('0x42')]=extractCalleridName;function getCallerId(_0xa08541,_0x1bda95,_0x25813b){if(!_[_0xba3f('0x43')](_0x25813b)&&typeof _0x25813b==='string'&&!_[_0xba3f('0x34')](_0x25813b)){if(!_[_0xba3f('0x43')](_0x1bda95)&&typeof _0x1bda95===_0xba3f('0x44')&&!_['isEmpty'](_0x1bda95)){return util[_0xba3f('0x45')](_0xba3f('0x46'),_0x1bda95,_0x25813b);}return util[_0xba3f('0x45')]('\x22%s\x22\x20<%s>',_0x25813b,_0x25813b);}if(!_[_0xba3f('0x43')](_0xa08541)&&typeof _0xa08541===_0xba3f('0x44')&&!_[_0xba3f('0x34')](_0xa08541)){return _0xa08541;}return _0xba3f('0x47');}exports[_0xba3f('0x48')]=getCallerId;function getCallerIdRandom(_0x5c7f83,_0x2d4bec){var _0x2d6fd6;var _0x3e4254;var _0x6bff34;if(_0x2d4bec<=0x0){_0x2d4bec=0x1;}_0x2d6fd6=new RegExp(_0xba3f('0x49')+_0x2d4bec+'}$');_0x3e4254=Math[_0xba3f('0x4a')](0xa,_0x2d4bec-0x1);_0x6bff34=Math['pow'](0xa,_0x2d4bec)-0x1;return util[_0xba3f('0x45')]('%s',_[_0xba3f('0x4b')](_0x5c7f83,_0x2d6fd6,_[_0xba3f('0x4c')](_0x3e4254,_0x6bff34)[_0xba3f('0x4d')]()));}exports[_0xba3f('0x4e')]=getCallerIdRandom;function decrementOriginate(_0x57ebec){if(_0x57ebec['originated']&&_0x57ebec[_0xba3f('0x2a')]>0x0){_0x57ebec[_0xba3f('0x2a')]-=0x1;}else{logger[_0xba3f('0x4f')](_0xba3f('0x50'));}}exports[_0xba3f('0x51')]=decrementOriginate;function checkContactEmpty(_0x444e96){return _0x444e96&&_0x444e96[_0xba3f('0x52')]>0x0;}exports[_0xba3f('0x53')]=checkContactEmpty;function erlangb(_0x57c782,_0x5c5a1b){if(_0x5c5a1b===0x0){return 0x0;}var _0x5f1870=0x1;for(var _0xe80e55=0x1;_0xe80e55<=_0x5c5a1b;_0xe80e55+=0x1){_0x5f1870=0x1+_0x5f1870*_0xe80e55/_0x57c782;}return 0x1/_0x5f1870;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x408132,_0xe57207,_0x217b1f){if(_0xe57207>_0x217b1f){for(var _0x433fe5=0x0;_0x433fe5<_0xe57207-_0x217b1f;_0x433fe5+=0x1){decrementOriginate(_0x408132);}}}exports[_0xba3f('0x54')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x504ee2){var _0x5704cc={};var _0x3dfa92=['id',_0xba3f('0x55'),_0xba3f('0x56'),_0xba3f('0x57'),_0xba3f('0x58')];if(_0x504ee2){for(var _0x286640 in _0x504ee2){if(typeof _0x504ee2[_0x286640]!==_0xba3f('0x59')){if(!_[_0xba3f('0x2f')](_0x504ee2[_0x286640])&&!_0x3dfa92['includes'](_0x286640)){_0x5704cc[util[_0xba3f('0x45')](_0xba3f('0x5a'),_0xba3f('0x5b'),_0x286640[_0xba3f('0x5c')]())]=_0x504ee2[_0x286640];}}}}return _0x5704cc;}exports[_0xba3f('0x5d')]=setXMDContactVariables;
\ No newline at end of file