Built motion from commit 9d1906d1.|2.5.40
[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 _0xbf94=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x345102,_0x4295a4){var _0x2d177f=function(_0x16c75f){while(--_0x16c75f){_0x345102['push'](_0x345102['shift']());}};_0x2d177f(++_0x4295a4);}(_0xbf94,0x146));var _0x4bf9=function(_0x50a6d5,_0x86aa56){_0x50a6d5=_0x50a6d5-0x0;var _0x53e1aa=_0xbf94[_0x50a6d5];return _0x53e1aa;};'use strict';var _=require(_0x4bf9('0x0'));var util=require(_0x4bf9('0x1'));var moment=require(_0x4bf9('0x2'));var BPromise=require(_0x4bf9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bf9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4bf9('0x5'));var logger=require('../../config/logger')(_0x4bf9('0x6'));var config=require(_0x4bf9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4bf9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6de4b,_0x31e3d5,_0x42283a){return new BPromise(function(_0xd169c1,_0x1da6a2){return client['request'](_0xa6de4b,_0x42283a)[_0x4bf9('0x9')](function(_0x4f0a24){logger[_0x4bf9('0xa')](_0x4bf9('0xb'),_0x31e3d5,_0x4bf9('0xc'));logger['debug'](_0x4bf9('0xd'),_0x31e3d5,'request\x20sent',JSON[_0x4bf9('0xe')](_0x4f0a24));if(_0x4f0a24[_0x4bf9('0xf')]){if(_0x4f0a24[_0x4bf9('0xf')][_0x4bf9('0x10')]===0x1f4){logger[_0x4bf9('0xf')](_0x4bf9('0xb'),_0x31e3d5,_0x4f0a24[_0x4bf9('0xf')]['message']);return _0x1da6a2(_0x4f0a24[_0x4bf9('0xf')][_0x4bf9('0x11')]);}logger[_0x4bf9('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x31e3d5,_0x4f0a24[_0x4bf9('0xf')][_0x4bf9('0x11')]);return _0xd169c1(_0x4f0a24[_0x4bf9('0xf')]['message']);}else{logger[_0x4bf9('0xa')](_0x4bf9('0xb'),_0x31e3d5,_0x4bf9('0xc'));_0xd169c1(_0x4f0a24['result'][_0x4bf9('0x11')]);}})[_0x4bf9('0x12')](function(_0x43a03f){logger[_0x4bf9('0xf')](_0x4bf9('0xb'),_0x31e3d5,_0x43a03f);_0x1da6a2(_0x43a03f);});});}