Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / userVoiceQueue / userVoiceQueue.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 _0xa3cc=['catch','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x5a6cf5,_0x3739d2){var _0x33b214=function(_0x5c8959){while(--_0x5c8959){_0x5a6cf5['push'](_0x5a6cf5['shift']());}};_0x33b214(++_0x3739d2);}(_0xa3cc,0x94));var _0xca3c=function(_0x36bb45,_0x2fd20b){_0x36bb45=_0x36bb45-0x0;var _0x152474=_0xa3cc[_0x36bb45];return _0x152474;};'use strict';var _=require(_0xca3c('0x0'));var util=require(_0xca3c('0x1'));var moment=require(_0xca3c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca3c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xca3c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xca3c('0x5'));var jayson=require(_0xca3c('0x6'));var client=jayson[_0xca3c('0x7')][_0xca3c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b5cb8,_0x33bf33,_0x48128f){return new BPromise(function(_0x4e6a14,_0x260e25){return client[_0xca3c('0x9')](_0x4b5cb8,_0x48128f)[_0xca3c('0xa')](function(_0x4f8930){logger['info'](_0xca3c('0xb'),_0x33bf33,_0xca3c('0xc'));logger[_0xca3c('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x33bf33,_0xca3c('0xc'),JSON[_0xca3c('0xe')](_0x4f8930));if(_0x4f8930['error']){if(_0x4f8930[_0xca3c('0xf')][_0xca3c('0x10')]===0x1f4){logger[_0xca3c('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x33bf33,_0x4f8930['error']['message']);return _0x260e25(_0x4f8930[_0xca3c('0xf')][_0xca3c('0x11')]);}logger[_0xca3c('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x33bf33,_0x4f8930['error'][_0xca3c('0x11')]);return _0x4e6a14(_0x4f8930[_0xca3c('0xf')]['message']);}else{logger[_0xca3c('0x12')](_0xca3c('0xb'),_0x33bf33,_0xca3c('0xc'));_0x4e6a14(_0x4f8930[_0xca3c('0x13')][_0xca3c('0x11')]);}})[_0xca3c('0x14')](function(_0x3d614e){logger[_0xca3c('0xf')](_0xca3c('0xb'),_0x33bf33,_0x3d614e);_0x260e25(_0x3d614e);});});}