cf98288f10f8384d50796fafd63f9adc4e68038b
[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 _0x294b=['jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x468fa5,_0x2062bb){var _0x1d9d6c=function(_0x4814d6){while(--_0x4814d6){_0x468fa5['push'](_0x468fa5['shift']());}};_0x1d9d6c(++_0x2062bb);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var moment=require(_0xb294('0x1'));var BPromise=require(_0xb294('0x2'));var rs=require(_0xb294('0x3'));var fs=require('fs');var Redis=require(_0xb294('0x4'));var db=require(_0xb294('0x5'))['db'];var utils=require(_0xb294('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb294('0x7'));var jayson=require(_0xb294('0x8'));var client=jayson[_0xb294('0x9')][_0xb294('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc7910,_0x509dbd,_0x39dfbf){return new BPromise(function(_0x5110aa,_0x5226a4){return client['request'](_0xcc7910,_0x39dfbf)[_0xb294('0xb')](function(_0x33f8e5){logger[_0xb294('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,'request\x20sent');logger['debug'](_0xb294('0xd'),_0x509dbd,_0xb294('0xe'),JSON[_0xb294('0xf')](_0x33f8e5));if(_0x33f8e5[_0xb294('0x10')]){if(_0x33f8e5[_0xb294('0x10')][_0xb294('0x11')]===0x1f4){logger[_0xb294('0x10')](_0xb294('0x12'),_0x509dbd,_0x33f8e5[_0xb294('0x10')][_0xb294('0x13')]);return _0x5226a4(_0x33f8e5['error']['message']);}logger[_0xb294('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,_0x33f8e5['error'][_0xb294('0x13')]);return _0x5110aa(_0x33f8e5[_0xb294('0x10')][_0xb294('0x13')]);}else{logger[_0xb294('0xc')](_0xb294('0x12'),_0x509dbd,_0xb294('0xe'));_0x5110aa(_0x33f8e5[_0xb294('0x14')][_0xb294('0x13')]);}})[_0xb294('0x15')](function(_0x289839){logger[_0xb294('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,_0x289839);_0x5226a4(_0x289839);});});}