dd5a387f54ad997da7a002878540562251bbfb9a
[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 _0x5001=['request\x20sent','debug','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5001,0x15a));var _0x1500=function(_0x382bca,_0xad2205){_0x382bca=_0x382bca-0x0;var _0x3bf371=_0x5001[_0x382bca];return _0x3bf371;};'use strict';var _=require(_0x1500('0x0'));var util=require('util');var moment=require(_0x1500('0x1'));var BPromise=require(_0x1500('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1500('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1500('0x4'));var logger=require(_0x1500('0x5'))(_0x1500('0x6'));var config=require(_0x1500('0x7'));var jayson=require(_0x1500('0x8'));var client=jayson[_0x1500('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x472b77,_0x31507c,_0x1e8acd){return new BPromise(function(_0xd2834a,_0x416d28){return client[_0x1500('0xa')](_0x472b77,_0x1e8acd)[_0x1500('0xb')](function(_0x3b19f4){logger[_0x1500('0xc')](_0x1500('0xd'),_0x31507c,_0x1500('0xe'));logger[_0x1500('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x31507c,'request\x20sent',JSON['stringify'](_0x3b19f4));if(_0x3b19f4[_0x1500('0x10')]){if(_0x3b19f4['error'][_0x1500('0x11')]===0x1f4){logger['error'](_0x1500('0xd'),_0x31507c,_0x3b19f4[_0x1500('0x10')]['message']);return _0x416d28(_0x3b19f4[_0x1500('0x10')][_0x1500('0x12')]);}logger[_0x1500('0x10')](_0x1500('0xd'),_0x31507c,_0x3b19f4[_0x1500('0x10')][_0x1500('0x12')]);return _0xd2834a(_0x3b19f4[_0x1500('0x10')][_0x1500('0x12')]);}else{logger[_0x1500('0xc')](_0x1500('0xd'),_0x31507c,_0x1500('0xe'));_0xd2834a(_0x3b19f4['result'][_0x1500('0x12')]);}})[_0x1500('0x13')](function(_0x4ba8b1){logger[_0x1500('0x10')](_0x1500('0xd'),_0x31507c,_0x4ba8b1);_0x416d28(_0x4ba8b1);});});}