Built motion from commit (unavailable).|2.5.4
[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 _0x04b5=['CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw'];(function(_0xce8627,_0x1a8bdf){var _0x146bc8=function(_0x1e3931){while(--_0x1e3931){_0xce8627['push'](_0xce8627['shift']());}};_0x146bc8(++_0x1a8bdf);}(_0x04b5,0x140));var _0x504b=function(_0x131cff,_0x489f20){_0x131cff=_0x131cff-0x0;var _0x3726da=_0x04b5[_0x131cff];return _0x3726da;};'use strict';var _=require(_0x504b('0x0'));var util=require(_0x504b('0x1'));var moment=require(_0x504b('0x2'));var BPromise=require(_0x504b('0x3'));var rs=require(_0x504b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x504b('0x5'))['db'];var utils=require(_0x504b('0x6'));var logger=require(_0x504b('0x7'))(_0x504b('0x8'));var config=require('../../config/environment');var jayson=require(_0x504b('0x9'));var client=jayson[_0x504b('0xa')][_0x504b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b4fc4,_0x430994,_0x555411){return new BPromise(function(_0x486cc2,_0x4ea8f7){return client['request'](_0x5b4fc4,_0x555411)[_0x504b('0xc')](function(_0x44257d){logger[_0x504b('0xd')](_0x504b('0xe'),_0x430994,'request\x20sent');logger['debug'](_0x504b('0xf'),_0x430994,_0x504b('0x10'),JSON[_0x504b('0x11')](_0x44257d));if(_0x44257d[_0x504b('0x12')]){if(_0x44257d['error'][_0x504b('0x13')]===0x1f4){logger[_0x504b('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x430994,_0x44257d[_0x504b('0x12')][_0x504b('0x14')]);return _0x4ea8f7(_0x44257d[_0x504b('0x12')][_0x504b('0x14')]);}logger[_0x504b('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x430994,_0x44257d['error']['message']);return _0x486cc2(_0x44257d['error'][_0x504b('0x14')]);}else{logger[_0x504b('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x430994,_0x504b('0x10'));_0x486cc2(_0x44257d[_0x504b('0x15')][_0x504b('0x14')]);}})[_0x504b('0x16')](function(_0x551bbf){logger[_0x504b('0x12')](_0x504b('0xe'),_0x430994,_0x551bbf);_0x4ea8f7(_0x551bbf);});});}exports['CreateVoiceTransferReport']=function(_0x1229b1){var _0x405062=this;return new Promise(function(_0x4f962e,_0x3a853a){return db[_0x504b('0x17')][_0x504b('0x18')](_0x1229b1[_0x504b('0x19')],{'raw':_0x1229b1['options']?_0x1229b1[_0x504b('0x1a')][_0x504b('0x1b')]===undefined?!![]:![]:!![]})[_0x504b('0xc')](function(_0x239f2a){logger[_0x504b('0xd')](_0x504b('0x1c'),_0x1229b1);logger['debug']('CreateVoiceTransferReport',_0x1229b1,JSON[_0x504b('0x11')](_0x239f2a));_0x4f962e(_0x239f2a);})[_0x504b('0x16')](function(_0x38216e){logger[_0x504b('0x12')]('CreateVoiceTransferReport',_0x38216e[_0x504b('0x14')],_0x1229b1);_0x3a853a(_0x405062['error'](0x1f4,_0x38216e[_0x504b('0x14')]));});});};