Built motion from commit eddce310.|2.6.12
[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 _0x466d=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','catch','lodash','moment','bluebird','randomstring'];(function(_0x524a25,_0x522d35){var _0x1ed046=function(_0xc6e06f){while(--_0xc6e06f){_0x524a25['push'](_0x524a25['shift']());}};_0x1ed046(++_0x522d35);}(_0x466d,0x191));var _0xd466=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0x466d[_0xdd827a];return _0x2f46f1;};'use strict';var _=require(_0xd466('0x0'));var util=require('util');var moment=require(_0xd466('0x1'));var BPromise=require(_0xd466('0x2'));var rs=require(_0xd466('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd466('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd466('0x5'))(_0xd466('0x6'));var config=require(_0xd466('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd466('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53c6fa,_0x2dc142,_0x176ed7){return new BPromise(function(_0x50eb6d,_0x3180c0){return client[_0xd466('0x9')](_0x53c6fa,_0x176ed7)[_0xd466('0xa')](function(_0x2a7c21){logger['info'](_0xd466('0xb'),_0x2dc142,'request\x20sent');logger[_0xd466('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x2dc142,_0xd466('0xd'),JSON['stringify'](_0x2a7c21));if(_0x2a7c21[_0xd466('0xe')]){if(_0x2a7c21[_0xd466('0xe')][_0xd466('0xf')]===0x1f4){logger[_0xd466('0xe')](_0xd466('0xb'),_0x2dc142,_0x2a7c21[_0xd466('0xe')]['message']);return _0x3180c0(_0x2a7c21[_0xd466('0xe')]['message']);}logger[_0xd466('0xe')](_0xd466('0xb'),_0x2dc142,_0x2a7c21[_0xd466('0xe')][_0xd466('0x10')]);return _0x50eb6d(_0x2a7c21['error'][_0xd466('0x10')]);}else{logger[_0xd466('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2dc142,_0xd466('0xd'));_0x50eb6d(_0x2a7c21[_0xd466('0x12')][_0xd466('0x10')]);}})['catch'](function(_0xc6b730){logger[_0xd466('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x2dc142,_0xc6b730);_0x3180c0(_0xc6b730);});});}exports[_0xd466('0x13')]=function(_0x272e5d){var _0x57e956=this;return new Promise(function(_0xa452dc,_0x3371a0){return db[_0xd466('0x14')][_0xd466('0x15')](_0x272e5d[_0xd466('0x16')],{'raw':_0x272e5d[_0xd466('0x17')]?_0x272e5d[_0xd466('0x17')][_0xd466('0x18')]===undefined?!![]:![]:!![]})[_0xd466('0xa')](function(_0x1d88d1){logger[_0xd466('0x11')]('CreateVoiceTransferReport',_0x272e5d);logger[_0xd466('0xc')]('CreateVoiceTransferReport',_0x272e5d,JSON[_0xd466('0x19')](_0x1d88d1));_0xa452dc(_0x1d88d1);})[_0xd466('0x1a')](function(_0x4e13f8){logger[_0xd466('0xe')](_0xd466('0x13'),_0x4e13f8[_0xd466('0x10')],_0x272e5d);_0x3371a0(_0x57e956[_0xd466('0xe')](0x1f4,_0x4e13f8['message']));});});};