Mercurial > pidgin
comparison libpurple/protocols/jabber/jingle/rtp.c @ 26105:836f2e0b3b22
Wait to send transport-info until the session-initiate ack is received.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Thu, 05 Feb 2009 23:30:48 +0000 |
parents | 4a245ffb4051 |
children | 9cda61a15698 |
comparison
equal
deleted
inserted
replaced
26104:d780894d7022 | 26105:836f2e0b3b22 |
---|---|
293 { | 293 { |
294 purple_debug_info("jingle-rtp", "jingle_rtp_new_candidate_cb\n"); | 294 purple_debug_info("jingle-rtp", "jingle_rtp_new_candidate_cb\n"); |
295 } | 295 } |
296 | 296 |
297 static void | 297 static void |
298 jingle_rtp_initiate_ack_cb(JabberStream *js, xmlnode *packet, gpointer data) | |
299 { | |
300 JingleSession *session = data; | |
301 | |
302 if (!strcmp(xmlnode_get_attrib(packet, "type"), "error") || | |
303 xmlnode_get_child(packet, "error")) { | |
304 gchar *sid = jingle_session_get_sid(session); | |
305 purple_media_end(jingle_rtp_get_media(session), NULL, NULL); | |
306 g_hash_table_remove(jingle_session_get_js( | |
307 session)->medias, sid); | |
308 g_free(sid); | |
309 return; | |
310 } | |
311 | |
312 jabber_iq_send(jingle_session_to_packet(session, | |
313 JINGLE_TRANSPORT_INFO)); | |
314 } | |
315 | |
316 static void | |
298 jingle_rtp_ready_cb(PurpleMedia *media, gchar *sid, gchar *name, JingleSession *session) | 317 jingle_rtp_ready_cb(PurpleMedia *media, gchar *sid, gchar *name, JingleSession *session) |
299 { | 318 { |
300 purple_debug_info("rtp", "ready-new: session: %s name: %s\n", sid, name); | 319 purple_debug_info("rtp", "ready-new: session: %s name: %s\n", sid, name); |
301 | 320 |
302 if (sid == NULL && name == NULL) { | 321 if (sid == NULL && name == NULL) { |
303 if (jingle_session_is_initiator(session) == TRUE) { | 322 if (jingle_session_is_initiator(session) == TRUE) { |
304 GList *contents = jingle_session_get_contents(session); | 323 GList *contents = jingle_session_get_contents(session); |
305 | 324 JabberIq *iq = jingle_session_to_packet( |
306 jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_INITIATE)); | 325 session, JINGLE_SESSION_INITIATE); |
307 | 326 |
308 for (; contents; contents = g_list_next(contents)) { | 327 if (contents->data) { |
309 JingleContent *content = (JingleContent *)contents->data; | 328 JingleTransport *transport = |
310 JingleTransport *transport = jingle_content_get_transport(content); | 329 jingle_content_get_transport(contents->data); |
311 if (JINGLE_IS_ICEUDP(transport)) | 330 if (JINGLE_IS_ICEUDP(transport)) |
312 jabber_iq_send(jingle_session_to_packet(session, | 331 jabber_iq_set_callback(iq, |
313 JINGLE_TRANSPORT_INFO)); | 332 jingle_rtp_initiate_ack_cb, session); |
314 } | 333 } |
334 | |
335 jabber_iq_send(iq); | |
315 } else { | 336 } else { |
316 jabber_iq_send(jingle_session_to_packet(session, JINGLE_TRANSPORT_INFO)); | 337 jabber_iq_send(jingle_session_to_packet(session, JINGLE_TRANSPORT_INFO)); |
317 jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_ACCEPT)); | 338 jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_ACCEPT)); |
318 } | 339 } |
319 } else if (sid != NULL && name != NULL) { | 340 } else if (sid != NULL && name != NULL) { |