summaryrefslogtreecommitdiff
path: root/main/rtp_engine.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2011-07-19 18:07:22 +0000
committerKinsey Moore <kmoore@digium.com>2011-07-19 18:07:22 +0000
commit1dc97eb69b6eefcd3825b2c427c51a37c8a31ca3 (patch)
tree6b0c0bf9d0548cfd085d9a8e3741f4de71fb4f79 /main/rtp_engine.c
parent4ea4b7e1ab142ad8f1335ffc018b096cb7fd77f0 (diff)
Merged revisions 328824 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328824 | kmoore | 2011-07-19 13:05:21 -0500 (Tue, 19 Jul 2011) | 18 lines Merged revisions 328823 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328823 | kmoore | 2011-07-19 12:57:18 -0500 (Tue, 19 Jul 2011) | 11 lines RTP bridge away with inband DTMF and feature detection When deciding whether Asterisk was allowed to bridge the call away from the core, chan_sip did not take into account the usage of features on dialed channels that require monitoring of DTMF on channels utilizing inband DTMF. This would cause Asterisk to allow the call to be locally or remotely bridged, preventing access to the data required to detect activations of such features. (closes 17237) Review: https://reviewboard.asterisk.org/r/1302/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r--main/rtp_engine.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 4ad3c9024..c7d77f809 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -69,8 +69,6 @@ struct ast_rtp_instance {
int holdtimeout;
/*! RTP keepalive interval */
int keepalive;
- /*! DTMF mode in use */
- enum ast_rtp_dtmf_mode dtmf_mode;
/*! Glue currently in use */
struct ast_rtp_glue *glue;
/*! Channel associated with the instance */
@@ -745,18 +743,12 @@ int ast_rtp_instance_dtmf_end_with_duration(struct ast_rtp_instance *instance, c
int ast_rtp_instance_dtmf_mode_set(struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode)
{
- if (!instance->engine->dtmf_mode_set || instance->engine->dtmf_mode_set(instance, dtmf_mode)) {
- return -1;
- }
-
- instance->dtmf_mode = dtmf_mode;
-
- return 0;
+ return (!instance->engine->dtmf_mode_set || instance->engine->dtmf_mode_set(instance, dtmf_mode)) ? -1 : 0;
}
enum ast_rtp_dtmf_mode ast_rtp_instance_dtmf_mode_get(struct ast_rtp_instance *instance)
{
- return instance->dtmf_mode;
+ return instance->engine->dtmf_mode_get ? instance->engine->dtmf_mode_get(instance) : 0;
}
void ast_rtp_instance_update_source(struct ast_rtp_instance *instance)
@@ -1291,6 +1283,7 @@ enum ast_bridge_result ast_rtp_instance_bridge(struct ast_channel *c0, struct as
enum ast_rtp_glue_result audio_glue0_res = AST_RTP_GLUE_RESULT_FORBID, video_glue0_res = AST_RTP_GLUE_RESULT_FORBID;
enum ast_rtp_glue_result audio_glue1_res = AST_RTP_GLUE_RESULT_FORBID, video_glue1_res = AST_RTP_GLUE_RESULT_FORBID;
enum ast_bridge_result res = AST_BRIDGE_FAILED;
+ enum ast_rtp_dtmf_mode dmode;
struct ast_format_cap *cap0 = ast_format_cap_alloc_nolock();
struct ast_format_cap *cap1 = ast_format_cap_alloc_nolock();
int unlock_chans = 1;
@@ -1352,11 +1345,13 @@ enum ast_bridge_result ast_rtp_instance_bridge(struct ast_channel *c0, struct as
}
/* If we need to get DTMF see if we can do it outside of the RTP stream itself */
- if ((flags & AST_BRIDGE_DTMF_CHANNEL_0) && instance0->properties[AST_RTP_PROPERTY_DTMF]) {
+ dmode = ast_rtp_instance_dtmf_mode_get(instance0);
+ if ((flags & AST_BRIDGE_DTMF_CHANNEL_0) && dmode) {
res = AST_BRIDGE_FAILED_NOWARN;
goto done;
}
- if ((flags & AST_BRIDGE_DTMF_CHANNEL_1) && instance1->properties[AST_RTP_PROPERTY_DTMF]) {
+ dmode = ast_rtp_instance_dtmf_mode_get(instance1);
+ if ((flags & AST_BRIDGE_DTMF_CHANNEL_1) && dmode) {
res = AST_BRIDGE_FAILED_NOWARN;
goto done;
}