Built motion from commit 14588770.|2.5.38
[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 _0x714f=['rpc','../../config/environment','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9c68c4,_0x57ac51){var _0x44c3bb=function(_0x41f933){while(--_0x41f933){_0x9c68c4['push'](_0x9c68c4['shift']());}};_0x44c3bb(++_0x57ac51);}(_0x714f,0x149));var _0xf714=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x714f[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0xf714('0x0'));var util=require('util');var moment=require(_0xf714('0x1'));var BPromise=require(_0xf714('0x2'));var rs=require(_0xf714('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf714('0x4'))['db'];var utils=require(_0xf714('0x5'));var logger=require(_0xf714('0x6'))(_0xf714('0x7'));var config=require(_0xf714('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf714('0x9')][_0xf714('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46a4e1,_0x31b6e4,_0x2c7a38){return new BPromise(function(_0xb16bf1,_0x4ca1b6){return client[_0xf714('0xb')](_0x46a4e1,_0x2c7a38)[_0xf714('0xc')](function(_0x3e909b){logger['info'](_0xf714('0xd'),_0x31b6e4,_0xf714('0xe'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x31b6e4,'request\x20sent',JSON['stringify'](_0x3e909b));if(_0x3e909b['error']){if(_0x3e909b[_0xf714('0xf')][_0xf714('0x10')]===0x1f4){logger[_0xf714('0xf')](_0xf714('0xd'),_0x31b6e4,_0x3e909b['error']['message']);return _0x4ca1b6(_0x3e909b[_0xf714('0xf')]['message']);}logger[_0xf714('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x31b6e4,_0x3e909b[_0xf714('0xf')]['message']);return _0xb16bf1(_0x3e909b[_0xf714('0xf')][_0xf714('0x11')]);}else{logger[_0xf714('0x12')](_0xf714('0xd'),_0x31b6e4,_0xf714('0xe'));_0xb16bf1(_0x3e909b[_0xf714('0x13')][_0xf714('0x11')]);}})[_0xf714('0x14')](function(_0x2eaa14){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x31b6e4,_0x2eaa14);_0x4ca1b6(_0x2eaa14);});});}