Built motion from commit d5e4af8c.|2.6.23
[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 _0x3351=['error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x3351,0x175));var _0x1335=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3351[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x1335('0x0'));var util=require(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1335('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1335('0x4'))(_0x1335('0x5'));var config=require(_0x1335('0x6'));var jayson=require(_0x1335('0x7'));var client=jayson[_0x1335('0x8')][_0x1335('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x387e44,_0x4033f0,_0x1793e6){return new BPromise(function(_0x19c13e,_0x53a9a2){return client[_0x1335('0xa')](_0x387e44,_0x1793e6)[_0x1335('0xb')](function(_0x4ef3a7){logger[_0x1335('0xc')](_0x1335('0xd'),_0x4033f0,'request\x20sent');logger[_0x1335('0xe')](_0x1335('0xf'),_0x4033f0,_0x1335('0x10'),JSON[_0x1335('0x11')](_0x4ef3a7));if(_0x4ef3a7[_0x1335('0x12')]){if(_0x4ef3a7[_0x1335('0x12')][_0x1335('0x13')]===0x1f4){logger[_0x1335('0x12')](_0x1335('0xd'),_0x4033f0,_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);return _0x53a9a2(_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);}logger[_0x1335('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4033f0,_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);return _0x19c13e(_0x4ef3a7[_0x1335('0x12')]['message']);}else{logger[_0x1335('0xc')](_0x1335('0xd'),_0x4033f0,_0x1335('0x10'));_0x19c13e(_0x4ef3a7[_0x1335('0x15')][_0x1335('0x14')]);}})[_0x1335('0x16')](function(_0x2c9a69){logger[_0x1335('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4033f0,_0x2c9a69);_0x53a9a2(_0x2c9a69);});});}