[svn-commits] tilghman: branch tilghman/codec_bits3 r227423 - in /team/tilghman/codec_bits3...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 3 15:11:08 CST 2009


Author: tilghman
Date: Tue Nov  3 15:11:04 2009
New Revision: 227423

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=227423
Log:
More debugging turned up problems

Modified:
    team/tilghman/codec_bits3/channels/chan_h323.c
    team/tilghman/codec_bits3/channels/h323/chan_h323.h
    team/tilghman/codec_bits3/channels/iax2-parser.c

Modified: team/tilghman/codec_bits3/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/chan_h323.c?view=diff&rev=227423&r1=227422&r2=227423
==============================================================================
--- team/tilghman/codec_bits3/channels/chan_h323.c (original)
+++ team/tilghman/codec_bits3/channels/chan_h323.c Tue Nov  3 15:11:04 2009
@@ -172,9 +172,9 @@
 	int newcontrol;				/*!< Pending control to send */
 	int newdigit;				/*!< Pending DTMF digit to send */
 	int newduration;			/*!< Pending DTMF digit duration to send */
-	int pref_codec;				/*!< Preferred codec */
-	int peercapability;			/*!< Capabilities learned from peer */
-	int jointcapability;			/*!< Common capabilities for local and remote side */
+	format_t pref_codec;				/*!< Preferred codec */
+	format_t peercapability;			/*!< Capabilities learned from peer */
+	format_t jointcapability;			/*!< Common capabilities for local and remote side */
 	struct ast_codec_pref peer_prefs;	/*!< Preferenced list of codecs which remote side supports */
 	int dtmf_pt[2];				/*!< Payload code used for RFC2833/CISCO messages */
 	int curDTMF;				/*!< DTMF tone being generated to Asterisk side */

Modified: team/tilghman/codec_bits3/channels/h323/chan_h323.h
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/h323/chan_h323.h?view=diff&rev=227423&r1=227422&r2=227423
==============================================================================
--- team/tilghman/codec_bits3/channels/h323/chan_h323.h (original)
+++ team/tilghman/codec_bits3/channels/h323/chan_h323.h Tue Nov  3 15:11:04 2009
@@ -30,6 +30,7 @@
 #define CHAN_H323_H
 
 #include <arpa/inet.h>
+#include "asterisk/frame_defs.h"
 
 /*
  * Enable support for sending/reception of tunnelled Q.SIG messages and
@@ -64,7 +65,7 @@
 	int				progress_audio;
 	int				dtmfcodec[2];
 	int				dtmfmode;
-	uint64_t        capability;
+	format_t        capability;
 	int				bridge;
 	int				nat;
 	int				tunnelOptions;

Modified: team/tilghman/codec_bits3/channels/iax2-parser.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/channels/iax2-parser.c?view=diff&rev=227423&r1=227422&r2=227423
==============================================================================
--- team/tilghman/codec_bits3/channels/iax2-parser.c (original)
+++ team/tilghman/codec_bits3/channels/iax2-parser.c Tue Nov  3 15:11:04 2009
@@ -214,6 +214,21 @@
 
 }
 
+static void dump_versioned_codec(char *output, int maxlen, void *value, int len)
+{
+	char *version = (char *) value;
+	if (version[0] == 0) {
+		if (len == (int) (sizeof(format_t) + sizeof(char))) {
+			format_t codec = ntohll(get_unaligned_uint64(value + 1));
+			ast_copy_string(output, ast_getformatname(codec), maxlen);
+		} else {
+			ast_copy_string(output, "Invalid length!", maxlen);
+		}
+	} else {
+		ast_copy_string(output, "Unknown version!", maxlen);
+	}
+}
+
 static void dump_prov_ies(char *output, int maxlen, unsigned char *iedata, int len);
 static void dump_prov(char *output, int maxlen, void *value, int len)
 {
@@ -233,7 +248,9 @@
 	{ IAX_IE_USERNAME, "USERNAME", dump_string },
 	{ IAX_IE_PASSWORD, "PASSWORD", dump_string },
 	{ IAX_IE_CAPABILITY, "CAPABILITY", dump_int },
+	{ IAX_IE_CAPABILITY2, "CAPABILITY2", dump_versioned_codec },
 	{ IAX_IE_FORMAT, "FORMAT", dump_int },
+	{ IAX_IE_FORMAT2, "FORMAT2", dump_versioned_codec },
 	{ IAX_IE_LANGUAGE, "LANGUAGE", dump_string },
 	{ IAX_IE_VERSION, "VERSION", dump_short },
 	{ IAX_IE_ADSICPE, "ADSICPE", dump_short },
@@ -684,7 +701,8 @@
 	struct _local {
 		unsigned char version;
 		uint64_t value;
-	} newval = { version, htonll(value) };
+	} __attribute__((packed)) newval = { version, };
+	put_unaligned_uint64(&newval.value, htonll(value));
 	return iax_ie_append_raw(ied, ie, &newval, (int) sizeof(newval));
 }
 




More information about the svn-commits mailing list