Built motion from commit (unavailable).|2.5.30
[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 _0x528b=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info'];(function(_0x49b0e5,_0x297603){var _0x83ad6a=function(_0x5273b9){while(--_0x5273b9){_0x49b0e5['push'](_0x49b0e5['shift']());}};_0x83ad6a(++_0x297603);}(_0x528b,0x126));var _0xb528=function(_0x2eb1d9,_0x421d73){_0x2eb1d9=_0x2eb1d9-0x0;var _0x559465=_0x528b[_0x2eb1d9];return _0x559465;};'use strict';var _=require(_0xb528('0x0'));var util=require(_0xb528('0x1'));var moment=require(_0xb528('0x2'));var BPromise=require(_0xb528('0x3'));var rs=require(_0xb528('0x4'));var fs=require('fs');var Redis=require(_0xb528('0x5'));var db=require(_0xb528('0x6'))['db'];var utils=require(_0xb528('0x7'));var logger=require('../../config/logger')(_0xb528('0x8'));var config=require('../../config/environment');var jayson=require(_0xb528('0x9'));var client=jayson[_0xb528('0xa')][_0xb528('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1981d6,_0x464bf3,_0x1caa4f){return new BPromise(function(_0x1d24f3,_0x2ba217){return client[_0xb528('0xc')](_0x1981d6,_0x1caa4f)['then'](function(_0x1a32a4){logger[_0xb528('0xd')](_0xb528('0xe'),_0x464bf3,_0xb528('0xf'));logger[_0xb528('0x10')](_0xb528('0x11'),_0x464bf3,_0xb528('0xf'),JSON[_0xb528('0x12')](_0x1a32a4));if(_0x1a32a4[_0xb528('0x13')]){if(_0x1a32a4[_0xb528('0x13')]['code']===0x1f4){logger[_0xb528('0x13')](_0xb528('0xe'),_0x464bf3,_0x1a32a4['error'][_0xb528('0x14')]);return _0x2ba217(_0x1a32a4[_0xb528('0x13')][_0xb528('0x14')]);}logger['error'](_0xb528('0xe'),_0x464bf3,_0x1a32a4['error'][_0xb528('0x14')]);return _0x1d24f3(_0x1a32a4['error'][_0xb528('0x14')]);}else{logger[_0xb528('0xd')](_0xb528('0xe'),_0x464bf3,_0xb528('0xf'));_0x1d24f3(_0x1a32a4['result'][_0xb528('0x14')]);}})[_0xb528('0x15')](function(_0x1d1bcd){logger[_0xb528('0x13')](_0xb528('0xe'),_0x464bf3,_0x1d1bcd);_0x2ba217(_0x1d1bcd);});});}