summaryrefslogtreecommitdiff
path: root/include/asterisk/res_sip_session.h
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-06-22 14:03:22 +0000
committerJoshua Colp <jcolp@digium.com>2013-06-22 14:03:22 +0000
commit77002bc377f19ea11e60732c486b6ef371688773 (patch)
treec19fd245c519c6d7905403849a7af9c7e4a4be3e /include/asterisk/res_sip_session.h
parentea03516cb5426915d183526335d3a7d662ea29dc (diff)
Merge in current pimp_my_sip work, including:
1. Security events 2. Websocket support 3. Diversion header + redirecting support 4. An anonymous endpoint identifier 5. Inbound extension state subscription support 6. PIDF notify generation 7. One touch recording support (special thanks Sean Bright!) 8. Blind and attended transfer support 9. Automatic inbound registration expiration 10. SRTP support 11. Media offer control dialplan function 12. Connected line support 13. SendText() support 14. Qualify support 15. Inband DTMF detection 16. Call and pickup groups 17. Messaging support Thanks everyone! Side note: I'm reminded of the song "How Far We've Come" by Matchbox Twenty. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/res_sip_session.h')
-rw-r--r--include/asterisk/res_sip_session.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/asterisk/res_sip_session.h b/include/asterisk/res_sip_session.h
index cbed52621..e4b05f7c3 100644
--- a/include/asterisk/res_sip_session.h
+++ b/include/asterisk/res_sip_session.h
@@ -26,6 +26,8 @@
#include "asterisk/channel.h"
/* Needed for ast_sockaddr struct */
#include "asterisk/netsock.h"
+/* Neeed for ast_sdp_srtp struct */
+#include "asterisk/sdp_srtp.h"
/* Forward declarations */
struct ast_sip_endpoint;
@@ -41,6 +43,7 @@ struct ast_party_id;
struct pjmedia_sdp_media;
struct pjmedia_sdp_session;
struct ast_rtp_instance;
+struct ast_dsp;
struct ast_sip_session_sdp_handler;
@@ -54,6 +57,8 @@ struct ast_sip_session_media {
struct ast_sockaddr direct_media_addr;
/*! \brief SDP handler that setup the RTP */
struct ast_sip_session_sdp_handler *handler;
+ /*! \brief Holds SRTP information */
+ struct ast_sdp_srtp *srtp;
/*! \brief Stream is on hold */
unsigned int held:1;
/*! \brief Stream type this session media handles */
@@ -97,10 +102,18 @@ struct ast_sip_session {
pj_timer_entry rescheduled_reinvite;
/* Format capabilities pertaining to direct media */
struct ast_format_cap *direct_media_cap;
+ /* When we need to forcefully end the session */
+ pj_timer_entry scheduled_termination;
/* Identity of endpoint this session deals with */
struct ast_party_id id;
/* Requested capabilities */
struct ast_format_cap *req_caps;
+ /* Codecs overriden by dialplan on an outgoing request */
+ struct ast_codec_pref override_prefs;
+ /* Optional DSP, used only for inband DTMF detection if configured */
+ struct ast_dsp *dsp;
+ /* Whether the termination of the session should be deferred */
+ unsigned int defer_terminate:1;
};
typedef int (*ast_sip_session_request_creation_cb)(struct ast_sip_session *session, pjsip_tx_data *tdata);
@@ -289,6 +302,13 @@ struct ast_sip_session *ast_sip_session_alloc(struct ast_sip_endpoint *endpoint,
struct ast_sip_session *ast_sip_session_create_outgoing(struct ast_sip_endpoint *endpoint, const char *location, const char *request_user, struct ast_format_cap *req_caps);
/*!
+ * \brief Defer local termination of a session until remote side terminates, or an amount of time passes
+ *
+ * \param session The session to defer termination on
+ */
+void ast_sip_session_defer_termination(struct ast_sip_session *session);
+
+/*!
* \brief Register an SDP handler
*
* An SDP handler is responsible for parsing incoming SDP streams and ensuring that
@@ -452,6 +472,14 @@ void ast_sip_session_send_response(struct ast_sip_session *session, pjsip_tx_dat
void ast_sip_session_send_request(struct ast_sip_session *session, pjsip_tx_data *tdata);
/*!
+ * \brief Creates an INVITE request.
+ *
+ * \param session Starting session for the INVITE
+ * \param tdata The created request.
+ */
+int ast_sip_session_create_invite(struct ast_sip_session *session, pjsip_tx_data **tdata);
+
+/*!
* \brief Send a SIP request and get called back when a response is received
*
* This will send the request out exactly the same as ast_sip_send_request() does.
@@ -465,4 +493,18 @@ void ast_sip_session_send_request(struct ast_sip_session *session, pjsip_tx_data
void ast_sip_session_send_request_with_cb(struct ast_sip_session *session, pjsip_tx_data *tdata,
ast_sip_session_response_cb on_response);
+/*!
+ * \brief Retrieves a session from a dialog
+ *
+ * \param dlg The dialog to retrieve the session from
+ *
+ * \retval non-NULL if session exists
+ * \retval NULL if no session
+ *
+ * \note The reference count of the session is increased when returned
+ *
+ * \note This function *must* be called with the dialog locked
+ */
+struct ast_sip_session *ast_sip_dialog_get_session(pjsip_dialog *dlg);
+
#endif /* _RES_SIP_SESSION_H */