Built motion from commit (unavailable).|2.5.26
[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 _0x956a=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11fb85,_0x90cf41){var _0x14038f=function(_0x418783){while(--_0x418783){_0x11fb85['push'](_0x11fb85['shift']());}};_0x14038f(++_0x90cf41);}(_0x956a,0x1cc));var _0xa956=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x956a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa956('0x0'));var util=require('util');var moment=require(_0xa956('0x1'));var BPromise=require(_0xa956('0x2'));var rs=require(_0xa956('0x3'));var fs=require('fs');var Redis=require(_0xa956('0x4'));var db=require(_0xa956('0x5'))['db'];var utils=require(_0xa956('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa956('0x7'));var jayson=require(_0xa956('0x8'));var client=jayson[_0xa956('0x9')][_0xa956('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ae68f,_0x261d32,_0x186b69){return new BPromise(function(_0x5b68ab,_0x25bd4d){return client[_0xa956('0xb')](_0x2ae68f,_0x186b69)[_0xa956('0xc')](function(_0x5346af){logger[_0xa956('0xd')](_0xa956('0xe'),_0x261d32,_0xa956('0xf'));logger[_0xa956('0x10')](_0xa956('0x11'),_0x261d32,_0xa956('0xf'),JSON[_0xa956('0x12')](_0x5346af));if(_0x5346af[_0xa956('0x13')]){if(_0x5346af['error'][_0xa956('0x14')]===0x1f4){logger['error'](_0xa956('0xe'),_0x261d32,_0x5346af['error'][_0xa956('0x15')]);return _0x25bd4d(_0x5346af['error'][_0xa956('0x15')]);}logger[_0xa956('0x13')](_0xa956('0xe'),_0x261d32,_0x5346af['error'][_0xa956('0x15')]);return _0x5b68ab(_0x5346af[_0xa956('0x13')]['message']);}else{logger[_0xa956('0xd')](_0xa956('0xe'),_0x261d32,_0xa956('0xf'));_0x5b68ab(_0x5346af[_0xa956('0x16')][_0xa956('0x15')]);}})[_0xa956('0x17')](function(_0x247a43){logger['error'](_0xa956('0xe'),_0x261d32,_0x247a43);_0x25bd4d(_0x247a43);});});}