Built motion from commit (unavailable).|2.4.20
[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 _0xc50e=['JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc50e,0xab));var _0xec50=function(_0x1fc57d,_0x5419f6){_0x1fc57d=_0x1fc57d-0x0;var _0x33aebb=_0xc50e[_0x1fc57d];return _0x33aebb;};'use strict';var _=require('lodash');var util=require(_0xec50('0x0'));var moment=require(_0xec50('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec50('0x2'));var db=require(_0xec50('0x3'))['db'];var utils=require(_0xec50('0x4'));var logger=require(_0xec50('0x5'))(_0xec50('0x6'));var config=require('../../config/environment');var jayson=require(_0xec50('0x7'));var client=jayson[_0xec50('0x8')][_0xec50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x201de1,_0x2ea67a,_0x3f8082){return new BPromise(function(_0x5574fc,_0x71ea13){return client[_0xec50('0xa')](_0x201de1,_0x3f8082)[_0xec50('0xb')](function(_0x1211bf){logger[_0xec50('0xc')](_0xec50('0xd'),_0x2ea67a,'request\x20sent');logger[_0xec50('0xe')](_0xec50('0xf'),_0x2ea67a,_0xec50('0x10'),JSON[_0xec50('0x11')](_0x1211bf));if(_0x1211bf[_0xec50('0x12')]){if(_0x1211bf[_0xec50('0x12')][_0xec50('0x13')]===0x1f4){logger[_0xec50('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ea67a,_0x1211bf['error'][_0xec50('0x14')]);return _0x71ea13(_0x1211bf[_0xec50('0x12')][_0xec50('0x14')]);}logger[_0xec50('0x12')](_0xec50('0xd'),_0x2ea67a,_0x1211bf[_0xec50('0x12')][_0xec50('0x14')]);return _0x5574fc(_0x1211bf[_0xec50('0x12')][_0xec50('0x14')]);}else{logger[_0xec50('0xc')](_0xec50('0xd'),_0x2ea67a,_0xec50('0x10'));_0x5574fc(_0x1211bf[_0xec50('0x15')]['message']);}})[_0xec50('0x16')](function(_0x35286a){logger[_0xec50('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ea67a,_0x35286a);_0x71ea13(_0x35286a);});});}