Built motion from commit f7863d46.|2.5.41
[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 _0x12aa=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x55fbde,_0x5545fd){var _0x3f00d6=function(_0x306dfc){while(--_0x306dfc){_0x55fbde['push'](_0x55fbde['shift']());}};_0x3f00d6(++_0x5545fd);}(_0x12aa,0x1a0));var _0xa12a=function(_0x315f55,_0x2f6f44){_0x315f55=_0x315f55-0x0;var _0x42d002=_0x12aa[_0x315f55];return _0x42d002;};'use strict';var _=require(_0xa12a('0x0'));var util=require(_0xa12a('0x1'));var moment=require('moment');var BPromise=require(_0xa12a('0x2'));var rs=require(_0xa12a('0x3'));var fs=require('fs');var Redis=require(_0xa12a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa12a('0x5'));var logger=require(_0xa12a('0x6'))('rpc');var config=require(_0xa12a('0x7'));var jayson=require(_0xa12a('0x8'));var client=jayson[_0xa12a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf785c7,_0x261987,_0xfc8356){return new BPromise(function(_0x5a6901,_0x365fa5){return client[_0xa12a('0xa')](_0xf785c7,_0xfc8356)[_0xa12a('0xb')](function(_0x30d8e6){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x261987,_0xa12a('0xc'));logger[_0xa12a('0xd')](_0xa12a('0xe'),_0x261987,_0xa12a('0xc'),JSON[_0xa12a('0xf')](_0x30d8e6));if(_0x30d8e6['error']){if(_0x30d8e6[_0xa12a('0x10')]['code']===0x1f4){logger[_0xa12a('0x10')](_0xa12a('0x11'),_0x261987,_0x30d8e6[_0xa12a('0x10')]['message']);return _0x365fa5(_0x30d8e6[_0xa12a('0x10')][_0xa12a('0x12')]);}logger[_0xa12a('0x10')](_0xa12a('0x11'),_0x261987,_0x30d8e6['error'][_0xa12a('0x12')]);return _0x5a6901(_0x30d8e6[_0xa12a('0x10')]['message']);}else{logger[_0xa12a('0x13')](_0xa12a('0x11'),_0x261987,_0xa12a('0xc'));_0x5a6901(_0x30d8e6[_0xa12a('0x14')]['message']);}})[_0xa12a('0x15')](function(_0x28bdbe){logger['error'](_0xa12a('0x11'),_0x261987,_0x28bdbe);_0x365fa5(_0x28bdbe);});});}