Built motion from commit ddca4d0d.|2.5.47
[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 _0xd8a7=['../../config/environment','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x36d12c,_0x2b5773){_0x36d12c=_0x36d12c-0x0;var _0xca6f7c=_0xd8a7[_0x36d12c];return _0xca6f7c;};'use strict';var _=require(_0x7d8a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d8a('0x1'));var fs=require('fs');var Redis=require(_0x7d8a('0x2'));var db=require(_0x7d8a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d8a('0x4'))('rpc');var config=require(_0x7d8a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d8a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf673,_0x28ea08,_0x240123){return new BPromise(function(_0x58ead1,_0x3207cc){return client[_0x7d8a('0x7')](_0x1cf673,_0x240123)[_0x7d8a('0x8')](function(_0x328503){logger[_0x7d8a('0x9')](_0x7d8a('0xa'),_0x28ea08,_0x7d8a('0xb'));logger[_0x7d8a('0xc')](_0x7d8a('0xd'),_0x28ea08,_0x7d8a('0xb'),JSON[_0x7d8a('0xe')](_0x328503));if(_0x328503[_0x7d8a('0xf')]){if(_0x328503[_0x7d8a('0xf')]['code']===0x1f4){logger[_0x7d8a('0xf')](_0x7d8a('0xa'),_0x28ea08,_0x328503[_0x7d8a('0xf')][_0x7d8a('0x10')]);return _0x3207cc(_0x328503[_0x7d8a('0xf')]['message']);}logger[_0x7d8a('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x28ea08,_0x328503[_0x7d8a('0xf')]['message']);return _0x58ead1(_0x328503[_0x7d8a('0xf')]['message']);}else{logger[_0x7d8a('0x9')](_0x7d8a('0xa'),_0x28ea08,'request\x20sent');_0x58ead1(_0x328503[_0x7d8a('0x11')][_0x7d8a('0x10')]);}})[_0x7d8a('0x12')](function(_0xe9563c){logger['error'](_0x7d8a('0xa'),_0x28ea08,_0xe9563c);_0x3207cc(_0xe9563c);});});}