Skip to content
Snippets Groups Projects
Commit 88077a4d authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

remove some duplicated code;

fix indentation on one line;
mark XXX some unreachable code;
mark XXX another place where we could reduce the nesting depth.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@31872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 2724885b
No related branches found
No related tags found
No related merge requests found
...@@ -11222,6 +11222,8 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str ...@@ -11222,6 +11222,8 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
return -1; return -1;
} else { } else {
/* XXX reduce nesting depth */
/* Handle REFER notifications */ /* Handle REFER notifications */
   
char buf[1024]; char buf[1024];
...@@ -11321,6 +11323,7 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str ...@@ -11321,6 +11323,7 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
return res; return res;
}; };
   
/* XXX hey, we never reach this code! */
/* THis could be voicemail notification */ /* THis could be voicemail notification */
transmit_response(p, "200 OK", req); transmit_response(p, "200 OK", req);
if (!p->lastinvite) if (!p->lastinvite)
...@@ -11370,7 +11373,7 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in ...@@ -11370,7 +11373,7 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
/* We have no bridge */ /* We have no bridge */
if (!earlyreplace) { if (!earlyreplace) {
if (option_debug > 1) if (option_debug > 1)
ast_log(LOG_DEBUG, " Attended transfer attempted to replace call with no bridge (maybe ringing). Channel %s!\n", replacecall->name); ast_log(LOG_DEBUG, " Attended transfer attempted to replace call with no bridge (maybe ringing). Channel %s!\n", replacecall->name);
oneleggedreplace = 1; oneleggedreplace = 1;
} }
} }
...@@ -11935,20 +11938,19 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int ...@@ -11935,20 +11938,19 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
} }
} else { } else {
if (p && !ast_test_flag(&p->flags[0], SIP_NEEDDESTROY)) { if (p && !ast_test_flag(&p->flags[0], SIP_NEEDDESTROY)) {
if (!p->jointcapability) { const char *msg;
if (ast_test_flag(req, SIP_PKT_IGNORE))
transmit_response(p, "488 Not Acceptable Here (codec error)", req); if (!p->jointcapability)
else msg = "488 Not Acceptable Here (codec error)";
transmit_response_reliable(p, "488 Not Acceptable Here (codec error)", req); else {
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
} else {
ast_log(LOG_NOTICE, "Unable to create/find SIP channel for this INVITE\n"); ast_log(LOG_NOTICE, "Unable to create/find SIP channel for this INVITE\n");
if (ast_test_flag(req, SIP_PKT_IGNORE)) msg = "503 Unavailable";
transmit_response(p, "503 Unavailable", req);
else
transmit_response_reliable(p, "503 Unavailable", req);
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
} }
if (ast_test_flag(req, SIP_PKT_IGNORE))
transmit_response(p, msg, req);
else
transmit_response_reliable(p, msg, req);
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
} }
} }
return res; return res;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment