Built motion from commit (unavailable).|2.5.30
[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 _0x58ef=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','stringify','lodash','moment','bluebird'];(function(_0x5249be,_0x251784){var _0x19ba8e=function(_0x253547){while(--_0x253547){_0x5249be['push'](_0x5249be['shift']());}};_0x19ba8e(++_0x251784);}(_0x58ef,0x1ce));var _0xf58e=function(_0x91d2a0,_0x14c5b6){_0x91d2a0=_0x91d2a0-0x0;var _0x55acd0=_0x58ef[_0x91d2a0];return _0x55acd0;};'use strict';var _=require(_0xf58e('0x0'));var util=require('util');var moment=require(_0xf58e('0x1'));var BPromise=require(_0xf58e('0x2'));var rs=require(_0xf58e('0x3'));var fs=require('fs');var Redis=require(_0xf58e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf58e('0x5'));var logger=require(_0xf58e('0x6'))(_0xf58e('0x7'));var config=require(_0xf58e('0x8'));var jayson=require(_0xf58e('0x9'));var client=jayson[_0xf58e('0xa')][_0xf58e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdad71,_0x20cbff,_0x5c30b4){return new BPromise(function(_0x28f421,_0x590d08){return client[_0xf58e('0xc')](_0xdad71,_0x5c30b4)[_0xf58e('0xd')](function(_0x28ff65){logger[_0xf58e('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x20cbff,_0xf58e('0xf'));logger['debug'](_0xf58e('0x10'),_0x20cbff,_0xf58e('0xf'),JSON['stringify'](_0x28ff65));if(_0x28ff65[_0xf58e('0x11')]){if(_0x28ff65[_0xf58e('0x11')][_0xf58e('0x12')]===0x1f4){logger[_0xf58e('0x11')](_0xf58e('0x13'),_0x20cbff,_0x28ff65[_0xf58e('0x11')][_0xf58e('0x14')]);return _0x590d08(_0x28ff65[_0xf58e('0x11')]['message']);}logger[_0xf58e('0x11')](_0xf58e('0x13'),_0x20cbff,_0x28ff65['error'][_0xf58e('0x14')]);return _0x28f421(_0x28ff65[_0xf58e('0x11')][_0xf58e('0x14')]);}else{logger[_0xf58e('0xe')](_0xf58e('0x13'),_0x20cbff,_0xf58e('0xf'));_0x28f421(_0x28ff65[_0xf58e('0x15')][_0xf58e('0x14')]);}})[_0xf58e('0x16')](function(_0x1aba2a){logger['error'](_0xf58e('0x13'),_0x20cbff,_0x1aba2a);_0x590d08(_0x1aba2a);});});}exports[_0xf58e('0x17')]=function(_0x416694){var _0x1b8be3=this;return new Promise(function(_0x2ff3c5,_0x571cfb){return db[_0xf58e('0x18')][_0xf58e('0x19')](_0x416694[_0xf58e('0x1a')],{'raw':_0x416694[_0xf58e('0x1b')]?_0x416694[_0xf58e('0x1b')][_0xf58e('0x1c')]===undefined?!![]:![]:!![]})[_0xf58e('0xd')](function(_0x324518){logger[_0xf58e('0xe')]('CreateVoiceTransferReport',_0x416694);logger[_0xf58e('0x1d')](_0xf58e('0x17'),_0x416694,JSON[_0xf58e('0x1e')](_0x324518));_0x2ff3c5(_0x324518);})[_0xf58e('0x16')](function(_0x53ec40){logger['error'](_0xf58e('0x17'),_0x53ec40[_0xf58e('0x14')],_0x416694);_0x571cfb(_0x1b8be3['error'](0x1f4,_0x53ec40[_0xf58e('0x14')]));});});};