[asterisk-commits] dvossel: branch dvossel/fixtheworld_phase2 r306118 - in /team/dvossel/fixthew...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 3 14:24:26 CST 2011


Author: dvossel
Date: Thu Feb  3 14:24:22 2011
New Revision: 306118

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=306118
Log:
Added ability to define RTP mime types with formats containing attributes

Modified:
    team/dvossel/fixtheworld_phase2/include/asterisk/format.h
    team/dvossel/fixtheworld_phase2/include/asterisk/rtp_engine.h
    team/dvossel/fixtheworld_phase2/main/asterisk.c
    team/dvossel/fixtheworld_phase2/main/format.c
    team/dvossel/fixtheworld_phase2/main/rtp_engine.c

Modified: team/dvossel/fixtheworld_phase2/include/asterisk/format.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase2/include/asterisk/format.h?view=diff&rev=306118&r1=306117&r2=306118
==============================================================================
--- team/dvossel/fixtheworld_phase2/include/asterisk/format.h (original)
+++ team/dvossel/fixtheworld_phase2/include/asterisk/format.h Thu Feb  3 14:24:22 2011
@@ -347,4 +347,9 @@
  */
 int ast_format_attr_init(void);
 
+/*!
+ * \brief Init the Asterisk global format list after all format attribute modules have been loaded
+ */
+int ast_format_list_init(void);
+
 #endif /* _AST_FORMAT_H */

Modified: team/dvossel/fixtheworld_phase2/include/asterisk/rtp_engine.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase2/include/asterisk/rtp_engine.h?view=diff&rev=306118&r1=306117&r2=306118
==============================================================================
--- team/dvossel/fixtheworld_phase2/include/asterisk/rtp_engine.h (original)
+++ team/dvossel/fixtheworld_phase2/include/asterisk/rtp_engine.h Thu Feb  3 14:24:22 2011
@@ -1798,6 +1798,8 @@
 int ast_rtp_instance_add_srtp_policy(struct ast_rtp_instance *instance, struct ast_srtp_policy *policy);
 struct ast_srtp *ast_rtp_instance_get_srtp(struct ast_rtp_instance *instance);
 
+/*! \brief initializes the rtp engine arrays */
+int ast_rtp_engine_init(void);
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/dvossel/fixtheworld_phase2/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase2/main/asterisk.c?view=diff&rev=306118&r1=306117&r2=306118
==============================================================================
--- team/dvossel/fixtheworld_phase2/main/asterisk.c (original)
+++ team/dvossel/fixtheworld_phase2/main/asterisk.c Thu Feb  3 14:24:22 2011
@@ -143,6 +143,7 @@
 #include "asterisk/poll-compat.h"
 #include "asterisk/ccss.h"
 #include "asterisk/test.h"
+#include "asterisk/rtp_engine.h"
 #include "asterisk/format.h"
 #include "asterisk/aoc.h"
 
@@ -3708,6 +3709,8 @@
 	astobj2_init();
 
 	ast_format_attr_init();
+	ast_format_list_init();
+	ast_rtp_engine_init();
 
 	ast_autoservice_init();
 

Modified: team/dvossel/fixtheworld_phase2/main/format.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase2/main/format.c?view=diff&rev=306118&r1=306117&r2=306118
==============================================================================
--- team/dvossel/fixtheworld_phase2/main/format.c (original)
+++ team/dvossel/fixtheworld_phase2/main/format.c Thu Feb  3 14:24:22 2011
@@ -870,36 +870,47 @@
 	return 0;
 }
 
+int ast_format_list_init()
+{
+	if (ast_rwlock_init(&format_list_array_lock)) {
+		return -1;
+	}
+	if (format_list_init()) {
+		goto init_list_cleanup;
+	}
+	if (build_format_list_array()) {
+		goto init_list_cleanup;
+	}
+
+	return 0;
+init_list_cleanup:
+
+	ast_rwlock_destroy(&format_list_array_lock);
+	ao2_ref(format_list, -1);
+	if (format_list_array) {
+		ao2_ref(format_list_array, -1);
+	}
+	return -1;
+}
+
 int ast_format_attr_init()
 {
 	ast_cli_register_multiple(my_clis, ARRAY_LEN(my_clis));
 	if (ast_rwlock_init(&ilock)) {
 		return -1;
 	}
-	if (ast_rwlock_init(&format_list_array_lock)) {
-		return -1;
-		ast_rwlock_destroy(&ilock);
-	}
+
 	if (!(interfaces = ao2_container_alloc(283, interface_hash_cb, interface_cmp_cb))) {
 		ast_rwlock_destroy(&ilock);
 		goto init_cleanup;
 	}
-	if (format_list_init()) {
-		goto init_cleanup;
-	}
-	if (build_format_list_array()) {
-		goto init_cleanup;
-	}
-
 	return 0;
 
 init_cleanup:
 	ast_rwlock_destroy(&ilock);
-	ast_rwlock_destroy(&format_list_array_lock);
 	if (interfaces) {
 		ao2_ref(interfaces, -1);
 	}
-	ao2_ref(format_list, -1);
 	return -1;
 }
 

Modified: team/dvossel/fixtheworld_phase2/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase2/main/rtp_engine.c?view=diff&rev=306118&r1=306117&r2=306118
==============================================================================
--- team/dvossel/fixtheworld_phase2/main/rtp_engine.c (original)
+++ team/dvossel/fixtheworld_phase2/main/rtp_engine.c Thu Feb  3 14:24:22 2011
@@ -83,50 +83,15 @@
 
 /*! The following array defines the MIME Media type (and subtype) for each
    of our codecs, or RTP-specific data type. */
-static const struct ast_rtp_mime_type {
+static struct ast_rtp_mime_type {
 	struct ast_rtp_payload_type payload_type;
 	char *type;
 	char *subtype;
 	unsigned int sample_rate;
-} ast_rtp_mime_types[] = {
-	{{1, {.id = AST_FORMAT_G723_1}, 0}, "audio", "G723", 8000},
-	{{1, {.id = AST_FORMAT_GSM}, 0}, "audio", "GSM", 8000},
-	{{1, {.id = AST_FORMAT_ULAW}, 0}, "audio", "PCMU", 8000},
-	{{1, {.id = AST_FORMAT_ULAW}, 0}, "audio", "G711U", 8000},
-	{{1, {.id = AST_FORMAT_ALAW}, 0}, "audio", "PCMA", 8000},
-	{{1, {.id = AST_FORMAT_ALAW}, 0}, "audio", "G711A", 8000},
-	{{1, {.id = AST_FORMAT_G726}, 0}, "audio", "G726-32", 8000},
-	{{1, {.id = AST_FORMAT_ADPCM}, 0}, "audio", "DVI4", 8000},
-	{{1, {.id = AST_FORMAT_SLINEAR}, 0}, "audio", "L16", 8000},
-	{{1, {.id = AST_FORMAT_SLINEAR16}, 0}, "audio", "L16", 16000},
-	{{1, {.id = AST_FORMAT_LPC10}, 0}, "audio", "LPC", 8000},
-	{{1, {.id = AST_FORMAT_G729A}, 0}, "audio", "G729", 8000},
-	{{1, {.id = AST_FORMAT_G729A}, 0}, "audio", "G729A", 8000},
-	{{1, {.id = AST_FORMAT_G729A}, 0}, "audio", "G.729", 8000},
-	{{1, {.id = AST_FORMAT_SPEEX}, 0}, "audio", "speex", 8000},
-	{{1, {.id = AST_FORMAT_SPEEX16}, 0},  "audio", "speex", 16000},
-	{{1, {.id = AST_FORMAT_ILBC}, 0}, "audio", "iLBC", 8000},
-	/* this is the sample rate listed in the RTP profile for the G.722
-	              codec, *NOT* the actual sample rate of the media stream
-	*/
-	{{1, {.id = AST_FORMAT_G722}, 0}, "audio", "G722", 8000},
-	{{1, {.id = AST_FORMAT_G726_AAL2}, 0}, "audio", "AAL2-G726-32", 8000},
-	{{0, {.id = 0}, AST_RTP_DTMF}, "audio", "telephone-event", 8000},
-	{{0, {.id = 0}, AST_RTP_CISCO_DTMF}, "audio", "cisco-telephone-event", 8000},
-	{{0, {.id = 0}, AST_RTP_CN}, "audio", "CN", 8000},
-	{{1, {.id = AST_FORMAT_JPEG}, 0}, "video", "JPEG", 90000},
-	{{1, {.id = AST_FORMAT_PNG}, 0}, "video", "PNG", 90000},
-	{{1, {.id = AST_FORMAT_H261}, 0}, "video", "H261", 90000},
-	{{1, {.id = AST_FORMAT_H263}, 0}, "video", "H263", 90000},
-	{{1, {.id = AST_FORMAT_H263_PLUS}, 0}, "video", "h263-1998", 90000},
-	{{1, {.id = AST_FORMAT_H264}, 0}, "video", "H264", 90000},
-	{{1, {.id = AST_FORMAT_MP4_VIDEO}, 0}, "video", "MP4V-ES", 90000},
-	{{1, {.id = AST_FORMAT_T140RED}, 0}, "text", "RED", 1000},
-	{{1, {.id = AST_FORMAT_T140}, 0}, "text", "T140", 1000},
-	{{1, {.id = AST_FORMAT_SIREN7}, 0}, "audio", "G7221", 16000},
-	{{1, {.id = AST_FORMAT_SIREN14}, 0}, "audio", "G7221", 32000},
-	{{1, {.id = AST_FORMAT_G719}, 0}, "audio", "G719", 48000},
-};
+} ast_rtp_mime_types[64];
+
+static int mime_types_len = 0;
+
 
 /*!
  * \brief Mapping between Asterisk codecs and rtp payload types
@@ -138,46 +103,7 @@
  * See http://www.iana.org/assignments/rtp-parameters for a list of
  * assigned values
  */
-static const struct ast_rtp_payload_type static_RTP_PT[AST_RTP_MAX_PT] = {
-	[0] = {1, {.id = AST_FORMAT_ULAW}, 0},
-	#ifdef USE_DEPRECATED_G726
-	[2] = {1, {.id = AST_FORMAT_G726}, 0},/* Technically this is G.721, but if Cisco can do it, so can we... */
-	#endif
-	[3] = {1, {.id = AST_FORMAT_GSM}, 0},
-	[4] = {1, {.id = AST_FORMAT_G723_1}, 0},
-	[5] = {1, {.id = AST_FORMAT_ADPCM}, 0},/* 8 kHz */
-	[6] = {1, {.id = AST_FORMAT_ADPCM}, 0}, /* 16 kHz */
-	[7] = {1, {.id = AST_FORMAT_LPC10}, 0},
-	[8] = {1, {.id = AST_FORMAT_ALAW}, 0},
-	[9] = {1, {.id = AST_FORMAT_G722}, 0},
-	[10] = {1, {.id = AST_FORMAT_SLINEAR}, 0}, /* 2 channels */
-	[11] = {1, {.id = AST_FORMAT_SLINEAR}, 0}, /* 1 channel */
-	[13] = {0, {.id = 0}, AST_RTP_CN},
-	[16] = {1, {.id = AST_FORMAT_ADPCM}, 0}, /* 11.025 kHz */
-	[17] = {1, {.id = AST_FORMAT_ADPCM}, 0}, /* 22.050 kHz */
-	[18] = {1, {.id = AST_FORMAT_G729A}, 0},
-	[19] = {0, {.id = 0}, AST_RTP_CN},         /* Also used for CN */
-	[26] = {1, {.id = AST_FORMAT_JPEG}, 0},
-	[31] = {1, {.id = AST_FORMAT_H261}, 0},
-	[34] = {1, {.id = AST_FORMAT_H263}, 0},
-	[97] = {1, {.id = AST_FORMAT_ILBC}, 0},
-	[98] = {1, {.id = AST_FORMAT_H263_PLUS}, 0},
-	[99] = {1, {.id = AST_FORMAT_H264}, 0},
-	[101] = {0, {.id = 0}, AST_RTP_DTMF},
-	[102] = {1, {.id = AST_FORMAT_SIREN7}, 0},
-	[103] = {1, {.id = AST_FORMAT_H263_PLUS}, 0},
-	[104] = {1, {.id = AST_FORMAT_MP4_VIDEO}, 0},
-	[105] = {1, {.id = AST_FORMAT_T140RED}, 0},   /* Real time text chat (with redundancy encoding) */
-	[106] = {1, {.id = AST_FORMAT_T140}, 0},      /* Real time text chat */
-	[110] = {1, {.id = AST_FORMAT_SPEEX}, 0},
-	[111] = {1, {.id = AST_FORMAT_G726}, 0},
-	[112] = {1, {.id = AST_FORMAT_G726_AAL2}, 0},
-	[115] = {1, {.id = AST_FORMAT_SIREN14}, 0},
-	[116] = {1, {.id = AST_FORMAT_G719}, 0},
-	[117] = {1, {.id = AST_FORMAT_SPEEX16}, 0},
-	[118] = {1, {.id = AST_FORMAT_SLINEAR16}, 0}, /* 16 Khz signed linear */
-	[121] = {0, {.id = 0}, AST_RTP_CISCO_DTMF},   /* Must be type 121 */
-};
+static struct ast_rtp_payload_type static_RTP_PT[AST_RTP_MAX_PT];
 
 int ast_rtp_engine_register2(struct ast_rtp_engine *engine, struct ast_module *module)
 {
@@ -555,7 +481,7 @@
 	if (pt < 0 || pt >= AST_RTP_MAX_PT)
 		return -1; /* bogus payload type */
 
-	for (i = 0; i < ARRAY_LEN(ast_rtp_mime_types); ++i) {
+	for (i = 0; i < mime_types_len; ++i) {
 		const struct ast_rtp_mime_type *t = &ast_rtp_mime_types[i];
 
 		if (strcasecmp(mimesubtype, t->subtype)) {
@@ -682,7 +608,7 @@
 {
 	int i;
 
-	for (i = 0; i < ARRAY_LEN(ast_rtp_mime_types); i++) {
+	for (i = 0; i < mime_types_len; i++) {
 		if (ast_rtp_mime_types[i].payload_type.asterisk_format && asterisk_format && format &&
 			(ast_format_cmp(format, &ast_rtp_mime_types[i].payload_type.format) != AST_FORMAT_CMP_NOT_EQUAL)) {
 			if ((format->id == AST_FORMAT_G726_AAL2) && (options & AST_RTP_OPT_G726_NONSTANDARD)) {
@@ -704,7 +630,7 @@
 {
 	unsigned int i;
 
-	for (i = 0; i < ARRAY_LEN(ast_rtp_mime_types); ++i) {
+	for (i = 0; i < mime_types_len; ++i) {
 		if (ast_rtp_mime_types[i].payload_type.asterisk_format && asterisk_format && format &&
 			(ast_format_cmp(format, &ast_rtp_mime_types[i].payload_type.format) != AST_FORMAT_CMP_NOT_EQUAL)) {
 			return ast_rtp_mime_types[i].sample_rate;
@@ -1879,3 +1805,117 @@
 {
 	return instance->srtp;
 }
+
+static void set_next_mime_type(struct ast_format *format, int rtp_code, char *type, char *subtype, unsigned int sample_rate)
+{
+	int x = mime_types_len;
+	if (ARRAY_LEN(ast_rtp_mime_types) == mime_types_len) {
+		return;
+	}
+	if (format) {
+		ast_rtp_mime_types[x].payload_type.asterisk_format = 1;
+		ast_format_copy(&ast_rtp_mime_types[x].payload_type.format, format);
+	} else {
+		ast_rtp_mime_types[x].payload_type.rtp_code = 0;
+	}
+	ast_rtp_mime_types[x].type = type;
+	ast_rtp_mime_types[x].subtype = subtype;
+	ast_rtp_mime_types[x].sample_rate = sample_rate;
+	mime_types_len++;
+}
+
+static void add_static_payload(int map, struct ast_format *format, int rtp_code)
+{
+	if (format) {
+		static_RTP_PT[map].asterisk_format = 1;
+		ast_format_copy(&static_RTP_PT[map].format, format);
+	} else {
+		static_RTP_PT[map].rtp_code = rtp_code;
+	}
+}
+
+int ast_rtp_engine_init()
+{
+	struct ast_format tmpfmt;
+
+	/* Define all the RTP mime types available */
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G723_1, 0), 0, "audio", "G723", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_GSM, 0), 0, "audio", "GSM", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_ULAW, 0), 0, "audio", "PCMU", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_ULAW, 0), 0, "audio", "G711U", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_ALAW, 0), 0, "audio", "PCMA", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_ALAW, 0), 0, "audio", "G711A", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G726, 0), 0, "audio", "G726-32", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_ADPCM, 0), 0, "audio", "DVI4", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR, 0), 0, "audio", "L16", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR16, 0), 0, "audio", "L16", 16000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_LPC10, 0), 0, "audio", "LPC", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G729A, 0), 0, "audio", "G729", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G729A, 0), 0, "audio", "G729A", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G729A, 0), 0, "audio", "G.729", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_SPEEX, 0), 0, "audio", "speex", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_SPEEX16, 0), 0,  "audio", "speex", 16000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_ILBC, 0), 0, "audio", "iLBC", 8000);
+	/* this is the sample rate listed in the RTP profile for the G.722
+	              codec, *NOT* the actual sample rate of the media stream
+	*/
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G722, 0), 0, "audio", "G722", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G726_AAL2, 0), 0, "audio", "AAL2-G726-32", 8000);
+	set_next_mime_type(NULL, AST_RTP_DTMF, "audio", "telephone-event", 8000);
+	set_next_mime_type(NULL, AST_RTP_CISCO_DTMF, "audio", "cisco-telephone-event", 8000);
+	set_next_mime_type(NULL, AST_RTP_CN, "audio", "CN", 8000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_JPEG, 0), 0, "video", "JPEG", 90000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_PNG, 0), 0, "video", "PNG", 90000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_H261, 0), 0, "video", "H261", 90000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_H263, 0), 0, "video", "H263", 90000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_H263_PLUS, 0), 0, "video", "h263-1998", 90000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_H264, 0), 0, "video", "H264", 90000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_MP4_VIDEO, 0), 0, "video", "MP4V-ES", 90000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_T140RED, 0), 0, "text", "RED", 1000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_T140, 0), 0, "text", "T140", 1000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_SIREN7, 0), 0, "audio", "G7221", 16000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_SIREN14, 0), 0, "audio", "G7221", 32000);
+	set_next_mime_type(ast_format_set(&tmpfmt, AST_FORMAT_G719, 0), 0, "audio", "G719", 48000);
+
+	/* Define the static rtp payload mappings */
+	add_static_payload(0, ast_format_set(&tmpfmt, AST_FORMAT_ULAW, 0), 0);
+	#ifdef USE_DEPRECATED_G726
+	add_static_payload(2, ast_format_set(&tmpfmt, AST_FORMAT_G726, 0), 0);/* Technically this is G.721, but if Cisco can do it, so can we... */
+	#endif
+	add_static_payload(3, ast_format_set(&tmpfmt, AST_FORMAT_GSM, 0), 0);
+	add_static_payload(4, ast_format_set(&tmpfmt, AST_FORMAT_G723_1, 0), 0);
+	add_static_payload(5, ast_format_set(&tmpfmt, AST_FORMAT_ADPCM, 0), 0);/* 8 kHz */
+	add_static_payload(6, ast_format_set(&tmpfmt, AST_FORMAT_ADPCM, 0), 0); /* 16 kHz */
+	add_static_payload(7, ast_format_set(&tmpfmt, AST_FORMAT_LPC10, 0), 0);
+	add_static_payload(8, ast_format_set(&tmpfmt, AST_FORMAT_ALAW, 0), 0);
+	add_static_payload(9, ast_format_set(&tmpfmt, AST_FORMAT_G722, 0), 0);
+	add_static_payload(10, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR, 0), 0); /* 2 channels */
+	add_static_payload(11, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR, 0), 0); /* 1 channel */
+	add_static_payload(13, NULL, AST_RTP_CN);
+	add_static_payload(16, ast_format_set(&tmpfmt, AST_FORMAT_ADPCM, 0), 0); /* 11.025 kHz */
+	add_static_payload(17, ast_format_set(&tmpfmt, AST_FORMAT_ADPCM, 0), 0); /* 22.050 kHz */
+	add_static_payload(18, ast_format_set(&tmpfmt, AST_FORMAT_G729A, 0), 0);
+	add_static_payload(19, NULL, AST_RTP_CN);         /* Also used for CN */
+	add_static_payload(26, ast_format_set(&tmpfmt, AST_FORMAT_JPEG, 0), 0);
+	add_static_payload(31, ast_format_set(&tmpfmt, AST_FORMAT_H261, 0), 0);
+	add_static_payload(34, ast_format_set(&tmpfmt, AST_FORMAT_H263, 0), 0);
+	add_static_payload(97, ast_format_set(&tmpfmt, AST_FORMAT_ILBC, 0), 0);
+	add_static_payload(98, ast_format_set(&tmpfmt, AST_FORMAT_H263_PLUS, 0), 0);
+	add_static_payload(99, ast_format_set(&tmpfmt, AST_FORMAT_H264, 0), 0);
+	add_static_payload(101, NULL, AST_RTP_DTMF);
+	add_static_payload(102, ast_format_set(&tmpfmt, AST_FORMAT_SIREN7, 0), 0);
+	add_static_payload(103, ast_format_set(&tmpfmt, AST_FORMAT_H263_PLUS, 0), 0);
+	add_static_payload(104, ast_format_set(&tmpfmt, AST_FORMAT_MP4_VIDEO, 0), 0);
+	add_static_payload(105, ast_format_set(&tmpfmt, AST_FORMAT_T140RED, 0), 0);   /* Real time text chat (with redundancy encoding) */
+	add_static_payload(106, ast_format_set(&tmpfmt, AST_FORMAT_T140, 0), 0);     /* Real time text chat */
+	add_static_payload(110, ast_format_set(&tmpfmt, AST_FORMAT_SPEEX, 0), 0);
+	add_static_payload(111, ast_format_set(&tmpfmt, AST_FORMAT_G726, 0), 0);
+	add_static_payload(112, ast_format_set(&tmpfmt, AST_FORMAT_G726_AAL2, 0), 0);
+	add_static_payload(115, ast_format_set(&tmpfmt, AST_FORMAT_SIREN14, 0), 0);
+	add_static_payload(116, ast_format_set(&tmpfmt, AST_FORMAT_G719, 0), 0);
+	add_static_payload(117, ast_format_set(&tmpfmt, AST_FORMAT_SPEEX16, 0), 0);
+	add_static_payload(118, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR16, 0), 0); /* 16 Khz signed linear */
+	add_static_payload(121, NULL, AST_RTP_CISCO_DTMF);   /* Must be type 121 */
+
+	return 0;
+}




More information about the asterisk-commits mailing list