Built motion from commit b5413ace.|2.6.9
[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 _0xfd6e=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x59f97a,_0x511696){var _0x411b33=function(_0x4f801e){while(--_0x4f801e){_0x59f97a['push'](_0x59f97a['shift']());}};_0x411b33(++_0x511696);}(_0xfd6e,0x16e));var _0xefd6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfd6e[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xefd6('0x0'));var util=require('util');var moment=require(_0xefd6('0x1'));var BPromise=require('bluebird');var rs=require(_0xefd6('0x2'));var fs=require('fs');var Redis=require(_0xefd6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xefd6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xefd6('0x5')][_0xefd6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26e108,_0xe477f9,_0x340765){return new BPromise(function(_0x5da399,_0x59c636){return client[_0xefd6('0x7')](_0x26e108,_0x340765)[_0xefd6('0x8')](function(_0x3c941a){logger['info'](_0xefd6('0x9'),_0xe477f9,_0xefd6('0xa'));logger[_0xefd6('0xb')](_0xefd6('0xc'),_0xe477f9,'request\x20sent',JSON[_0xefd6('0xd')](_0x3c941a));if(_0x3c941a[_0xefd6('0xe')]){if(_0x3c941a[_0xefd6('0xe')][_0xefd6('0xf')]===0x1f4){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x59c636(_0x3c941a['error'][_0xefd6('0x10')]);}logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x5da399(_0x3c941a['error'][_0xefd6('0x10')]);}else{logger['info'](_0xefd6('0x9'),_0xe477f9,'request\x20sent');_0x5da399(_0x3c941a[_0xefd6('0x11')][_0xefd6('0x10')]);}})['catch'](function(_0x17bf20){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x17bf20);_0x59c636(_0x17bf20);});});}