summaryrefslogtreecommitdiff
path: root/include/asterisk/res_pjsip_session.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-05-28 16:56:07 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-05-28 16:56:07 +0000
commit69125a7ae2516902c682ba9a91c5dfa1d189ad29 (patch)
tree457360104b1bc9c779113eb038bd0c8f623a585f /include/asterisk/res_pjsip_session.h
parenta5aea0cca026fe894b9f50b6995f6ab5dcf080b1 (diff)
res_pjsip_session: Fix leaked video RTP ports.
Simply enabling PJSIP to negotiage a video codec (e.g., h264) would leak video RTP ports if the codec were not negotiated by an incoming call. * Made add_sdp_streams() associate the handler with the media stream if the handler handled the media stream. Otherwise, when the ast_sip_session_media object was destroyed it didn't know how to clean up the RTP resources. * Fixed sdp_requires_deferral() associating the handler with the media stream when deciding if the SDP processing needs to be deferred for T.38. Like the leaked video RTP ports, the T.38 handler needs to clean up allocated resources from deciding if SDP processing needs to be deffered. * Cleaned up some dead code in handle_incoming_sdp() and sdp_requires_deferral(). ASTERISK-23721 #close Reported by: cervajs Review: https://reviewboard.asterisk.org/r/3571/ ........ Merged revisions 414749 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/res_pjsip_session.h')
-rw-r--r--include/asterisk/res_pjsip_session.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h
index 562895b52..5a07137dc 100644
--- a/include/asterisk/res_pjsip_session.h
+++ b/include/asterisk/res_pjsip_session.h
@@ -216,6 +216,17 @@ struct ast_sip_session_supplement {
AST_LIST_ENTRY(ast_sip_session_supplement) next;
};
+enum ast_sip_session_sdp_stream_defer {
+ /*! The stream was not handled by this handler. If there are other registered handlers for this stream type, they will be called. */
+ AST_SIP_SESSION_SDP_DEFER_NOT_HANDLED,
+ /*! There was an error encountered. No further operations will take place and the current negotiation will be abandoned. */
+ AST_SIP_SESSION_SDP_DEFER_ERROR,
+ /*! Re-invite is not needed */
+ AST_SIP_SESSION_SDP_DEFER_NOT_NEEDED,
+ /*! Re-invite should be deferred and will be resumed later. No further operations will take place. */
+ AST_SIP_SESSION_SDP_DEFER_NEEDED,
+};
+
/*!
* \brief A handler for SDPs in SIP sessions
*
@@ -230,14 +241,17 @@ struct ast_sip_session_sdp_handler {
* If a stream can not be immediately negotiated the re-invite can be deferred and
* resumed at a later time. It is up to the handler which caused deferral to occur
* to resume it.
+ *
* \param session The session for which the media is being re-invited
* \param session_media The media being reinvited
- * \param sdp The entire SDP.
- * \retval 0 The stream was unhandled or does not need the re-invite to be deferred.
- * \retval 1 Re-invite should be deferred and will be resumed later. No further operations will take place.
+ * \param sdp The entire SDP. Useful for getting "global" information, such as connections or attributes
+ * \param stream PJSIP incoming SDP media lines to parse by handler.
+ *
+ * \return enum ast_sip_session_defer_stream
+ *
* \note This is optional, if not implemented the stream is assumed to not be deferred.
*/
- int (*defer_incoming_sdp_stream)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream);
+ enum ast_sip_session_sdp_stream_defer (*defer_incoming_sdp_stream)(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream);
/*!
* \brief Set session details based on a stream in an incoming SDP offer or answer
* \param session The session for which the media is being negotiated