Built motion from commit 9e1399f3.|2.5.37
[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 _0x1979=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x1979,0xd4));var _0x9197=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x1979[_0x3cf5a3];return _0x39ba2d;};'use strict';var _=require(_0x9197('0x0'));var util=require(_0x9197('0x1'));var moment=require(_0x9197('0x2'));var BPromise=require(_0x9197('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9197('0x4'));var db=require(_0x9197('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9197('0x6'))(_0x9197('0x7'));var config=require(_0x9197('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9197('0x9')][_0x9197('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8b97,_0x24ed58,_0x1d2a5a){return new BPromise(function(_0x537689,_0x373252){return client[_0x9197('0xb')](_0x2c8b97,_0x1d2a5a)['then'](function(_0x103f2a){logger[_0x9197('0xc')](_0x9197('0xd'),_0x24ed58,_0x9197('0xe'));logger['debug'](_0x9197('0xf'),_0x24ed58,_0x9197('0xe'),JSON['stringify'](_0x103f2a));if(_0x103f2a[_0x9197('0x10')]){if(_0x103f2a[_0x9197('0x10')][_0x9197('0x11')]===0x1f4){logger[_0x9197('0x10')](_0x9197('0xd'),_0x24ed58,_0x103f2a[_0x9197('0x10')][_0x9197('0x12')]);return _0x373252(_0x103f2a[_0x9197('0x10')]['message']);}logger[_0x9197('0x10')](_0x9197('0xd'),_0x24ed58,_0x103f2a[_0x9197('0x10')][_0x9197('0x12')]);return _0x537689(_0x103f2a[_0x9197('0x10')][_0x9197('0x12')]);}else{logger[_0x9197('0xc')](_0x9197('0xd'),_0x24ed58,'request\x20sent');_0x537689(_0x103f2a[_0x9197('0x13')]['message']);}})[_0x9197('0x14')](function(_0x5f709f){logger[_0x9197('0x10')](_0x9197('0xd'),_0x24ed58,_0x5f709f);_0x373252(_0x5f709f);});});}