Built motion from commit (unavailable).|2.5.14
[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 _0xd881=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','request\x20sent','debug','stringify','code','error','ChatProactiveAction,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x23bcd7,_0x293524){var _0x921192=function(_0x1d9baa){while(--_0x1d9baa){_0x23bcd7['push'](_0x23bcd7['shift']());}};_0x921192(++_0x293524);}(_0xd881,0x167));var _0x1d88=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd881[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x1d88('0x0'));var util=require(_0x1d88('0x1'));var moment=require(_0x1d88('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d88('0x3'));var fs=require('fs');var Redis=require(_0x1d88('0x4'));var db=require(_0x1d88('0x5'))['db'];var utils=require(_0x1d88('0x6'));var logger=require('../../config/logger')(_0x1d88('0x7'));var config=require(_0x1d88('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1d88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe573a6,_0x12b3ad,_0x3e90d2){return new BPromise(function(_0x600746,_0x53b081){return client[_0x1d88('0xa')](_0xe573a6,_0x3e90d2)['then'](function(_0x107339){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x12b3ad,_0x1d88('0xb'));logger[_0x1d88('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x12b3ad,_0x1d88('0xb'),JSON[_0x1d88('0xd')](_0x107339));if(_0x107339['error']){if(_0x107339['error'][_0x1d88('0xe')]===0x1f4){logger[_0x1d88('0xf')](_0x1d88('0x10'),_0x12b3ad,_0x107339[_0x1d88('0xf')][_0x1d88('0x11')]);return _0x53b081(_0x107339[_0x1d88('0xf')]['message']);}logger[_0x1d88('0xf')](_0x1d88('0x10'),_0x12b3ad,_0x107339[_0x1d88('0xf')][_0x1d88('0x11')]);return _0x600746(_0x107339[_0x1d88('0xf')][_0x1d88('0x11')]);}else{logger[_0x1d88('0x12')](_0x1d88('0x10'),_0x12b3ad,_0x1d88('0xb'));_0x600746(_0x107339[_0x1d88('0x13')]['message']);}})['catch'](function(_0x530184){logger[_0x1d88('0xf')](_0x1d88('0x10'),_0x12b3ad,_0x530184);_0x53b081(_0x530184);});});}