Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jingle/rtp.c @ 26046:99055b8db16b
Choose the transport type according to the responder's caps.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Sat, 06 Dec 2008 02:20:09 +0000 |
parents | bee5ab815291 |
children | c7d4b67b3332 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/rtp.c Tue Nov 25 02:59:47 2008 +0000 +++ b/libpurple/protocols/jabber/jingle/rtp.c Sat Dec 06 02:20:09 2008 +0000 @@ -666,6 +666,7 @@ JabberBuddy *jb; JabberBuddyResource *jbr; PurpleMedia *media; + const gchar *transport_type; gchar *jid = NULL, *me = NULL, *sid = NULL; @@ -680,6 +681,16 @@ purple_debug_error("jingle-rtp", "Could not find buddy's resource\n"); } + if (jabber_resource_has_capability(jbr, JINGLE_TRANSPORT_ICEUDP)) { + transport_type = JINGLE_TRANSPORT_ICEUDP; + } else if (jabber_resource_has_capability(jbr, JINGLE_TRANSPORT_RAWUDP)) { + transport_type = JINGLE_TRANSPORT_RAWUDP; + } else { + purple_debug_error("jingle-rtp", "Resource doesn't support " + "the same transport types\n"); + return NULL; + } + if ((strchr(who, '/') == NULL) && jbr && (jbr->name != NULL)) { jid = g_strdup_printf("%s/%s", who, jbr->name); } else { @@ -695,7 +706,7 @@ if (type & PURPLE_MEDIA_AUDIO) { - transport = jingle_transport_create(JINGLE_TRANSPORT_ICEUDP); + transport = jingle_transport_create(transport_type); content = jingle_content_create(JINGLE_APP_RTP, "initiator", "session", "audio-session", "both", transport); jingle_session_add_content(session, content); @@ -703,7 +714,7 @@ jingle_rtp_init_media(content); } if (type & PURPLE_MEDIA_VIDEO) { - transport = jingle_transport_create(JINGLE_TRANSPORT_ICEUDP); + transport = jingle_transport_create(transport_type); content = jingle_content_create(JINGLE_APP_RTP, "initiator", "session", "video-session", "both", transport); jingle_session_add_content(session, content);