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 _0x8ccb=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','TeamVoiceQueue,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring'];(function(_0x4d993a,_0x150d3c){var _0x5a004e=function(_0x2e3abc){while(--_0x2e3abc){_0x4d993a['push'](_0x4d993a['shift']());}};_0x5a004e(++_0x150d3c);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x4ea6af,_0x4aa32e){_0x4ea6af=_0x4ea6af-0x0;var _0x4cb1e6=_0x8ccb[_0x4ea6af];return _0x4cb1e6;};'use strict';var _=require(_0xb8cc('0x0'));var util=require(_0xb8cc('0x1'));var moment=require('moment');var BPromise=require(_0xb8cc('0x2'));var rs=require(_0xb8cc('0x3'));var fs=require('fs');var Redis=require(_0xb8cc('0x4'));var db=require(_0xb8cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb8cc('0x6'));var config=require(_0xb8cc('0x7'));var jayson=require(_0xb8cc('0x8'));var client=jayson['client'][_0xb8cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x349552,_0x139945,_0x56951f){return new BPromise(function(_0x35c86d,_0x2c338f){return client[_0xb8cc('0xa')](_0x349552,_0x56951f)['then'](function(_0x175473){logger[_0xb8cc('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x139945,'request\x20sent');logger[_0xb8cc('0xc')](_0xb8cc('0xd'),_0x139945,'request\x20sent',JSON['stringify'](_0x175473));if(_0x175473[_0xb8cc('0xe')]){if(_0x175473[_0xb8cc('0xe')]['code']===0x1f4){logger[_0xb8cc('0xe')](_0xb8cc('0xf'),_0x139945,_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);return _0x2c338f(_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);}logger[_0xb8cc('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x139945,_0x175473[_0xb8cc('0xe')]['message']);return _0x35c86d(_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);}else{logger[_0xb8cc('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x139945,_0xb8cc('0x11'));_0x35c86d(_0x175473[_0xb8cc('0x12')][_0xb8cc('0x10')]);}})['catch'](function(_0x2ba498){logger['error'](_0xb8cc('0xf'),_0x139945,_0x2ba498);_0x2c338f(_0x2ba498);});});}