Built motion from commit (unavailable).|2.5.3
[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 _0x7455=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x7455,0xe6));var _0x5745=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7455[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5745('0x0'));var util=require(_0x5745('0x1'));var moment=require(_0x5745('0x2'));var BPromise=require('bluebird');var rs=require(_0x5745('0x3'));var fs=require('fs');var Redis=require(_0x5745('0x4'));var db=require(_0x5745('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5745('0x6'))(_0x5745('0x7'));var config=require(_0x5745('0x8'));var jayson=require(_0x5745('0x9'));var client=jayson[_0x5745('0xa')][_0x5745('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa5b44e,_0x2c0897,_0x1c3bd6){return new BPromise(function(_0x36bc63,_0xb7e0ba){return client[_0x5745('0xc')](_0xa5b44e,_0x1c3bd6)['then'](function(_0x37cf24){logger[_0x5745('0xd')](_0x5745('0xe'),_0x2c0897,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2c0897,_0x5745('0xf'),JSON[_0x5745('0x10')](_0x37cf24));if(_0x37cf24[_0x5745('0x11')]){if(_0x37cf24['error'][_0x5745('0x12')]===0x1f4){logger[_0x5745('0x11')](_0x5745('0xe'),_0x2c0897,_0x37cf24[_0x5745('0x11')][_0x5745('0x13')]);return _0xb7e0ba(_0x37cf24['error'][_0x5745('0x13')]);}logger[_0x5745('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x2c0897,_0x37cf24['error'][_0x5745('0x13')]);return _0x36bc63(_0x37cf24[_0x5745('0x11')][_0x5745('0x13')]);}else{logger[_0x5745('0xd')](_0x5745('0xe'),_0x2c0897,_0x5745('0xf'));_0x36bc63(_0x37cf24[_0x5745('0x14')][_0x5745('0x13')]);}})['catch'](function(_0x1dfa0e){logger[_0x5745('0x11')](_0x5745('0xe'),_0x2c0897,_0x1dfa0e);_0xb7e0ba(_0x1dfa0e);});});}