diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-22 19:41:10 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-22 19:41:10 +0000 |
commit | d112c591878fb1c50aa1dfd9c74fa0798491d7c9 (patch) | |
tree | aaf5d21d40b496bb9f658bfa17ed259e642c2526 /channels/chan_h323.c | |
parent | 85ac09f3a33b704620da786865f8d9b4964f9b6a (diff) |
Merged revisions 189993 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r189993 | jpeeler | 2009-04-22 14:23:49 -0500 (Wed, 22 Apr 2009) | 18 lines
Make chan_h323 respect packetization settings
Previously, packetization settings were ignored and now they are not. A new
config option 'autoframing' has been added to mirror the way chan_sip handles
it. Turning on the autoframing option (available both as a global option or per
peer) overrides the local settings with the remote packetization settings.
Testing was performed with varying packetization levels with the following
codecs: ulaw, alaw, gsm, and g729.
(closes issue #12415)
Reported by: pj
Patches:
2009012200_h323packetization.diff.txt uploaded by mvanbaak (license 7),
modified by me
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@189996 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rw-r--r-- | channels/chan_h323.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index e7b06456f..d43cca979 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -1251,6 +1251,8 @@ static int update_common_options(struct ast_variable *v, struct call_options *op if (!strcasecmp(v->name, "allow")) { ast_parse_allow_disallow(&options->prefs, &options->capability, v->value, 1); + } else if (!strcasecmp(v->name, "autoframing")) { + options->autoframing = ast_true(v->value); } else if (!strcasecmp(v->name, "disallow")) { ast_parse_allow_disallow(&options->prefs, &options->capability, v->value, 0); } else if (!strcasecmp(v->name, "dtmfmode")) { @@ -2460,8 +2462,15 @@ static void set_peer_capabilities(unsigned call_reference, const char *token, in ast_debug(1, "prefs[%d]=%s:%d\n", i, (prefs->order[i] ? ast_getformatname(1 << (prefs->order[i]-1)) : "<none>"), prefs->framing[i]); } } - if (pvt->rtp) - ast_rtp_codec_setpref(pvt->rtp, &pvt->peer_prefs); + if (pvt->rtp) { + if (pvt->options.autoframing) { + ast_debug(2, "Autoframing option set, using peer's packetization settings\n"); + ast_rtp_codec_setpref(pvt->rtp, &pvt->peer_prefs); + } else { + ast_debug(2, "Autoframing option not set, ignoring peer's packetization settings\n"); + ast_rtp_codec_setpref(pvt->rtp, &pvt->options.prefs); + } + } } ast_mutex_unlock(&pvt->lock); } @@ -2485,8 +2494,15 @@ static void set_local_capabilities(unsigned call_reference, const char *token) ast_mutex_unlock(&pvt->lock); h323_set_capabilities(token, capability, dtmfmode, &prefs, pref_codec); - if (h323debug) + if (h323debug) { + int i; + for (i = 0; i < 32; i++) { + if (!prefs.order[i]) + break; + ast_debug(1, "local prefs[%d]=%s:%d\n", i, (prefs.order[i] ? ast_getformatname(1 << (prefs.order[i]-1)) : "<none>"), prefs.framing[i]); + } ast_debug(1, "Capabilities for connection %s is set\n", token); + } } static void remote_hold(unsigned call_reference, const char *token, int is_hold) @@ -2870,6 +2886,7 @@ static int reload_config(int is_reload) global_options.holdHandling = 0; global_options.capability = GLOBAL_CAPABILITY; global_options.bridge = 1; /* Do native bridging by default */ + global_options.autoframing = 0; strcpy(default_context, "default"); h323_signalling_port = 1720; gatekeeper_disable = 1; |