e9beb8fdcff1942023bdd7da17c40a85d1cb6c65
[motion2.git] / server / api / voiceTransferReport / voiceTransferReport.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 _0xad36=['VoiceTransferReport','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport'];(function(_0x15abba,_0x30ef6c){var _0x14696b=function(_0x483633){while(--_0x483633){_0x15abba['push'](_0x15abba['shift']());}};_0x14696b(++_0x30ef6c);}(_0xad36,0x1c6));var _0x6ad3=function(_0x407444,_0x9f7c4c){_0x407444=_0x407444-0x0;var _0x1ba581=_0xad36[_0x407444];return _0x1ba581;};'use strict';var _=require(_0x6ad3('0x0'));var util=require(_0x6ad3('0x1'));var moment=require(_0x6ad3('0x2'));var BPromise=require(_0x6ad3('0x3'));var rs=require(_0x6ad3('0x4'));var fs=require('fs');var Redis=require(_0x6ad3('0x5'));var db=require(_0x6ad3('0x6'))['db'];var utils=require(_0x6ad3('0x7'));var logger=require(_0x6ad3('0x8'))(_0x6ad3('0x9'));var config=require('../../config/environment');var jayson=require(_0x6ad3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x118c7f,_0x4056ba,_0x904fc6){return new BPromise(function(_0x386e71,_0x36e256){return client['request'](_0x118c7f,_0x904fc6)['then'](function(_0x53cc18){logger[_0x6ad3('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x4056ba,'request\x20sent');logger[_0x6ad3('0xc')](_0x6ad3('0xd'),_0x4056ba,_0x6ad3('0xe'),JSON['stringify'](_0x53cc18));if(_0x53cc18['error']){if(_0x53cc18['error'][_0x6ad3('0xf')]===0x1f4){logger[_0x6ad3('0x10')](_0x6ad3('0x11'),_0x4056ba,_0x53cc18[_0x6ad3('0x10')][_0x6ad3('0x12')]);return _0x36e256(_0x53cc18[_0x6ad3('0x10')][_0x6ad3('0x12')]);}logger[_0x6ad3('0x10')](_0x6ad3('0x11'),_0x4056ba,_0x53cc18['error'][_0x6ad3('0x12')]);return _0x386e71(_0x53cc18[_0x6ad3('0x10')][_0x6ad3('0x12')]);}else{logger['info'](_0x6ad3('0x11'),_0x4056ba,_0x6ad3('0xe'));_0x386e71(_0x53cc18[_0x6ad3('0x13')][_0x6ad3('0x12')]);}})[_0x6ad3('0x14')](function(_0x88bd5f){logger[_0x6ad3('0x10')](_0x6ad3('0x11'),_0x4056ba,_0x88bd5f);_0x36e256(_0x88bd5f);});});}exports[_0x6ad3('0x15')]=function(_0x3ecf8e){var _0x147649=this;return new Promise(function(_0x18d648,_0x16e55c){return db[_0x6ad3('0x16')][_0x6ad3('0x17')](_0x3ecf8e[_0x6ad3('0x18')],{'raw':_0x3ecf8e[_0x6ad3('0x19')]?_0x3ecf8e[_0x6ad3('0x19')][_0x6ad3('0x1a')]===undefined?!![]:![]:!![]})[_0x6ad3('0x1b')](function(_0x222761){logger[_0x6ad3('0xb')](_0x6ad3('0x15'),_0x3ecf8e);logger[_0x6ad3('0xc')]('CreateVoiceTransferReport',_0x3ecf8e,JSON['stringify'](_0x222761));_0x18d648(_0x222761);})['catch'](function(_0x186283){logger['error']('CreateVoiceTransferReport',_0x186283['message'],_0x3ecf8e);_0x16e55c(_0x147649[_0x6ad3('0x10')](0x1f4,_0x186283[_0x6ad3('0x12')]));});});};