Built motion from commit 9d7072cc.|2.5.39
[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 _0x92a2=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','then'];(function(_0x55bfe5,_0x572fd9){var _0x3932fc=function(_0x1be700){while(--_0x1be700){_0x55bfe5['push'](_0x55bfe5['shift']());}};_0x3932fc(++_0x572fd9);}(_0x92a2,0x1ee));var _0x292a=function(_0x5177bf,_0x44d5eb){_0x5177bf=_0x5177bf-0x0;var _0x6c117d=_0x92a2[_0x5177bf];return _0x6c117d;};'use strict';var _=require(_0x292a('0x0'));var util=require(_0x292a('0x1'));var moment=require(_0x292a('0x2'));var BPromise=require(_0x292a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x292a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x292a('0x5'));var logger=require(_0x292a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x292a('0x7'));var client=jayson[_0x292a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b7ec3,_0xde082c,_0x41f1f0){return new BPromise(function(_0x3e5c02,_0x419de4){return client['request'](_0x3b7ec3,_0x41f1f0)[_0x292a('0x9')](function(_0x1beb9d){logger['info'](_0x292a('0xa'),_0xde082c,_0x292a('0xb'));logger['debug'](_0x292a('0xc'),_0xde082c,'request\x20sent',JSON[_0x292a('0xd')](_0x1beb9d));if(_0x1beb9d[_0x292a('0xe')]){if(_0x1beb9d[_0x292a('0xe')][_0x292a('0xf')]===0x1f4){logger[_0x292a('0xe')](_0x292a('0xa'),_0xde082c,_0x1beb9d[_0x292a('0xe')]['message']);return _0x419de4(_0x1beb9d[_0x292a('0xe')][_0x292a('0x10')]);}logger[_0x292a('0xe')](_0x292a('0xa'),_0xde082c,_0x1beb9d[_0x292a('0xe')][_0x292a('0x10')]);return _0x3e5c02(_0x1beb9d['error'][_0x292a('0x10')]);}else{logger['info'](_0x292a('0xa'),_0xde082c,'request\x20sent');_0x3e5c02(_0x1beb9d[_0x292a('0x11')]['message']);}})['catch'](function(_0x3c5b3f){logger[_0x292a('0xe')](_0x292a('0xa'),_0xde082c,_0x3c5b3f);_0x419de4(_0x3c5b3f);});});}