Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.814 diff -u -r1.814 chan_sip.c --- channels/chan_sip.c 23 Aug 2005 17:59:26 -0000 1.814 +++ channels/chan_sip.c 24 Aug 2005 17:50:25 -0000 @@ -1096,7 +1096,8 @@ } /* Too many retries */ if (pkt->owner && pkt->method != SIP_OPTIONS) { - ast_log(LOG_WARNING, "Maximum retries exceeded on call %s for seqno %d (%s %s)\n", pkt->owner->callid, pkt->seqno, (ast_test_flag(pkt, FLAG_FATAL)) ? "Critical" : "Non-critical", (ast_test_flag(pkt, FLAG_RESPONSE)) ? "Response" : "Request"); + if (ast_test_flag(pkt, FLAG_FATAL) || sipdebug) /* Tell us if it's critical or if we're debugging */ + ast_log(LOG_WARNING, "Maximum retries exceeded on call %s for seqno %d (%s %s)\n", pkt->owner->callid, pkt->seqno, (ast_test_flag(pkt, FLAG_FATAL)) ? "Critical" : "Non-critical", (ast_test_flag(pkt, FLAG_RESPONSE)) ? "Response" : "Request"); } else { if (pkt->method == SIP_OPTIONS && sipdebug) ast_log(LOG_WARNING, "Cancelling retransmit of OPTIONs (call id %s) \n", pkt->owner->callid); @@ -5747,6 +5748,7 @@ char iabuf[INET_ADDRSTRLEN]; char *name, *c; char *t; + /* Terminate URI */ t = uri; while(*t && (*t > 32) && (*t != ';')) @@ -5779,7 +5781,7 @@ } if (peer) { if (!ast_test_flag(peer, SIP_DYNAMIC)) { - ast_log(LOG_NOTICE, "Peer '%s' is trying to register, but not configured as host=dynamic\n", peer->name); + ast_log(LOG_ERROR, "Peer '%s' is trying to register, but not configured as host=dynamic\n", peer->name); } else { ast_copy_flags(p, peer, SIP_NAT); transmit_response(p, "100 Trying", req); @@ -8230,7 +8232,8 @@ username = auth->username; secret = auth->secret; md5secret = auth->md5secret; - ast_log(LOG_NOTICE,"Using realm %s authentication for this call\n", p->realm); + if (sipdebug) + ast_log(LOG_DEBUG,"Using realm %s authentication for call %s\n", p->realm, p->callid); } else { /* No authentication, use peer or register= config */ username = p->authname; @@ -9805,23 +9808,15 @@ copy_request(&p->initreq, req); check_via(p, req); if ((res = register_verify(p, sin, req, e, ignore)) < 0) - ast_log(LOG_NOTICE, "Registration from '%s' failed for '%s'\n", get_header(req, "To"), ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr)); + ast_log(LOG_NOTICE, "Registration from '%s' failed for '%s' - %s\n", get_header(req, "To"), ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), (res == -1) ? "Wrong password" : "Username/auth name mismatch"); if (res < 1) { - /* Go ahead and free RTP port */ - if (p->rtp && !p->owner) { - ast_rtp_destroy(p->rtp); - p->rtp = NULL; - } - if (p->vrtp && !p->owner) { - ast_rtp_destroy(p->vrtp); - p->vrtp = NULL; - } /* 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); } return res; } + /*--- handle_request: Handle SIP requests (methods) ---*/ /* this is where all incoming requests go first */ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock)