Built motion from commit (unavailable).|2.5.14
[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 _0xc26b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc26b,0x160));var _0xbc26=function(_0x393793,_0x17fd09){_0x393793=_0x393793-0x0;var _0xadbb72=_0xc26b[_0x393793];return _0xadbb72;};'use strict';var _=require(_0xbc26('0x0'));var util=require(_0xbc26('0x1'));var moment=require(_0xbc26('0x2'));var BPromise=require(_0xbc26('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc26('0x4'));var db=require(_0xbc26('0x5'))['db'];var utils=require(_0xbc26('0x6'));var logger=require(_0xbc26('0x7'))(_0xbc26('0x8'));var config=require(_0xbc26('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3610a0,_0x23e930,_0x1c4c33){return new BPromise(function(_0x4731a4,_0x122254){return client['request'](_0x3610a0,_0x1c4c33)[_0xbc26('0xa')](function(_0x2c01a2){logger['info'](_0xbc26('0xb'),_0x23e930,_0xbc26('0xc'));logger['debug'](_0xbc26('0xd'),_0x23e930,_0xbc26('0xc'),JSON['stringify'](_0x2c01a2));if(_0x2c01a2['error']){if(_0x2c01a2[_0xbc26('0xe')]['code']===0x1f4){logger[_0xbc26('0xe')](_0xbc26('0xb'),_0x23e930,_0x2c01a2[_0xbc26('0xe')][_0xbc26('0xf')]);return _0x122254(_0x2c01a2[_0xbc26('0xe')][_0xbc26('0xf')]);}logger['error'](_0xbc26('0xb'),_0x23e930,_0x2c01a2[_0xbc26('0xe')][_0xbc26('0xf')]);return _0x4731a4(_0x2c01a2['error'][_0xbc26('0xf')]);}else{logger['info'](_0xbc26('0xb'),_0x23e930,_0xbc26('0xc'));_0x4731a4(_0x2c01a2['result'][_0xbc26('0xf')]);}})[_0xbc26('0x10')](function(_0x515137){logger[_0xbc26('0xe')](_0xbc26('0xb'),_0x23e930,_0x515137);_0x122254(_0x515137);});});}