diff options
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 27a100ca0..baa0e4822 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7227,7 +7227,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Sanity checks */ - if (!hp) { + if (!hp && !vhp && !thp && !ihp) { ast_log(LOG_WARNING, "Insufficient information in SDP (c=)...\n"); return -1; } @@ -8194,7 +8194,9 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg add_header(resp, "Expires", tmp); if (p->expiry) { /* Only add contact if we have an expiry time */ char contact[SIPBUFSIZE]; - snprintf(contact, sizeof(contact), "%s;expires=%d", (p->method == SIP_SUBSCRIBE ? p->our_contact : p->fullcontact), p->expiry); + const char *contact_uri = p->method == SIP_SUBSCRIBE ? p->our_contact : p->fullcontact; + char *brackets = strchr(contact_uri, '<'); + 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)) { |