diff options
author | Kinsey Moore <kmoore@digium.com> | 2012-06-15 17:13:20 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2012-06-15 17:13:20 +0000 |
commit | bf6ef69702a1b9fbe78bee7cd0fe4d44de92fbb1 (patch) | |
tree | 5ecb70613cb93f7b9f1384074053136868632283 /channels/sip | |
parent | 88c9c6bef8928c5d857172f1b8206c08699d0f75 (diff) |
Allow chan_sip to decline unwanted media streams
This change replaces the static array of four representable media
streams with an AST_LIST so that chan_sip can keep track of offered
media streams. This allows chan_sip to deal with offers containing
multiple same-type streams and many other situations without rejecting
the SDP offer in its entirety, yet still generating a valid response.
This also covers cases where Asterisk can not comprehend the offer if
it is in the correct format.
Previously, chan_sip would reject SDP offers or entirely ignore
individual stream offers in an effort to be more compatible which
would often result in invalid SDP responses.
Review: https://reviewboard.asterisk.org/r/1988/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip')
-rw-r--r-- | channels/sip/include/sip.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h index e8f079df6..a9b7e0277 100644 --- a/channels/sip/include/sip.h +++ b/channels/sip/include/sip.h @@ -467,6 +467,7 @@ enum media_type { SDP_VIDEO, /*!< RTP/AVP Video */ SDP_IMAGE, /*!< Image udptl, not TCP or RTP */ SDP_TEXT, /*!< RTP/AVP Realtime Text */ + SDP_UNKNOWN, /*!< Unknown media type */ }; /*! \brief Authentication types - proxy or www authentication @@ -968,10 +969,11 @@ struct sip_st_cfg { }; /*! \brief Structure for remembering offered media in an INVITE, to make sure we reply - to all media streams. In theory. In practise, we try our best. */ + to all media streams. */ struct offered_media { - int order_offered; /*!< Order the media was offered in. Not offered is 0 */ - char codecs[128]; + enum media_type type; /*!< The type of media that was offered */ + char *decline_m_line; /*!< Used if the media type is unknown/unused or a media stream is declined */ + AST_LIST_ENTRY(offered_media) next; }; /*! Additional headers to send with MESSAGE method packet. */ @@ -1194,7 +1196,7 @@ struct sip_pvt { * * The large-scale changes would be a good idea for implementing during an SDP rewrite. */ - struct offered_media offered_media[OFFERED_MEDIA_COUNT]; + AST_LIST_HEAD_NOLOCK(, offered_media) offered_media; struct ast_cc_config_params *cc_params; struct sip_epa_entry *epa_entry; int fromdomainport; /*!< Domain port to show in from field */ |