7271c7e9cb45cfc66f6b62e7ab142b60a49a2e4e
[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 _0x244f=['request','then','info','request\x20sent','debug','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','client','http'];(function(_0x185f9a,_0x29740c){var _0x329cd0=function(_0x349cfd){while(--_0x349cfd){_0x185f9a['push'](_0x185f9a['shift']());}};_0x329cd0(++_0x29740c);}(_0x244f,0xb5));var _0xf244=function(_0x40fa24,_0x541c09){_0x40fa24=_0x40fa24-0x0;var _0x13452a=_0x244f[_0x40fa24];return _0x13452a;};'use strict';var _=require(_0xf244('0x0'));var util=require(_0xf244('0x1'));var moment=require(_0xf244('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf244('0x3'));var db=require(_0xf244('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf244('0x5'));var config=require('../../config/environment');var jayson=require(_0xf244('0x6'));var client=jayson[_0xf244('0x7')][_0xf244('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ac0dd,_0x45a230,_0x2a1af3){return new BPromise(function(_0x3bfb60,_0x52279d){return client[_0xf244('0x9')](_0x1ac0dd,_0x2a1af3)[_0xf244('0xa')](function(_0xeee21c){logger[_0xf244('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x45a230,_0xf244('0xc'));logger[_0xf244('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x45a230,'request\x20sent',JSON['stringify'](_0xeee21c));if(_0xeee21c[_0xf244('0xe')]){if(_0xeee21c[_0xf244('0xe')][_0xf244('0xf')]===0x1f4){logger[_0xf244('0xe')](_0xf244('0x10'),_0x45a230,_0xeee21c[_0xf244('0xe')][_0xf244('0x11')]);return _0x52279d(_0xeee21c['error']['message']);}logger[_0xf244('0xe')](_0xf244('0x10'),_0x45a230,_0xeee21c[_0xf244('0xe')][_0xf244('0x11')]);return _0x3bfb60(_0xeee21c[_0xf244('0xe')][_0xf244('0x11')]);}else{logger[_0xf244('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x45a230,_0xf244('0xc'));_0x3bfb60(_0xeee21c['result']['message']);}})[_0xf244('0x12')](function(_0xd91273){logger[_0xf244('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x45a230,_0xd91273);_0x52279d(_0xd91273);});});}