32e0773d558b66c1fd9cdd086425cc3b12ecf0b5
[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 _0x110f=['client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x110f,0x69));var _0xf110=function(_0x54fd02,_0x2f5765){_0x54fd02=_0x54fd02-0x0;var _0x4c9530=_0x110f[_0x54fd02];return _0x4c9530;};'use strict';var _=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var moment=require(_0xf110('0x2'));var BPromise=require(_0xf110('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf110('0x4'))['db'];var utils=require(_0xf110('0x5'));var logger=require(_0xf110('0x6'))(_0xf110('0x7'));var config=require('../../config/environment');var jayson=require(_0xf110('0x8'));var client=jayson[_0xf110('0x9')][_0xf110('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e19,_0x56791b,_0x11798a){return new BPromise(function(_0x25f156,_0x459706){return client['request'](_0x3c5e19,_0x11798a)[_0xf110('0xb')](function(_0x5b331f){logger['info'](_0xf110('0xc'),_0x56791b,_0xf110('0xd'));logger['debug'](_0xf110('0xe'),_0x56791b,_0xf110('0xd'),JSON['stringify'](_0x5b331f));if(_0x5b331f['error']){if(_0x5b331f['error'][_0xf110('0xf')]===0x1f4){logger[_0xf110('0x10')](_0xf110('0xc'),_0x56791b,_0x5b331f[_0xf110('0x10')][_0xf110('0x11')]);return _0x459706(_0x5b331f[_0xf110('0x10')]['message']);}logger['error'](_0xf110('0xc'),_0x56791b,_0x5b331f[_0xf110('0x10')][_0xf110('0x11')]);return _0x25f156(_0x5b331f[_0xf110('0x10')][_0xf110('0x11')]);}else{logger['info'](_0xf110('0xc'),_0x56791b,_0xf110('0xd'));_0x25f156(_0x5b331f[_0xf110('0x12')]['message']);}})['catch'](function(_0x1540dd){logger[_0xf110('0x10')](_0xf110('0xc'),_0x56791b,_0x1540dd);_0x459706(_0x1540dd);});});}