40de96c374a10d3798187d5efa8e0cb5215fb9b1
[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 _0xb75a=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xfc970,_0x490f43){var _0x2d033a=function(_0x19c458){while(--_0x19c458){_0xfc970['push'](_0xfc970['shift']());}};_0x2d033a(++_0x490f43);}(_0xb75a,0x92));var _0xab75=function(_0x20fa63,_0x65c8d3){_0x20fa63=_0x20fa63-0x0;var _0x4c37ae=_0xb75a[_0x20fa63];return _0x4c37ae;};'use strict';var _=require(_0xab75('0x0'));var util=require(_0xab75('0x1'));var moment=require(_0xab75('0x2'));var BPromise=require(_0xab75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab75('0x4'));var db=require(_0xab75('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xab75('0x6'))(_0xab75('0x7'));var config=require(_0xab75('0x8'));var jayson=require(_0xab75('0x9'));var client=jayson[_0xab75('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526e89,_0x35bf7b,_0xc095cd){return new BPromise(function(_0x3801b2,_0xb7c0b5){return client[_0xab75('0xb')](_0x526e89,_0xc095cd)[_0xab75('0xc')](function(_0x10e861){logger[_0xab75('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x35bf7b,_0xab75('0xe'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x35bf7b,_0xab75('0xe'),JSON[_0xab75('0xf')](_0x10e861));if(_0x10e861[_0xab75('0x10')]){if(_0x10e861['error'][_0xab75('0x11')]===0x1f4){logger[_0xab75('0x10')](_0xab75('0x12'),_0x35bf7b,_0x10e861[_0xab75('0x10')][_0xab75('0x13')]);return _0xb7c0b5(_0x10e861[_0xab75('0x10')][_0xab75('0x13')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x35bf7b,_0x10e861[_0xab75('0x10')]['message']);return _0x3801b2(_0x10e861[_0xab75('0x10')][_0xab75('0x13')]);}else{logger[_0xab75('0xd')](_0xab75('0x12'),_0x35bf7b,'request\x20sent');_0x3801b2(_0x10e861[_0xab75('0x14')]['message']);}})[_0xab75('0x15')](function(_0x322239){logger[_0xab75('0x10')](_0xab75('0x12'),_0x35bf7b,_0x322239);_0xb7c0b5(_0x322239);});});}