Built motion from commit f3da74b7.|2.5.36
[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 _0xa900=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3a2ced,_0x2566d4){var _0x5e3c94=function(_0x128ed5){while(--_0x128ed5){_0x3a2ced['push'](_0x3a2ced['shift']());}};_0x5e3c94(++_0x2566d4);}(_0xa900,0x174));var _0x0a90=function(_0x25f9dc,_0x36c8e1){_0x25f9dc=_0x25f9dc-0x0;var _0x4213ec=_0xa900[_0x25f9dc];return _0x4213ec;};'use strict';var _=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var moment=require(_0x0a90('0x2'));var BPromise=require(_0x0a90('0x3'));var rs=require(_0x0a90('0x4'));var fs=require('fs');var Redis=require(_0x0a90('0x5'));var db=require(_0x0a90('0x6'))['db'];var utils=require(_0x0a90('0x7'));var logger=require(_0x0a90('0x8'))('rpc');var config=require(_0x0a90('0x9'));var jayson=require(_0x0a90('0xa'));var client=jayson[_0x0a90('0xb')][_0x0a90('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dcfeb,_0xd10e92,_0x34a70f){return new BPromise(function(_0x38bac4,_0x432d6d){return client[_0x0a90('0xd')](_0x2dcfeb,_0x34a70f)[_0x0a90('0xe')](function(_0x121dae){logger[_0x0a90('0xf')](_0x0a90('0x10'),_0xd10e92,_0x0a90('0x11'));logger[_0x0a90('0x12')](_0x0a90('0x13'),_0xd10e92,_0x0a90('0x11'),JSON[_0x0a90('0x14')](_0x121dae));if(_0x121dae[_0x0a90('0x15')]){if(_0x121dae[_0x0a90('0x15')][_0x0a90('0x16')]===0x1f4){logger[_0x0a90('0x15')](_0x0a90('0x10'),_0xd10e92,_0x121dae[_0x0a90('0x15')][_0x0a90('0x17')]);return _0x432d6d(_0x121dae[_0x0a90('0x15')]['message']);}logger[_0x0a90('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0xd10e92,_0x121dae[_0x0a90('0x15')][_0x0a90('0x17')]);return _0x38bac4(_0x121dae[_0x0a90('0x15')][_0x0a90('0x17')]);}else{logger[_0x0a90('0xf')](_0x0a90('0x10'),_0xd10e92,'request\x20sent');_0x38bac4(_0x121dae[_0x0a90('0x18')][_0x0a90('0x17')]);}})[_0x0a90('0x19')](function(_0x1fd98c){logger[_0x0a90('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0xd10e92,_0x1fd98c);_0x432d6d(_0x1fd98c);});});}exports[_0x0a90('0x1a')]=function(_0x5b778e){var _0x4ee9b9=this;return new Promise(function(_0x9a5468,_0x105704){return db[_0x0a90('0x1b')][_0x0a90('0x1c')](_0x5b778e['body'],{'raw':_0x5b778e[_0x0a90('0x1d')]?_0x5b778e[_0x0a90('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x0a90('0xe')](function(_0x3c9c49){logger[_0x0a90('0xf')](_0x0a90('0x1a'),_0x5b778e);logger[_0x0a90('0x12')](_0x0a90('0x1a'),_0x5b778e,JSON['stringify'](_0x3c9c49));_0x9a5468(_0x3c9c49);})[_0x0a90('0x19')](function(_0x4db24c){logger[_0x0a90('0x15')]('CreateVoiceTransferReport',_0x4db24c['message'],_0x5b778e);_0x105704(_0x4ee9b9[_0x0a90('0x15')](0x1f4,_0x4db24c[_0x0a90('0x17')]));});});};