Built motion from commit 7158bc59.|2.5.42
[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 _0x721b=['stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x721b,0x18d));var _0xb721=function(_0x4a070c,_0x55d6d5){_0x4a070c=_0x4a070c-0x0;var _0x169426=_0x721b[_0x4a070c];return _0x169426;};'use strict';var _=require(_0xb721('0x0'));var util=require('util');var moment=require(_0xb721('0x1'));var BPromise=require(_0xb721('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb721('0x3'));var db=require(_0xb721('0x4'))['db'];var utils=require(_0xb721('0x5'));var logger=require(_0xb721('0x6'))(_0xb721('0x7'));var config=require(_0xb721('0x8'));var jayson=require(_0xb721('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d064c,_0x2e8463,_0x31134d){return new BPromise(function(_0x5ee34a,_0x215a9d){return client[_0xb721('0xa')](_0x1d064c,_0x31134d)[_0xb721('0xb')](function(_0x4f468b){logger[_0xb721('0xc')](_0xb721('0xd'),_0x2e8463,_0xb721('0xe'));logger[_0xb721('0xf')](_0xb721('0x10'),_0x2e8463,_0xb721('0xe'),JSON[_0xb721('0x11')](_0x4f468b));if(_0x4f468b[_0xb721('0x12')]){if(_0x4f468b[_0xb721('0x12')][_0xb721('0x13')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2e8463,_0x4f468b[_0xb721('0x12')][_0xb721('0x14')]);return _0x215a9d(_0x4f468b['error'][_0xb721('0x14')]);}logger['error'](_0xb721('0xd'),_0x2e8463,_0x4f468b[_0xb721('0x12')][_0xb721('0x14')]);return _0x5ee34a(_0x4f468b[_0xb721('0x12')][_0xb721('0x14')]);}else{logger['info'](_0xb721('0xd'),_0x2e8463,_0xb721('0xe'));_0x5ee34a(_0x4f468b[_0xb721('0x15')][_0xb721('0x14')]);}})[_0xb721('0x16')](function(_0xdb60f3){logger[_0xb721('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2e8463,_0xdb60f3);_0x215a9d(_0xdb60f3);});});}