--- channels/chan_sip.c-old 2009-02-12 16:41:20.000000000 -0500 +++ channels/chan_sip.c 2009-03-25 14:53:43.000000000 -0400 @@ -21027,14 +21027,16 @@ if (fullcontact->used > 0) { ast_copy_string(peer->fullcontact, fullcontact->str, sizeof(peer->fullcontact)); peer->rt_fromcontact = TRUE; - /* We have a hostname in the fullcontact, but if we don't have an - * address listed on the entry (or if it's 'dynamic'), then we need to - * parse the entry to obtain the IP address, so a dynamic host can be - * contacted immediately after reload (as opposed to waiting for it to - * register once again). */ - /* XXX May need to revisit the final argument; does the realtime DB store whether - * the original contact was over TLS or not? XXX */ - __set_address_from_contact(fullcontact->str, &peer->addr, 0); + if (!(peer->addr.sin_addr.s_addr && peer->addr.sin_port)) { + /* We have a hostname in the fullcontact, but if we don't have an + * address listed on the entry (or if it's 'dynamic'), then we need to + * parse the entry to obtain the IP address, so a dynamic host can be + * contacted immediately after reload (as opposed to waiting for it to + * register once again). */ + /* XXX May need to revisit the final argument; does the realtime DB store whether + * the original contact was over TLS or not? XXX */ + __set_address_from_contact(fullcontact->str, &peer->addr, 0); + } } if (srvlookup) {