summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-06-04 19:18:24 +0000
committerOlle Johansson <oej@edvina.net>2006-06-04 19:18:24 +0000
commit043b765bdce63ccf644b60287aeeef101381d471 (patch)
tree77fd6f7170ef13156475106773b6b8af0a942d84
parente97507e8fb74a19c99602687ef5c14e1c945df45 (diff)
Respond to some of Luigis questions...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c47
1 files changed, 2 insertions, 45 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d4f465387..f2eb0f6f6 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11219,7 +11219,8 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
return -1;
} else {
- /* XXX reduce nesting depth */
+ /* Save nesting depth for now, since there might be other events we will
+ support in the future */
/* Handle REFER notifications */
@@ -11319,13 +11320,6 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
transmit_response(p, "200 OK", req);
return res;
};
-
- /* XXX hey, we never reach this code! */
- /* THis could be voicemail notification */
- transmit_response(p, "200 OK", req);
- if (!p->lastinvite)
- ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
- return res;
}
/*! \brief Handle incoming OPTIONS request */
@@ -11603,15 +11597,6 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
/* Skip leading whitespace */
replace_id = ast_skip_blanks(replace_id);
- /* XXX there are several bugs in the code below,
- * because 'ptr' can be NULL so all the dereferences in strcasestr()
- * would cause panics.
- * I think we should do something like the code below, which also has
- * the advantage of not depending on the order of headers.
- * Please test if it works, and in case remove the block in #else / #endif
- */
-#if 1 /* proposed replacement */
-
start = replace_id;
while ( (ptr = strsep(&start, ";")) ) {
ptr = ast_skip_blanks(ptr); /* XXX maybe unnecessary ? */
@@ -11622,34 +11607,6 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
fromtag = strsep(&fromtag, "&"); /* trim what ? */
}
}
-#else /* original code, buggy */
- if ((ptr = strchr(replace_id, ';'))) {
- *ptr = '\0';
- ptr++;
- }
- start = ptr;
-
- to = strcasestr(ptr, "to-tag=");
- if (to) {
- ptr = to + 7;
- totag = ptr;
- if ((to = strchr(ptr, ';')))
- *to = '\0';
- /* XXX this code is also wrong as to can be NULL */
- to++;
- ptr = to;
- }
-
- to = strcasestr(ptr, "from-tag=");
- if (to) {
- ptr = to + 9;
- fromtag = ptr;
- if ((to = strchr(ptr, '&')))
- *to = '\0';
- if ((to = strchr(ptr, ';')))
- *to = '\0';
- }
-#endif
if (sipdebug && option_debug > 3)
ast_log(LOG_DEBUG,"Invite/replaces: Will use Replace-Call-ID : %s Fromtag: %s Totag: %s\n", replace_id, fromtag ? fromtag : "<no from tag>", totag ? totag : "<no to tag>");