Built motion from commit cf5ff673.|2.5.41
[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 _0x8c2d=['info','request\x20sent','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','debug','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x41e27b,_0x37f77c){var _0x174637=function(_0xf65e2b){while(--_0xf65e2b){_0x41e27b['push'](_0x41e27b['shift']());}};_0x174637(++_0x37f77c);}(_0x8c2d,0x1a4));var _0xd8c2=function(_0xbaf7d7,_0x5ef011){_0xbaf7d7=_0xbaf7d7-0x0;var _0x5bb3d6=_0x8c2d[_0xbaf7d7];return _0x5bb3d6;};'use strict';var _=require(_0xd8c2('0x0'));var util=require(_0xd8c2('0x1'));var moment=require(_0xd8c2('0x2'));var BPromise=require(_0xd8c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8c2('0x5'));var logger=require('../../config/logger')(_0xd8c2('0x6'));var config=require(_0xd8c2('0x7'));var jayson=require(_0xd8c2('0x8'));var client=jayson['client'][_0xd8c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a3b7,_0x328d4b,_0x57dfdc){return new BPromise(function(_0x1e6470,_0x4c1ed2){return client[_0xd8c2('0xa')](_0x50a3b7,_0x57dfdc)[_0xd8c2('0xb')](function(_0x4f9207){logger[_0xd8c2('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x328d4b,_0xd8c2('0xd'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x328d4b,_0xd8c2('0xd'),JSON[_0xd8c2('0xe')](_0x4f9207));if(_0x4f9207[_0xd8c2('0xf')]){if(_0x4f9207[_0xd8c2('0xf')][_0xd8c2('0x10')]===0x1f4){logger[_0xd8c2('0xf')](_0xd8c2('0x11'),_0x328d4b,_0x4f9207[_0xd8c2('0xf')][_0xd8c2('0x12')]);return _0x4c1ed2(_0x4f9207[_0xd8c2('0xf')][_0xd8c2('0x12')]);}logger['error'](_0xd8c2('0x11'),_0x328d4b,_0x4f9207[_0xd8c2('0xf')][_0xd8c2('0x12')]);return _0x1e6470(_0x4f9207['error']['message']);}else{logger[_0xd8c2('0xc')](_0xd8c2('0x11'),_0x328d4b,'request\x20sent');_0x1e6470(_0x4f9207[_0xd8c2('0x13')][_0xd8c2('0x12')]);}})['catch'](function(_0x15149d){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x328d4b,_0x15149d);_0x4c1ed2(_0x15149d);});});}exports[_0xd8c2('0x14')]=function(_0x4c894){var _0x5edf62=this;return new Promise(function(_0xac556e,_0x33ff65){return db[_0xd8c2('0x15')][_0xd8c2('0x16')](_0x4c894[_0xd8c2('0x17')],{'raw':_0x4c894[_0xd8c2('0x18')]?_0x4c894[_0xd8c2('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xd8c2('0xb')](function(_0x28c7d4){logger[_0xd8c2('0xc')]('CreateVoiceTransferReport',_0x4c894);logger[_0xd8c2('0x19')](_0xd8c2('0x14'),_0x4c894,JSON[_0xd8c2('0xe')](_0x28c7d4));_0xac556e(_0x28c7d4);})[_0xd8c2('0x1a')](function(_0x20782a){logger[_0xd8c2('0xf')](_0xd8c2('0x14'),_0x20782a[_0xd8c2('0x12')],_0x4c894);_0x33ff65(_0x5edf62[_0xd8c2('0xf')](0x1f4,_0x20782a[_0xd8c2('0x12')]));});});};