Built motion from commit (unavailable).|2.4.4
[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 _0xa1c1=['stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','options','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4efb6,_0x44e1ea){var _0x23b346=function(_0xa4aa0f){while(--_0xa4aa0f){_0x4efb6['push'](_0x4efb6['shift']());}};_0x23b346(++_0x44e1ea);}(_0xa1c1,0xb8));var _0x1a1c=function(_0x20af15,_0x1e0f52){_0x20af15=_0x20af15-0x0;var _0x2c7b91=_0xa1c1[_0x20af15];return _0x2c7b91;};'use strict';var _=require('lodash');var util=require(_0x1a1c('0x0'));var moment=require(_0x1a1c('0x1'));var BPromise=require(_0x1a1c('0x2'));var rs=require(_0x1a1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a1c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a1c('0x5'))('rpc');var config=require(_0x1a1c('0x6'));var jayson=require(_0x1a1c('0x7'));var client=jayson['client'][_0x1a1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e94aa,_0x466b43,_0x117028){return new BPromise(function(_0x3473b0,_0x3ab847){return client[_0x1a1c('0x9')](_0x5e94aa,_0x117028)[_0x1a1c('0xa')](function(_0x328924){logger[_0x1a1c('0xb')](_0x1a1c('0xc'),_0x466b43,_0x1a1c('0xd'));logger[_0x1a1c('0xe')](_0x1a1c('0xf'),_0x466b43,_0x1a1c('0xd'),JSON[_0x1a1c('0x10')](_0x328924));if(_0x328924[_0x1a1c('0x11')]){if(_0x328924[_0x1a1c('0x11')][_0x1a1c('0x12')]===0x1f4){logger[_0x1a1c('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x466b43,_0x328924[_0x1a1c('0x11')][_0x1a1c('0x13')]);return _0x3ab847(_0x328924['error'][_0x1a1c('0x13')]);}logger[_0x1a1c('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x466b43,_0x328924[_0x1a1c('0x11')][_0x1a1c('0x13')]);return _0x3473b0(_0x328924['error'][_0x1a1c('0x13')]);}else{logger['info'](_0x1a1c('0xc'),_0x466b43,_0x1a1c('0xd'));_0x3473b0(_0x328924[_0x1a1c('0x14')][_0x1a1c('0x13')]);}})['catch'](function(_0x268ab8){logger[_0x1a1c('0x11')](_0x1a1c('0xc'),_0x466b43,_0x268ab8);_0x3ab847(_0x268ab8);});});}exports[_0x1a1c('0x15')]=function(_0x275504){var _0x127fc7=this;return new Promise(function(_0x855c7c,_0x3349bb){return db[_0x1a1c('0x16')]['create'](_0x275504['body'],{'raw':_0x275504[_0x1a1c('0x17')]?_0x275504[_0x1a1c('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53087e){logger[_0x1a1c('0xb')](_0x1a1c('0x15'),_0x275504);logger[_0x1a1c('0xe')](_0x1a1c('0x15'),_0x275504,JSON[_0x1a1c('0x10')](_0x53087e));_0x855c7c(_0x53087e);})[_0x1a1c('0x18')](function(_0x2d20ac){logger['error']('CreateVoiceTransferReport',_0x2d20ac[_0x1a1c('0x13')],_0x275504);_0x3349bb(_0x127fc7['error'](0x1f4,_0x2d20ac['message']));});});};