Built motion from commit c116dc8b.|2.6.30
[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 _0x336a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x1d122d,_0xee172e){var _0xd4f10=function(_0x3a4398){while(--_0x3a4398){_0x1d122d['push'](_0x1d122d['shift']());}};_0xd4f10(++_0xee172e);}(_0x336a,0xa3));var _0xa336=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x336a[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xa336('0x0'));var util=require(_0xa336('0x1'));var moment=require(_0xa336('0x2'));var BPromise=require('bluebird');var rs=require(_0xa336('0x3'));var fs=require('fs');var Redis=require(_0xa336('0x4'));var db=require(_0xa336('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa336('0x6'))(_0xa336('0x7'));var config=require(_0xa336('0x8'));var jayson=require(_0xa336('0x9'));var client=jayson[_0xa336('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbec93d,_0x925e4c,_0x1b25de){return new BPromise(function(_0x527ad8,_0x1fdd6e){return client[_0xa336('0xb')](_0xbec93d,_0x1b25de)[_0xa336('0xc')](function(_0x1c7a09){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x925e4c,_0xa336('0xd'));logger[_0xa336('0xe')](_0xa336('0xf'),_0x925e4c,_0xa336('0xd'),JSON[_0xa336('0x10')](_0x1c7a09));if(_0x1c7a09[_0xa336('0x11')]){if(_0x1c7a09[_0xa336('0x11')][_0xa336('0x12')]===0x1f4){logger['error'](_0xa336('0x13'),_0x925e4c,_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);return _0x1fdd6e(_0x1c7a09[_0xa336('0x11')]['message']);}logger['error'](_0xa336('0x13'),_0x925e4c,_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);return _0x527ad8(_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);}else{logger[_0xa336('0x15')](_0xa336('0x13'),_0x925e4c,'request\x20sent');_0x527ad8(_0x1c7a09[_0xa336('0x16')][_0xa336('0x14')]);}})[_0xa336('0x17')](function(_0x4fe949){logger['error'](_0xa336('0x13'),_0x925e4c,_0x4fe949);_0x1fdd6e(_0x4fe949);});});}