diff --git a/channels/chan_sip.c b/channels/chan_sip.c index bbd238aa61..30fdf32e53 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10712,6 +10712,7 @@ static int sip_reg_timeout(const void *data) r->call = dialog_unref(r->call, "unrefing r->call"); } /* If we have a limit, stop registration and give up */ + r->timeout = -1; if (global_regattempts_max && r->regattempts > global_regattempts_max) { /* Ok, enough is enough. Don't try any more */ /* We could add an external notification here... @@ -10720,7 +10721,6 @@ static int sip_reg_timeout(const void *data) r->regstate = REG_STATE_FAILED; } else { r->regstate = REG_STATE_UNREGISTERED; - r->timeout = -1; res=transmit_register(r, SIP_REGISTER, NULL, NULL); } manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));