Call moveToChannel callback only if exists
This commit is contained in:
@ -251,7 +251,6 @@ class Asset {
|
||||
}
|
||||
|
||||
_moveToChannel(callback) {
|
||||
console.log('_moveToChannel')
|
||||
Request.post(
|
||||
this.apiEndpoint + '/audio/enter-group/' + this.id + '/' + this.groupId,
|
||||
{
|
||||
@ -277,9 +276,9 @@ class Asset {
|
||||
}
|
||||
));
|
||||
utils.writeLog(`Asset ${this.id} mmonitoring group ${this.groupId}`)
|
||||
return callback();
|
||||
if (callback) return callback();
|
||||
} else {
|
||||
return callback('Cannot send group-monitoring: Hub not connected');
|
||||
if (callback) return callback('Cannot send group-monitoring: Hub not connected');
|
||||
}
|
||||
} else {
|
||||
console.log('_moveToChannel--------------------')
|
||||
@ -376,7 +375,7 @@ class Asset {
|
||||
_makePtt(callback) {
|
||||
// Sending group monitoring before we make PTT()
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user