[mod_sofia] Gateways DOWN state introduced a regression: REG gateways in DOWN state could not be killed. NOREG gateways could change state in some conditions. Register and Unregister commands will now error if a gateway is NOREG.

This commit is contained in:
Andrey Volk
2021-03-18 00:53:38 +03:00
parent 9e49a4176b
commit 0059f0cc1b
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -3666,6 +3666,8 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
gateway_ptr->state = REG_STATE_UNREGED;
stream->write_function(stream, "+OK\n");
sofia_reg_release_gateway(gateway_ptr);
} else {
stream->write_function(stream, "-ERR NOREG gateway [%s] can't be registered!\n", gname);
}
} else {
stream->write_function(stream, "Invalid gateway!\n");
@@ -3697,6 +3699,8 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
gateway_ptr->state = REG_STATE_UNREGISTER;
stream->write_function(stream, "+OK\n");
sofia_reg_release_gateway(gateway_ptr);
} else {
stream->write_function(stream, "-ERR NOREG gateway [%s] can't be unregistered!\n", gname);
}
} else {
stream->write_function(stream, "Invalid gateway!\n");