Built motion from commit 753c950e.|2.5.42
[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 _0x74c1=['http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x5c5c49,_0x4b502e){var _0x4b6e49=function(_0x3d9475){while(--_0x3d9475){_0x5c5c49['push'](_0x5c5c49['shift']());}};_0x4b6e49(++_0x4b502e);}(_0x74c1,0xbc));var _0x174c=function(_0x563ccc,_0x3f10a9){_0x563ccc=_0x563ccc-0x0;var _0x174990=_0x74c1[_0x563ccc];return _0x174990;};'use strict';var _=require(_0x174c('0x0'));var util=require(_0x174c('0x1'));var moment=require(_0x174c('0x2'));var BPromise=require(_0x174c('0x3'));var rs=require(_0x174c('0x4'));var fs=require('fs');var Redis=require(_0x174c('0x5'));var db=require(_0x174c('0x6'))['db'];var utils=require(_0x174c('0x7'));var logger=require('../../config/logger')(_0x174c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x174c('0x9')][_0x174c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe82211,_0x1a9893,_0x3177da){return new BPromise(function(_0x3904d3,_0x499639){return client[_0x174c('0xb')](_0xe82211,_0x3177da)['then'](function(_0x16d0e7){logger[_0x174c('0xc')](_0x174c('0xd'),_0x1a9893,_0x174c('0xe'));logger['debug'](_0x174c('0xf'),_0x1a9893,_0x174c('0xe'),JSON[_0x174c('0x10')](_0x16d0e7));if(_0x16d0e7[_0x174c('0x11')]){if(_0x16d0e7[_0x174c('0x11')][_0x174c('0x12')]===0x1f4){logger[_0x174c('0x11')](_0x174c('0xd'),_0x1a9893,_0x16d0e7[_0x174c('0x11')][_0x174c('0x13')]);return _0x499639(_0x16d0e7['error']['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1a9893,_0x16d0e7[_0x174c('0x11')][_0x174c('0x13')]);return _0x3904d3(_0x16d0e7['error'][_0x174c('0x13')]);}else{logger['info'](_0x174c('0xd'),_0x1a9893,_0x174c('0xe'));_0x3904d3(_0x16d0e7[_0x174c('0x14')]['message']);}})[_0x174c('0x15')](function(_0x1e7f07){logger[_0x174c('0x11')](_0x174c('0xd'),_0x1a9893,_0x1e7f07);_0x499639(_0x1e7f07);});});}