Built motion from commit 3c2ce842.|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 _0x448a=['../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x5b039b,_0x162e87){var _0x409502=function(_0x1e7e16){while(--_0x1e7e16){_0x5b039b['push'](_0x5b039b['shift']());}};_0x409502(++_0x162e87);}(_0x448a,0x1ef));var _0xa448=function(_0x34fba6,_0xc0058c){_0x34fba6=_0x34fba6-0x0;var _0x23440c=_0x448a[_0x34fba6];return _0x23440c;};'use strict';var _=require('lodash');var util=require(_0xa448('0x0'));var moment=require(_0xa448('0x1'));var BPromise=require('bluebird');var rs=require(_0xa448('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa448('0x3'));var logger=require(_0xa448('0x4'))('rpc');var config=require(_0xa448('0x5'));var jayson=require(_0xa448('0x6'));var client=jayson[_0xa448('0x7')][_0xa448('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12b0e2,_0x1f4749,_0x1ec2d8){return new BPromise(function(_0x54bdb0,_0x5df2c1){return client[_0xa448('0x9')](_0x12b0e2,_0x1ec2d8)[_0xa448('0xa')](function(_0x40006c){logger[_0xa448('0xb')](_0xa448('0xc'),_0x1f4749,_0xa448('0xd'));logger[_0xa448('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x1f4749,'request\x20sent',JSON[_0xa448('0xf')](_0x40006c));if(_0x40006c[_0xa448('0x10')]){if(_0x40006c['error'][_0xa448('0x11')]===0x1f4){logger[_0xa448('0x10')](_0xa448('0xc'),_0x1f4749,_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);return _0x5df2c1(_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);}logger[_0xa448('0x10')](_0xa448('0xc'),_0x1f4749,_0x40006c['error']['message']);return _0x54bdb0(_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);}else{logger[_0xa448('0xb')](_0xa448('0xc'),_0x1f4749,_0xa448('0xd'));_0x54bdb0(_0x40006c[_0xa448('0x13')]['message']);}})['catch'](function(_0x5b8899){logger['error'](_0xa448('0xc'),_0x1f4749,_0x5b8899);_0x5df2c1(_0x5b8899);});});}