Built motion from commit 3c2ce842.|2.6.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 _0x9ff7=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','catch'];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0x9ff7,0x8c));var _0x79ff=function(_0x34b827,_0x3a91e0){_0x34b827=_0x34b827-0x0;var _0x27b2a5=_0x9ff7[_0x34b827];return _0x27b2a5;};'use strict';var _=require(_0x79ff('0x0'));var util=require(_0x79ff('0x1'));var moment=require('moment');var BPromise=require(_0x79ff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79ff('0x3'));var db=require(_0x79ff('0x4'))['db'];var utils=require(_0x79ff('0x5'));var logger=require(_0x79ff('0x6'))(_0x79ff('0x7'));var config=require(_0x79ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x79ff('0x9')][_0x79ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f8f8c,_0x5583e1,_0x16a050){return new BPromise(function(_0x5e6846,_0x25a9db){return client[_0x79ff('0xb')](_0x4f8f8c,_0x16a050)['then'](function(_0x47956e){logger[_0x79ff('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5583e1,_0x79ff('0xd'));logger[_0x79ff('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5583e1,_0x79ff('0xd'),JSON['stringify'](_0x47956e));if(_0x47956e[_0x79ff('0xf')]){if(_0x47956e[_0x79ff('0xf')][_0x79ff('0x10')]===0x1f4){logger[_0x79ff('0xf')](_0x79ff('0x11'),_0x5583e1,_0x47956e[_0x79ff('0xf')][_0x79ff('0x12')]);return _0x25a9db(_0x47956e[_0x79ff('0xf')][_0x79ff('0x12')]);}logger['error'](_0x79ff('0x11'),_0x5583e1,_0x47956e[_0x79ff('0xf')][_0x79ff('0x12')]);return _0x5e6846(_0x47956e[_0x79ff('0xf')][_0x79ff('0x12')]);}else{logger[_0x79ff('0xc')](_0x79ff('0x11'),_0x5583e1,_0x79ff('0xd'));_0x5e6846(_0x47956e['result'][_0x79ff('0x12')]);}})[_0x79ff('0x13')](function(_0x5851fd){logger[_0x79ff('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5583e1,_0x5851fd);_0x25a9db(_0x5851fd);});});}