mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
RTP/ICE: Send on first valid pair.
When handling ICE negotiations, it's possible that there can be a delay between STUN binding requests which in turn will cause a delay in ICE completion, preventing media from flowing. It should be possible to send media when there is at least one valid pair, preventing this scenario from occurring. A change was added to PJPROJECT that adds an optional callback (on_valid_pair) that will be called when the first valid pair is found during ICE negotiation. Asterisk uses this to start the DTLS handshake, allowing media to flow. It will only be called once, either on the first valid pair, or when ICE negotiation is complete. ASTERISK-28716 Change-Id: Ia7b68c34f06d2a1d91c5ed51627b66fd0363d867
This commit is contained in:
committed by
Benjamin Keith Ford
parent
1fc1336b2c
commit
168637cc0c
20
configure.ac
20
configure.ac
@@ -2436,6 +2436,26 @@ if test "$USE_PJPROJECT" != "no" ; then
|
||||
AST_C_COMPILE_CHECK([PJSIP_ENDPOINT_COMPACT_FORM], [pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;], [pjsip.h])
|
||||
AST_C_COMPILE_CHECK([PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE], [struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;], [pjsip.h])
|
||||
AST_C_COMPILE_CHECK([PJSIP_OAUTH_AUTHENTICATION], [struct pjsip_oauth_credential credential;], [pjsip.h])
|
||||
AC_MSG_CHECKING(for pjproject on_valid_pair callback)
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <pjsip.h>
|
||||
#include <pjsip_ua.h>
|
||||
#include <pjnath.h>
|
||||
void on_valid_pair(pj_ice_sess *ice) {}
|
||||
void on_ice_complete(pj_ice_sess *ice, pj_status_t status) {}
|
||||
void on_rx_data(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len) {}
|
||||
pj_status_t on_tx_pkt(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, const void *pkt, pj_size_t size, const pj_sockaddr_t *dst_addr, unsigned dst_addr_len) {}],
|
||||
[pj_ice_sess_cb ice_sess_cb = {
|
||||
.on_valid_pair = on_valid_pair,
|
||||
.on_ice_complete = on_ice_complete,
|
||||
.on_rx_data = on_rx_data,
|
||||
.on_tx_pkt = on_tx_pkt,
|
||||
};])],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK, 1, [Define to 1 if on_valid_pair callback is present.]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
LIBS="${saved_libs}"
|
||||
CPPFLAGS="${saved_cppflags}"
|
||||
|
||||
|
Reference in New Issue
Block a user