Built motion from commit 64440dd5.|2.6.29
[motion2.git] / server / services / ami / dialer / utils / index.js
index 93aa2d4..0c0b936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0ba=['RECALLINQUEUE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','dialGlobalInterval','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','ACTIVE','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','toString','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','util','../../../../config/logger','dialer','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME'];(function(_0x2da0da,_0x3a967a){var _0x34fbe6=function(_0x3b6495){while(--_0x3b6495){_0x2da0da['push'](_0x2da0da['shift']());}};_0x34fbe6(++_0x3a967a);}(_0xf0ba,0x9f));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaf0b('0x0'));var moment=require('moment');var util=require(_0xaf0b('0x1'));var logger=require(_0xaf0b('0x2'))(_0xaf0b('0x3'));var timezones=require('../../../../config/environment/shared')[_0xaf0b('0x4')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xaf0b('0x5'),'CONTACTS_RESCHEDULED':_0xaf0b('0x6'),'DEACTIVATED':_0xaf0b('0x7'),'DISACTIVED':_0xaf0b('0x8'),'EMPTY_INTERVAL':_0xaf0b('0x9'),'INACTIVE':_0xaf0b('0xa'),'NO_AGENTS_LOGGED':_0xaf0b('0xb'),'NO_AVAILABLE_CONTACTS':_0xaf0b('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xaf0b('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xaf0b('0xe'),'QUEUE_RECALL':_0xaf0b('0xf'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xaf0b('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x20019c){return _0x20019c[_0xaf0b('0x11')]===_0xaf0b('0x12');}exports[_0xaf0b('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x3c167b){return _0x3c167b[_0xaf0b('0x14')]===_0xaf0b('0x15');}exports[_0xaf0b('0x16')]=isIVRCampaign;function isOutboundQueue(_0x1b529e){return _0x1b529e[_0xaf0b('0x14')]===_0xaf0b('0x17');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x43b111){return _0x43b111[_0xaf0b('0x18')];}exports[_0xaf0b('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5567e2){return _0x5567e2[_0xaf0b('0x1a')];}exports[_0xaf0b('0x1b')]=isIVRCampaignActive;function getSeconds(_0x419aaf,_0x59dd12){var _0x5695df=moment(_0x419aaf)[_0xaf0b('0x1c')](0x0);var _0x6c8578=moment(_0x59dd12)[_0xaf0b('0x1c')](0x0);return _0x5695df[_0xaf0b('0x1d')](_0x6c8578,'seconds');}exports[_0xaf0b('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0xa669c6,_0x46f052){var _0x481f73=![];var _0x3dbc6e=_0xa669c6['dialMethod']!==_0x46f052[_0xaf0b('0x11')]||_0xa669c6[_0xaf0b('0x18')]!==_0x46f052['dialActive']||_0xa669c6[_0xaf0b('0x1f')]!==_0x46f052['message'];var _0x4bed37=_0xa669c6[_0xaf0b('0x20')]!==_0x46f052[_0xaf0b('0x20')]||_0xa669c6[_0xaf0b('0x21')]!==_0x46f052['loggedIn']||_0xa669c6[_0xaf0b('0x22')]!==_0x46f052[_0xaf0b('0x22')]||_0xa669c6['paused']!==_0x46f052[_0xaf0b('0x23')]||_0xa669c6[_0xaf0b('0x24')]!==_0x46f052[_0xaf0b('0x24')]||_0xa669c6['pTalking']!==_0x46f052[_0xaf0b('0x25')]||_0xa669c6[_0xaf0b('0x26')]!==_0x46f052[_0xaf0b('0x26')]||_0xa669c6['inUse']!==_0x46f052[_0xaf0b('0x27')]||_0xa669c6['originated']!==_0x46f052[_0xaf0b('0x28')];if(_0xa669c6[_0xaf0b('0x29')]&&_0x46f052['Trunk']){_0x481f73=_0xa669c6[_0xaf0b('0x29')][_0xaf0b('0x2a')]!==_0x46f052[_0xaf0b('0x29')][_0xaf0b('0x2a')]||_0xa669c6[_0xaf0b('0x29')][_0xaf0b('0x1a')]!==_0x46f052[_0xaf0b('0x29')][_0xaf0b('0x1a')];}return _0x3dbc6e||_0x4bed37||_0x481f73;}exports[_0xaf0b('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x187916){var _0x2b3b88=null;var _0x5edc69=_0x187916[_0xaf0b('0x2c')];if(_[_0xaf0b('0x2d')](_0x187916['dialGlobalInterval'])||_[_0xaf0b('0x2d')](_0x187916[_0xaf0b('0x2e')])||_['isNil'](_0x187916[_0xaf0b('0x2e')][_0xaf0b('0x2f')])){_0x2b3b88=CAMPAIGN_STATUS[_0xaf0b('0x30')];}else if(_[_0xaf0b('0x31')](_0x187916[_0xaf0b('0x32')])||_['isEmpty'](_0x187916[_0xaf0b('0x2e')]['Intervals'])){_0x2b3b88=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x5edc69&&!timezones[_0x5edc69]){_0x2b3b88=CAMPAIGN_STATUS[_0xaf0b('0x33')];}return _0x2b3b88;}function checkAnyValidTrunk(_0x39004f,_0x30484d){var _0x11a00a=null;var _0x4659b3=_0xaf0b('0x34');var _0x3ecec6=[_0xaf0b('0x35'),'unmonitored'];var _0x26a0c7=!![];if(_0x39004f[_0xaf0b('0x29')]&&_0x39004f[_0xaf0b('0x29')][_0xaf0b('0x1a')]){_0x4659b3+=_0x39004f[_0xaf0b('0x29')]['name'];_0x11a00a=_0x30484d[_0x4659b3];_0x26a0c7=_0x3ecec6[_0xaf0b('0x36')](_0x11a00a[_0xaf0b('0x37')]);}else if(_0x39004f[_0xaf0b('0x38')]&&_0x39004f['TrunkBackup']['active']){_0x4659b3+=_0x39004f[_0xaf0b('0x38')]['name'];_0x11a00a=_0x30484d[_0x4659b3];_0x26a0c7=_0x3ecec6[_0xaf0b('0x36')](_0x11a00a['status']);}return _0x26a0c7;}function getQueueCampaignStatusMessage(_0x1b42f1,_0xf4b0fc){var _0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x39')];var _0x4dbc56=isPreviewCampaign(_0x1b42f1);if(!isQueueCampaignActive(_0x1b42f1)){if(_0x4dbc56){_0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x3a')];}else{if(_0x1b42f1[_0xaf0b('0x28')]===0x0&&_0x1b42f1[_0xaf0b('0x24')]===0x0&&_0x1b42f1[_0xaf0b('0x26')]===0x0&&(_0x1b42f1['pTalking']||0x0)===0x0){_0x99e017=CAMPAIGN_STATUS['INACTIVE'];}else{_0x99e017=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x1b42f1[_0xaf0b('0x21')]===0x0){_0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x3b')];}else if(!checkAnyValidTrunk(_0x1b42f1,_0xf4b0fc)){_0x99e017=CAMPAIGN_STATUS[_0xaf0b('0x3c')];}else if(!isPreviewCampaign(_0x1b42f1)){var _0x36d79c=checkAnyValidQueueCampaignInterval(_0x1b42f1);if(_0x36d79c){_0x99e017=_0x36d79c;}}return _0x99e017;}exports[_0xaf0b('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xc46876){var _0x3d38dc=CAMPAIGN_STATUS[_0xaf0b('0x3e')];if(_0xc46876[_0xaf0b('0x28')]===0x0&&_0xc46876[_0xaf0b('0x24')]===0x0&&_0xc46876['waiting']===0x0&&(_0xc46876[_0xaf0b('0x25')]||0x0)===0x0){_0x3d38dc=CAMPAIGN_STATUS['INACTIVE'];}return _0x3d38dc;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3d89d9){var _0x375cd1=_0x3d89d9[_0xaf0b('0x3f')](/"(.*?)"/);return _0x375cd1?_0x375cd1[0x1]:_0x3d89d9;}exports[_0xaf0b('0x40')]=extractCalleridName;function getCallerId(_0x397f69,_0x5c4641,_0x4793cf){if(!_[_0xaf0b('0x41')](_0x4793cf)&&typeof _0x4793cf===_0xaf0b('0x42')&&!_['isEmpty'](_0x4793cf)){if(!_['isUndefined'](_0x5c4641)&&typeof _0x5c4641===_0xaf0b('0x42')&&!_['isEmpty'](_0x5c4641)){return util[_0xaf0b('0x43')](_0xaf0b('0x44'),_0x5c4641,_0x4793cf);}return util['format'](_0xaf0b('0x44'),_0x4793cf,_0x4793cf);}if(!_[_0xaf0b('0x41')](_0x397f69)&&typeof _0x397f69==='string'&&!_[_0xaf0b('0x31')](_0x397f69)){return _0x397f69;}return _0xaf0b('0x45');}exports[_0xaf0b('0x46')]=getCallerId;function getCallerIdRandom(_0x2f0364,_0x16d2b3){var _0x311fba;var _0x3a592f;var _0x40d9a0;if(_0x16d2b3<=0x0){_0x16d2b3=0x1;}_0x311fba=new RegExp(_0xaf0b('0x47')+_0x16d2b3+'}$');_0x3a592f=Math[_0xaf0b('0x48')](0xa,_0x16d2b3-0x1);_0x40d9a0=Math['pow'](0xa,_0x16d2b3)-0x1;return util[_0xaf0b('0x43')]('%s',_['replace'](_0x2f0364,_0x311fba,_['random'](_0x3a592f,_0x40d9a0)[_0xaf0b('0x49')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x10e89b){if(_0x10e89b[_0xaf0b('0x28')]&&_0x10e89b[_0xaf0b('0x28')]>0x0){_0x10e89b[_0xaf0b('0x28')]-=0x1;}else{logger['error'](_0xaf0b('0x4a'));}}exports[_0xaf0b('0x4b')]=decrementOriginate;function checkContactEmpty(_0x5334e2){return _0x5334e2&&_0x5334e2[_0xaf0b('0x4c')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x395644,_0x26a5e3){if(_0x26a5e3===0x0){return 0x0;}var _0x11fe60=0x1;for(var _0x5dfb10=0x1;_0x5dfb10<=_0x26a5e3;_0x5dfb10+=0x1){_0x11fe60=0x1+_0x11fe60*_0x5dfb10/_0x395644;}return 0x1/_0x11fe60;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x5638ab,_0x4c1603,_0x43f3ba){if(_0x4c1603>_0x43f3ba){for(var _0x149845=0x0;_0x149845<_0x4c1603-_0x43f3ba;_0x149845+=0x1){decrementOriginate(_0x5638ab);}}}exports[_0xaf0b('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x592493){var _0x18eeaa={};var _0x1cfe1a=['id',_0xaf0b('0x4e'),_0xaf0b('0x4f'),_0xaf0b('0x50')];const _0x41bcb1=0xfa;if(_0x592493){for(var _0x34560d in _0x592493){if(typeof _0x592493[_0x34560d]!==_0xaf0b('0x51')){if(!_['isNil'](_0x592493[_0x34560d])&&!_0x1cfe1a['includes'](_0x34560d)){if(_0x34560d===_0xaf0b('0x52')&&_0x592493[_0x34560d]['length']>_0x41bcb1){_0x18eeaa[_0xaf0b('0x53')+_0x34560d[_0xaf0b('0x54')]()]=_0x592493[_0x34560d][_0xaf0b('0x49')]()[_0xaf0b('0x55')](0x0,_0x41bcb1);}else{_0x18eeaa[_0xaf0b('0x53')+_0x34560d[_0xaf0b('0x54')]()]=_0x592493[_0x34560d];}}}}}return _0x18eeaa;}exports[_0xaf0b('0x56')]=setXMDContactVariables;
\ No newline at end of file
+var _0x8f73=['Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','erlangb','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','description','XMD-','substring','toUpperCase','setXMDContactVariables','lodash','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated'];(function(_0x3e81df,_0xb0f7e3){var _0x1c7c79=function(_0x2db358){while(--_0x2db358){_0x3e81df['push'](_0x3e81df['shift']());}};_0x1c7c79(++_0xb0f7e3);}(_0x8f73,0x82));var _0x38f7=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x8f73[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x38f7('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x38f7('0x1'))(_0x38f7('0x2'));var timezones=require('../../../../config/environment/shared')[_0x38f7('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x38f7('0x4'),'BLACKLIST':_0x38f7('0x5'),'CONTACTS_RESCHEDULED':_0x38f7('0x6'),'DEACTIVATED':_0x38f7('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x38f7('0x8'),'INACTIVE':_0x38f7('0x9'),'NO_AGENTS_LOGGED':_0x38f7('0xa'),'NO_AVAILABLE_CONTACTS':_0x38f7('0xb'),'NULL_INTERVAL':_0x38f7('0xc'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x38f7('0xd'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x38f7('0xe'),'RUNNING':_0x38f7('0xf'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x38f7('0x10')};exports[_0x38f7('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x553fc9){return _0x553fc9['dialMethod']===_0x38f7('0x12');}exports[_0x38f7('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x54380e){return _0x54380e[_0x38f7('0x14')]===_0x38f7('0x15');}exports[_0x38f7('0x16')]=isIVRCampaign;function isOutboundQueue(_0xb6f8){return _0xb6f8[_0x38f7('0x14')]===_0x38f7('0x17');}exports[_0x38f7('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x7653a4){return _0x7653a4[_0x38f7('0x19')];}exports[_0x38f7('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x10ffa5){return _0x10ffa5[_0x38f7('0x1b')];}exports[_0x38f7('0x1c')]=isIVRCampaignActive;function getSeconds(_0x599b84,_0x3b1f7f){var _0x10f508=moment(_0x599b84)['milliseconds'](0x0);var _0x19faf8=moment(_0x3b1f7f)[_0x38f7('0x1d')](0x0);return _0x10f508['diff'](_0x19faf8,'seconds');}exports[_0x38f7('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x20b46d,_0x10f554){var _0x505843=![];var _0x120ad9=_0x20b46d[_0x38f7('0x1f')]!==_0x10f554['dialMethod']||_0x20b46d[_0x38f7('0x19')]!==_0x10f554[_0x38f7('0x19')]||_0x20b46d[_0x38f7('0x20')]!==_0x10f554[_0x38f7('0x20')];var _0x4f3197=_0x20b46d['available']!==_0x10f554[_0x38f7('0x21')]||_0x20b46d[_0x38f7('0x22')]!==_0x10f554[_0x38f7('0x22')]||_0x20b46d[_0x38f7('0x23')]!==_0x10f554[_0x38f7('0x23')]||_0x20b46d[_0x38f7('0x24')]!==_0x10f554[_0x38f7('0x24')]||_0x20b46d['talking']!==_0x10f554[_0x38f7('0x25')]||_0x20b46d['pTalking']!==_0x10f554[_0x38f7('0x26')]||_0x20b46d[_0x38f7('0x27')]!==_0x10f554[_0x38f7('0x27')]||_0x20b46d[_0x38f7('0x28')]!==_0x10f554['inUse']||_0x20b46d[_0x38f7('0x29')]!==_0x10f554[_0x38f7('0x29')];if(_0x20b46d[_0x38f7('0x2a')]&&_0x10f554[_0x38f7('0x2a')]){_0x505843=_0x20b46d[_0x38f7('0x2a')][_0x38f7('0x2b')]!==_0x10f554['Trunk'][_0x38f7('0x2b')]||_0x20b46d[_0x38f7('0x2a')][_0x38f7('0x1b')]!==_0x10f554[_0x38f7('0x2a')][_0x38f7('0x1b')];}return _0x120ad9||_0x4f3197||_0x505843;}exports[_0x38f7('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1f94d4){var _0x207255=null;var _0x1cad60=_0x1f94d4['dialTimezone'];if(_[_0x38f7('0x2d')](_0x1f94d4[_0x38f7('0x2e')])||_[_0x38f7('0x2d')](_0x1f94d4[_0x38f7('0x2f')])||_[_0x38f7('0x2d')](_0x1f94d4[_0x38f7('0x2f')][_0x38f7('0x30')])){_0x207255=CAMPAIGN_STATUS[_0x38f7('0x31')];}else if(_[_0x38f7('0x32')](_0x1f94d4[_0x38f7('0x2e')])||_[_0x38f7('0x32')](_0x1f94d4['Interval'][_0x38f7('0x30')])){_0x207255=CAMPAIGN_STATUS[_0x38f7('0x33')];}else if(_0x1cad60&&!timezones[_0x1cad60]){_0x207255=CAMPAIGN_STATUS[_0x38f7('0x34')];}return _0x207255;}function checkAnyValidTrunk(_0x3d332c,_0x479f1a){var _0x234297=null;var _0x10c944=_0x38f7('0x35');var _0x166ce4=[_0x38f7('0x36'),'unmonitored'];var _0x530cd1=!![];if(_0x3d332c[_0x38f7('0x2a')]&&_0x3d332c[_0x38f7('0x2a')][_0x38f7('0x1b')]){_0x10c944+=_0x3d332c[_0x38f7('0x2a')]['name'];_0x234297=_0x479f1a[_0x10c944];_0x530cd1=_0x166ce4[_0x38f7('0x37')](_0x234297[_0x38f7('0x38')]);}else if(_0x3d332c[_0x38f7('0x39')]&&_0x3d332c[_0x38f7('0x39')][_0x38f7('0x1b')]){_0x10c944+=_0x3d332c[_0x38f7('0x39')][_0x38f7('0x2b')];_0x234297=_0x479f1a[_0x10c944];_0x530cd1=_0x166ce4[_0x38f7('0x37')](_0x234297[_0x38f7('0x38')]);}return _0x530cd1;}function getQueueCampaignStatusMessage(_0x4f5b2d,_0x47fa15){var _0x528af7=CAMPAIGN_STATUS[_0x38f7('0x4')];var _0x51772=isPreviewCampaign(_0x4f5b2d);if(!isQueueCampaignActive(_0x4f5b2d)){if(_0x51772){_0x528af7=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x4f5b2d[_0x38f7('0x29')]===0x0&&_0x4f5b2d[_0x38f7('0x25')]===0x0&&_0x4f5b2d[_0x38f7('0x27')]===0x0&&(_0x4f5b2d[_0x38f7('0x26')]||0x0)===0x0){_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3a')];}else{_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3b')];}}}else if(_0x4f5b2d[_0x38f7('0x22')]===0x0){_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3c')];}else if(!checkAnyValidTrunk(_0x4f5b2d,_0x47fa15)){_0x528af7=CAMPAIGN_STATUS[_0x38f7('0x3d')];}else if(!isPreviewCampaign(_0x4f5b2d)){var _0x9688bb=checkAnyValidQueueCampaignInterval(_0x4f5b2d);if(_0x9688bb){_0x528af7=_0x9688bb;}}return _0x528af7;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x49335d){var _0x53edff=CAMPAIGN_STATUS[_0x38f7('0x3b')];if(_0x49335d[_0x38f7('0x29')]===0x0&&_0x49335d[_0x38f7('0x25')]===0x0&&_0x49335d[_0x38f7('0x27')]===0x0&&(_0x49335d[_0x38f7('0x26')]||0x0)===0x0){_0x53edff=CAMPAIGN_STATUS[_0x38f7('0x3a')];}return _0x53edff;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x80a36c){var _0x37727e=_0x80a36c[_0x38f7('0x3e')](/"(.*?)"/);return _0x37727e?_0x37727e[0x1]:_0x80a36c;}exports[_0x38f7('0x3f')]=extractCalleridName;function getCallerId(_0x17806b,_0x290118,_0x3d02d2){if(!_[_0x38f7('0x40')](_0x3d02d2)&&typeof _0x3d02d2===_0x38f7('0x41')&&!_[_0x38f7('0x32')](_0x3d02d2)){if(!_[_0x38f7('0x40')](_0x290118)&&typeof _0x290118===_0x38f7('0x41')&&!_[_0x38f7('0x32')](_0x290118)){return util[_0x38f7('0x42')]('\x22%s\x22\x20<%s>',_0x290118,_0x3d02d2);}return util[_0x38f7('0x42')](_0x38f7('0x43'),_0x3d02d2,_0x3d02d2);}if(!_[_0x38f7('0x40')](_0x17806b)&&typeof _0x17806b===_0x38f7('0x41')&&!_[_0x38f7('0x32')](_0x17806b)){return _0x17806b;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x116da8,_0x42de6d){var _0x2a241d;var _0x1525c8;var _0x34f6c4;if(_0x42de6d<=0x0){_0x42de6d=0x1;}_0x2a241d=new RegExp(_0x38f7('0x44')+_0x42de6d+'}$');_0x1525c8=Math[_0x38f7('0x45')](0xa,_0x42de6d-0x1);_0x34f6c4=Math[_0x38f7('0x45')](0xa,_0x42de6d)-0x1;return util['format']('%s',_['replace'](_0x116da8,_0x2a241d,_[_0x38f7('0x46')](_0x1525c8,_0x34f6c4)[_0x38f7('0x47')]()));}exports[_0x38f7('0x48')]=getCallerIdRandom;function decrementOriginate(_0x5f2768){if(_0x5f2768[_0x38f7('0x29')]&&_0x5f2768[_0x38f7('0x29')]>0x0){_0x5f2768[_0x38f7('0x29')]-=0x1;}else{logger[_0x38f7('0x49')](_0x38f7('0x4a'));}}exports[_0x38f7('0x4b')]=decrementOriginate;function checkContactEmpty(_0x4fbc3d){return _0x4fbc3d&&_0x4fbc3d['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x4de22d,_0x56fda2){if(_0x56fda2===0x0){return 0x0;}var _0x1c2633=0x1;for(var _0x47faf0=0x1;_0x47faf0<=_0x56fda2;_0x47faf0+=0x1){_0x1c2633=0x1+_0x1c2633*_0x47faf0/_0x4de22d;}return 0x1/_0x1c2633;}exports[_0x38f7('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x17caa3,_0x4cdd66,_0x3d769f){if(_0x4cdd66>_0x3d769f){for(var _0x49cc15=0x0;_0x49cc15<_0x4cdd66-_0x3d769f;_0x49cc15+=0x1){decrementOriginate(_0x17caa3);}}}exports[_0x38f7('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x167e7b){var _0x412220={};var _0x2e45cb=['id',_0x38f7('0x4e'),'tags',_0x38f7('0x4f')];const _0x2738cb=0xfa;if(_0x167e7b){for(var _0x50f37d in _0x167e7b){if(typeof _0x167e7b[_0x50f37d]!==_0x38f7('0x50')){if(!_[_0x38f7('0x2d')](_0x167e7b[_0x50f37d])&&!_0x2e45cb['includes'](_0x50f37d)){if(_0x50f37d===_0x38f7('0x51')&&_0x167e7b[_0x50f37d]['length']>_0x2738cb){_0x412220[_0x38f7('0x52')+_0x50f37d['toUpperCase']()]=_0x167e7b[_0x50f37d][_0x38f7('0x47')]()[_0x38f7('0x53')](0x0,_0x2738cb);}else{_0x412220['XMD-'+_0x50f37d[_0x38f7('0x54')]()]=_0x167e7b[_0x50f37d];}}}}}return _0x412220;}exports[_0x38f7('0x55')]=setXMDContactVariables;
\ No newline at end of file