summaryrefslogtreecommitdiff
path: root/src/core.h
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-07-19 18:37:38 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-07-19 18:37:38 +0200
commit9da1970131662ad480dae589618411734dcf4905 (patch)
tree44577fcffff35352d432c3aa0c9b0dd69e33c1a0 /src/core.h
parente27e37b547b709d8ecf8be306c2b5137b7affad3 (diff)
add support for rtp_timeout and redial
1. Added support for RTP timeout. The feature is disabled by default and can be enabled with config "rtp_timeout N" where N is the number of seconds of RTP inactivity. If this is detected, the call is closed with a "special" SIP reason code of 701. 2. Added support for automatic re-connect in the menu module. This can be enabled by setting the 2 config items: redial_attempts 3 redial_delay 5 This work was contributed by Sveriges Radio. Thanks goes to Ola Palm and Jim Eld.
Diffstat (limited to 'src/core.h')
-rw-r--r--src/core.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core.h b/src/core.h
index dca28b5..d6958b4 100644
--- a/src/core.h
+++ b/src/core.h
@@ -281,6 +281,9 @@ typedef void (stream_rtp_h)(const struct rtp_header *hdr, struct mbuf *mb,
void *arg);
typedef void (stream_rtcp_h)(struct rtcp_msg *msg, void *arg);
+typedef void (stream_error_h)(struct stream *strm, int err, void *arg);
+
+
/** Defines a generic media stream */
struct stream {
struct le le; /**< Linked list element */
@@ -307,6 +310,13 @@ struct stream {
stream_rtp_h *rtph; /**< Stream RTP handler */
stream_rtcp_h *rtcph; /**< Stream RTCP handler */
void *arg; /**< Handler argument */
+
+ stream_error_h *errorh;
+ void *errorh_arg;
+ struct tmr tmr_rtp;
+ uint64_t ts_last;
+ bool terminated;
+ uint32_t rtp_timeout_ms; /* [ms] */
};
int stream_alloc(struct stream **sp, const struct config_avt *cfg,
@@ -327,8 +337,11 @@ void stream_set_srate(struct stream *s, uint32_t srate_tx, uint32_t srate_rx);
void stream_send_fir(struct stream *s, bool pli);
void stream_reset(struct stream *s);
void stream_set_bw(struct stream *s, uint32_t bps);
+void stream_set_error_handler(struct stream *strm,
+ stream_error_h *errorh, void *arg);
int stream_debug(struct re_printf *pf, const struct stream *s);
int stream_print(struct re_printf *pf, const struct stream *s);
+void stream_enable_rtp_timeout(struct stream *strm, uint32_t timeout_ms);
/*