Built motion from commit e1760111.|2.6.18
[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 _0xb1c1=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x574a8f,_0x30e401){var _0x14332c=function(_0x226301){while(--_0x226301){_0x574a8f['push'](_0x574a8f['shift']());}};_0x14332c(++_0x30e401);}(_0xb1c1,0x1c7));var _0x1b1c=function(_0x21a045,_0x49f64f){_0x21a045=_0x21a045-0x0;var _0x40214b=_0xb1c1[_0x21a045];return _0x40214b;};'use strict';var _=require(_0x1b1c('0x0'));var util=require(_0x1b1c('0x1'));var moment=require('moment');var BPromise=require(_0x1b1c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b1c('0x3'));var db=require(_0x1b1c('0x4'))['db'];var utils=require(_0x1b1c('0x5'));var logger=require(_0x1b1c('0x6'))(_0x1b1c('0x7'));var config=require(_0x1b1c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1b1c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2711,_0x3b2b45,_0x377724){return new BPromise(function(_0x3ff7e8,_0x2a394c){return client[_0x1b1c('0xa')](_0x4a2711,_0x377724)['then'](function(_0x1714e7){logger[_0x1b1c('0xb')](_0x1b1c('0xc'),_0x3b2b45,_0x1b1c('0xd'));logger['debug'](_0x1b1c('0xe'),_0x3b2b45,_0x1b1c('0xd'),JSON[_0x1b1c('0xf')](_0x1714e7));if(_0x1714e7[_0x1b1c('0x10')]){if(_0x1714e7['error'][_0x1b1c('0x11')]===0x1f4){logger[_0x1b1c('0x10')](_0x1b1c('0xc'),_0x3b2b45,_0x1714e7[_0x1b1c('0x10')][_0x1b1c('0x12')]);return _0x2a394c(_0x1714e7['error']['message']);}logger['error'](_0x1b1c('0xc'),_0x3b2b45,_0x1714e7['error'][_0x1b1c('0x12')]);return _0x3ff7e8(_0x1714e7[_0x1b1c('0x10')]['message']);}else{logger['info'](_0x1b1c('0xc'),_0x3b2b45,'request\x20sent');_0x3ff7e8(_0x1714e7['result'][_0x1b1c('0x12')]);}})[_0x1b1c('0x13')](function(_0x2b0d09){logger[_0x1b1c('0x10')](_0x1b1c('0xc'),_0x3b2b45,_0x2b0d09);_0x2a394c(_0x2b0d09);});});}