Built motion from commit 0900f080.|2.5.45
[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 _0xcf84=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xcf84,0x175));var _0x4cf8=function(_0x2cf733,_0x194b88){_0x2cf733=_0x2cf733-0x0;var _0x57d504=_0xcf84[_0x2cf733];return _0x57d504;};'use strict';var _=require(_0x4cf8('0x0'));var util=require(_0x4cf8('0x1'));var moment=require(_0x4cf8('0x2'));var BPromise=require(_0x4cf8('0x3'));var rs=require(_0x4cf8('0x4'));var fs=require('fs');var Redis=require(_0x4cf8('0x5'));var db=require(_0x4cf8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cf8('0x7'))('rpc');var config=require(_0x4cf8('0x8'));var jayson=require(_0x4cf8('0x9'));var client=jayson[_0x4cf8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c25ae,_0x2002cc,_0x4755cd){return new BPromise(function(_0x4ea833,_0x2ca70f){return client[_0x4cf8('0xb')](_0x5c25ae,_0x4755cd)[_0x4cf8('0xc')](function(_0x1f490d){logger[_0x4cf8('0xd')](_0x4cf8('0xe'),_0x2002cc,_0x4cf8('0xf'));logger[_0x4cf8('0x10')](_0x4cf8('0x11'),_0x2002cc,'request\x20sent',JSON[_0x4cf8('0x12')](_0x1f490d));if(_0x1f490d[_0x4cf8('0x13')]){if(_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x14')]===0x1f4){logger[_0x4cf8('0x13')](_0x4cf8('0xe'),_0x2002cc,_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x15')]);return _0x2ca70f(_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x15')]);}logger[_0x4cf8('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2002cc,_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x15')]);return _0x4ea833(_0x1f490d['error']['message']);}else{logger[_0x4cf8('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2002cc,_0x4cf8('0xf'));_0x4ea833(_0x1f490d[_0x4cf8('0x16')]['message']);}})['catch'](function(_0x5c556b){logger[_0x4cf8('0x13')](_0x4cf8('0xe'),_0x2002cc,_0x5c556b);_0x2ca70f(_0x5c556b);});});}