From: Matthew Jordan Date: Sun, 19 Oct 2014 03:58:16 +0000 (+0000) Subject: res/res_pjsip_sdp_rtp: Undo 425921 X-Git-Tag: 12.7.0-rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4bc58bdee31d52a95a987a45a743582555408e2;p=thirdparty%2Fasterisk.git res/res_pjsip_sdp_rtp: Undo 425921 This patch for r425921 introduced a different 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, particularly in 12: (1) The format capabilities structures and how they are used are a bit harder to manipulate than they are in 13 (2) 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/12@425943 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 6d97c9a891..191ff73e01 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -912,14 +912,15 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as struct ast_format format; RAII_VAR(struct ast_format_cap *, caps, NULL, ast_format_cap_destroy); enum ast_format_type media_type = stream_to_media_type(session_media->stream_type); + int direct_media_enabled = !ast_sockaddr_isnull(&session_media->direct_media_addr) && !ast_format_cap_is_empty(session->direct_media_cap); + int use_override_prefs = session->override_prefs.formats[0].id; struct ast_codec_pref *prefs = use_override_prefs ? &session->override_prefs : &session->endpoint->media.prefs; if ((use_override_prefs && !codec_pref_has_type(&session->override_prefs, media_type)) || - (!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;