summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-04-10 19:55:39 +0000
committerOlle Johansson <oej@edvina.net>2006-04-10 19:55:39 +0000
commit8b1543974f2f568a5462afcf838d7ad382b95284 (patch)
treef61b285a0a049d359696d5c19bac5384af79f6fa /channels/chan_sip.c
parent70e407c5bedda9f3814190828b630967bcc88a18 (diff)
Resolve conflicts, prepare for next batch of conflicts
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4df8cab40..8539dd61b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9990,51 +9990,53 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
}
}
- } else if (sipmethod == SIP_INVITE) {
+ } else if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, ignore, seqno);
- } else if (sipmethod == SIP_REGISTER) {
+ else if (sipmethod == SIP_REGISTER)
res = handle_response_register(p, resp, rest, req, ignore, seqno);
- }
break;
case 202: /* Transfer accepted */
if (sipmethod == SIP_REFER)
handle_response_refer(p, resp, rest, req, ignore, seqno);
break;
case 401: /* Not www-authorized on SIP method */
- if (sipmethod == SIP_INVITE) {
+ if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, ignore, seqno);
- } else if (sipmethod == SIP_REFER) {
+ else if (sipmethod == SIP_REFER)
handle_response_refer(p, resp, rest, req, ignore, seqno);
- } else if (p->registry && sipmethod == SIP_REGISTER) {
+ else if (p->registry && sipmethod == SIP_REGISTER)
res = handle_response_register(p, resp, rest, req, ignore, seqno);
- } else {
+ else {
ast_log(LOG_WARNING, "Got authentication request (401) on unknown %s to '%s'\n", sip_methods[sipmethod].text, get_header(req, "To"));
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
}
break;
case 403: /* Forbidden - we failed authentication */
- if (sipmethod == SIP_INVITE) {
+ if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, ignore, seqno);
- } else if (p->registry && sipmethod == SIP_REGISTER) {
+ else if (p->registry && sipmethod == SIP_REGISTER)
res = handle_response_register(p, resp, rest, req, ignore, seqno);
- } else {
- ast_log(LOG_WARNING, "Forbidden - wrong password on authentication for %s\n", msg);
+ else {
+ ast_log(LOG_WARNING, "Forbidden - maybe wrong password on authentication for %s\n", msg);
+ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
}
break;
case 404: /* Not found */
- if (p->registry && sipmethod == SIP_REGISTER) {
+ if (p->registry && sipmethod == SIP_REGISTER)
res = handle_response_register(p, resp, rest, req, ignore, seqno);
- } else if (sipmethod == SIP_INVITE) {
+ else if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, ignore, seqno);
- } else if (owner)
+ else if (owner)
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
break;
case 407: /* Proxy auth required */
- if (sipmethod == SIP_INVITE) {
+ if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, ignore, seqno);
- } else if (sipmethod == SIP_REFER) {
+ else if (sipmethod == SIP_REFER)
handle_response_refer(p, resp, rest, req, ignore, seqno);
- } else if (sipmethod == SIP_BYE) {
+ else if (p->registry && sipmethod == SIP_REGISTER)
+ res = handle_response_register(p, resp, rest, req, ignore, seqno);
+ else if (sipmethod == SIP_BYE) {
if (ast_strlen_zero(p->authname))
ast_log(LOG_WARNING, "Asked to authenticate %s, to %s:%d but we have no matching peer!\n",
msg, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr), ntohs(p->recv.sin_port));
@@ -10043,24 +10045,24 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
ast_log(LOG_NOTICE, "Failed to authenticate on %s to '%s'\n", msg, get_header(&p->initreq, "From"));
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
}
- } else if (p->registry && sipmethod == SIP_REGISTER) {
- res = handle_response_register(p, resp, rest, req, ignore, seqno);
} else /* We can't handle this, giving up in a bad way */
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
break;
case 491: /* Pending */
- if (sipmethod == SIP_INVITE) {
+ if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, ignore, seqno);
- } else {
+ else {
ast_log(LOG_DEBUG, "Got 491 on %s, unspported. Call ID %s\n", sip_methods[sipmethod].text, p->callid);
+ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
}
+ break;
case 501: /* Not Implemented */
- if (sipmethod == SIP_INVITE) {
+ if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, ignore, seqno);
- } else if (sipmethod == SIP_REFER) {
+ else if (sipmethod == SIP_REFER)
handle_response_refer(p, resp, rest, req, ignore, seqno);
- } else
+ else
ast_log(LOG_WARNING, "Host '%s' does not implement '%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), p->sa.sin_addr), msg);
break;
case 603: /* Declined transfer */