diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-10 15:51:36 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-10 15:51:36 +0000 |
commit | 3a96d3035f193b234e332add1941d137f82d990f (patch) | |
tree | 3357377b2da02873548299172bdb8ff1e25d908a | |
parent | 70e3b760c274ae030d8f745aff3612aec2752f24 (diff) |
Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
With this change, we make note of Record-Route headers present in any SUBSCRIBE
request that we receive so that our outbound NOTIFY requests will have the proper
Route headers in them.
(closes issue #14725)
Reported by: ibc
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@205775 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index df825e7da..132899f34 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7314,8 +7314,11 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho snprintf(tmp, sizeof(tmp), "%d %s", ++p->ocseq, sip_methods[sipmethod].text); add_header(req, "Via", p->via); - /* SLD: FIXME?: do Route: here too? I think not cos this is the first request. - * OTOH, then we won't have anything in p->route anyway */ + /* This will be a no-op most of the time. However, under certain circumstances, + * NOTIFY messages will use this function for preparing the request and should + * have Route headers present. + */ + add_route(req, p->route); /* Build Remote Party-ID and From */ if (ast_test_flag(&p->flags[0], SIP_SENDRPID) && (sipmethod == SIP_INVITE)) { build_rpid(p); @@ -15768,6 +15771,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, copy_request(&p->initreq, req); check_via(p, req); + build_route(p, req, 0); } else if (ast_test_flag(req, SIP_PKT_DEBUG) && ast_test_flag(req, SIP_PKT_IGNORE)) ast_verbose("Ignoring this SUBSCRIBE request\n"); |