Built motion from commit a61a4a20.|2.5.46
[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 _0xe1b2=['lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x23986d,_0x1836aa){var _0x266c39=function(_0x5438c5){while(--_0x5438c5){_0x23986d['push'](_0x23986d['shift']());}};_0x266c39(++_0x1836aa);}(_0xe1b2,0x126));var _0x2e1b=function(_0x2ef25d,_0xf2d3b5){_0x2ef25d=_0x2ef25d-0x0;var _0x1974da=_0xe1b2[_0x2ef25d];return _0x1974da;};'use strict';var _=require(_0x2e1b('0x0'));var util=require(_0x2e1b('0x1'));var moment=require(_0x2e1b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e1b('0x3'));var db=require(_0x2e1b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e1b('0x5'))(_0x2e1b('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e1b('0x7'));var client=jayson['client'][_0x2e1b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cfc86,_0x5079d7,_0x2077a0){return new BPromise(function(_0x4981d6,_0x2d7d87){return client[_0x2e1b('0x9')](_0x4cfc86,_0x2077a0)[_0x2e1b('0xa')](function(_0x5561f6){logger[_0x2e1b('0xb')](_0x2e1b('0xc'),_0x5079d7,_0x2e1b('0xd'));logger[_0x2e1b('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5079d7,_0x2e1b('0xd'),JSON[_0x2e1b('0xf')](_0x5561f6));if(_0x5561f6['error']){if(_0x5561f6[_0x2e1b('0x10')][_0x2e1b('0x11')]===0x1f4){logger['error'](_0x2e1b('0xc'),_0x5079d7,_0x5561f6['error'][_0x2e1b('0x12')]);return _0x2d7d87(_0x5561f6[_0x2e1b('0x10')][_0x2e1b('0x12')]);}logger[_0x2e1b('0x10')](_0x2e1b('0xc'),_0x5079d7,_0x5561f6[_0x2e1b('0x10')][_0x2e1b('0x12')]);return _0x4981d6(_0x5561f6[_0x2e1b('0x10')][_0x2e1b('0x12')]);}else{logger[_0x2e1b('0xb')](_0x2e1b('0xc'),_0x5079d7,_0x2e1b('0xd'));_0x4981d6(_0x5561f6[_0x2e1b('0x13')][_0x2e1b('0x12')]);}})[_0x2e1b('0x14')](function(_0x30f7ff){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5079d7,_0x30f7ff);_0x2d7d87(_0x30f7ff);});});}