3128c7938b224c75b65bc0d67fd9459532d9e125
[motion2.git] / server / services / ami / rpc / interval.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 _0x2e87=['map','interval','concat','Request','IntervalIftime','intervalIftime','stack','replace','trim','silly','intervalIftime\x20called\x20with','isArray','length','every','string'];(function(_0x4689c6,_0x3ad9ee){var _0x1628ad=function(_0x74683f){while(--_0x74683f){_0x4689c6['push'](_0x4689c6['shift']());}};_0x1628ad(++_0x3ad9ee);}(_0x2e87,0x1b9));var _0x72e8=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x2e87[_0x448f8];return _0xa73126;};var logger=require('../../../config/logger')('dialer');var client=require('../client');function intervalIftime(_0x33ba3f,_0x3d4411){const _0x8781f9=new Error()[_0x72e8('0x0')][_0x72e8('0x1')](/^Error/,'')[_0x72e8('0x2')]();logger[_0x72e8('0x3')](_0x72e8('0x4'),_0x33ba3f,_0x3d4411,_0x8781f9);const _0x40eb35=Array[_0x72e8('0x5')](_0x33ba3f);if(!_0x33ba3f||_0x40eb35&&_0x33ba3f[_0x72e8('0x6')]===0x0){return Promise['resolve'](![]);}else{var _0x1dabc4=[];var _0x1490d7=[];var _0x11f806=_0x40eb35?_0x33ba3f:[_0x33ba3f];var _0x51521a=_0x11f806[_0x72e8('0x7')](function(_0x3ed441){return typeof _0x3ed441==='number';});var _0x406cc3=_0x11f806['every'](function(_0x404029){return typeof _0x404029===_0x72e8('0x8');});if(!_0x51521a&&!_0x406cc3){_0x1dabc4=_0x11f806[_0x72e8('0x9')](function(_0x310758){return _0x310758['id'];});if(_0x1dabc4[_0x72e8('0x6')]===0x0){_0x1490d7=_0x11f806[_0x72e8('0x9')](function(_0x3851e5){return _0x3851e5[_0x72e8('0xa')];});}}else{if(_0x51521a){_0x1dabc4=_0x1dabc4[_0x72e8('0xb')](_0x11f806);}if(_0x406cc3){_0x1490d7=_0x1490d7[_0x72e8('0xb')](_0x11f806);}}return client[_0x72e8('0xc')]('IntervalIftime',{'intervalIds':_0x1dabc4,'intervals':_0x1490d7,'timezone':_0x3d4411,'log':_0x72e8('0xd')});}}exports[_0x72e8('0xe')]=intervalIftime;