Built motion from commit (unavailable).|2.4.18
[motion2.git] / server / api / voiceDialReport / voiceDialReport.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 _0x2557=['options','raw','UpdateVoiceDialReport','update','body','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x2557,0x11e));var _0x7255=function(_0x445ca7,_0x44f206){_0x445ca7=_0x445ca7-0x0;var _0x3aeb86=_0x2557[_0x445ca7];return _0x3aeb86;};'use strict';var _=require(_0x7255('0x0'));var util=require('util');var moment=require(_0x7255('0x1'));var BPromise=require(_0x7255('0x2'));var rs=require(_0x7255('0x3'));var fs=require('fs');var Redis=require(_0x7255('0x4'));var db=require(_0x7255('0x5'))['db'];var utils=require(_0x7255('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7255('0x7'));var client=jayson[_0x7255('0x8')][_0x7255('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x841417,_0x419dc0,_0x2142a5){return new BPromise(function(_0x5b6aa4,_0x3baa49){return client[_0x7255('0xa')](_0x841417,_0x2142a5)[_0x7255('0xb')](function(_0x5388d5){logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));logger[_0x7255('0xf')](_0x7255('0x10'),_0x419dc0,_0x7255('0xe'),JSON[_0x7255('0x11')](_0x5388d5));if(_0x5388d5['error']){if(_0x5388d5[_0x7255('0x12')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x419dc0,_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);return _0x3baa49(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x5388d5[_0x7255('0x12')]['message']);return _0x5b6aa4(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}else{logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));_0x5b6aa4(_0x5388d5[_0x7255('0x14')][_0x7255('0x13')]);}})[_0x7255('0x15')](function(_0x1dc830){logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x1dc830);_0x3baa49(_0x1dc830);});});}exports[_0x7255('0x16')]=function(_0x19dac1){var _0x2c0cd7=this;return new Promise(function(_0x3db713,_0x33f843){return db[_0x7255('0x17')]['create'](_0x19dac1['body'],{'raw':_0x19dac1[_0x7255('0x18')]?_0x19dac1[_0x7255('0x18')][_0x7255('0x19')]===undefined?!![]:![]:!![]})[_0x7255('0xb')](function(_0x4bff12){logger[_0x7255('0xc')](_0x7255('0x16'),_0x19dac1);logger[_0x7255('0xf')](_0x7255('0x16'),_0x19dac1,JSON[_0x7255('0x11')](_0x4bff12));_0x3db713(_0x4bff12);})[_0x7255('0x15')](function(_0x38f9eb){logger[_0x7255('0x12')]('CreateVoiceDialReport',_0x38f9eb[_0x7255('0x13')],_0x19dac1);_0x33f843(_0x2c0cd7[_0x7255('0x12')](0x1f4,_0x38f9eb[_0x7255('0x13')]));});});};exports[_0x7255('0x1a')]=function(_0x153113){var _0x35dd34=this;return new Promise(function(_0xb518cb,_0x4a62eb){return db[_0x7255('0x17')][_0x7255('0x1b')](_0x153113[_0x7255('0x1c')],{'raw':_0x153113['options']?_0x153113[_0x7255('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153113[_0x7255('0x18')]?_0x153113[_0x7255('0x18')]['where']||null:null,'attributes':_0x153113[_0x7255('0x18')]?_0x153113[_0x7255('0x18')][_0x7255('0x1d')]||null:null,'limit':_0x153113[_0x7255('0x18')]?_0x153113[_0x7255('0x18')][_0x7255('0x1e')]||null:null})['then'](function(_0x4260cb){logger[_0x7255('0xc')]('UpdateVoiceDialReport',_0x153113);logger['debug'](_0x7255('0x1a'),_0x153113,JSON[_0x7255('0x11')](_0x4260cb));_0xb518cb(_0x4260cb);})[_0x7255('0x15')](function(_0x3eeb50){logger[_0x7255('0x12')](_0x7255('0x1a'),_0x3eeb50[_0x7255('0x13')],_0x153113);_0x4a62eb(_0x35dd34[_0x7255('0x12')](0x1f4,_0x3eeb50['message']));});});};