Built motion from commit 5b761a7b.|2.5.36
[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 _0xd817=['rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x23863a,_0x5c05c9){var _0x3bb82d=function(_0x21541b){while(--_0x21541b){_0x23863a['push'](_0x23863a['shift']());}};_0x3bb82d(++_0x5c05c9);}(_0xd817,0x12e));var _0x7d81=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xd817[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x7d81('0x0'));var util=require(_0x7d81('0x1'));var moment=require(_0x7d81('0x2'));var BPromise=require(_0x7d81('0x3'));var rs=require(_0x7d81('0x4'));var fs=require('fs');var Redis=require(_0x7d81('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d81('0x6'));var config=require(_0x7d81('0x7'));var jayson=require(_0x7d81('0x8'));var client=jayson[_0x7d81('0x9')][_0x7d81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16ab1a,_0x57f574,_0x278cbe){return new BPromise(function(_0x396112,_0x47079e){return client[_0x7d81('0xb')](_0x16ab1a,_0x278cbe)['then'](function(_0x3784b9){logger[_0x7d81('0xc')](_0x7d81('0xd'),_0x57f574,_0x7d81('0xe'));logger[_0x7d81('0xf')](_0x7d81('0x10'),_0x57f574,_0x7d81('0xe'),JSON[_0x7d81('0x11')](_0x3784b9));if(_0x3784b9[_0x7d81('0x12')]){if(_0x3784b9[_0x7d81('0x12')][_0x7d81('0x13')]===0x1f4){logger[_0x7d81('0x12')](_0x7d81('0xd'),_0x57f574,_0x3784b9[_0x7d81('0x12')]['message']);return _0x47079e(_0x3784b9[_0x7d81('0x12')][_0x7d81('0x14')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x57f574,_0x3784b9['error'][_0x7d81('0x14')]);return _0x396112(_0x3784b9['error'][_0x7d81('0x14')]);}else{logger[_0x7d81('0xc')](_0x7d81('0xd'),_0x57f574,_0x7d81('0xe'));_0x396112(_0x3784b9[_0x7d81('0x15')][_0x7d81('0x14')]);}})['catch'](function(_0x2bdd01){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x57f574,_0x2bdd01);_0x47079e(_0x2bdd01);});});}