Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SDP protos to support DTLS #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libsofia-sip-ua/sdp/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,7 @@ int sdp_media_uses_rtp(sdp_media_t const *m)
return m &&
(m->m_proto == sdp_proto_rtp ||
m->m_proto == sdp_proto_srtp || m->m_proto == sdp_proto_extended_srtp ||
m->m_proto == sdp_proto_srtp_dtls || m->m_proto == sdp_proto_extended_srtp_dtls ||
(m->m_proto == sdp_proto_x && m->m_proto_name &&
su_casenmatch(m->m_proto_name, "RTP/", 4)));
}
Expand Down
6 changes: 3 additions & 3 deletions libsofia-sip-ua/sdp/sdp_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,11 +1416,11 @@ void sdp_media_transport(sdp_media_t *m, char const *s)
else if (su_casematch(s, "RTP/SAVP"))
m->m_proto = sdp_proto_srtp, m->m_proto_name = "RTP/SAVP";
else if (su_casematch(s, "UDP/TLS/RTP/SAVP"))
m->m_proto = sdp_proto_srtp, m->m_proto_name = "RTP/SAVP";
m->m_proto = sdp_proto_srtp_dtls, m->m_proto_name = "UDP/TLS/RTP/SAVP";
else if (su_casematch(s, "RTP/SAVPF"))
m->m_proto = sdp_proto_extended_srtp, m->m_proto_name = "RTP/SAVPF";
else if (su_casematch(s, "UDP/TLS/RTP/SAVPF"))
m->m_proto = sdp_proto_extended_srtp, m->m_proto_name = "UDP/TLS/RTP/SAVPF";
m->m_proto = sdp_proto_extended_srtp_dtls, m->m_proto_name = "UDP/TLS/RTP/SAVPF";
else if (su_casematch(s, "RTP/AVPF"))
m->m_proto = sdp_proto_extended_rtp, m->m_proto_name = "RTP/AVPF";
else if (su_casematch(s, "UDP/RTP/AVPF"))
Expand All @@ -1445,7 +1445,7 @@ void sdp_media_transport(sdp_media_t *m, char const *s)
/** Check if media uses RTP as its transport protocol. */
int sdp_media_has_rtp(sdp_media_t const *m)
{
return m && (m->m_proto == sdp_proto_rtp || m->m_proto == sdp_proto_srtp || m->m_proto == sdp_proto_extended_srtp || m->m_proto == sdp_proto_extended_rtp);
return m && (m->m_proto == sdp_proto_rtp || m->m_proto == sdp_proto_srtp || m->m_proto == sdp_proto_extended_srtp || m->m_proto == sdp_proto_extended_rtp || m->m_proto == sdp_proto_srtp_dtls || m->m_proto == sdp_proto_extended_srtp_dtls);
}

#define RTPMAP(pt, encoding, rate, params) \
Expand Down
2 changes: 2 additions & 0 deletions libsofia-sip-ua/sdp/sdp_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,9 @@ static void print_media(sdp_printer_t *p,
case sdp_proto_udp: proto = "udp"; break;
case sdp_proto_rtp: proto = "RTP/AVP"; break;
case sdp_proto_srtp: proto = "RTP/SAVP"; break;
case sdp_proto_srtp_dtls: proto = "UDP/TLS/RTP/SAVP"; break;
//case sdp_proto_extended_srtp: proto = "RTP/SAVPF"; break;
case sdp_proto_extended_srtp_dtls: proto = "UDP/TLS/RTP/SAVPF"; break;
case sdp_proto_udptl: proto = "udptl"; break;
case sdp_proto_msrp: proto = "TCP/MSRP"; break;
case sdp_proto_msrps: proto = "TCP/TLS/MSRP"; break;
Expand Down
6 changes: 4 additions & 2 deletions libsofia-sip-ua/sdp/sofia-sip/sdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ typedef enum
sdp_proto_udptl = 258, /**< UDPTL. @NEW_1_12_4. */
sdp_proto_msrp = 259, /**< TCP/MSRP @NEW_MSRP*/
sdp_proto_msrps = 260, /**< TCP/TLS/MSRP @NEW_MSRP*/
sdp_proto_extended_srtp = 261, /** WEBRTC SAVPF */
sdp_proto_extended_rtp = 262, /** WEBRTC AVPF */
sdp_proto_extended_srtp = 261, /** WEBRTC SAVPF */
sdp_proto_extended_rtp = 262, /** WEBRTC AVPF */
sdp_proto_extended_srtp_dtls = 263, /** WEBRTC AVPF DTLS */
sdp_proto_srtp_dtls = 264, /**< RTP/SAVP DTLS */
sdp_proto_tls = 511, /**< TLS over TCP */
sdp_proto_any = 512 /**< * wildcard */
} sdp_proto_e;
Expand Down