Built motion from commit 351e7f9c.|2.6.31
[motion2.git] / server / api / openchannelTransferReport / openchannelTransferReport.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 _0x5785=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x374f60,_0x551010){var _0x454eda=function(_0x5c096e){while(--_0x5c096e){_0x374f60['push'](_0x374f60['shift']());}};_0x454eda(++_0x551010);}(_0x5785,0x119));var _0x5578=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x5785[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var moment=require(_0x5578('0x2'));var BPromise=require(_0x5578('0x3'));var rs=require(_0x5578('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5578('0x5'))['db'];var utils=require(_0x5578('0x6'));var logger=require(_0x5578('0x7'))(_0x5578('0x8'));var config=require(_0x5578('0x9'));var jayson=require(_0x5578('0xa'));var client=jayson[_0x5578('0xb')][_0x5578('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x464ab2,_0x287860,_0x545581){return new BPromise(function(_0x520bbf,_0x3d37dc){return client[_0x5578('0xd')](_0x464ab2,_0x545581)['then'](function(_0x433ed0){logger['info'](_0x5578('0xe'),_0x287860,'request\x20sent');logger[_0x5578('0xf')](_0x5578('0x10'),_0x287860,_0x5578('0x11'),JSON['stringify'](_0x433ed0));if(_0x433ed0['error']){if(_0x433ed0[_0x5578('0x12')][_0x5578('0x13')]===0x1f4){logger[_0x5578('0x12')](_0x5578('0xe'),_0x287860,_0x433ed0[_0x5578('0x12')][_0x5578('0x14')]);return _0x3d37dc(_0x433ed0[_0x5578('0x12')][_0x5578('0x14')]);}logger[_0x5578('0x12')](_0x5578('0xe'),_0x287860,_0x433ed0['error'][_0x5578('0x14')]);return _0x520bbf(_0x433ed0[_0x5578('0x12')][_0x5578('0x14')]);}else{logger[_0x5578('0x15')](_0x5578('0xe'),_0x287860,_0x5578('0x11'));_0x520bbf(_0x433ed0[_0x5578('0x16')][_0x5578('0x14')]);}})[_0x5578('0x17')](function(_0xc9c5a4){logger['error'](_0x5578('0xe'),_0x287860,_0xc9c5a4);_0x3d37dc(_0xc9c5a4);});});}