Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / services / routing / server / 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 _0x441a=['join','\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','iftime','routing','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','info','[%s][INTERVAL\x20VALID]\x20%s\x20%s'];(function(_0x15c04b,_0x154d0a){var _0x2f094d=function(_0x3877e9){while(--_0x3877e9){_0x15c04b['push'](_0x15c04b['shift']());}};_0x2f094d(++_0x154d0a);}(_0x441a,0x7c));var _0xa441=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x441a[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0xa441('0x0'));var iftime=require('../../../utils/iftime')[_0xa441('0x1')];var logger=require('../../../config/logger')(_0xa441('0x2'));exports[_0xa441('0x3')]=function(_0x2bb211,_0xc8e953,_0x4fad7d){return function(_0x573d87){if(_0x4fad7d[_0xa441('0x4')]&&!_0x4fad7d['rules'][_0x2bb211]){logger['info'](_0xa441('0x5'),_0x2bb211);return _0x573d87['stop']();}var _0x55e976=_0xc8e953['map'](function(_0x24a571){return iftime(_0x24a571);});var _0x778f5=_['some'](_0x55e976);if(_0x778f5){logger[_0xa441('0x6')](_0xa441('0x7'),_0x2bb211,_0xc8e953[_0xa441('0x8')](_0xa441('0x9')),_0x778f5);_0x573d87['when'](_0x778f5);}else{logger['info'](_0xa441('0xa'),_0x2bb211,_0xc8e953['join'](_0xa441('0x9')));_0x573d87['stop']();}};};