Built motion from commit ddca4d0d.|2.5.47
[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 _0x1cc1=['error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbb2e42,_0xbc3ea7){var _0xf938b4=function(_0x4bc20a){while(--_0x4bc20a){_0xbb2e42['push'](_0xbb2e42['shift']());}};_0xf938b4(++_0xbc3ea7);}(_0x1cc1,0x17d));var _0x11cc=function(_0x113d3a,_0x136b76){_0x113d3a=_0x113d3a-0x0;var _0x2db9f5=_0x1cc1[_0x113d3a];return _0x2db9f5;};'use strict';var _=require('lodash');var util=require(_0x11cc('0x0'));var moment=require(_0x11cc('0x1'));var BPromise=require(_0x11cc('0x2'));var rs=require(_0x11cc('0x3'));var fs=require('fs');var Redis=require(_0x11cc('0x4'));var db=require(_0x11cc('0x5'))['db'];var utils=require(_0x11cc('0x6'));var logger=require(_0x11cc('0x7'))(_0x11cc('0x8'));var config=require('../../config/environment');var jayson=require(_0x11cc('0x9'));var client=jayson[_0x11cc('0xa')][_0x11cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x423936,_0x2e370f,_0x52528d){return new BPromise(function(_0x4d34ba,_0x5d0b8f){return client[_0x11cc('0xc')](_0x423936,_0x52528d)[_0x11cc('0xd')](function(_0x4d4995){logger[_0x11cc('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2e370f,_0x11cc('0xf'));logger[_0x11cc('0x10')](_0x11cc('0x11'),_0x2e370f,_0x11cc('0xf'),JSON[_0x11cc('0x12')](_0x4d4995));if(_0x4d4995['error']){if(_0x4d4995[_0x11cc('0x13')][_0x11cc('0x14')]===0x1f4){logger[_0x11cc('0x13')](_0x11cc('0x15'),_0x2e370f,_0x4d4995[_0x11cc('0x13')][_0x11cc('0x16')]);return _0x5d0b8f(_0x4d4995[_0x11cc('0x13')][_0x11cc('0x16')]);}logger['error'](_0x11cc('0x15'),_0x2e370f,_0x4d4995[_0x11cc('0x13')][_0x11cc('0x16')]);return _0x4d34ba(_0x4d4995['error']['message']);}else{logger['info'](_0x11cc('0x15'),_0x2e370f,_0x11cc('0xf'));_0x4d34ba(_0x4d4995[_0x11cc('0x17')][_0x11cc('0x16')]);}})[_0x11cc('0x18')](function(_0x4e7881){logger[_0x11cc('0x13')](_0x11cc('0x15'),_0x2e370f,_0x4e7881);_0x5d0b8f(_0x4e7881);});});}