[asterisk-commits] jpeeler: branch jpeeler/bug12415 r188772 - in /team/jpeeler/bug12415/channels...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 16 15:59:26 CDT 2009
Author: jpeeler
Date: Thu Apr 16 15:59:14 2009
New Revision: 188772
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=188772
Log:
Check in some incomplete work. Notes for me: the general strategy is to accept the remote capabilities and then if the autoframing is turned off to overwrite the packetization settings with the local settings or the default.
Modified:
team/jpeeler/bug12415/channels/chan_h323.c
team/jpeeler/bug12415/channels/h323/ast_h323.cxx
team/jpeeler/bug12415/channels/h323/chan_h323.h
Modified: team/jpeeler/bug12415/channels/chan_h323.c
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug12415/channels/chan_h323.c?view=diff&rev=188772&r1=188771&r2=188772
==============================================================================
--- team/jpeeler/bug12415/channels/chan_h323.c (original)
+++ team/jpeeler/bug12415/channels/chan_h323.c Thu Apr 16 15:59:14 2009
@@ -1251,6 +1251,8 @@
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")) {
Modified: team/jpeeler/bug12415/channels/h323/ast_h323.cxx
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug12415/channels/h323/ast_h323.cxx?view=diff&rev=188772&r1=188771&r2=188772
==============================================================================
--- team/jpeeler/bug12415/channels/h323/ast_h323.cxx (original)
+++ team/jpeeler/bug12415/channels/h323/ast_h323.cxx Thu Apr 16 15:59:14 2009
@@ -1770,12 +1770,13 @@
if (!(peer_capabilities & ast_codec)) {
struct ast_format_list format;
ast_codec_pref_append(&prefs, ast_codec);
- format = ast_codec_pref_getsize(&prefs, ast_codec);
- if ((ast_codec == AST_FORMAT_ALAW) || (ast_codec == AST_FORMAT_ULAW)) {
- ms = remoteCapabilities[i].GetTxFramesInPacket();
- if (ms > 60)
- ms = format.cur_ms;
- } else
+ //format = ast_codec_pref_getsize(&prefs, ast_codec);
+ //if ((ast_codec == AST_FORMAT_ALAW) || (ast_codec == AST_FORMAT_ULAW)) {
+ // ms = remoteCapabilities[i].GetTxFramesInPacket();
+ // if (ms > 60)
+ // ms = format.cur_ms;
+ //} else
+ // ... I think, grab the remote characteristics here and then reset to local settings if necessary
ms = remoteCapabilities[i].GetTxFramesInPacket() * format.inc_ms;
ast_codec_pref_setsize(&prefs, ast_codec, ms);
}
@@ -1900,7 +1901,6 @@
struct ast_codec_pref *prefs = (struct ast_codec_pref *)_prefs;
struct ast_format_list format;
int frames_per_packet;
- int max_frames_per_packet;
H323Capability *cap;
localCapabilities.RemoveAll();
@@ -1925,9 +1925,9 @@
if (!(caps & codec) || (alreadysent & codec) || !(codec & AST_FORMAT_AUDIO_MASK))
continue;
alreadysent |= codec;
+ /* format.cur_ms will be set to default if packetization is not explicitly set */
format = ast_codec_pref_getsize(prefs, codec);
frames_per_packet = (format.inc_ms ? format.cur_ms / format.inc_ms : format.cur_ms);
- max_frames_per_packet = (format.inc_ms ? format.max_ms / format.inc_ms : 0);
switch(codec) {
#if 0
case AST_FORMAT_SPEEX:
@@ -1947,43 +1947,35 @@
AST_G729Capability *g729Cap;
lastcap = localCapabilities.SetCapability(0, 0, g729aCap = new AST_G729ACapability(frames_per_packet));
lastcap = localCapabilities.SetCapability(0, 0, g729Cap = new AST_G729Capability(frames_per_packet));
- if (max_frames_per_packet) {
- g729aCap->SetTxFramesInPacket(max_frames_per_packet);
- g729Cap->SetTxFramesInPacket(max_frames_per_packet);
- }
+ g729aCap->SetTxFramesInPacket(format.cur_ms);
+ g729Cap->SetTxFramesInPacket(format.cur_ms);
break;
case AST_FORMAT_G723_1:
AST_G7231Capability *g7231Cap;
lastcap = localCapabilities.SetCapability(0, 0, g7231Cap = new AST_G7231Capability(frames_per_packet, TRUE));
- if (max_frames_per_packet)
- g7231Cap->SetTxFramesInPacket(max_frames_per_packet);
+ g7231Cap->SetTxFramesInPacket(format.cur_ms);
lastcap = localCapabilities.SetCapability(0, 0, g7231Cap = new AST_G7231Capability(frames_per_packet, FALSE));
- if (max_frames_per_packet)
- g7231Cap->SetTxFramesInPacket(max_frames_per_packet);
+ g7231Cap->SetTxFramesInPacket(format.cur_ms);
break;
case AST_FORMAT_GSM:
AST_GSM0610Capability *gsmCap;
lastcap = localCapabilities.SetCapability(0, 0, gsmCap = new AST_GSM0610Capability(frames_per_packet));
- if (max_frames_per_packet)
- gsmCap->SetTxFramesInPacket(max_frames_per_packet);
+ gsmCap->SetTxFramesInPacket(format.cur_ms);
break;
case AST_FORMAT_ULAW:
AST_G711Capability *g711uCap;
lastcap = localCapabilities.SetCapability(0, 0, g711uCap = new AST_G711Capability(format.cur_ms, H323_G711Capability::muLaw));
- if (format.max_ms)
- g711uCap->SetTxFramesInPacket(format.max_ms);
+ g711uCap->SetTxFramesInPacket(format.cur_ms);
break;
case AST_FORMAT_ALAW:
AST_G711Capability *g711aCap;
lastcap = localCapabilities.SetCapability(0, 0, g711aCap = new AST_G711Capability(format.cur_ms, H323_G711Capability::ALaw));
- if (format.max_ms)
- g711aCap->SetTxFramesInPacket(format.max_ms);
+ g711aCap->SetTxFramesInPacket(format.cur_ms);
break;
case AST_FORMAT_G726_AAL2:
AST_CiscoG726Capability *g726Cap;
lastcap = localCapabilities.SetCapability(0, 0, g726Cap = new AST_CiscoG726Capability(frames_per_packet));
- if (max_frames_per_packet)
- g726Cap->SetTxFramesInPacket(max_frames_per_packet);
+ g726Cap->SetTxFramesInPacket(format.cur_ms);
break;
default:
alreadysent &= ~codec;
Modified: team/jpeeler/bug12415/channels/h323/chan_h323.h
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug12415/channels/h323/chan_h323.h?view=diff&rev=188772&r1=188771&r2=188772
==============================================================================
--- team/jpeeler/bug12415/channels/h323/chan_h323.h (original)
+++ team/jpeeler/bug12415/channels/h323/chan_h323.h Thu Apr 16 15:59:14 2009
@@ -69,6 +69,7 @@
int nat;
int tunnelOptions;
int holdHandling;
+ int autoframing; /*!< turn on to override local settings with remote framing length */
struct ast_codec_pref prefs;
} call_options_t;
More information about the asterisk-commits
mailing list