summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-11-12 20:47:25 +0000
committerOlle Johansson <oej@edvina.net>2006-11-12 20:47:25 +0000
commit139bf2b626e9cfb62df00ef6e51a97b7e8c2d9a5 (patch)
tree6ff0ba894b78bb7ade6cca3fff701039eb7d5cc6
parent462407a3a67bafc6bcc94567594bf92f3d5008cf (diff)
Part of patch in #7403 to improve tag checking in pedantic mode (stephen_dredge)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 9a2f83d34..1dd26d953 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4373,6 +4373,19 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
if (option_debug > 4 )
ast_log(LOG_DEBUG, "= Looking for Call ID: %s (Checking %s) --From tag %s --To-tag %s \n", callid, req->method==SIP_RESPONSE ? "To" : "From", fromtag, totag);
+
+ /* All messages must always have From: tag */
+ if (ast_strlen_zero(fromtag)) {
+ if (option_debug > 4 )
+ ast_log(LOG_DEBUG, "%s request has no from tag, dropping callid: %s from: %s\n", sip_methods[req->method].text , callid, from );
+ return NULL;
+ }
+ /* reject requests that must always have a To: tag */
+ if (ast_strlen_zero(totag) && (req->method == SIP_ACK || req->method == SIP_BYE || req->method == SIP_INFO )) {
+ if (option_debug > 4)
+ ast_log(LOG_DEBUG, "%s must have a to tag. dropping callid: %s from: %s\n", sip_methods[req->method].text , callid, from );
+ return NULL;
+ }
}
dialoglist_lock();