Built motion from commit 85328c08.|2.5.50
[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 _0x3f49=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x3f49,0x11f));var _0x93f4=function(_0x3027cf,_0x4a289d){_0x3027cf=_0x3027cf-0x0;var _0x49773a=_0x3f49[_0x3027cf];return _0x49773a;};'use strict';var _=require(_0x93f4('0x0'));var util=require(_0x93f4('0x1'));var moment=require('moment');var BPromise=require(_0x93f4('0x2'));var rs=require(_0x93f4('0x3'));var fs=require('fs');var Redis=require(_0x93f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x93f4('0x5'));var logger=require(_0x93f4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x93f4('0x7'));var client=jayson[_0x93f4('0x8')][_0x93f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a86ad,_0x956b50,_0x5d22d9){return new BPromise(function(_0x144f31,_0x5e5b4d){return client[_0x93f4('0xa')](_0x5a86ad,_0x5d22d9)[_0x93f4('0xb')](function(_0x325984){logger[_0x93f4('0xc')](_0x93f4('0xd'),_0x956b50,_0x93f4('0xe'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x956b50,_0x93f4('0xe'),JSON[_0x93f4('0xf')](_0x325984));if(_0x325984[_0x93f4('0x10')]){if(_0x325984[_0x93f4('0x10')][_0x93f4('0x11')]===0x1f4){logger[_0x93f4('0x10')](_0x93f4('0xd'),_0x956b50,_0x325984[_0x93f4('0x10')]['message']);return _0x5e5b4d(_0x325984[_0x93f4('0x10')]['message']);}logger['error'](_0x93f4('0xd'),_0x956b50,_0x325984[_0x93f4('0x10')][_0x93f4('0x12')]);return _0x144f31(_0x325984['error']['message']);}else{logger[_0x93f4('0xc')](_0x93f4('0xd'),_0x956b50,_0x93f4('0xe'));_0x144f31(_0x325984['result'][_0x93f4('0x12')]);}})[_0x93f4('0x13')](function(_0x53151e){logger[_0x93f4('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x956b50,_0x53151e);_0x5e5b4d(_0x53151e);});});}