Built motion from commit 4c281f94.|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 _0x7d55=['request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','OpenchannelTransferReport,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d55,0x1bc));var _0x57d5=function(_0x3ba997,_0x1b8649){_0x3ba997=_0x3ba997-0x0;var _0x50a52d=_0x7d55[_0x3ba997];return _0x50a52d;};'use strict';var _=require(_0x57d5('0x0'));var util=require(_0x57d5('0x1'));var moment=require(_0x57d5('0x2'));var BPromise=require(_0x57d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57d5('0x4'))['db'];var utils=require(_0x57d5('0x5'));var logger=require(_0x57d5('0x6'))('rpc');var config=require(_0x57d5('0x7'));var jayson=require(_0x57d5('0x8'));var client=jayson[_0x57d5('0x9')][_0x57d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4393ed,_0x47282c,_0x599ec5){return new BPromise(function(_0x50bc50,_0x59e164){return client['request'](_0x4393ed,_0x599ec5)[_0x57d5('0xb')](function(_0x1e8e1c){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x47282c,_0x57d5('0xc'));logger['debug'](_0x57d5('0xd'),_0x47282c,_0x57d5('0xc'),JSON[_0x57d5('0xe')](_0x1e8e1c));if(_0x1e8e1c['error']){if(_0x1e8e1c['error'][_0x57d5('0xf')]===0x1f4){logger['error'](_0x57d5('0x10'),_0x47282c,_0x1e8e1c[_0x57d5('0x11')][_0x57d5('0x12')]);return _0x59e164(_0x1e8e1c[_0x57d5('0x11')][_0x57d5('0x12')]);}logger[_0x57d5('0x11')](_0x57d5('0x10'),_0x47282c,_0x1e8e1c[_0x57d5('0x11')]['message']);return _0x50bc50(_0x1e8e1c['error'][_0x57d5('0x12')]);}else{logger['info'](_0x57d5('0x10'),_0x47282c,_0x57d5('0xc'));_0x50bc50(_0x1e8e1c['result'][_0x57d5('0x12')]);}})['catch'](function(_0x5e99df){logger[_0x57d5('0x11')](_0x57d5('0x10'),_0x47282c,_0x5e99df);_0x59e164(_0x5e99df);});});}