Built motion from commit b5996064.|2.6.21
[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 _0x7c1b=['map','interval','concat','Request','IntervalIftime','intervalIftime','../../../config/logger','../client','stack','replace','trim','silly','isArray','length','resolve','every','number','string'];(function(_0x3cccea,_0x172a13){var _0x5170a0=function(_0x295898){while(--_0x295898){_0x3cccea['push'](_0x3cccea['shift']());}};_0x5170a0(++_0x172a13);}(_0x7c1b,0x1a4));var _0xb7c1=function(_0x4f9105,_0x587b0c){_0x4f9105=_0x4f9105-0x0;var _0x9f8a21=_0x7c1b[_0x4f9105];return _0x9f8a21;};var logger=require(_0xb7c1('0x0'))('dialer');var client=require(_0xb7c1('0x1'));function intervalIftime(_0x3dbfe3,_0x18a1d7){const _0x186c23=new Error()[_0xb7c1('0x2')][_0xb7c1('0x3')](/^Error/,'')[_0xb7c1('0x4')]();logger[_0xb7c1('0x5')]('intervalIftime\x20called\x20with',_0x3dbfe3,_0x18a1d7,_0x186c23);const _0x54eb9f=Array[_0xb7c1('0x6')](_0x3dbfe3);if(!_0x3dbfe3||_0x54eb9f&&_0x3dbfe3[_0xb7c1('0x7')]===0x0){return Promise[_0xb7c1('0x8')](![]);}else{var _0x19e398=[];var _0x40f8df=[];var _0x564429=_0x54eb9f?_0x3dbfe3:[_0x3dbfe3];var _0x1ba3f6=_0x564429[_0xb7c1('0x9')](function(_0x47d2cd){return typeof _0x47d2cd===_0xb7c1('0xa');});var _0x1422eb=_0x564429[_0xb7c1('0x9')](function(_0x415ba5){return typeof _0x415ba5===_0xb7c1('0xb');});if(!_0x1ba3f6&&!_0x1422eb){_0x19e398=_0x564429[_0xb7c1('0xc')](function(_0x3e250f){return _0x3e250f['id'];});if(_0x19e398[_0xb7c1('0x7')]===0x0){_0x40f8df=_0x564429[_0xb7c1('0xc')](function(_0xfab7e2){return _0xfab7e2[_0xb7c1('0xd')];});}}else{if(_0x1ba3f6){_0x19e398=_0x19e398[_0xb7c1('0xe')](_0x564429);}if(_0x1422eb){_0x40f8df=_0x40f8df['concat'](_0x564429);}}return client[_0xb7c1('0xf')](_0xb7c1('0x10'),{'intervalIds':_0x19e398,'intervals':_0x40f8df,'timezone':_0x18a1d7,'log':'IntervalIftime'});}}exports[_0xb7c1('0x11')]=intervalIftime;