fa6b601b57e55e31371685e1c39489e8c01e91c7
[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 _0xa7e6=['stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa7e6,0x74));var _0x6a7e=function(_0x148073,_0x37dbaa){_0x148073=_0x148073-0x0;var _0x30ba58=_0xa7e6[_0x148073];return _0x30ba58;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var moment=require(_0x6a7e('0x2'));var BPromise=require(_0x6a7e('0x3'));var rs=require(_0x6a7e('0x4'));var fs=require('fs');var Redis=require(_0x6a7e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a7e('0x6'));var logger=require(_0x6a7e('0x7'))(_0x6a7e('0x8'));var config=require(_0x6a7e('0x9'));var jayson=require(_0x6a7e('0xa'));var client=jayson['client'][_0x6a7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16249d,_0x37165d,_0x342c96){return new BPromise(function(_0x45e92e,_0x3f3f2f){return client[_0x6a7e('0xc')](_0x16249d,_0x342c96)[_0x6a7e('0xd')](function(_0xdaa33d){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x37165d,'request\x20sent');logger['debug'](_0x6a7e('0xe'),_0x37165d,_0x6a7e('0xf'),JSON[_0x6a7e('0x10')](_0xdaa33d));if(_0xdaa33d[_0x6a7e('0x11')]){if(_0xdaa33d[_0x6a7e('0x11')]['code']===0x1f4){logger[_0x6a7e('0x11')](_0x6a7e('0x12'),_0x37165d,_0xdaa33d['error']['message']);return _0x3f3f2f(_0xdaa33d[_0x6a7e('0x11')][_0x6a7e('0x13')]);}logger[_0x6a7e('0x11')](_0x6a7e('0x12'),_0x37165d,_0xdaa33d['error'][_0x6a7e('0x13')]);return _0x45e92e(_0xdaa33d[_0x6a7e('0x11')][_0x6a7e('0x13')]);}else{logger[_0x6a7e('0x14')](_0x6a7e('0x12'),_0x37165d,'request\x20sent');_0x45e92e(_0xdaa33d[_0x6a7e('0x15')]['message']);}})['catch'](function(_0x454561){logger['error'](_0x6a7e('0x12'),_0x37165d,_0x454561);_0x3f3f2f(_0x454561);});});}