2e580db0f49214a4d6e3ae8dc2976878219d20ce
[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 _0x5cbb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2df48f,_0x4129c1){var _0x1b7ad9=function(_0x413b41){while(--_0x413b41){_0x2df48f['push'](_0x2df48f['shift']());}};_0x1b7ad9(++_0x4129c1);}(_0x5cbb,0xe3));var _0xb5cb=function(_0x5f0ace,_0x2d10ce){_0x5f0ace=_0x5f0ace-0x0;var _0x42c54e=_0x5cbb[_0x5f0ace];return _0x42c54e;};'use strict';var _=require(_0xb5cb('0x0'));var util=require(_0xb5cb('0x1'));var moment=require(_0xb5cb('0x2'));var BPromise=require(_0xb5cb('0x3'));var rs=require(_0xb5cb('0x4'));var fs=require('fs');var Redis=require(_0xb5cb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb5cb('0x6'));var logger=require(_0xb5cb('0x7'))(_0xb5cb('0x8'));var config=require(_0xb5cb('0x9'));var jayson=require(_0xb5cb('0xa'));var client=jayson['client'][_0xb5cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11dc00,_0x10db58,_0x4a5768){return new BPromise(function(_0x3abfb9,_0x305946){return client[_0xb5cb('0xc')](_0x11dc00,_0x4a5768)[_0xb5cb('0xd')](function(_0x41877f){logger[_0xb5cb('0xe')](_0xb5cb('0xf'),_0x10db58,_0xb5cb('0x10'));logger[_0xb5cb('0x11')](_0xb5cb('0x12'),_0x10db58,_0xb5cb('0x10'),JSON[_0xb5cb('0x13')](_0x41877f));if(_0x41877f[_0xb5cb('0x14')]){if(_0x41877f[_0xb5cb('0x14')][_0xb5cb('0x15')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x10db58,_0x41877f[_0xb5cb('0x14')][_0xb5cb('0x16')]);return _0x305946(_0x41877f[_0xb5cb('0x14')]['message']);}logger[_0xb5cb('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x10db58,_0x41877f['error'][_0xb5cb('0x16')]);return _0x3abfb9(_0x41877f[_0xb5cb('0x14')]['message']);}else{logger[_0xb5cb('0xe')](_0xb5cb('0xf'),_0x10db58,'request\x20sent');_0x3abfb9(_0x41877f[_0xb5cb('0x17')]['message']);}})[_0xb5cb('0x18')](function(_0x2bfee6){logger[_0xb5cb('0x14')](_0xb5cb('0xf'),_0x10db58,_0x2bfee6);_0x305946(_0x2bfee6);});});}