aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-12 22:04:51 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-12 22:04:51 +0000
commit88bfcb671328040b79c9d6ca966402539524326d (patch)
tree24326afc8f1cbf64c5dc15d7013b19991584bf86 /include
parent19019525545806c438b9877c638a0bcc410267f5 (diff)
Only change the RTP ssrc when we see that it has changed
This change basically reverts the change reviewed in https://reviewboard.asterisk.org/r/374/ and instead limits the updating of the RTP synchronization source to only those times when we detect that the other side of the conversation has changed the ssrc. The problem is that SRCUPDATE control frames are sent many times where we don't want a new ssrc, including whenever Asterisk has to send DTMF in a normal bridge. This is also not the first time that this mistake has been made. The initial implementation of the ast_rtp_new_source function also changed the ssrc--and then it was removed because of this same issue. Then, we put it back in again to fix a different issue. This patch attempts to only change the ssrc when we see that the other side of the conversation has changed the ssrc. It also renames some functions to make their purpose more clear. Review: https://reviewboard.asterisk.org/r/540/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252089 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/frame.h4
-rw-r--r--include/asterisk/rtp_engine.h38
2 files changed, 30 insertions, 12 deletions
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index f9a9a4f0a..6f45386cd 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -85,7 +85,8 @@ struct ast_codec_pref {
* \arg \b HOLD Call is placed on hold
* \arg \b UNHOLD Call is back from hold
* \arg \b VIDUPDATE Video update requested
- * \arg \b SRCUPDATE The source of media has changed
+ * \arg \b SRCUPDATE The source of media has changed (RTP marker bit must change)
+ * \arg \b SRCCHANGE Media source has changed (RTP marker bit and SSRC must change)
* \arg \b CONNECTED_LINE Connected line has changed
* \arg \b REDIRECTING Call redirecting information has changed.
*/
@@ -323,6 +324,7 @@ enum ast_control_frame_type {
AST_CONTROL_CONNECTED_LINE = 22,/*!< Indicate connected line has changed */
AST_CONTROL_REDIRECTING = 23, /*!< Indicate redirecting id has changed */
AST_CONTROL_T38_PARAMETERS = 24, /*! T38 state change request/notification with parameters */
+ AST_CONTROL_SRCCHANGE = 25, /*!< Media source has changed and requires a new RTP SSRC */
};
enum ast_control_t38 {
diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index 86f7c27e7..770f4d2f5 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -92,8 +92,6 @@ enum ast_rtp_property {
AST_RTP_PROPERTY_STUN,
/*! Enable RTCP support */
AST_RTP_PROPERTY_RTCP,
- /*! Don't force a new SSRC on new source */
- AST_RTP_PROPERTY_CONSTANT_SSRC,
/*!
* \brief Maximum number of RTP properties supported
@@ -322,10 +320,10 @@ struct ast_rtp_engine {
int (*dtmf_begin)(struct ast_rtp_instance *instance, char digit);
/*! Callback for stopping RFC2833 DTMF transmission */
int (*dtmf_end)(struct ast_rtp_instance *instance, char digit);
- /*! Callback to indicate that a new source of media has come in */
- void (*new_source)(struct ast_rtp_instance *instance);
- /*! Callback to tell new_source not to change SSRC */
- void (*constant_ssrc_set)(struct ast_rtp_instance *instance);
+ /*! Callback to indicate that we should update the marker bit */
+ void (*update_source)(struct ast_rtp_instance *instance);
+ /*! Callback to indicate that we should update the marker bit and ssrc */
+ void (*change_source)(struct ast_rtp_instance *instance);
/*! Callback for setting an extended RTP property */
int (*extended_prop_set)(struct ast_rtp_instance *instance, int property, void *value);
/*! Callback for getting an extended RTP property */
@@ -1192,22 +1190,40 @@ int ast_rtp_instance_dtmf_mode_set(struct ast_rtp_instance *instance, enum ast_r
enum ast_rtp_dtmf_mode ast_rtp_instance_dtmf_mode_get(struct ast_rtp_instance *instance);
/*!
- * \brief Indicate a new source of audio has dropped in
+ * \brief Indicate that the RTP marker bit should be set on an RTP stream
*
* \param instance Instance that the new media source is feeding into
*
* Example usage:
*
* \code
- * ast_rtp_instance_new_source(instance);
+ * ast_rtp_instance_update_source(instance);
* \endcode
*
- * This indicates that a new source of media is feeding the instance pointed to by
- * instance.
+ * This indicates that the source of media that is feeding the instance pointed to by
+ * instance has been updated and that the marker bit should be set.
*
* \since 1.8
*/
-void ast_rtp_instance_new_source(struct ast_rtp_instance *instance);
+void ast_rtp_instance_update_source(struct ast_rtp_instance *instance);
+
+/*!
+ * \brief Indicate a new source of audio has dropped in and the ssrc should change
+ *
+ * \param instance Instance that the new media source is feeding into
+ *
+ * Example usage:
+ *
+ * \code
+ * ast_rtp_instance_change_source(instance);
+ * \endcode
+ *
+ * This indicates that the source of media that is feeding the instance pointed to by
+ * instance has changed and that the marker bit should be set and the SSRC updated.
+ *
+ * \since 1.8
+ */
+void ast_rtp_instance_change_source(struct ast_rtp_instance *instance);
/*!
* \brief Set QoS parameters on an RTP session