8a009c8aa9a0971d36568a29d60d3c222e916fba
[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 _0xe48c=['rpc','../../config/environment','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5c4a29,_0x3230cf){var _0x30db8a=function(_0x3c0e5a){while(--_0x3c0e5a){_0x5c4a29['push'](_0x5c4a29['shift']());}};_0x30db8a(++_0x3230cf);}(_0xe48c,0x19b));var _0xce48=function(_0x3def60,_0x461f37){_0x3def60=_0x3def60-0x0;var _0x35d629=_0xe48c[_0x3def60];return _0x35d629;};'use strict';var _=require(_0xce48('0x0'));var util=require(_0xce48('0x1'));var moment=require(_0xce48('0x2'));var BPromise=require(_0xce48('0x3'));var rs=require(_0xce48('0x4'));var fs=require('fs');var Redis=require(_0xce48('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce48('0x6'));var logger=require('../../config/logger')(_0xce48('0x7'));var config=require(_0xce48('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xce48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fe1fd,_0x317ae4,_0x5daa4e){return new BPromise(function(_0x3d9e98,_0x1064c9){return client[_0xce48('0xa')](_0x2fe1fd,_0x5daa4e)[_0xce48('0xb')](function(_0x5c80fa){logger[_0xce48('0xc')](_0xce48('0xd'),_0x317ae4,'request\x20sent');logger[_0xce48('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x317ae4,'request\x20sent',JSON[_0xce48('0xf')](_0x5c80fa));if(_0x5c80fa[_0xce48('0x10')]){if(_0x5c80fa['error'][_0xce48('0x11')]===0x1f4){logger[_0xce48('0x10')](_0xce48('0xd'),_0x317ae4,_0x5c80fa[_0xce48('0x10')]['message']);return _0x1064c9(_0x5c80fa[_0xce48('0x10')][_0xce48('0x12')]);}logger[_0xce48('0x10')](_0xce48('0xd'),_0x317ae4,_0x5c80fa[_0xce48('0x10')][_0xce48('0x12')]);return _0x3d9e98(_0x5c80fa[_0xce48('0x10')][_0xce48('0x12')]);}else{logger[_0xce48('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x317ae4,_0xce48('0x13'));_0x3d9e98(_0x5c80fa[_0xce48('0x14')][_0xce48('0x12')]);}})[_0xce48('0x15')](function(_0x45dd18){logger[_0xce48('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x317ae4,_0x45dd18);_0x1064c9(_0x45dd18);});});}