diff options
author | Alfred E. Heggestad <aeh@db.org> | 2016-07-19 18:37:38 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2016-07-19 18:37:38 +0200 |
commit | 9da1970131662ad480dae589618411734dcf4905 (patch) | |
tree | 44577fcffff35352d432c3aa0c9b0dd69e33c1a0 /src/core.h | |
parent | e27e37b547b709d8ecf8be306c2b5137b7affad3 (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.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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); /* |