Built motion from commit (unavailable).|2.5.26
[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 _0xf301=['VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','VoiceTransferReport','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0xf301,0xe6));var _0x1f30=function(_0x2c7984,_0x39d8e6){_0x2c7984=_0x2c7984-0x0;var _0x22d1b5=_0xf301[_0x2c7984];return _0x22d1b5;};'use strict';var _=require(_0x1f30('0x0'));var util=require(_0x1f30('0x1'));var moment=require(_0x1f30('0x2'));var BPromise=require(_0x1f30('0x3'));var rs=require(_0x1f30('0x4'));var fs=require('fs');var Redis=require(_0x1f30('0x5'));var db=require(_0x1f30('0x6'))['db'];var utils=require(_0x1f30('0x7'));var logger=require(_0x1f30('0x8'))(_0x1f30('0x9'));var config=require(_0x1f30('0xa'));var jayson=require(_0x1f30('0xb'));var client=jayson[_0x1f30('0xc')][_0x1f30('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x82a96f,_0x5a705f,_0x1f77a8){return new BPromise(function(_0x43c98d,_0x2b4484){return client[_0x1f30('0xe')](_0x82a96f,_0x1f77a8)[_0x1f30('0xf')](function(_0xbd04ec){logger[_0x1f30('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a705f,'request\x20sent');logger[_0x1f30('0x11')](_0x1f30('0x12'),_0x5a705f,_0x1f30('0x13'),JSON[_0x1f30('0x14')](_0xbd04ec));if(_0xbd04ec[_0x1f30('0x15')]){if(_0xbd04ec[_0x1f30('0x15')]['code']===0x1f4){logger[_0x1f30('0x15')](_0x1f30('0x16'),_0x5a705f,_0xbd04ec['error'][_0x1f30('0x17')]);return _0x2b4484(_0xbd04ec[_0x1f30('0x15')][_0x1f30('0x17')]);}logger[_0x1f30('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a705f,_0xbd04ec['error'][_0x1f30('0x17')]);return _0x43c98d(_0xbd04ec[_0x1f30('0x15')][_0x1f30('0x17')]);}else{logger[_0x1f30('0x10')](_0x1f30('0x16'),_0x5a705f,_0x1f30('0x13'));_0x43c98d(_0xbd04ec[_0x1f30('0x18')][_0x1f30('0x17')]);}})[_0x1f30('0x19')](function(_0x1ca3ab){logger[_0x1f30('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a705f,_0x1ca3ab);_0x2b4484(_0x1ca3ab);});});}exports['CreateVoiceTransferReport']=function(_0x4e56cd){var _0x400732=this;return new Promise(function(_0x5cd250,_0x533225){return db[_0x1f30('0x1a')]['create'](_0x4e56cd[_0x1f30('0x1b')],{'raw':_0x4e56cd[_0x1f30('0x1c')]?_0x4e56cd[_0x1f30('0x1c')][_0x1f30('0x1d')]===undefined?!![]:![]:!![]})[_0x1f30('0xf')](function(_0x59fd32){logger['info']('CreateVoiceTransferReport',_0x4e56cd);logger[_0x1f30('0x11')](_0x1f30('0x1e'),_0x4e56cd,JSON['stringify'](_0x59fd32));_0x5cd250(_0x59fd32);})[_0x1f30('0x19')](function(_0x6a644){logger['error']('CreateVoiceTransferReport',_0x6a644['message'],_0x4e56cd);_0x533225(_0x400732['error'](0x1f4,_0x6a644[_0x1f30('0x17')]));});});};