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);
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");