Built motion from commit 19a84241.|2.5.34
[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 _0xaae6=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x10d230,_0x22da2d){var _0x26792c=function(_0x13313a){while(--_0x13313a){_0x10d230['push'](_0x10d230['shift']());}};_0x26792c(++_0x22da2d);}(_0xaae6,0x86));var _0x6aae=function(_0x1db449,_0x25cbfa){_0x1db449=_0x1db449-0x0;var _0x2c43f9=_0xaae6[_0x1db449];return _0x2c43f9;};'use strict';var _=require(_0x6aae('0x0'));var util=require(_0x6aae('0x1'));var moment=require(_0x6aae('0x2'));var BPromise=require(_0x6aae('0x3'));var rs=require(_0x6aae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aae('0x5'))['db'];var utils=require(_0x6aae('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6aae('0x7'));var jayson=require(_0x6aae('0x8'));var client=jayson[_0x6aae('0x9')][_0x6aae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ab85,_0x6ed1a9,_0x29cafa){return new BPromise(function(_0x904147,_0xc673c5){return client[_0x6aae('0xb')](_0x56ab85,_0x29cafa)[_0x6aae('0xc')](function(_0x4e5689){logger[_0x6aae('0xd')](_0x6aae('0xe'),_0x6ed1a9,_0x6aae('0xf'));logger[_0x6aae('0x10')](_0x6aae('0x11'),_0x6ed1a9,_0x6aae('0xf'),JSON['stringify'](_0x4e5689));if(_0x4e5689[_0x6aae('0x12')]){if(_0x4e5689['error'][_0x6aae('0x13')]===0x1f4){logger[_0x6aae('0x12')](_0x6aae('0xe'),_0x6ed1a9,_0x4e5689[_0x6aae('0x12')][_0x6aae('0x14')]);return _0xc673c5(_0x4e5689[_0x6aae('0x12')][_0x6aae('0x14')]);}logger[_0x6aae('0x12')](_0x6aae('0xe'),_0x6ed1a9,_0x4e5689['error'][_0x6aae('0x14')]);return _0x904147(_0x4e5689[_0x6aae('0x12')][_0x6aae('0x14')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x6ed1a9,_0x6aae('0xf'));_0x904147(_0x4e5689[_0x6aae('0x15')][_0x6aae('0x14')]);}})['catch'](function(_0xdea0a0){logger[_0x6aae('0x12')](_0x6aae('0xe'),_0x6ed1a9,_0xdea0a0);_0xc673c5(_0xdea0a0);});});}