Index: channels/chan_sip.c =================================================================== --- a/channels/chan_sip.c (Revision 291226) +++ b/channels/chan_sip.c (Arbeitskopie) @@ -18329,8 +18329,6 @@ if (r->call) r->call = dialog_unref(r->call, "unsetting registry->call pointer-- case 200"); p->registry = registry_unref(p->registry, "unref registry entry p->registry"); - /* Let this one hang around until we have all the responses */ - sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); /* p->needdestroy = 1; */ /* set us up for re-registering @@ -18374,6 +18372,8 @@ expires_ms -= EXPIRY_GUARD_SECS * 1000; if (sipdebug) ast_log(LOG_NOTICE, "Outbound Registration: Expiry for %s is %d sec (Scheduling reregistration in %d s)\n", r->hostname, expires, expires_ms/1000); + /* Let this one hang around until we have all the responses */ + sip_scheddestroy(p, (expires_ms > ((p->timer_t1 != 0) ? p->timer_t1 : global_t1) * 64) ? DEFAULT_TRANS_TIMEOUT : (expires_ms - 1000)); r->refresh= (int) expires_ms / 1000;