Built motion from commit (unavailable).|2.5.27
[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 _0xcea2=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xcea2,0x89));var _0x2cea=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xcea2[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2cea('0x0'));var BPromise=require(_0x2cea('0x1'));var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2cea('0x4'));var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require(_0x2cea('0x8'));var client=jayson[_0x2cea('0x9')][_0x2cea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18bacb,_0x5e3633,_0x4d46d6){return new BPromise(function(_0x204f0f,_0x2787e8){return client[_0x2cea('0xb')](_0x18bacb,_0x4d46d6)[_0x2cea('0xc')](function(_0x26f02d){logger[_0x2cea('0xd')](_0x2cea('0xe'),_0x5e3633,_0x2cea('0xf'));logger[_0x2cea('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5e3633,_0x2cea('0xf'),JSON[_0x2cea('0x11')](_0x26f02d));if(_0x26f02d[_0x2cea('0x12')]){if(_0x26f02d['error'][_0x2cea('0x13')]===0x1f4){logger[_0x2cea('0x12')](_0x2cea('0xe'),_0x5e3633,_0x26f02d[_0x2cea('0x12')][_0x2cea('0x14')]);return _0x2787e8(_0x26f02d[_0x2cea('0x12')]['message']);}logger[_0x2cea('0x12')](_0x2cea('0xe'),_0x5e3633,_0x26f02d[_0x2cea('0x12')][_0x2cea('0x14')]);return _0x204f0f(_0x26f02d[_0x2cea('0x12')][_0x2cea('0x14')]);}else{logger[_0x2cea('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5e3633,_0x2cea('0xf'));_0x204f0f(_0x26f02d[_0x2cea('0x15')][_0x2cea('0x14')]);}})[_0x2cea('0x16')](function(_0x211501){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x5e3633,_0x211501);_0x2787e8(_0x211501);});});}