Built motion from commit (unavailable).|2.4.0
[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 _0x2c0c=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceTransferReport','create','body','options','lodash'];(function(_0x58d6e2,_0x212485){var _0x2273de=function(_0xb90163){while(--_0xb90163){_0x58d6e2['push'](_0x58d6e2['shift']());}};_0x2273de(++_0x212485);}(_0x2c0c,0x195));var _0xc2c0=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x2c0c[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0xc2c0('0x0'));var util=require(_0xc2c0('0x1'));var moment=require(_0xc2c0('0x2'));var BPromise=require(_0xc2c0('0x3'));var rs=require(_0xc2c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2c0('0x5'))['db'];var utils=require(_0xc2c0('0x6'));var logger=require(_0xc2c0('0x7'))(_0xc2c0('0x8'));var config=require(_0xc2c0('0x9'));var jayson=require(_0xc2c0('0xa'));var client=jayson[_0xc2c0('0xb')][_0xc2c0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36f5c1,_0x3be3db,_0x34973f){return new BPromise(function(_0x457c18,_0x1a3415){return client[_0xc2c0('0xd')](_0x36f5c1,_0x34973f)[_0xc2c0('0xe')](function(_0x4aa1fa){logger[_0xc2c0('0xf')](_0xc2c0('0x10'),_0x3be3db,_0xc2c0('0x11'));logger[_0xc2c0('0x12')](_0xc2c0('0x13'),_0x3be3db,_0xc2c0('0x11'),JSON[_0xc2c0('0x14')](_0x4aa1fa));if(_0x4aa1fa['error']){if(_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x16')]===0x1f4){logger[_0xc2c0('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x3be3db,_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x17')]);return _0x1a3415(_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x17')]);}logger[_0xc2c0('0x15')](_0xc2c0('0x10'),_0x3be3db,_0x4aa1fa['error']['message']);return _0x457c18(_0x4aa1fa[_0xc2c0('0x15')][_0xc2c0('0x17')]);}else{logger[_0xc2c0('0xf')](_0xc2c0('0x10'),_0x3be3db,'request\x20sent');_0x457c18(_0x4aa1fa['result'][_0xc2c0('0x17')]);}})[_0xc2c0('0x18')](function(_0xa41c40){logger[_0xc2c0('0x15')](_0xc2c0('0x10'),_0x3be3db,_0xa41c40);_0x1a3415(_0xa41c40);});});}exports[_0xc2c0('0x19')]=function(_0x247c65){var _0x2f5633=this;return new Promise(function(_0x15c6a2,_0x349382){return db['VoiceTransferReport'][_0xc2c0('0x1a')](_0x247c65[_0xc2c0('0x1b')],{'raw':_0x247c65[_0xc2c0('0x1c')]?_0x247c65['options']['raw']===undefined?!![]:![]:!![]})[_0xc2c0('0xe')](function(_0x4cafb7){logger[_0xc2c0('0xf')](_0xc2c0('0x19'),_0x247c65);logger[_0xc2c0('0x12')](_0xc2c0('0x19'),_0x247c65,JSON[_0xc2c0('0x14')](_0x4cafb7));_0x15c6a2(_0x4cafb7);})[_0xc2c0('0x18')](function(_0x1c8971){logger['error']('CreateVoiceTransferReport',_0x1c8971[_0xc2c0('0x17')],_0x247c65);_0x349382(_0x2f5633['error'](0x1f4,_0x1c8971[_0xc2c0('0x17')]));});});};