[Asterisk-cvs] asterisk rtp.c,1.120,1.121

kpfleming at lists.digium.com kpfleming at lists.digium.com
Tue Apr 5 18:42:13 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv10575

Modified Files:
	rtp.c 
Log Message:
report non-codec capabilities in 'sip debug' properly (bug #3960)


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- rtp.c	4 Apr 2005 02:13:40 -0000	1.120
+++ rtp.c	5 Apr 2005 23:34:56 -0000	1.121
@@ -805,7 +805,7 @@
 }
 
 /* Looks up an RTP code out of our *static* outbound list */
-int ast_rtp_lookup_code(struct ast_rtp* rtp, int isAstFormat, int code) {
+int ast_rtp_lookup_code(struct ast_rtp* rtp, const int isAstFormat, const int code) {
 
 	int pt;
 
@@ -838,7 +838,7 @@
 	return -1;
 }
 
-char* ast_rtp_lookup_mime_subtype(int isAstFormat, int code) {
+char* ast_rtp_lookup_mime_subtype(const int isAstFormat, const int code) {
 
 	int i;
 
@@ -850,6 +850,27 @@
 	return "";
 }
 
+char *ast_rtp_lookup_mime_multiple(char *buf, int size, const int capability, const int isAstFormat)
+{
+	int format;
+
+	if (!buf || !size)
+		return NULL;
+
+	snprintf(buf, size, "0x%x (", capability);
+
+	for (format = 1; format < AST_RTP_MAX; format <<= 1) {
+		if (capability & format) {
+			const char *name = ast_rtp_lookup_mime_subtype(isAstFormat, format);
+			snprintf(buf + strlen(buf), size - strlen(buf), "%s|", name);
+		}
+	}
+	if (!ast_strlen_zero(buf))
+		buf[strlen(buf)] = ')';
+
+	return buf;
+}
+
 static int rtp_socket(void)
 {
 	int s;




More information about the svn-commits mailing list