Built motion from commit eddce310.|2.6.12
[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 _0xf776=['error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bcc4c,_0x2ab231){var _0x4465ec=function(_0x3e0750){while(--_0x3e0750){_0x4bcc4c['push'](_0x4bcc4c['shift']());}};_0x4465ec(++_0x2ab231);}(_0xf776,0x169));var _0x6f77=function(_0x18bfad,_0x2593ff){_0x18bfad=_0x18bfad-0x0;var _0x59ed95=_0xf776[_0x18bfad];return _0x59ed95;};'use strict';var _=require(_0x6f77('0x0'));var util=require('util');var moment=require(_0x6f77('0x1'));var BPromise=require(_0x6f77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f77('0x3'));var db=require(_0x6f77('0x4'))['db'];var utils=require(_0x6f77('0x5'));var logger=require(_0x6f77('0x6'))('rpc');var config=require(_0x6f77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f77('0x8')][_0x6f77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36ffd2,_0x18a937,_0x545ba9){return new BPromise(function(_0x1dd52f,_0x5a83ba){return client[_0x6f77('0xa')](_0x36ffd2,_0x545ba9)[_0x6f77('0xb')](function(_0x14ea05){logger[_0x6f77('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x18a937,_0x6f77('0xd'));logger[_0x6f77('0xe')](_0x6f77('0xf'),_0x18a937,_0x6f77('0xd'),JSON[_0x6f77('0x10')](_0x14ea05));if(_0x14ea05[_0x6f77('0x11')]){if(_0x14ea05['error'][_0x6f77('0x12')]===0x1f4){logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x5a83ba(_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);}logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x1dd52f(_0x14ea05[_0x6f77('0x11')]['message']);}else{logger['info'](_0x6f77('0x13'),_0x18a937,_0x6f77('0xd'));_0x1dd52f(_0x14ea05['result'][_0x6f77('0x14')]);}})['catch'](function(_0xf36aa2){logger[_0x6f77('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x18a937,_0xf36aa2);_0x5a83ba(_0xf36aa2);});});}