Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.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 _0xdd6e=['request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x222362,_0x4967cd){var _0x1a3039=function(_0x196d32){while(--_0x196d32){_0x222362['push'](_0x222362['shift']());}};_0x1a3039(++_0x4967cd);}(_0xdd6e,0xa5));var _0xedd6=function(_0x5c59d7,_0x178512){_0x5c59d7=_0x5c59d7-0x0;var _0x20b059=_0xdd6e[_0x5c59d7];return _0x20b059;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var moment=require(_0xedd6('0x2'));var BPromise=require(_0xedd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedd6('0x4'));var db=require(_0xedd6('0x5'))['db'];var utils=require(_0xedd6('0x6'));var logger=require(_0xedd6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xedd6('0x8')][_0xedd6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5300a5,_0x135950,_0x30d933){return new BPromise(function(_0x15f317,_0x29743a){return client[_0xedd6('0xa')](_0x5300a5,_0x30d933)['then'](function(_0x4c282c){logger[_0xedd6('0xb')](_0xedd6('0xc'),_0x135950,'request\x20sent');logger[_0xedd6('0xd')](_0xedd6('0xe'),_0x135950,_0xedd6('0xf'),JSON[_0xedd6('0x10')](_0x4c282c));if(_0x4c282c['error']){if(_0x4c282c[_0xedd6('0x11')]['code']===0x1f4){logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);return _0x29743a(_0x4c282c['error'][_0xedd6('0x12')]);}logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);return _0x15f317(_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);}else{logger[_0xedd6('0xb')](_0xedd6('0xc'),_0x135950,_0xedd6('0xf'));_0x15f317(_0x4c282c[_0xedd6('0x13')][_0xedd6('0x12')]);}})['catch'](function(_0x278c18){logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x278c18);_0x29743a(_0x278c18);});});}