081d1108a1525a90c539c785e64f1e683b2ab0bf
[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 _0x9f63=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x9f63,0x148));var _0x39f6=function(_0xb2a00c,_0x28f109){_0xb2a00c=_0xb2a00c-0x0;var _0x4c9545=_0x9f63[_0xb2a00c];return _0x4c9545;};'use strict';var _=require(_0x39f6('0x0'));var util=require(_0x39f6('0x1'));var moment=require(_0x39f6('0x2'));var BPromise=require(_0x39f6('0x3'));var rs=require(_0x39f6('0x4'));var fs=require('fs');var Redis=require(_0x39f6('0x5'));var db=require(_0x39f6('0x6'))['db'];var utils=require(_0x39f6('0x7'));var logger=require(_0x39f6('0x8'))('rpc');var config=require(_0x39f6('0x9'));var jayson=require(_0x39f6('0xa'));var client=jayson[_0x39f6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bb7b1,_0x21f49e,_0x380f08){return new BPromise(function(_0x10778e,_0x47a603){return client[_0x39f6('0xc')](_0x3bb7b1,_0x380f08)[_0x39f6('0xd')](function(_0x4d8948){logger[_0x39f6('0xe')](_0x39f6('0xf'),_0x21f49e,_0x39f6('0x10'));logger[_0x39f6('0x11')](_0x39f6('0x12'),_0x21f49e,_0x39f6('0x10'),JSON['stringify'](_0x4d8948));if(_0x4d8948[_0x39f6('0x13')]){if(_0x4d8948[_0x39f6('0x13')][_0x39f6('0x14')]===0x1f4){logger['error'](_0x39f6('0xf'),_0x21f49e,_0x4d8948[_0x39f6('0x13')][_0x39f6('0x15')]);return _0x47a603(_0x4d8948[_0x39f6('0x13')]['message']);}logger[_0x39f6('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x21f49e,_0x4d8948[_0x39f6('0x13')][_0x39f6('0x15')]);return _0x10778e(_0x4d8948[_0x39f6('0x13')][_0x39f6('0x15')]);}else{logger[_0x39f6('0xe')](_0x39f6('0xf'),_0x21f49e,'request\x20sent');_0x10778e(_0x4d8948[_0x39f6('0x16')][_0x39f6('0x15')]);}})[_0x39f6('0x17')](function(_0x89df4e){logger[_0x39f6('0x13')](_0x39f6('0xf'),_0x21f49e,_0x89df4e);_0x47a603(_0x89df4e);});});}