Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 325304) +++ channels/chan_sip.c (working copy) @@ -9739,14 +9739,14 @@ add_supported_header(p, resp); /* If this is an invite, add Session-Timers related headers if the feature is active for this session */ - if (p->method == SIP_INVITE && p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE) { + if (req->method == SIP_INVITE && p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE) { char se_hdr[256]; snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval, strefresher2str(p->stimer->st_ref)); add_header(resp, "Session-Expires", se_hdr); } - if (msg[0] == '2' && (p->method == SIP_SUBSCRIBE || p->method == SIP_REGISTER)) { + if (msg[0] == '2' && (req->method == SIP_SUBSCRIBE || req->method == SIP_REGISTER)) { /* For registration responses, we also need expiry and contact info */ char tmp[256]; @@ -9760,7 +9760,7 @@ snprintf(contact, sizeof(contact), "%s%s%s;expires=%d", brackets ? "" : "<", contact_uri, brackets ? "" : ">", p->expiry); add_header(resp, "Contact", contact); /* Not when we unregister */ } - } else if (!ast_strlen_zero(p->our_contact) && resp_needs_contact(msg, p->method)) { + } else if (!ast_strlen_zero(p->our_contact) && resp_needs_contact(msg, req->method)) { add_header(resp, "Contact", p->our_contact); }