diff options
author | Joshua Colp <jcolp@digium.com> | 2006-11-30 21:22:01 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2006-11-30 21:22:01 +0000 |
commit | 869101028b619423f7c4d78ee96d3b669efc8cb4 (patch) | |
tree | 3228da5ddf405a44a55083a5cc1979f85561a5c9 /main/rtp.c | |
parent | 813f8d26fec6286542e3d202cc4f1bb6c9fc5a90 (diff) |
Merged revisions 48168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r48168 | file | 2006-11-30 16:18:24 -0500 (Thu, 30 Nov 2006) | 2 lines
Do not do a partial bridge for Google Talk since we need to handle STUN. (issue #8448 reported by phsultan)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main/rtp.c b/main/rtp.c index 838105290..3d394a043 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -183,6 +183,7 @@ static int bridge_p2p_rtcp_write(struct ast_rtp *rtp, unsigned int *rtcpheader, #define FLAG_P2P_NEED_DTMF (1 << 5) #define FLAG_CALLBACK_MODE (1 << 6) #define FLAG_DTMF_COMPENSATE (1 << 7) +#define FLAG_HAS_STUN (1 << 8) /*! * \brief Structure defining an RTCP session. @@ -545,6 +546,11 @@ void ast_rtp_setdtmfcompensate(struct ast_rtp *rtp, int compensate) ast_set2_flag(rtp, compensate ? 1 : 0, FLAG_DTMF_COMPENSATE); } +void ast_rtp_setstun(struct ast_rtp *rtp, int stun_enable) +{ + ast_set2_flag(rtp, stun_enable ? 1 : 0, FLAG_HAS_STUN); +} + static struct ast_frame *send_dtmf(struct ast_rtp *rtp, enum ast_frame_type type) { if (((ast_test_flag(rtp, FLAG_DTMF_COMPENSATE) && type == AST_FRAME_DTMF_END) || @@ -2913,8 +2919,8 @@ static int p2p_rtp_callback(int *id, int fd, short events, void *cbdata) /*! \brief Helper function to switch a channel and RTP stream into callback mode */ static int p2p_callback_enable(struct ast_channel *chan, struct ast_rtp *rtp, int **iod) { - /* If we need DTMF or we have no IO structure, then we can't do direct callback */ - if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) || !rtp->io) + /* If we need DTMF, are looking for STUN, or we have no IO structure then we can't do direct callback */ + if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) || ast_test_flag(rtp, FLAG_HAS_STUN) || !rtp->io) return 0; /* If the RTP structure is already in callback mode, remove it temporarily */ |