summaryrefslogtreecommitdiff
path: root/res/res_pjsip_sdp_rtp.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-10-19 04:01:31 +0000
committerMatthew Jordan <mjordan@digium.com>2014-10-19 04:01:31 +0000
commit70b21c4617ed429f597cefc0b88684f207a0b580 (patch)
tree47b3320bf8c4389a2111824a376a36d5436aa1e7 /res/res_pjsip_sdp_rtp.c
parent2c7556769cfe2652c82087279588466fb17a4590 (diff)
res/res_pjsip_sdp_rtp: Revert 425922
This patch for r425922 introduced a bug, wherein sending an INVITE request with no SDP would cause Asterisk to not send an SDP Offer in the 200 OK. The current structure of res_pjsip_sdp_rtp is a bit hard to deal with to fix this, as create_outgoing_sdp has no knowledge of whether or not it is creating an SDP as a new Offer or an Answer. This is something of an oversight in the callback definition, as the caller of it does have this information. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r--res/res_pjsip_sdp_rtp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 092157cbc..1f863008f 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -899,11 +899,13 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
int rtp_code;
RAII_VAR(struct ast_format_cap *, caps, NULL, ao2_cleanup);
enum ast_media_type media_type = stream_to_media_type(session_media->stream_type);
+ int use_override_prefs = ast_format_cap_count(session->req_caps);
+
int direct_media_enabled = !ast_sockaddr_isnull(&session_media->direct_media_addr) &&
ast_format_cap_count(session->direct_media_cap);
- if (!ast_format_cap_has_type(session->endpoint->media.codecs, media_type) ||
- !ast_format_cap_has_type(session->req_caps, media_type)) {
+ if ((use_override_prefs && !ast_format_cap_has_type(session->req_caps, media_type)) ||
+ (!use_override_prefs && !ast_format_cap_has_type(session->endpoint->media.codecs, media_type))) {
/* If no type formats are configured don't add a stream */
return 0;
} else if (!session_media->rtp && create_rtp(session, session_media, session->endpoint->media.rtp.ipv6)) {