Built motion from commit 0900f080.|2.5.45
[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 _0xb1c5=['code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x41b313,_0x6862cd){var _0x5c332e=function(_0x34722f){while(--_0x34722f){_0x41b313['push'](_0x41b313['shift']());}};_0x5c332e(++_0x6862cd);}(_0xb1c5,0x68));var _0x5b1c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb1c5[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x5b1c('0x0'));var moment=require(_0x5b1c('0x1'));var BPromise=require(_0x5b1c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b1c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b1c('0x4'));var logger=require(_0x5b1c('0x5'))(_0x5b1c('0x6'));var config=require(_0x5b1c('0x7'));var jayson=require(_0x5b1c('0x8'));var client=jayson[_0x5b1c('0x9')][_0x5b1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ea392,_0x4cb405,_0x581e06){return new BPromise(function(_0x3e4057,_0xfa8c14){return client['request'](_0x3ea392,_0x581e06)['then'](function(_0x205682){logger[_0x5b1c('0xb')](_0x5b1c('0xc'),_0x4cb405,'request\x20sent');logger['debug'](_0x5b1c('0xd'),_0x4cb405,_0x5b1c('0xe'),JSON['stringify'](_0x205682));if(_0x205682[_0x5b1c('0xf')]){if(_0x205682[_0x5b1c('0xf')][_0x5b1c('0x10')]===0x1f4){logger[_0x5b1c('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4cb405,_0x205682[_0x5b1c('0xf')]['message']);return _0xfa8c14(_0x205682[_0x5b1c('0xf')][_0x5b1c('0x11')]);}logger[_0x5b1c('0xf')](_0x5b1c('0xc'),_0x4cb405,_0x205682['error'][_0x5b1c('0x11')]);return _0x3e4057(_0x205682[_0x5b1c('0xf')]['message']);}else{logger[_0x5b1c('0xb')](_0x5b1c('0xc'),_0x4cb405,_0x5b1c('0xe'));_0x3e4057(_0x205682[_0x5b1c('0x12')][_0x5b1c('0x11')]);}})[_0x5b1c('0x13')](function(_0x4b2ea3){logger[_0x5b1c('0xf')](_0x5b1c('0xc'),_0x4cb405,_0x4b2ea3);_0xfa8c14(_0x4b2ea3);});});}