Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.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 _0x1bb4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x469ca5,_0x5f2127){var _0x589310=function(_0x49b2cc){while(--_0x49b2cc){_0x469ca5['push'](_0x469ca5['shift']());}};_0x589310(++_0x5f2127);}(_0x1bb4,0x131));var _0x41bb=function(_0x5a5ae6,_0x48b0ca){_0x5a5ae6=_0x5a5ae6-0x0;var _0x510357=_0x1bb4[_0x5a5ae6];return _0x510357;};'use strict';var _=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));var moment=require(_0x41bb('0x2'));var BPromise=require(_0x41bb('0x3'));var rs=require(_0x41bb('0x4'));var fs=require('fs');var Redis=require(_0x41bb('0x5'));var db=require(_0x41bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x41bb('0x7'))('rpc');var config=require(_0x41bb('0x8'));var jayson=require(_0x41bb('0x9'));var client=jayson[_0x41bb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11ce5b,_0x92b791,_0x53c19e){return new BPromise(function(_0x35ada5,_0x1da9a2){return client[_0x41bb('0xb')](_0x11ce5b,_0x53c19e)[_0x41bb('0xc')](function(_0xc51830){logger[_0x41bb('0xd')](_0x41bb('0xe'),_0x92b791,_0x41bb('0xf'));logger[_0x41bb('0x10')](_0x41bb('0x11'),_0x92b791,'request\x20sent',JSON[_0x41bb('0x12')](_0xc51830));if(_0xc51830[_0x41bb('0x13')]){if(_0xc51830[_0x41bb('0x13')]['code']===0x1f4){logger[_0x41bb('0x13')](_0x41bb('0xe'),_0x92b791,_0xc51830[_0x41bb('0x13')][_0x41bb('0x14')]);return _0x1da9a2(_0xc51830[_0x41bb('0x13')]['message']);}logger[_0x41bb('0x13')](_0x41bb('0xe'),_0x92b791,_0xc51830['error'][_0x41bb('0x14')]);return _0x35ada5(_0xc51830[_0x41bb('0x13')][_0x41bb('0x14')]);}else{logger[_0x41bb('0xd')](_0x41bb('0xe'),_0x92b791,'request\x20sent');_0x35ada5(_0xc51830[_0x41bb('0x15')][_0x41bb('0x14')]);}})['catch'](function(_0x14a7e3){logger[_0x41bb('0x13')](_0x41bb('0xe'),_0x92b791,_0x14a7e3);_0x1da9a2(_0x14a7e3);});});}