Built motion from commit f9526609.|2.6.29
[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 _0x4cf4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','then','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4192e6,_0x2a88d4){var _0x51a85a=function(_0x8dca6e){while(--_0x8dca6e){_0x4192e6['push'](_0x4192e6['shift']());}};_0x51a85a(++_0x2a88d4);}(_0x4cf4,0x12f));var _0x44cf=function(_0x27d26f,_0x14cbea){_0x27d26f=_0x27d26f-0x0;var _0x40f484=_0x4cf4[_0x27d26f];return _0x40f484;};'use strict';var _=require(_0x44cf('0x0'));var util=require(_0x44cf('0x1'));var moment=require('moment');var BPromise=require(_0x44cf('0x2'));var rs=require(_0x44cf('0x3'));var fs=require('fs');var Redis=require(_0x44cf('0x4'));var db=require(_0x44cf('0x5'))['db'];var utils=require(_0x44cf('0x6'));var logger=require(_0x44cf('0x7'))(_0x44cf('0x8'));var config=require(_0x44cf('0x9'));var jayson=require(_0x44cf('0xa'));var client=jayson['client'][_0x44cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3384cf,_0x3b6b0f,_0x37416b){return new BPromise(function(_0x3ace8f,_0x1a9f29){return client[_0x44cf('0xc')](_0x3384cf,_0x37416b)['then'](function(_0x5774c3){logger[_0x44cf('0xd')](_0x44cf('0xe'),_0x3b6b0f,'request\x20sent');logger[_0x44cf('0xf')](_0x44cf('0x10'),_0x3b6b0f,_0x44cf('0x11'),JSON['stringify'](_0x5774c3));if(_0x5774c3['error']){if(_0x5774c3[_0x44cf('0x12')][_0x44cf('0x13')]===0x1f4){logger[_0x44cf('0x12')](_0x44cf('0xe'),_0x3b6b0f,_0x5774c3[_0x44cf('0x12')][_0x44cf('0x14')]);return _0x1a9f29(_0x5774c3[_0x44cf('0x12')]['message']);}logger[_0x44cf('0x12')](_0x44cf('0xe'),_0x3b6b0f,_0x5774c3[_0x44cf('0x12')][_0x44cf('0x14')]);return _0x3ace8f(_0x5774c3[_0x44cf('0x12')]['message']);}else{logger[_0x44cf('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x3b6b0f,_0x44cf('0x11'));_0x3ace8f(_0x5774c3[_0x44cf('0x15')][_0x44cf('0x14')]);}})['catch'](function(_0x577d3d){logger[_0x44cf('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x3b6b0f,_0x577d3d);_0x1a9f29(_0x577d3d);});});}exports[_0x44cf('0x16')]=function(_0x1b192d){var _0x5a026a=this;return new Promise(function(_0x3b192f,_0x422f53){return db[_0x44cf('0x17')][_0x44cf('0x18')](_0x1b192d[_0x44cf('0x19')],{'raw':_0x1b192d['options']?_0x1b192d[_0x44cf('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x44cf('0x1b')](function(_0x5c4aee){logger['info'](_0x44cf('0x16'),_0x1b192d);logger[_0x44cf('0xf')](_0x44cf('0x16'),_0x1b192d,JSON['stringify'](_0x5c4aee));_0x3b192f(_0x5c4aee);})['catch'](function(_0x5514bf){logger[_0x44cf('0x12')](_0x44cf('0x16'),_0x5514bf[_0x44cf('0x14')],_0x1b192d);_0x422f53(_0x5a026a['error'](0x1f4,_0x5514bf['message']));});});};