Built motion from commit f94df7f0.|2.5.48
[motion2.git] / server / api / cmHopper / cmHopper.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xf998=['send','index','map','CmHopper','fieldName','type','key','model','keys','query','filters','intersection','$or','$gt','$lt','$lte','$ne','$eq','$not','$in','$notIn','$like','$notLike','$notILike','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','VoiceQueueId','VoiceQueue','Campaign','createdAt','updatedAt','state','statedesc','membername','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Company','List','Queue','getPreviewRecall','UPDATE','CmList','dialActive','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','error','stack','name'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0xf998,0x6c));var _0x8f99=function(_0x44e843,_0x18e958){_0x44e843=_0x44e843-0x0;var _0x4f0a2d=_0xf998[_0x44e843];return _0x4f0a2d;};'use strict';var emlformat=require(_0x8f99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f99('0x1'));var jsonpatch=require(_0x8f99('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f99('0x3'));var Mustache=require(_0x8f99('0x4'));var util=require(_0x8f99('0x5'));var path=require('path');var sox=require(_0x8f99('0x6'));var csv=require(_0x8f99('0x7'));var ejs=require(_0x8f99('0x8'));var fs=require('fs');var fs_extra=require(_0x8f99('0x9'));var _=require(_0x8f99('0xa'));var squel=require('squel');var crypto=require(_0x8f99('0xb'));var jsforce=require(_0x8f99('0xc'));var deskjs=require(_0x8f99('0xd'));var toCsv=require(_0x8f99('0x7'));var querystring=require(_0x8f99('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f99('0xf'));var hardwareService=require(_0x8f99('0x10'));var logger=require(_0x8f99('0x11'))(_0x8f99('0x12'));var utils=require('../../config/utils');var config=require(_0x8f99('0x13'));var shared=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8f99('0x14'))['db'];function respondWithStatusCode(_0xdd8f0c,_0x309b18){_0x309b18=_0x309b18||0xcc;return function(_0x49e591){if(_0x49e591){return _0xdd8f0c[_0x8f99('0x15')](_0x309b18);}return _0xdd8f0c[_0x8f99('0x16')](_0x309b18)['end']();};}function respondWithResult(_0x37a348,_0x1889b7){_0x1889b7=_0x1889b7||0xc8;return function(_0x124c78){if(_0x124c78){return _0x37a348[_0x8f99('0x16')](_0x1889b7)[_0x8f99('0x17')](_0x124c78);}};}function respondWithFilteredResult(_0x4508c2,_0x456b6f){return function(_0xcebbda){if(_0xcebbda){var _0x2a3465=typeof _0x456b6f[_0x8f99('0x18')]===_0x8f99('0x19')&&typeof _0x456b6f[_0x8f99('0x1a')]==='undefined';var _0x10d3e6=_0xcebbda['count'];var _0xff8cd0=_0x2a3465?0x0:_0x456b6f[_0x8f99('0x18')];var _0x36c9d8=_0x2a3465?_0xcebbda[_0x8f99('0x1b')]:_0x456b6f[_0x8f99('0x18')]+_0x456b6f[_0x8f99('0x1a')];var _0x549e6f;if(_0x36c9d8>=_0x10d3e6){_0x36c9d8=_0x10d3e6;_0x549e6f=0xc8;}else{_0x549e6f=0xce;}_0x4508c2[_0x8f99('0x16')](_0x549e6f);return _0x4508c2['set'](_0x8f99('0x1c'),_0xff8cd0+'-'+_0x36c9d8+'/'+_0x10d3e6)[_0x8f99('0x17')](_0xcebbda);}return null;};}function patchUpdates(_0x4f450e){return function(_0x51cef9){try{jsonpatch[_0x8f99('0x1d')](_0x51cef9,_0x4f450e,!![]);}catch(_0x20ab21){return BPromise[_0x8f99('0x1e')](_0x20ab21);}return _0x51cef9['save']();};}function saveUpdates(_0x272840,_0x1fafcf){return function(_0x3c5e4b){if(_0x3c5e4b){return _0x3c5e4b[_0x8f99('0x1f')](_0x272840)['then'](function(_0x41a70b){return _0x41a70b;});}return null;};}function removeEntity(_0x2e3e60,_0xd516eb){return function(_0x4e7c3e){if(_0x4e7c3e){return _0x4e7c3e[_0x8f99('0x20')]()[_0x8f99('0x21')](function(){_0x2e3e60[_0x8f99('0x16')](0xcc)[_0x8f99('0x22')]();});}};}function handleEntityNotFound(_0xdbb289,_0x38629a){return function(_0x5a6725){if(!_0x5a6725){_0xdbb289[_0x8f99('0x15')](0x194);}return _0x5a6725;};}function handleError(_0x515308,_0x4122fe){_0x4122fe=_0x4122fe||0x1f4;return function(_0x2b7c79){logger[_0x8f99('0x23')](_0x2b7c79[_0x8f99('0x24')]);if(_0x2b7c79[_0x8f99('0x25')]){delete _0x2b7c79[_0x8f99('0x25')];}_0x515308['status'](_0x4122fe)[_0x8f99('0x26')](_0x2b7c79);};}exports[_0x8f99('0x27')]=function(_0x2634ab,_0x27e1f4){var _0x512ad9={},_0x3c168f={},_0x510e34={'count':0x0,'rows':[]};var _0x101983=_[_0x8f99('0x28')](db[_0x8f99('0x29')]['rawAttributes'],function(_0x177214){return{'name':_0x177214[_0x8f99('0x2a')],'type':_0x177214[_0x8f99('0x2b')][_0x8f99('0x2c')]};});_0x3c168f[_0x8f99('0x2d')]=_['map'](_0x101983,_0x8f99('0x25'));_0x3c168f['query']=_[_0x8f99('0x2e')](_0x2634ab[_0x8f99('0x2f')]);_0x3c168f[_0x8f99('0x30')]=_[_0x8f99('0x31')](_0x3c168f['model'],_0x3c168f[_0x8f99('0x2f')]);_0x3c168f[_0x8f99('0x30')]=_['concat'](_0x3c168f[_0x8f99('0x30')],['$and',_0x8f99('0x32'),_0x8f99('0x33'),'$gte',_0x8f99('0x34'),_0x8f99('0x35'),_0x8f99('0x36'),_0x8f99('0x37'),_0x8f99('0x38'),'$between','$notBetween',_0x8f99('0x39'),_0x8f99('0x3a'),_0x8f99('0x3b'),_0x8f99('0x3c'),'$iLike',_0x8f99('0x3d'),_0x8f99('0x3b'),'$overlap',_0x8f99('0x3e'),_0x8f99('0x3f'),_0x8f99('0x40')]);_0x512ad9[_0x8f99('0x41')]=_[_0x8f99('0x31')](_0x3c168f[_0x8f99('0x2d')],qs[_0x8f99('0x42')](_0x2634ab[_0x8f99('0x2f')][_0x8f99('0x42')]));_0x512ad9[_0x8f99('0x41')]=_0x512ad9[_0x8f99('0x41')][_0x8f99('0x43')]?_0x512ad9[_0x8f99('0x41')]:_0x3c168f[_0x8f99('0x2d')];if(!_0x2634ab[_0x8f99('0x2f')][_0x8f99('0x44')](_0x8f99('0x45'))){_0x512ad9['limit']=qs[_0x8f99('0x1a')](_0x2634ab[_0x8f99('0x2f')]['limit']);_0x512ad9[_0x8f99('0x18')]=qs[_0x8f99('0x18')](_0x2634ab[_0x8f99('0x2f')][_0x8f99('0x18')]);}_0x512ad9[_0x8f99('0x46')]=qs[_0x8f99('0x47')](_0x2634ab[_0x8f99('0x2f')][_0x8f99('0x47')]);_0x512ad9['where']=qs[_0x8f99('0x30')](_['pick'](_0x2634ab[_0x8f99('0x2f')],_0x3c168f['filters']),_0x101983);if(_0x2634ab[_0x8f99('0x2f')][_0x8f99('0x48')]){_0x512ad9[_0x8f99('0x49')]=_[_0x8f99('0x4a')](_0x512ad9[_0x8f99('0x49')],{'$or':_[_0x8f99('0x28')](_0x101983,function(_0x3650ab){if(_0x3650ab[_0x8f99('0x2b')]!=='VIRTUAL'){var _0x165582={};_0x165582[_0x3650ab[_0x8f99('0x25')]]={'$like':'%'+_0x2634ab[_0x8f99('0x2f')][_0x8f99('0x48')]+'%'};return _0x165582;}})});}_0x512ad9=_[_0x8f99('0x4a')]({},_0x512ad9,_0x2634ab[_0x8f99('0x4b')]);var _0x30f78d={'where':_0x512ad9['where']};return db[_0x8f99('0x29')][_0x8f99('0x1b')](_0x30f78d)['then'](function(_0x126f34){_0x510e34[_0x8f99('0x1b')]=_0x126f34;if(_0x2634ab['query'][_0x8f99('0x4c')]){_0x512ad9['include']=[{'all':!![]}];}return db[_0x8f99('0x29')][_0x8f99('0x4d')](_0x512ad9);})['then'](function(_0x4ba30d){_0x510e34[_0x8f99('0x4e')]=_0x4ba30d;return _0x510e34;})['then'](respondWithFilteredResult(_0x27e1f4,_0x512ad9))[_0x8f99('0x4f')](handleError(_0x27e1f4,null));};exports[_0x8f99('0x50')]=function(_0x507f51,_0xf48676){var _0x47bef1={'raw':!![],'where':{'id':_0x507f51['params']['id']}},_0x2193f4={};_0x2193f4[_0x8f99('0x2d')]=_[_0x8f99('0x2e')](db[_0x8f99('0x29')]['rawAttributes']);_0x2193f4[_0x8f99('0x2f')]=_[_0x8f99('0x2e')](_0x507f51[_0x8f99('0x2f')]);_0x2193f4[_0x8f99('0x30')]=_[_0x8f99('0x31')](_0x2193f4[_0x8f99('0x2d')],_0x2193f4['query']);_0x47bef1[_0x8f99('0x41')]=_['intersection'](_0x2193f4['model'],qs[_0x8f99('0x42')](_0x507f51[_0x8f99('0x2f')]['fields']));_0x47bef1['attributes']=_0x47bef1['attributes'][_0x8f99('0x43')]?_0x47bef1['attributes']:_0x2193f4['model'];if(_0x507f51[_0x8f99('0x2f')][_0x8f99('0x4c')]){_0x47bef1[_0x8f99('0x51')]=[{'all':!![]}];}_0x47bef1=_[_0x8f99('0x4a')]({},_0x47bef1,_0x507f51[_0x8f99('0x4b')]);return db[_0x8f99('0x29')][_0x8f99('0x52')](_0x47bef1)[_0x8f99('0x21')](handleEntityNotFound(_0xf48676,null))['then'](respondWithResult(_0xf48676,null))['catch'](handleError(_0xf48676,null));};exports[_0x8f99('0x53')]=function(_0x5176a0,_0x534696){return db[_0x8f99('0x29')][_0x8f99('0x53')](_0x5176a0[_0x8f99('0x54')],{})['then'](respondWithResult(_0x534696,0xc9))['catch'](handleError(_0x534696,null));};exports[_0x8f99('0x1f')]=function(_0xd15783,_0x247bfe){if(_0xd15783['body']['id']){delete _0xd15783[_0x8f99('0x54')]['id'];}return db[_0x8f99('0x29')]['find']({'where':{'id':_0xd15783[_0x8f99('0x55')]['id']}})[_0x8f99('0x21')](handleEntityNotFound(_0x247bfe,null))[_0x8f99('0x21')](saveUpdates(_0xd15783[_0x8f99('0x54')],null))[_0x8f99('0x21')](respondWithResult(_0x247bfe,null))[_0x8f99('0x4f')](handleError(_0x247bfe,null));};exports[_0x8f99('0x56')]=function(_0x234591,_0x176ba0){return db[_0x8f99('0x29')][_0x8f99('0x56')]()[_0x8f99('0x21')](respondWithResult(_0x176ba0,null))[_0x8f99('0x4f')](handleError(_0x176ba0,null));};exports[_0x8f99('0x20')]=function(_0x19bf30,_0x332480){var _0x3ba011;return db[_0x8f99('0x29')]['find']({'where':{'id':_0x19bf30[_0x8f99('0x55')]['id']}})[_0x8f99('0x21')](handleEntityNotFound(_0x332480,null))[_0x8f99('0x21')](function(_0x40617f){if(_0x40617f){return _0x40617f[_0x8f99('0x20')]()[_0x8f99('0x21')](function(_0x58ea5f){return _0x58ea5f;});}})[_0x8f99('0x21')](function(_0x4f8a6d){_0x3ba011=_0x4f8a6d;if(_0x4f8a6d){if(_0x4f8a6d[_0x8f99('0x57')]||_0x4f8a6d['CampaignId']){return db[_0x4f8a6d[_0x8f99('0x57')]?_0x8f99('0x58'):_0x8f99('0x59')][_0x8f99('0x52')]({'where':{'id':_0x4f8a6d['VoiceQueueId']?_0x4f8a6d['VoiceQueueId']:_0x4f8a6d['CampaignId']},'attributes':['id',_0x8f99('0x25')],'raw':!![]});}}})['then'](function(_0x45c2b1){var _0x4a93cb={};if(_0x45c2b1){_[_0x8f99('0x4a')](_0x4a93cb,_['omit'](_0x3ba011['dataValues'],[_0x8f99('0x5a'),_0x8f99('0x5b'),'id']));_0x4a93cb[_0x8f99('0x5c')]=0x15;_0x4a93cb[_0x8f99('0x5d')]='deleted';_0x4a93cb['campaign']=_0x45c2b1[_0x8f99('0x25')];_0x4a93cb[_0x8f99('0x5e')]=_0x19bf30['user'][_0x8f99('0x25')];_0x4a93cb['UserId']=_0x19bf30[_0x8f99('0x5f')]['id'];_0x4a93cb[_0x8f99('0x60')]=!![];_0x4a93cb[_0x8f99('0x61')]=moment()[_0x8f99('0x62')](_0x8f99('0x63'));_0x4a93cb[_0x8f99('0x64')]=_0x3ba011['phone'];_0x4a93cb[_0x8f99('0x65')]=_0x3ba011['VoiceQueueId']?_0x8f99('0x66'):_0x8f99('0x67');return db[_0x8f99('0x68')][_0x8f99('0x52')]({'where':{'id':_0x4a93cb[_0x8f99('0x69')]},'attributes':[_0x8f99('0x6a'),_0x8f99('0x6b')]})['then'](function(_0x32c130){if(!_[_0x8f99('0x6c')](_0x332480)&&!_['isNil'](_0x32c130[_0x8f99('0x6a')])){_0x4a93cb[_0x8f99('0x6d')]=_0x32c130[_0x8f99('0x6a')];if(!_[_0x8f99('0x6c')](_0x32c130['lastName'])){_0x4a93cb[_0x8f99('0x6d')]+='\x20'+_0x32c130['lastName'];}}})['finally'](function(){return db[_0x8f99('0x6e')]['create'](_0x4a93cb);});}})[_0x8f99('0x21')](function(){return _0x332480['status'](0xcc)[_0x8f99('0x22')]();})['catch'](handleError(_0x332480,null));};exports[_0x8f99('0x6f')]=function(_0x2346d5,_0x1acfca,_0x288cc1){var _0x5b58ac=[];return db['CmContact'][_0x8f99('0x56')]()[_0x8f99('0x21')](function(_0x5dac3c){_0x5b58ac=_['keys'](_0x5dac3c);return _0x2346d5[_0x8f99('0x5f')][_0x8f99('0x70')]({'where':{'type':_0x8f99('0x71'),'dialActive':!![],'dialMethod':_0x8f99('0x72')},'attributes':['id',_0x8f99('0x73'),_0x8f99('0x74')],'raw':!![]});})[_0x8f99('0x21')](function(_0x309bfd){if(_0x309bfd&&_0x309bfd[_0x8f99('0x43')]){return db[_0x8f99('0x75')][_0x8f99('0x76')](function(_0x344b86){var _0x1bba0d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8f99('0x62')](_0x8f99('0x63'))},'VoiceQueueId':{'$in':_['map'](_0x309bfd,'id')},'$or':[{'UserId':null},{'UserId':_0x2346d5[_0x8f99('0x5f')]['id']}]};var _0x7c6190={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x309bfd)['filter']([_0x8f99('0x74'),0x0])[_0x8f99('0x28')]('id')[_0x8f99('0x77')]()},'$or':[{'UserId':null},{'UserId':_0x2346d5[_0x8f99('0x5f')]['id']}]};var _0x8b0f53={'$or':[_0x1bba0d,_0x7c6190]};var _0x5a9f8e=[];if(_0x2346d5['body']['direction']&&_0x2346d5[_0x8f99('0x54')]['direction']==='prev'){if(!_['isEmpty'](_0x2346d5['body']['hopperIds'])){_0x8b0f53['id']={'$in':_0x2346d5[_0x8f99('0x54')][_0x8f99('0x78')]};}_0x5a9f8e=[[_0x8f99('0x79'),_0x8f99('0x7a')],[_0x8f99('0x7b'),_0x309bfd[0x0]['dialOrderByScheduledAt']===_0x8f99('0x7a')?_0x8f99('0x7c'):_0x8f99('0x7a')],db[_0x8f99('0x75')][_0x8f99('0x7d')](_0x8f99('0x7e')),['id',_0x8f99('0x7c')]];}else{if(!_[_0x8f99('0x7f')](_0x2346d5[_0x8f99('0x54')][_0x8f99('0x78')])){_0x8b0f53['id']={'$notIn':_0x2346d5['body'][_0x8f99('0x78')]};}_0x5a9f8e=[[_0x8f99('0x79'),_0x8f99('0x7c')],[_0x8f99('0x7b'),_0x309bfd[0x0]['dialOrderByScheduledAt']],db[_0x8f99('0x75')][_0x8f99('0x7d')](_0x8f99('0x80')),['id',_0x8f99('0x7a')]];}return db['CmHopper'][_0x8f99('0x81')]({'attributes':['id',_0x8f99('0x82'),_0x8f99('0x83')],'where':_0x8b0f53,'order':_0x5a9f8e,'transaction':_0x344b86,'lock':_0x344b86[_0x8f99('0x84')]['UPDATE'],'include':[{'model':db[_0x8f99('0x68')],'as':'Contact','attributes':_0x5b58ac,'include':[{'model':db['CmCompany'],'as':_0x8f99('0x85'),'attributes':['id',_0x8f99('0x25')]}]},{'model':db['CmList'],'as':_0x8f99('0x86'),'attributes':['id',_0x8f99('0x25')]},{'model':db['VoiceQueue'],'as':_0x8f99('0x87'),'attributes':['id',_0x8f99('0x25'),'dialActive']}]})[_0x8f99('0x21')](function(_0x5c6c85){if(_0x5c6c85){return _0x5c6c85[_0x8f99('0x1f')]({'UserId':_0x2346d5['user']['id']},{'transaction':_0x344b86});}});});}})[_0x8f99('0x21')](handleEntityNotFound(_0x1acfca,null))[_0x8f99('0x21')](respondWithResult(_0x1acfca,null))['catch'](handleError(_0x1acfca,null));};exports[_0x8f99('0x88')]=function(_0x338b45,_0x8b0b8d,_0x3fc2cb){var _0x518805=[];return db[_0x8f99('0x68')][_0x8f99('0x56')]()[_0x8f99('0x21')](function(_0x2c9367){_0x518805=_['keys'](_0x2c9367);return _0x338b45[_0x8f99('0x5f')][_0x8f99('0x70')]({'where':{'type':_0x8f99('0x71'),'dialActive':!![],'dialMethod':_0x8f99('0x72')},'attributes':['id',_0x8f99('0x73'),_0x8f99('0x74')],'raw':!![]});})[_0x8f99('0x21')](function(_0x27eac7){if(_0x27eac7&&_0x27eac7['length']){return db['sequelize'][_0x8f99('0x76')](function(_0x1e894e){var _0x1fd0e9={'active':![],'recallme':!![],'id':_0x338b45[_0x8f99('0x54')]['hopperId']};return db[_0x8f99('0x29')][_0x8f99('0x81')]({'attributes':['id',_0x8f99('0x82'),_0x8f99('0x83')],'where':_0x1fd0e9,'transaction':_0x1e894e,'lock':_0x1e894e[_0x8f99('0x84')][_0x8f99('0x89')],'include':[{'model':db[_0x8f99('0x68')],'as':'Contact','attributes':_0x518805,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x8f99('0x25')]}]},{'model':db[_0x8f99('0x8a')],'as':_0x8f99('0x86'),'attributes':['id',_0x8f99('0x25')]},{'model':db[_0x8f99('0x58')],'as':_0x8f99('0x87'),'attributes':['id','name',_0x8f99('0x8b')]}]})[_0x8f99('0x21')](function(_0x43c094){if(_0x43c094){return _0x43c094[_0x8f99('0x1f')]({'UserId':_0x338b45[_0x8f99('0x5f')]['id']},{'transaction':_0x1e894e});}});});}})['then'](handleEntityNotFound(_0x8b0b8d,null))[_0x8f99('0x21')](respondWithResult(_0x8b0b8d,null))[_0x8f99('0x4f')](handleError(_0x8b0b8d,null));};exports[_0x8f99('0x8c')]=function(_0x1a8b68,_0xf7e959,_0x16a52d){return _0x1a8b68[_0x8f99('0x5f')][_0x8f99('0x70')]({'where':{'type':_0x8f99('0x71'),'dialActive':!![],'dialMethod':_0x8f99('0x72')},'attributes':['id'],'raw':!![]})[_0x8f99('0x21')](function(_0x314fcf){if(_0x314fcf&&_0x314fcf[_0x8f99('0x43')]){return db[_0x8f99('0x29')][_0x8f99('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8f99('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8f99('0x28')](_0x314fcf,'id')},'$or':[{'UserId':null},{'UserId':_0x1a8b68[_0x8f99('0x5f')]['id']}]}});}return 0x0;})[_0x8f99('0x21')](function(_0x23fbd7){if(!_[_0x8f99('0x6c')](_0x23fbd7)&&_['isNumber'](_0x23fbd7)){return _0xf7e959[_0x8f99('0x16')](0xc8)[_0x8f99('0x17')]({'contacts':_0x23fbd7});}else{logger[_0x8f99('0x23')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x8f99('0x8c'),0x194,_0x8f99('0x8d'));_0xf7e959[_0x8f99('0x15')](0x194);}})[_0x8f99('0x4f')](handleError(_0xf7e959,null));};exports[_0x8f99('0x8e')]=function(_0x541d42,_0x3ec812,_0x49bce7){var _0x1e3fa1=shared[_0x8f99('0x8f')];var _0x1a6161=[];_[_0x8f99('0x28')](_0x1e3fa1,function(_0x235c8c){_0x1a6161['push']({'id':_0x235c8c['name'],'name':_0x235c8c['name'],'utcOffset':_0x235c8c[_0x8f99('0x90')]});});return _0x3ec812['status'](0xc8)[_0x8f99('0x17')]({'tz':_0x1a6161});};exports[_0x8f99('0x91')]=function(_0x17a098,_0x443578,_0x4fcf57){var _0x34487b=shared[_0x8f99('0x8f')];var _0x2e553e={};if(!_[_0x8f99('0x6c')](_0x34487b[_0x17a098[_0x8f99('0x54')]['id']]))_0x2e553e=_0x34487b[_0x17a098['body']['id']];return _0x443578[_0x8f99('0x16')](0xc8)[_0x8f99('0x17')](_0x2e553e);};