b571e25220dfb47bd6902cd126cefe1caa183dac
[motion2.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.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 _0x7f3b=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5774f4,_0x4a4240){var _0x19bd1a=function(_0x5ab942){while(--_0x5ab942){_0x5774f4['push'](_0x5774f4['shift']());}};_0x19bd1a(++_0x4a4240);}(_0x7f3b,0x6e));var _0xb7f3=function(_0x3073c3,_0x2ddf87){_0x3073c3=_0x3073c3-0x0;var _0x587c1c=_0x7f3b[_0x3073c3];return _0x587c1c;};'use strict';var _=require(_0xb7f3('0x0'));var util=require(_0xb7f3('0x1'));var moment=require(_0xb7f3('0x2'));var BPromise=require(_0xb7f3('0x3'));var rs=require(_0xb7f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7f3('0x5'))['db'];var utils=require(_0xb7f3('0x6'));var logger=require(_0xb7f3('0x7'))(_0xb7f3('0x8'));var config=require(_0xb7f3('0x9'));var jayson=require(_0xb7f3('0xa'));var client=jayson[_0xb7f3('0xb')][_0xb7f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50c32a,_0x17e5f3,_0x3d9b62){return new BPromise(function(_0x2ce934,_0x1014bd){return client[_0xb7f3('0xd')](_0x50c32a,_0x3d9b62)[_0xb7f3('0xe')](function(_0xb00d5b){logger[_0xb7f3('0xf')](_0xb7f3('0x10'),_0x17e5f3,_0xb7f3('0x11'));logger['debug'](_0xb7f3('0x12'),_0x17e5f3,_0xb7f3('0x11'),JSON[_0xb7f3('0x13')](_0xb00d5b));if(_0xb00d5b[_0xb7f3('0x14')]){if(_0xb00d5b[_0xb7f3('0x14')][_0xb7f3('0x15')]===0x1f4){logger[_0xb7f3('0x14')](_0xb7f3('0x10'),_0x17e5f3,_0xb00d5b['error'][_0xb7f3('0x16')]);return _0x1014bd(_0xb00d5b[_0xb7f3('0x14')][_0xb7f3('0x16')]);}logger['error'](_0xb7f3('0x10'),_0x17e5f3,_0xb00d5b[_0xb7f3('0x14')][_0xb7f3('0x16')]);return _0x2ce934(_0xb00d5b[_0xb7f3('0x14')][_0xb7f3('0x16')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x17e5f3,'request\x20sent');_0x2ce934(_0xb00d5b[_0xb7f3('0x17')][_0xb7f3('0x16')]);}})[_0xb7f3('0x18')](function(_0x2b4362){logger[_0xb7f3('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x17e5f3,_0x2b4362);_0x1014bd(_0x2b4362);});});}