Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / teamVoiceQueue / teamVoiceQueue.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 _0x35a2=['../../config/environment','jayson/promise','client','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x35a2,0x1ed));var _0x235a=function(_0x493f77,_0x4fd20f){_0x493f77=_0x493f77-0x0;var _0xedac33=_0x35a2[_0x493f77];return _0xedac33;};'use strict';var _=require(_0x235a('0x0'));var util=require(_0x235a('0x1'));var moment=require('moment');var BPromise=require(_0x235a('0x2'));var rs=require(_0x235a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x235a('0x4'))['db'];var utils=require(_0x235a('0x5'));var logger=require(_0x235a('0x6'))('rpc');var config=require(_0x235a('0x7'));var jayson=require(_0x235a('0x8'));var client=jayson[_0x235a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x753f24,_0x4c7778,_0x31ef39){return new BPromise(function(_0xa3ee5a,_0x14e3d5){return client['request'](_0x753f24,_0x31ef39)[_0x235a('0xa')](function(_0x349f07){logger[_0x235a('0xb')](_0x235a('0xc'),_0x4c7778,_0x235a('0xd'));logger[_0x235a('0xe')](_0x235a('0xf'),_0x4c7778,_0x235a('0xd'),JSON['stringify'](_0x349f07));if(_0x349f07[_0x235a('0x10')]){if(_0x349f07[_0x235a('0x10')][_0x235a('0x11')]===0x1f4){logger['error'](_0x235a('0xc'),_0x4c7778,_0x349f07[_0x235a('0x10')][_0x235a('0x12')]);return _0x14e3d5(_0x349f07['error'][_0x235a('0x12')]);}logger['error'](_0x235a('0xc'),_0x4c7778,_0x349f07['error']['message']);return _0xa3ee5a(_0x349f07['error']['message']);}else{logger[_0x235a('0xb')](_0x235a('0xc'),_0x4c7778,_0x235a('0xd'));_0xa3ee5a(_0x349f07[_0x235a('0x13')][_0x235a('0x12')]);}})['catch'](function(_0x1d812d){logger[_0x235a('0x10')](_0x235a('0xc'),_0x4c7778,_0x1d812d);_0x14e3d5(_0x1d812d);});});}