pidgin.vv.yahoo.voice: 2c2a8380: Format the SDP string better and send al...

maiku at pidgin.im maiku at pidgin.im
Sun Aug 30 07:17:03 EDT 2009


-----------------------------------------------------------------
Revision: 2c2a838006c159388ba4d8fc7f30e7166bcabaca
Ancestor: a7c422fff3edb538ec323b48b0081e0edd1308be
Author: maiku at pidgin.im
Date: 2009-08-30T11:11:09
Branch: im.pidgin.pidgin.vv.yahoo.voice
URL: http://d.pidgin.im/viewmtn/revision/info/2c2a838006c159388ba4d8fc7f30e7166bcabaca

Modified files:
        libpurple/protocols/yahoo/yahoo_sip.c

ChangeLog: 

Format the SDP string better and send all common codecs.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo_sip.c	c9bf271678093eb3bef6c0899314f9c89d87f038
+++ libpurple/protocols/yahoo/yahoo_sip.c	eeb67c8bdf7923950b54347cca5c0e3da20ea2f2
@@ -75,13 +75,14 @@ yahoo_sip_send_response(PurpleMedia *med
 	const gchar *name = purple_url_decode(
 			nua_handle_remote(nh)->a_display);
 	GList *codecs, *candidates;
-	gchar **codec_strs, **candidate_strs,
-			*codec_str, *candidate_str, *sdp_str;
+	gchar **codec_strs, **codec_strs2, **candidate_strs,
+			*codec_str, *codec_str2, *candidate_str, *sdp_str;
 	guint port = 0;
 	guint i = 0;
 
 	codecs = purple_media_get_codecs(media, "yahoo-voice");
 	codec_strs = g_new0(gchar*, g_list_length(codecs) + 1);
+	codec_strs2 = g_new0(gchar*, g_list_length(codecs) + 1);
 
 	for (; codecs; codecs = g_list_delete_link(codecs, codecs)) {
 		PurpleMediaCodec *codec = codecs->data;
@@ -90,11 +91,15 @@ yahoo_sip_send_response(PurpleMedia *med
 		codec_strs[i] = g_strdup_printf("a=rtpmap:%d %s/%d\r\n",
 				purple_media_codec_get_id(codec), encoding_name,
 				purple_media_codec_get_clock_rate(codec));
+		codec_strs2[i] = g_strdup_printf("%d",
+				purple_media_codec_get_id(codec));
 		g_free(encoding_name);
 		++i;
 	}
 	codec_str = g_strjoinv(NULL, codec_strs);
 	g_strfreev(codec_strs);
+	codec_str2 = g_strjoinv(" ", codec_strs2);
+	g_strfreev(codec_strs2);
 	purple_debug_info("yahoo", "local codecs:\n%s", codec_str);
 
 	candidates = purple_media_get_local_candidates(media,
@@ -129,13 +134,17 @@ yahoo_sip_send_response(PurpleMedia *med
 	g_strfreev(candidate_strs);
 	purple_debug_info("yahoo", "local candidates:\n%s", candidate_str);
 
-	sdp_str = g_strdup_printf("m=audio %d RTP/AVP 97 0 8 101 100\r"
-			"\n%s%sa=sendrecv\r\n", port, codec_str, candidate_str);
+	sdp_str = g_strdup_printf("m=audio %d RTP/AVP %s\r"
+			"\n%s%sa=sendrecv\r\n", port, codec_str2,
+			codec_str, candidate_str);
 	g_free(codec_str);
+	g_free(codec_str2);
 	g_free(candidate_str);
 
 	nua_respond(nh, 200, "OK",
 			SOATAG_USER_SDP_STR(sdp_str),
+			/* This is essentially all common codecs */
+			SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),
 			TAG_END());
 	g_free(sdp_str);
 }
@@ -598,6 +607,9 @@ yahoo_sip_uninit(PurpleAccount *account)
 	YahooData *yd = purple_connection_get_protocol_data(pc);
 	YahooSip *ysip = yd->ysip;
 
+	if (!ysip)
+		return;
+
 	if (ysip->sip_host_query)
 		purple_dnsquery_destroy(ysip->sip_host_query);
 


More information about the Commits mailing list