c662f3b97672e45da068b2e61344eef3e248d14c
[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 _0xa093=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1cb115,_0x55cac1){var _0x27dd09=function(_0x46d60f){while(--_0x46d60f){_0x1cb115['push'](_0x1cb115['shift']());}};_0x27dd09(++_0x55cac1);}(_0xa093,0x18e));var _0x3a09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa093[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a09('0x0'));var util=require(_0x3a09('0x1'));var moment=require(_0x3a09('0x2'));var BPromise=require(_0x3a09('0x3'));var rs=require(_0x3a09('0x4'));var fs=require('fs');var Redis=require(_0x3a09('0x5'));var db=require(_0x3a09('0x6'))['db'];var utils=require(_0x3a09('0x7'));var logger=require(_0x3a09('0x8'))(_0x3a09('0x9'));var config=require(_0x3a09('0xa'));var jayson=require(_0x3a09('0xb'));var client=jayson[_0x3a09('0xc')][_0x3a09('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x21a1e2,_0x12f0ad,_0x146a17){return new BPromise(function(_0x5265fc,_0x2a0a8a){return client['request'](_0x21a1e2,_0x146a17)[_0x3a09('0xe')](function(_0xf39682){logger[_0x3a09('0xf')](_0x3a09('0x10'),_0x12f0ad,_0x3a09('0x11'));logger[_0x3a09('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x12f0ad,_0x3a09('0x11'),JSON[_0x3a09('0x13')](_0xf39682));if(_0xf39682[_0x3a09('0x14')]){if(_0xf39682[_0x3a09('0x14')][_0x3a09('0x15')]===0x1f4){logger[_0x3a09('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x12f0ad,_0xf39682[_0x3a09('0x14')][_0x3a09('0x16')]);return _0x2a0a8a(_0xf39682[_0x3a09('0x14')][_0x3a09('0x16')]);}logger[_0x3a09('0x14')](_0x3a09('0x10'),_0x12f0ad,_0xf39682[_0x3a09('0x14')][_0x3a09('0x16')]);return _0x5265fc(_0xf39682['error'][_0x3a09('0x16')]);}else{logger[_0x3a09('0xf')](_0x3a09('0x10'),_0x12f0ad,_0x3a09('0x11'));_0x5265fc(_0xf39682[_0x3a09('0x17')][_0x3a09('0x16')]);}})[_0x3a09('0x18')](function(_0x5e58c8){logger[_0x3a09('0x14')](_0x3a09('0x10'),_0x12f0ad,_0x5e58c8);_0x2a0a8a(_0x5e58c8);});});}