e3483ec3e3c8cd503fd7b1326860234513363493
[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 _0x746f=['client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x746f,0x9c));var _0xf746=function(_0x25bb35,_0x2f0637){_0x25bb35=_0x25bb35-0x0;var _0x1d3d46=_0x746f[_0x25bb35];return _0x1d3d46;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var moment=require(_0xf746('0x2'));var BPromise=require(_0xf746('0x3'));var rs=require(_0xf746('0x4'));var fs=require('fs');var Redis=require(_0xf746('0x5'));var db=require(_0xf746('0x6'))['db'];var utils=require(_0xf746('0x7'));var logger=require(_0xf746('0x8'))(_0xf746('0x9'));var config=require(_0xf746('0xa'));var jayson=require(_0xf746('0xb'));var client=jayson[_0xf746('0xc')][_0xf746('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2edb61,_0x3fc620,_0x301d4d){return new BPromise(function(_0x11cbaa,_0x37a0f5){return client[_0xf746('0xe')](_0x2edb61,_0x301d4d)[_0xf746('0xf')](function(_0x232864){logger[_0xf746('0x10')](_0xf746('0x11'),_0x3fc620,_0xf746('0x12'));logger['debug'](_0xf746('0x13'),_0x3fc620,_0xf746('0x12'),JSON[_0xf746('0x14')](_0x232864));if(_0x232864['error']){if(_0x232864[_0xf746('0x15')]['code']===0x1f4){logger[_0xf746('0x15')](_0xf746('0x11'),_0x3fc620,_0x232864[_0xf746('0x15')][_0xf746('0x16')]);return _0x37a0f5(_0x232864[_0xf746('0x15')][_0xf746('0x16')]);}logger['error'](_0xf746('0x11'),_0x3fc620,_0x232864[_0xf746('0x15')][_0xf746('0x16')]);return _0x11cbaa(_0x232864['error'][_0xf746('0x16')]);}else{logger[_0xf746('0x10')](_0xf746('0x11'),_0x3fc620,_0xf746('0x12'));_0x11cbaa(_0x232864[_0xf746('0x17')][_0xf746('0x16')]);}})['catch'](function(_0x313a59){logger['error'](_0xf746('0x11'),_0x3fc620,_0x313a59);_0x37a0f5(_0x313a59);});});}