9388ba31b579d2544ee5e2c517c4e9b001af6b0c
[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 _0x799c=['http','request','info','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x799c,0x6a));var _0xc799=function(_0x2e8bc5,_0x489875){_0x2e8bc5=_0x2e8bc5-0x0;var _0x249e65=_0x799c[_0x2e8bc5];return _0x249e65;};'use strict';var _=require(_0xc799('0x0'));var util=require('util');var moment=require(_0xc799('0x1'));var BPromise=require('bluebird');var rs=require(_0xc799('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc799('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc799('0x4'))(_0xc799('0x5'));var config=require(_0xc799('0x6'));var jayson=require(_0xc799('0x7'));var client=jayson['client'][_0xc799('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19056f,_0x15dd85,_0x3c48a1){return new BPromise(function(_0x1565af,_0x39e39c){return client[_0xc799('0x9')](_0x19056f,_0x3c48a1)['then'](function(_0x137895){logger[_0xc799('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x15dd85,'request\x20sent');logger[_0xc799('0xb')](_0xc799('0xc'),_0x15dd85,'request\x20sent',JSON['stringify'](_0x137895));if(_0x137895[_0xc799('0xd')]){if(_0x137895['error'][_0xc799('0xe')]===0x1f4){logger[_0xc799('0xd')](_0xc799('0xf'),_0x15dd85,_0x137895[_0xc799('0xd')]['message']);return _0x39e39c(_0x137895['error'][_0xc799('0x10')]);}logger['error'](_0xc799('0xf'),_0x15dd85,_0x137895[_0xc799('0xd')][_0xc799('0x10')]);return _0x1565af(_0x137895[_0xc799('0xd')][_0xc799('0x10')]);}else{logger[_0xc799('0xa')](_0xc799('0xf'),_0x15dd85,'request\x20sent');_0x1565af(_0x137895[_0xc799('0x11')][_0xc799('0x10')]);}})[_0xc799('0x12')](function(_0x2276dd){logger[_0xc799('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x15dd85,_0x2276dd);_0x39e39c(_0x2276dd);});});}