Built motion from commit (unavailable).|2.5.26
[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 _0x4e85=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','client'];(function(_0x1a6830,_0x57ab21){var _0x478659=function(_0x15c406){while(--_0x15c406){_0x1a6830['push'](_0x1a6830['shift']());}};_0x478659(++_0x57ab21);}(_0x4e85,0x119));var _0x54e8=function(_0x461492,_0x37456f){_0x461492=_0x461492-0x0;var _0x4d4e3d=_0x4e85[_0x461492];return _0x4d4e3d;};'use strict';var _=require(_0x54e8('0x0'));var util=require(_0x54e8('0x1'));var moment=require('moment');var BPromise=require(_0x54e8('0x2'));var rs=require(_0x54e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x54e8('0x4'));var logger=require(_0x54e8('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x54e8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ea47e,_0x2b9c36,_0x4ff8a6){return new BPromise(function(_0x9239d4,_0x41d0b5){return client[_0x54e8('0x7')](_0x5ea47e,_0x4ff8a6)[_0x54e8('0x8')](function(_0x21b00f){logger[_0x54e8('0x9')](_0x54e8('0xa'),_0x2b9c36,'request\x20sent');logger[_0x54e8('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2b9c36,_0x54e8('0xc'),JSON[_0x54e8('0xd')](_0x21b00f));if(_0x21b00f[_0x54e8('0xe')]){if(_0x21b00f[_0x54e8('0xe')][_0x54e8('0xf')]===0x1f4){logger[_0x54e8('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2b9c36,_0x21b00f[_0x54e8('0xe')]['message']);return _0x41d0b5(_0x21b00f[_0x54e8('0xe')][_0x54e8('0x10')]);}logger[_0x54e8('0xe')](_0x54e8('0xa'),_0x2b9c36,_0x21b00f['error'][_0x54e8('0x10')]);return _0x9239d4(_0x21b00f[_0x54e8('0xe')][_0x54e8('0x10')]);}else{logger[_0x54e8('0x9')](_0x54e8('0xa'),_0x2b9c36,'request\x20sent');_0x9239d4(_0x21b00f[_0x54e8('0x11')]['message']);}})['catch'](function(_0x3d9d0e){logger[_0x54e8('0xe')](_0x54e8('0xa'),_0x2b9c36,_0x3d9d0e);_0x41d0b5(_0x3d9d0e);});});}