Call moveToChannel callback only if exists

This commit is contained in:
Sergiu Toma 2022-01-13 17:58:18 +02:00
parent 40f46c7ade
commit cc93d9cdcc
2 changed files with 10 additions and 6 deletions

View File

@ -17,8 +17,8 @@ accept_untrusted_certs = true
[settings] [settings]
max_fails = 3 max_fails = 3
send_voice = true send_voice = true
send_gps = true send_gps = 'true'
send_group_monitoring_before_each_call = false send_group_monitoring_before_each_call = 'true'
gps_report_interval = 10000 # The interval in which the GPS is sent gps_report_interval = 10000 # The interval in which the GPS is sent
gps_lat_start_point = 46.217802 gps_lat_start_point = 46.217802
gps_lng_start_point = 24.776126 gps_lng_start_point = 24.776126
@ -26,6 +26,11 @@ delay_between_clients = 300
testing_duration = 600 # seconds testing_duration = 600 # seconds
[assets] [assets]
#ids = [
# 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502
#]
ids = [ ids = [
5488 5488
] ]

View File

@ -251,7 +251,6 @@ class Asset {
} }
_moveToChannel(callback) { _moveToChannel(callback) {
console.log('_moveToChannel')
Request.post( Request.post(
this.apiEndpoint + '/audio/enter-group/' + this.id + '/' + this.groupId, this.apiEndpoint + '/audio/enter-group/' + this.id + '/' + this.groupId,
{ {
@ -277,9 +276,9 @@ class Asset {
} }
)); ));
utils.writeLog(`Asset ${this.id} mmonitoring group ${this.groupId}`) utils.writeLog(`Asset ${this.id} mmonitoring group ${this.groupId}`)
return callback(); if (callback) return callback();
} else { } else {
return callback('Cannot send group-monitoring: Hub not connected'); if (callback) return callback('Cannot send group-monitoring: Hub not connected');
} }
} else { } else {
console.log('_moveToChannel--------------------') console.log('_moveToChannel--------------------')
@ -376,7 +375,7 @@ class Asset {
_makePtt(callback) { _makePtt(callback) {
// Sending group monitoring before we make PTT() // Sending group monitoring before we make PTT()
// Is used for the HUB load test(_moveToChannel is sent anyway after connecting to murmur-register) // Is used for the HUB load test(_moveToChannel is sent anyway after connecting to murmur-register)
if (this.configs.settings.send_group_monitoring_before_each_call) { if (this.configs.settings.send_group_monitoring_before_each_call == 'true') {
this._moveToChannel(); this._moveToChannel();
} }