--- chan_sip.c_v1-0 2005-03-14 08:39:12.000000000 -0500 +++ chan_sip.c_fix2 2005-03-14 08:57:02.000000000 -0500 @@ -11,6 +11,7 @@ * the GNU General Public License */ +#define DUAL_PORT_GATEWAY_CALLID_BUG #include #include @@ -4890,7 +4891,6 @@ ast_log(LOG_NOTICE, "Peer '%s' is trying to register, but not configured as host=dynamic\n", peer->name); } else { p->nat = peer->nat; - transmit_response(p, "100 Trying", req); if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), peer->name, peer->secret, peer->md5secret, "REGISTER", uri, 0, ignore))) { sip_cancel_destroy(p); if (parse_contact(p, peer, req)) { @@ -4930,6 +4930,7 @@ ast_device_state_changed("SIP/%s", peer->name); } if (res < 0) + /* this is complete rubbish too, should be 401 with new nonce*/ transmit_response(p, "403 Forbidden", &p->initreq); if (peer && peer->temponly) { if (peer->ha) { @@ -7701,7 +7702,12 @@ } /* Destroy the session, but keep us around for just a bit in case they don't get our 200 OK */ - sip_scheddestroy(p, 15*1000); +#ifdef DUAL_PORT_GATEWAY_CALLID_BUG + /* sacrificing retrans opportunity in exchange */ + sip_destroy(p); +#else + sip_scheddestroy(p, 15*1000); +#endif } } else if (!strcasecmp(cmd, "ACK")) { /* Make sure we don't ignore this */