Built motion from commit (unavailable).|2.5.3
[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 _0x74fb=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3248c3,_0x355905){var _0x123814=function(_0x232e85){while(--_0x232e85){_0x3248c3['push'](_0x3248c3['shift']());}};_0x123814(++_0x355905);}(_0x74fb,0x6b));var _0xb74f=function(_0x2301a3,_0x2258e3){_0x2301a3=_0x2301a3-0x0;var _0x18816a=_0x74fb[_0x2301a3];return _0x18816a;};'use strict';var _=require(_0xb74f('0x0'));var util=require(_0xb74f('0x1'));var moment=require(_0xb74f('0x2'));var BPromise=require(_0xb74f('0x3'));var rs=require(_0xb74f('0x4'));var fs=require('fs');var Redis=require(_0xb74f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb74f('0x6'))('rpc');var config=require(_0xb74f('0x7'));var jayson=require(_0xb74f('0x8'));var client=jayson[_0xb74f('0x9')][_0xb74f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd14af0,_0x1c357c,_0x142cc0){return new BPromise(function(_0x2c3201,_0x46886e){return client[_0xb74f('0xb')](_0xd14af0,_0x142cc0)['then'](function(_0x22aa9a){logger[_0xb74f('0xc')](_0xb74f('0xd'),_0x1c357c,_0xb74f('0xe'));logger[_0xb74f('0xf')](_0xb74f('0x10'),_0x1c357c,_0xb74f('0xe'),JSON['stringify'](_0x22aa9a));if(_0x22aa9a[_0xb74f('0x11')]){if(_0x22aa9a[_0xb74f('0x11')][_0xb74f('0x12')]===0x1f4){logger[_0xb74f('0x11')](_0xb74f('0xd'),_0x1c357c,_0x22aa9a[_0xb74f('0x11')][_0xb74f('0x13')]);return _0x46886e(_0x22aa9a[_0xb74f('0x11')][_0xb74f('0x13')]);}logger[_0xb74f('0x11')](_0xb74f('0xd'),_0x1c357c,_0x22aa9a[_0xb74f('0x11')]['message']);return _0x2c3201(_0x22aa9a['error'][_0xb74f('0x13')]);}else{logger[_0xb74f('0xc')](_0xb74f('0xd'),_0x1c357c,_0xb74f('0xe'));_0x2c3201(_0x22aa9a[_0xb74f('0x14')][_0xb74f('0x13')]);}})['catch'](function(_0x27bfc0){logger[_0xb74f('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1c357c,_0x27bfc0);_0x46886e(_0x27bfc0);});});}