Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 311732) +++ channels/chan_sip.c (working copy) @@ -13042,9 +13042,11 @@ /*! \todo We need to save the TRANSPORT here too */ pvt->sa = pvt->recv; return 0; + } else if (!ast_strlen_zero(pvt->fullcontact)) { + return __set_address_from_contact(pvt->fullcontact, &pvt->sa, pvt->socket.type == SIP_TRANSPORT_TLS ? 1 : 0); } - - return __set_address_from_contact(pvt->fullcontact, &pvt->sa, pvt->socket.type == SIP_TRANSPORT_TLS ? 1 : 0); + /* No fullcontact so no new contact address */ + return -1; } /*! \brief Parse contact header and save registration (peer registration) */ @@ -19090,7 +19092,8 @@ if (!reinvite) build_route(p, req, 1); - if(set_address_from_contact(p)) { + /* If a response contains no contact, but we already have a valid host/port, don't bail */ + if(set_address_from_contact(p) && ast_sockaddr_port(&p->sa) == 0) { /* Bad contact - we don't know how to reach this device */ /* We need to ACK, but then send a bye */ if (!p->route && !req->ignore)