From 5c805cb03e8545d6b6917e6c2dae52b55e1b4a60 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Wed, 3 Aug 2011 21:49:15 +0200 Subject: [PATCH] media: drop support for ms-early-media Remote party can have multiple active points of presence where the user can accept call. Because libnice does not support parallel ICE negotiation with multiple endpoints having the same set of candidates, codecs, usernames and passwords, I drop support of early media from SIPE. Reason is that on the call initialization, ICE negotiation was started with the endpoint whose 183 Session Progress response we received first. Later if remote user accepted the call on different endpoint, the connection could not be established. Now ICE process is delayed until final reply is received from the user selected endpoint, so that connection establishment can be done only with the single correct point of presence. Drawback is a media transport lag between accepting a call and a moment when ICE process is finished, but still better than inability to establish the network route for media at all. --- src/core/sip-transport.c | 12 ++---------- src/core/sipe-media.c | 34 ++++------------------------------ 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/src/core/sip-transport.c b/src/core/sip-transport.c index 0616b0c3..378c0592 100644 --- a/src/core/sip-transport.c +++ b/src/core/sip-transport.c @@ -1413,16 +1413,8 @@ static void process_input_message(struct sipe_core_private *sipe_private, struct transaction *trans = transactions_find(transport, msg); if (trans) { if (msg->response < 200) { - if (msg->bodylen != 0) { - SIPE_DEBUG_INFO("got provisional (%d) response with body", msg->response); - if (trans->callback) { - SIPE_DEBUG_INFO_NOFORMAT("process_input_message: we have a transaction callback"); - (trans->callback)(sipe_private, msg, trans); - } - } else { - /* ignore provisional response */ - SIPE_DEBUG_INFO("process_input_message: got provisional (%d) response, ignoring", msg->response); - } + /* ignore provisional response */ + SIPE_DEBUG_INFO("process_input_message: got provisional (%d) response, ignoring", msg->response); /* Transaction not yet completed */ trans = NULL; diff --git a/src/core/sipe-media.c b/src/core/sipe-media.c index a5e9f1a3..d36e1a58 100644 --- a/src/core/sipe-media.c +++ b/src/core/sipe-media.c @@ -289,8 +289,6 @@ sipe_invite_call(struct sipe_core_private *sipe_private, TransCallback tc) contact = get_contact(sipe_private); hdr = g_strdup_printf( - "Supported: ms-early-media\r\n" - "Supported: 100rel\r\n" "ms-keep-alive: UAC;hop-hop=yes\r\n" "Contact: %s\r\n" "Content-Type: %s\r\n", @@ -554,14 +552,7 @@ candidates_prepared_cb(struct sipe_media_call *call, call_private->smsg = NULL; apply_remote_message(call_private, smsg); - - if (!send_invite_response_if_ready(call_private) && - call_private->ice_version == SIPE_ICE_RFC_5245 && - call_private->encryption_compatible) { - send_response_with_session_description(call_private, - 183, "Session Progress"); - } - + send_invite_response_if_ready(call_private); sdpmsg_free(smsg); } } @@ -1095,28 +1086,11 @@ process_invite_call_response(struct sipe_core_private *sipe_private, } apply_remote_message(call_private, smsg); - - if (msg->response == 183) { - // Session in progress - const gchar *rseq = sipmsg_find_header(msg, "RSeq"); - const gchar *cseq = sipmsg_find_header(msg, "CSeq"); - gchar *rack = g_strdup_printf("RAck: %s %s\r\n", rseq, cseq); - sip_transport_request(sipe_private, - "PRACK", - with, - with, - rack, - NULL, - dialog, - NULL); - g_free(rack); - } else { - sipe_media_send_ack(sipe_private, msg, trans); - reinvite_on_candidate_pair_cb(SIPE_CORE_PUBLIC); - } - sdpmsg_free(smsg); + sipe_media_send_ack(sipe_private, msg, trans); + reinvite_on_candidate_pair_cb(SIPE_CORE_PUBLIC); + return TRUE; } -- 2.11.4.GIT