Built motion from commit a679711e.|2.6.15
[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 _0x6108=['OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x6108,0xbc));var _0x8610=function(_0x3afade,_0x1644b0){_0x3afade=_0x3afade-0x0;var _0x458909=_0x6108[_0x3afade];return _0x458909;};'use strict';var _=require(_0x8610('0x0'));var util=require('util');var moment=require(_0x8610('0x1'));var BPromise=require(_0x8610('0x2'));var rs=require(_0x8610('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8610('0x4'));var logger=require(_0x8610('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8610('0x6'));var client=jayson[_0x8610('0x7')][_0x8610('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26dab3,_0x4e0fe4,_0x174f41){return new BPromise(function(_0x49e0a2,_0x6ee380){return client[_0x8610('0x9')](_0x26dab3,_0x174f41)[_0x8610('0xa')](function(_0x48d693){logger[_0x8610('0xb')](_0x8610('0xc'),_0x4e0fe4,_0x8610('0xd'));logger[_0x8610('0xe')](_0x8610('0xf'),_0x4e0fe4,_0x8610('0xd'),JSON['stringify'](_0x48d693));if(_0x48d693[_0x8610('0x10')]){if(_0x48d693[_0x8610('0x10')][_0x8610('0x11')]===0x1f4){logger['error'](_0x8610('0xc'),_0x4e0fe4,_0x48d693['error'][_0x8610('0x12')]);return _0x6ee380(_0x48d693[_0x8610('0x10')][_0x8610('0x12')]);}logger[_0x8610('0x10')](_0x8610('0xc'),_0x4e0fe4,_0x48d693['error']['message']);return _0x49e0a2(_0x48d693[_0x8610('0x10')][_0x8610('0x12')]);}else{logger[_0x8610('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4e0fe4,'request\x20sent');_0x49e0a2(_0x48d693['result'][_0x8610('0x12')]);}})[_0x8610('0x13')](function(_0x56ec75){logger[_0x8610('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4e0fe4,_0x56ec75);_0x6ee380(_0x56ec75);});});}