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");
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");
free(pkey);
}
- if (gateway_ptr->state == REG_STATE_NOREG) {
+ if (gateway_ptr->state == REG_STATE_NOREG || gateway_ptr->state == REG_STATE_DOWN) {
if (last) {
last->next = gateway_ptr->next;
char *user_via = NULL;
char *register_host = NULL;
- if (!now) {
+ if (!now && ostate != REG_STATE_NOREG) {
gateway_ptr->state = ostate = REG_STATE_UNREGED;
gateway_ptr->expires_str = "0";
}