Built motion from commit 19a84241.|2.5.34
[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 _0x2180=['error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2463af,_0x351a8f){var _0x4e41ae=function(_0x16854a){while(--_0x16854a){_0x2463af['push'](_0x2463af['shift']());}};_0x4e41ae(++_0x351a8f);}(_0x2180,0x11b));var _0x0218=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x2180[_0x30f030];return _0xf7614f;};'use strict';var _=require(_0x0218('0x0'));var util=require(_0x0218('0x1'));var moment=require(_0x0218('0x2'));var BPromise=require(_0x0218('0x3'));var rs=require(_0x0218('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0218('0x5'))['db'];var utils=require(_0x0218('0x6'));var logger=require('../../config/logger')(_0x0218('0x7'));var config=require(_0x0218('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0218('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24c603,_0x35fe3c,_0x1b26a7){return new BPromise(function(_0x1b3c5c,_0x384b88){return client[_0x0218('0xa')](_0x24c603,_0x1b26a7)[_0x0218('0xb')](function(_0x4680e4){logger[_0x0218('0xc')](_0x0218('0xd'),_0x35fe3c,_0x0218('0xe'));logger['debug'](_0x0218('0xf'),_0x35fe3c,_0x0218('0xe'),JSON[_0x0218('0x10')](_0x4680e4));if(_0x4680e4[_0x0218('0x11')]){if(_0x4680e4[_0x0218('0x11')]['code']===0x1f4){logger[_0x0218('0x11')](_0x0218('0xd'),_0x35fe3c,_0x4680e4[_0x0218('0x11')]['message']);return _0x384b88(_0x4680e4[_0x0218('0x11')]['message']);}logger[_0x0218('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35fe3c,_0x4680e4[_0x0218('0x11')][_0x0218('0x12')]);return _0x1b3c5c(_0x4680e4[_0x0218('0x11')]['message']);}else{logger[_0x0218('0xc')](_0x0218('0xd'),_0x35fe3c,_0x0218('0xe'));_0x1b3c5c(_0x4680e4['result']['message']);}})[_0x0218('0x13')](function(_0xc1206e){logger[_0x0218('0x11')](_0x0218('0xd'),_0x35fe3c,_0xc1206e);_0x384b88(_0xc1206e);});});}