]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
authorMark Michelson <mmichelson@digium.com>
Fri, 10 Jul 2009 15:51:36 +0000 (15:51 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 10 Jul 2009 15:51:36 +0000 (15:51 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@205775 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index df825e7da844831508b4997bd9f72d7d517fe7e8..132899f34125c21d531ae935402bcd52f8f499fb 100644 (file)
@@ -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");