Built motion from commit 52c8a02d.|2.6.29
[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 _0x0d98=['request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x539040,_0x1398b9){var _0x365a77=function(_0x3ea62e){while(--_0x3ea62e){_0x539040['push'](_0x539040['shift']());}};_0x365a77(++_0x1398b9);}(_0x0d98,0x149));var _0x80d9=function(_0xa4ff0a,_0x32610f){_0xa4ff0a=_0xa4ff0a-0x0;var _0x7d89a6=_0x0d98[_0xa4ff0a];return _0x7d89a6;};'use strict';var _=require(_0x80d9('0x0'));var util=require(_0x80d9('0x1'));var moment=require(_0x80d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80d9('0x3'))['db'];var utils=require(_0x80d9('0x4'));var logger=require(_0x80d9('0x5'))(_0x80d9('0x6'));var config=require('../../config/environment');var jayson=require(_0x80d9('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e5f6b,_0x45f2f1,_0xb8d05){return new BPromise(function(_0x5cc7b7,_0x4f3fe9){return client[_0x80d9('0x8')](_0x5e5f6b,_0xb8d05)[_0x80d9('0x9')](function(_0x4e874d){logger['info'](_0x80d9('0xa'),_0x45f2f1,_0x80d9('0xb'));logger['debug'](_0x80d9('0xc'),_0x45f2f1,_0x80d9('0xb'),JSON[_0x80d9('0xd')](_0x4e874d));if(_0x4e874d[_0x80d9('0xe')]){if(_0x4e874d[_0x80d9('0xe')][_0x80d9('0xf')]===0x1f4){logger['error'](_0x80d9('0xa'),_0x45f2f1,_0x4e874d[_0x80d9('0xe')]['message']);return _0x4f3fe9(_0x4e874d[_0x80d9('0xe')][_0x80d9('0x10')]);}logger[_0x80d9('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x45f2f1,_0x4e874d[_0x80d9('0xe')]['message']);return _0x5cc7b7(_0x4e874d[_0x80d9('0xe')][_0x80d9('0x10')]);}else{logger[_0x80d9('0x11')](_0x80d9('0xa'),_0x45f2f1,'request\x20sent');_0x5cc7b7(_0x4e874d[_0x80d9('0x12')][_0x80d9('0x10')]);}})[_0x80d9('0x13')](function(_0xa8c7e9){logger[_0x80d9('0xe')](_0x80d9('0xa'),_0x45f2f1,_0xa8c7e9);_0x4f3fe9(_0xa8c7e9);});});}