Built motion from commit b5996064.|2.6.21
[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 _0x2a9f=['code','message','result','catch','CreateVoiceTransferReport','create','body','options','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2a9f,0x191));var _0xf2a9=function(_0x578761,_0x13d455){_0x578761=_0x578761-0x0;var _0x20c626=_0x2a9f[_0x578761];return _0x20c626;};'use strict';var _=require(_0xf2a9('0x0'));var util=require(_0xf2a9('0x1'));var moment=require(_0xf2a9('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2a9('0x4'))['db'];var utils=require(_0xf2a9('0x5'));var logger=require(_0xf2a9('0x6'))(_0xf2a9('0x7'));var config=require(_0xf2a9('0x8'));var jayson=require(_0xf2a9('0x9'));var client=jayson[_0xf2a9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7715,_0x25d4e3,_0x157043){return new BPromise(function(_0x5e4084,_0x36c91b){return client[_0xf2a9('0xb')](_0x2f7715,_0x157043)['then'](function(_0x28bfe5){logger[_0xf2a9('0xc')](_0xf2a9('0xd'),_0x25d4e3,_0xf2a9('0xe'));logger[_0xf2a9('0xf')](_0xf2a9('0x10'),_0x25d4e3,_0xf2a9('0xe'),JSON[_0xf2a9('0x11')](_0x28bfe5));if(_0x28bfe5['error']){if(_0x28bfe5[_0xf2a9('0x12')][_0xf2a9('0x13')]===0x1f4){logger[_0xf2a9('0x12')](_0xf2a9('0xd'),_0x25d4e3,_0x28bfe5[_0xf2a9('0x12')][_0xf2a9('0x14')]);return _0x36c91b(_0x28bfe5[_0xf2a9('0x12')][_0xf2a9('0x14')]);}logger[_0xf2a9('0x12')](_0xf2a9('0xd'),_0x25d4e3,_0x28bfe5[_0xf2a9('0x12')][_0xf2a9('0x14')]);return _0x5e4084(_0x28bfe5[_0xf2a9('0x12')][_0xf2a9('0x14')]);}else{logger[_0xf2a9('0xc')](_0xf2a9('0xd'),_0x25d4e3,_0xf2a9('0xe'));_0x5e4084(_0x28bfe5[_0xf2a9('0x15')][_0xf2a9('0x14')]);}})[_0xf2a9('0x16')](function(_0x4684ee){logger[_0xf2a9('0x12')](_0xf2a9('0xd'),_0x25d4e3,_0x4684ee);_0x36c91b(_0x4684ee);});});}exports[_0xf2a9('0x17')]=function(_0x26d7b6){var _0x39c852=this;return new Promise(function(_0x2b6212,_0x1ccd87){return db['VoiceTransferReport'][_0xf2a9('0x18')](_0x26d7b6[_0xf2a9('0x19')],{'raw':_0x26d7b6[_0xf2a9('0x1a')]?_0x26d7b6[_0xf2a9('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xf2a9('0x1b')](function(_0x3b5946){logger[_0xf2a9('0xc')](_0xf2a9('0x17'),_0x26d7b6);logger[_0xf2a9('0xf')]('CreateVoiceTransferReport',_0x26d7b6,JSON[_0xf2a9('0x11')](_0x3b5946));_0x2b6212(_0x3b5946);})[_0xf2a9('0x16')](function(_0x27ffd3){logger['error'](_0xf2a9('0x17'),_0x27ffd3[_0xf2a9('0x14')],_0x26d7b6);_0x1ccd87(_0x39c852[_0xf2a9('0x12')](0x1f4,_0x27ffd3[_0xf2a9('0x14')]));});});};