Built motion from commit (unavailable).|2.5.11
[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 _0x548a=['rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x548a,0x1dd));var _0xa548=function(_0x39bc56,_0x2979cd){_0x39bc56=_0x39bc56-0x0;var _0x2eb196=_0x548a[_0x39bc56];return _0x2eb196;};'use strict';var _=require('lodash');var util=require(_0xa548('0x0'));var moment=require('moment');var BPromise=require(_0xa548('0x1'));var rs=require(_0xa548('0x2'));var fs=require('fs');var Redis=require(_0xa548('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa548('0x4'));var logger=require(_0xa548('0x5'))(_0xa548('0x6'));var config=require(_0xa548('0x7'));var jayson=require(_0xa548('0x8'));var client=jayson[_0xa548('0x9')][_0xa548('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5783c0,_0x766b26,_0x259bd3){return new BPromise(function(_0x5a0799,_0x30546d){return client[_0xa548('0xb')](_0x5783c0,_0x259bd3)[_0xa548('0xc')](function(_0x25793f){logger['info'](_0xa548('0xd'),_0x766b26,'request\x20sent');logger[_0xa548('0xe')](_0xa548('0xf'),_0x766b26,_0xa548('0x10'),JSON[_0xa548('0x11')](_0x25793f));if(_0x25793f[_0xa548('0x12')]){if(_0x25793f[_0xa548('0x12')]['code']===0x1f4){logger[_0xa548('0x12')](_0xa548('0xd'),_0x766b26,_0x25793f[_0xa548('0x12')][_0xa548('0x13')]);return _0x30546d(_0x25793f[_0xa548('0x12')][_0xa548('0x13')]);}logger['error'](_0xa548('0xd'),_0x766b26,_0x25793f['error'][_0xa548('0x13')]);return _0x5a0799(_0x25793f[_0xa548('0x12')]['message']);}else{logger[_0xa548('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x766b26,_0xa548('0x10'));_0x5a0799(_0x25793f[_0xa548('0x15')][_0xa548('0x13')]);}})[_0xa548('0x16')](function(_0x57b14f){logger[_0xa548('0x12')](_0xa548('0xd'),_0x766b26,_0x57b14f);_0x30546d(_0x57b14f);});});}