[asterisk-commits] jpeeler: branch jpeeler/bug12415 r189772 - in /team/jpeeler/bug12415/channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 21 15:37:13 CDT 2009


Author: jpeeler
Date: Tue Apr 21 15:37:09 2009
New Revision: 189772

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=189772
Log:
try this, actually works correctly with GSM now

Modified:
    team/jpeeler/bug12415/channels/chan_h323.c
    team/jpeeler/bug12415/channels/h323/ast_h323.cxx

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=189772&r1=189771&r2=189772
==============================================================================
--- team/jpeeler/bug12415/channels/chan_h323.c (original)
+++ team/jpeeler/bug12415/channels/chan_h323.c Tue Apr 21 15:37:09 2009
@@ -2452,8 +2452,15 @@
 				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_codecs_packetization_set(ast_rtp_instance_get_codecs(pvt->rtp), pvt->rtp, &pvt->peer_prefs);
+		if (pvt->rtp) {
+			if (pvt->options.autoframing) {
+				ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(pvt->rtp), pvt->rtp, &pvt->peer_prefs);
+			} else {
+				ast_debug(2, "Autoframing option not set, ignoring peer's packetization settings");
+				ast_log(LOG_WARNING, "jpeeler: autoframing not set\n");
+				ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(pvt->rtp), pvt->rtp, &pvt->options.prefs);
+			}
+		}
 	}
 	ast_mutex_unlock(&pvt->lock);
 }
@@ -2477,8 +2484,15 @@
 	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)

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=189772&r1=189771&r2=189772
==============================================================================
--- team/jpeeler/bug12415/channels/h323/ast_h323.cxx (original)
+++ team/jpeeler/bug12415/channels/h323/ast_h323.cxx Tue Apr 21 15:37:09 2009
@@ -1770,13 +1770,12 @@
 					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);
+						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;
+								//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);
 					}




More information about the asterisk-commits mailing list