aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-09 20:08:04 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-09 20:08:04 +0000
commit7fea0c44e41858adae41d0a9ffeee2d74375aa9e (patch)
tree0509495809755bbcf10dc4d2be642c3691fd2c7c
parentffd9acbf2a7bc7d28bddd32bb497634b9ec8a751 (diff)
Add check_via calls to more request handlers
INFO, NOTIFY, OPTIONS, REFER, and MESSAGE requests were not checking the topmost Via to determine where to send the response. Adding check_via calls to those request handlers solves this. (closes issue #13071) Reported by: baron Patches: check_via.patch uploaded by baron (license 531) Tested by: baron git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168128 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5d8ed871f..ec9220e38 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11332,6 +11332,7 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
unsigned int event;
const char *c = get_header(req, "Content-Type");
+ check_via(p, req);
/* Need to check the media/type */
if (!strcasecmp(c, "application/dtmf-relay") ||
!strcasecmp(c, "application/vnd.nortelnetworks.digits")) {
@@ -13580,6 +13581,7 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
char *eventid = NULL;
char *sep;
+ check_via(p, req);
if( (sep = strchr(event, ';')) ) { /* XXX bug here - overwriting string ? */
*sep++ = '\0';
eventid = sep;
@@ -13707,7 +13709,7 @@ static int handle_request_options(struct sip_pvt *p, struct sip_request *req)
{
int res;
-
+ check_via(p, req);
/* XXX Should we authenticate OPTIONS? XXX */
if (p->lastinvite) {
@@ -14903,6 +14905,7 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
int res = 0;
+ check_via(p, req);
if (ast_test_flag(req, SIP_PKT_DEBUG))
ast_verbose("Call %s got a SIP call transfer from %s: (REFER)!\n", p->callid, ast_test_flag(&p->flags[0], SIP_OUTGOING) ? "callee" : "caller");
@@ -15353,6 +15356,7 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req)
static int handle_request_message(struct sip_pvt *p, struct sip_request *req)
{
if (!ast_test_flag(req, SIP_PKT_IGNORE)) {
+ check_via(p, req);
if (ast_test_flag(req, SIP_PKT_DEBUG))
ast_verbose("Receiving message!\n");
receive_message(p, req);