Built motion from commit (unavailable).|2.5.22
[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 _0xad66=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','request\x20sent'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xad66,0x8c));var _0x6ad6=function(_0x430a0f,_0x48911b){_0x430a0f=_0x430a0f-0x0;var _0x357190=_0xad66[_0x430a0f];return _0x357190;};'use strict';var _=require(_0x6ad6('0x0'));var util=require(_0x6ad6('0x1'));var moment=require(_0x6ad6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ad6('0x3'));var db=require(_0x6ad6('0x4'))['db'];var utils=require(_0x6ad6('0x5'));var logger=require(_0x6ad6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6ad6('0x7'));var client=jayson[_0x6ad6('0x8')][_0x6ad6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51942e,_0x2c1eae,_0x57fa75){return new BPromise(function(_0xe45687,_0x484237){return client['request'](_0x51942e,_0x57fa75)['then'](function(_0x4a22ce){logger[_0x6ad6('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c1eae,_0x6ad6('0xb'));logger[_0x6ad6('0xc')](_0x6ad6('0xd'),_0x2c1eae,_0x6ad6('0xb'),JSON[_0x6ad6('0xe')](_0x4a22ce));if(_0x4a22ce[_0x6ad6('0xf')]){if(_0x4a22ce[_0x6ad6('0xf')]['code']===0x1f4){logger[_0x6ad6('0xf')](_0x6ad6('0x10'),_0x2c1eae,_0x4a22ce['error'][_0x6ad6('0x11')]);return _0x484237(_0x4a22ce[_0x6ad6('0xf')][_0x6ad6('0x11')]);}logger[_0x6ad6('0xf')](_0x6ad6('0x10'),_0x2c1eae,_0x4a22ce[_0x6ad6('0xf')]['message']);return _0xe45687(_0x4a22ce[_0x6ad6('0xf')][_0x6ad6('0x11')]);}else{logger[_0x6ad6('0xa')](_0x6ad6('0x10'),_0x2c1eae,_0x6ad6('0xb'));_0xe45687(_0x4a22ce[_0x6ad6('0x12')][_0x6ad6('0x11')]);}})['catch'](function(_0x5b542a){logger[_0x6ad6('0xf')](_0x6ad6('0x10'),_0x2c1eae,_0x5b542a);_0x484237(_0x5b542a);});});}