summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2017-02-22 15:11:29 -0600
committerJoshua Colp <jcolp@digium.com>2017-03-01 12:12:46 +0000
commit9c55a7179800fa66e1887383f2a75eac0efd24b0 (patch)
treef72f33b1a52cd08d7a69f9a9f388f4c3042c2e6a /include/asterisk
parent26bf1846e2d436ffec1867351f25e5bcd43139c6 (diff)
SDP: Add initial SDP state machine.
This introduces and documents the various states in the state machine. This also introduces API functions that induce state changes, and places TODO comments telling what needs to be done in addition to what is already there. Those TODOs will be replaced with real code in upcoming changes. Change-Id: I871c0eb480b4c84d83e91ac5628e7a673e8b89ed
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/sdp_state.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/asterisk/sdp_state.h b/include/asterisk/sdp_state.h
index b5e44179e..14d3e7c04 100644
--- a/include/asterisk/sdp_state.h
+++ b/include/asterisk/sdp_state.h
@@ -55,4 +55,43 @@ struct ast_rtp_instance *ast_sdp_state_get_rtp_instance(struct ast_sdp_state *sd
*/
struct ast_stream_topology *ast_sdp_state_get_joint_topology(struct ast_sdp_state *sdp_state);
+/*!
+ * \brief Get the local SDP.
+ *
+ * If we have not received a remote SDP yet, this will be an SDP offer based
+ * on known streams and options If we have received a remote SDP, this will
+ * be the negotiated SDP based on the joint capabilities. The return type is
+ * a void pointer because the representation of the SDP is going to be determined based
+ * on the SDP options when allocating the SDP state.
+ *
+ * This function will allocate RTP instances if RTP instances have not already
+ * been allocated for the streams.
+ *
+ * The return here is const. The use case for this is so that a channel can add the SDP to an outgoing
+ * message. The API user should not attempt to modify the SDP. SDP modification should only be done through
+ * the API.
+ */
+const void *ast_sdp_state_get_local(struct ast_sdp_state *sdp_state);
+
+/*!
+ * \brief Set the remote SDP.
+ *
+ * This can be used for either a remote offer or answer.
+ * This can also be used whenever an UPDATE, re-INVITE, etc. arrives.
+ * The type of the "remote" parameter is dictated by whatever SDP representation
+ * was set in the ast_sdp_options used during ast_sdp_state allocation
+ *
+ * This function will NOT allocate RTP instances.
+ */
+int ast_sdp_state_set_remote(struct ast_sdp_state *sdp_state, void *remote);
+
+/*!
+ * \brief Reset the SDP state and stream capabilities as if the SDP state had just been allocated.
+ *
+ * This is most useful for when a channel driver is sending a session refresh message
+ * and needs to re-advertise its initial capabilities instead of the previously-negotiated
+ * joint capabilities.
+ */
+int ast_sdp_state_reset(struct ast_sdp_state *sdp_state);
+
#endif /* _ASTERISK_SDP_STATE_H */