7912a758d899826067a1febb1becd8b4979f2668
[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 _0x93aa=['error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1be178,_0x3bf9ab){var _0x37e2d0=function(_0x545e92){while(--_0x545e92){_0x1be178['push'](_0x1be178['shift']());}};_0x37e2d0(++_0x3bf9ab);}(_0x93aa,0x1b7));var _0xa93a=function(_0x1be714,_0x38f376){_0x1be714=_0x1be714-0x0;var _0x3f2739=_0x93aa[_0x1be714];return _0x3f2739;};'use strict';var _=require(_0xa93a('0x0'));var util=require(_0xa93a('0x1'));var moment=require(_0xa93a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa93a('0x3'));var fs=require('fs');var Redis=require(_0xa93a('0x4'));var db=require(_0xa93a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa93a('0x6'));var config=require(_0xa93a('0x7'));var jayson=require(_0xa93a('0x8'));var client=jayson[_0xa93a('0x9')][_0xa93a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bee0d,_0x2ba7e2,_0xa5e468){return new BPromise(function(_0x4eda60,_0x554e24){return client[_0xa93a('0xb')](_0x5bee0d,_0xa5e468)[_0xa93a('0xc')](function(_0x4fe1c3){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0xa93a('0xd'));logger[_0xa93a('0xe')](_0xa93a('0xf'),_0x2ba7e2,_0xa93a('0xd'),JSON[_0xa93a('0x10')](_0x4fe1c3));if(_0x4fe1c3[_0xa93a('0x11')]){if(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x12')]===0x1f4){logger[_0xa93a('0x11')](_0xa93a('0x13'),_0x2ba7e2,_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);return _0x554e24(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);}logger[_0xa93a('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0x4fe1c3['error'][_0xa93a('0x14')]);return _0x4eda60(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);}else{logger[_0xa93a('0x15')](_0xa93a('0x13'),_0x2ba7e2,_0xa93a('0xd'));_0x4eda60(_0x4fe1c3[_0xa93a('0x16')]['message']);}})[_0xa93a('0x17')](function(_0x44fa67){logger[_0xa93a('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0x44fa67);_0x554e24(_0x44fa67);});});}