5a675057be476ad03db871bffb03142e5ec0408d
[motion2.git] / server / api / chatProactiveAction / chatProactiveAction.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 _0x46ee=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0x46ee,0x6b));var _0xe46e=function(_0x3545aa,_0x59c5a6){_0x3545aa=_0x3545aa-0x0;var _0x513534=_0x46ee[_0x3545aa];return _0x513534;};'use strict';var _=require(_0xe46e('0x0'));var util=require(_0xe46e('0x1'));var moment=require(_0xe46e('0x2'));var BPromise=require(_0xe46e('0x3'));var rs=require(_0xe46e('0x4'));var fs=require('fs');var Redis=require(_0xe46e('0x5'));var db=require(_0xe46e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe46e('0x7'));var client=jayson[_0xe46e('0x8')][_0xe46e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cbf01,_0x2bd6db,_0x503d16){return new BPromise(function(_0x417fa7,_0x209d13){return client[_0xe46e('0xa')](_0x5cbf01,_0x503d16)['then'](function(_0x317a04){logger[_0xe46e('0xb')](_0xe46e('0xc'),_0x2bd6db,'request\x20sent');logger['debug'](_0xe46e('0xd'),_0x2bd6db,_0xe46e('0xe'),JSON['stringify'](_0x317a04));if(_0x317a04[_0xe46e('0xf')]){if(_0x317a04[_0xe46e('0xf')][_0xe46e('0x10')]===0x1f4){logger[_0xe46e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bd6db,_0x317a04[_0xe46e('0xf')][_0xe46e('0x11')]);return _0x209d13(_0x317a04[_0xe46e('0xf')][_0xe46e('0x11')]);}logger[_0xe46e('0xf')](_0xe46e('0xc'),_0x2bd6db,_0x317a04['error'][_0xe46e('0x11')]);return _0x417fa7(_0x317a04['error'][_0xe46e('0x11')]);}else{logger[_0xe46e('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bd6db,_0xe46e('0xe'));_0x417fa7(_0x317a04[_0xe46e('0x12')][_0xe46e('0x11')]);}})[_0xe46e('0x13')](function(_0x4d359a){logger[_0xe46e('0xf')](_0xe46e('0xc'),_0x2bd6db,_0x4d359a);_0x209d13(_0x4d359a);});});}