diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-22 19:20:53 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-22 19:20:53 +0000 |
commit | c6fe6d8afeb05b15b07e8abbebd278704d9ca533 (patch) | |
tree | 37bbe75afc36aabffc2ecec9fbfcdb6bd546cd46 /channels/chan_h323.c | |
parent | 0f47b052d063fe3677ded347842f9d7aec34567a (diff) |
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.4@189991 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 695e3b406..6125822dc 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -1256,6 +1256,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")) { @@ -2409,8 +2411,15 @@ static void set_peer_capabilities(unsigned call_reference, const char *token, in ast_log(LOG_DEBUG, "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_log(LOG_DEBUG, "Autoframing option set, using peer's packetization settings\n"); + ast_rtp_codec_setpref(pvt->rtp, &pvt->peer_prefs); + } else { + ast_log(LOG_DEBUG, "Autoframing option not set, using ignoring peer's packetization settings\n"); + ast_rtp_codec_setpref(pvt->rtp, &pvt->options.prefs); + } + } } ast_mutex_unlock(&pvt->lock); } @@ -2434,8 +2443,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_log(LOG_DEBUG, "local prefs[%d]=%s:%d\n", i, (prefs.order[i] ? ast_getformatname(1 << (prefs.order[i]-1)) : "<none>"), prefs.framing[i]); + } ast_log(LOG_DEBUG, "Capabilities for connection %s is set\n", token); + } } static void *do_monitor(void *data) @@ -2816,6 +2832,7 @@ static int reload_config(int is_reload) global_options.dtmfmode = H323_DTMF_RFC2833; 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; |