Built motion from commit 47436d59.|2.6.7
[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 _0xc558=['then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request'];(function(_0x252dad,_0x541d96){var _0xaa2322=function(_0x862325){while(--_0x862325){_0x252dad['push'](_0x252dad['shift']());}};_0xaa2322(++_0x541d96);}(_0xc558,0x79));var _0x8c55=function(_0x144095,_0x5ee9e9){_0x144095=_0x144095-0x0;var _0x4d9bb7=_0xc558[_0x144095];return _0x4d9bb7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8c55('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c55('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c55('0x2'));var logger=require(_0x8c55('0x3'))('rpc');var config=require(_0x8c55('0x4'));var jayson=require(_0x8c55('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32445a,_0x319aca,_0x3b7310){return new BPromise(function(_0x43ff48,_0x4a5cca){return client[_0x8c55('0x6')](_0x32445a,_0x3b7310)[_0x8c55('0x7')](function(_0x196c08){logger['info'](_0x8c55('0x8'),_0x319aca,_0x8c55('0x9'));logger['debug'](_0x8c55('0xa'),_0x319aca,_0x8c55('0x9'),JSON[_0x8c55('0xb')](_0x196c08));if(_0x196c08[_0x8c55('0xc')]){if(_0x196c08['error'][_0x8c55('0xd')]===0x1f4){logger[_0x8c55('0xc')](_0x8c55('0x8'),_0x319aca,_0x196c08[_0x8c55('0xc')]['message']);return _0x4a5cca(_0x196c08[_0x8c55('0xc')][_0x8c55('0xe')]);}logger[_0x8c55('0xc')](_0x8c55('0x8'),_0x319aca,_0x196c08[_0x8c55('0xc')][_0x8c55('0xe')]);return _0x43ff48(_0x196c08[_0x8c55('0xc')][_0x8c55('0xe')]);}else{logger['info'](_0x8c55('0x8'),_0x319aca,_0x8c55('0x9'));_0x43ff48(_0x196c08[_0x8c55('0xf')][_0x8c55('0xe')]);}})['catch'](function(_0x3f1947){logger[_0x8c55('0xc')](_0x8c55('0x8'),_0x319aca,_0x3f1947);_0x4a5cca(_0x3f1947);});});}