b64a3e2696212a11292e7c23849165696308b051
[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 _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5577,0x1b4));var _0x7557=function(_0x5efc92,_0x39c025){_0x5efc92=_0x5efc92-0x0;var _0x239547=_0x5577[_0x5efc92];return _0x239547;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});}