Built motion from commit (unavailable).|2.5.28
[motion2.git] / server / api / condition / condition.rpc.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 _0xc43f=['code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xc43f,0xe1));var _0xfc43=function(_0x48b57d,_0x30a7eb){_0x48b57d=_0x48b57d-0x0;var _0x18763b=_0xc43f[_0x48b57d];return _0x18763b;};'use strict';var _=require(_0xfc43('0x0'));var util=require('util');var moment=require(_0xfc43('0x1'));var BPromise=require(_0xfc43('0x2'));var rs=require(_0xfc43('0x3'));var fs=require('fs');var Redis=require(_0xfc43('0x4'));var db=require(_0xfc43('0x5'))['db'];var utils=require(_0xfc43('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc43('0x7'));var jayson=require(_0xfc43('0x8'));var client=jayson[_0xfc43('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x199854,_0x22c625,_0x3cda26){return new BPromise(function(_0x199979,_0x34ebff){return client[_0xfc43('0xa')](_0x199854,_0x3cda26)[_0xfc43('0xb')](function(_0x49708f){logger['info'](_0xfc43('0xc'),_0x22c625,_0xfc43('0xd'));logger[_0xfc43('0xe')](_0xfc43('0xf'),_0x22c625,'request\x20sent',JSON['stringify'](_0x49708f));if(_0x49708f[_0xfc43('0x10')]){if(_0x49708f[_0xfc43('0x10')][_0xfc43('0x11')]===0x1f4){logger[_0xfc43('0x10')](_0xfc43('0xc'),_0x22c625,_0x49708f[_0xfc43('0x10')]['message']);return _0x34ebff(_0x49708f[_0xfc43('0x10')][_0xfc43('0x12')]);}logger[_0xfc43('0x10')]('Condition,\x20%s,\x20%s',_0x22c625,_0x49708f[_0xfc43('0x10')][_0xfc43('0x12')]);return _0x199979(_0x49708f[_0xfc43('0x10')][_0xfc43('0x12')]);}else{logger[_0xfc43('0x13')]('Condition,\x20%s,\x20%s',_0x22c625,'request\x20sent');_0x199979(_0x49708f[_0xfc43('0x14')]['message']);}})[_0xfc43('0x15')](function(_0x889a09){logger['error']('Condition,\x20%s,\x20%s',_0x22c625,_0x889a09);_0x34ebff(_0x889a09);});});}