Commit bb30ea7b authored by johan's avatar johan
Browse files

Lime-Ik SDP attribute is at session level

parent 97048b94
......@@ -906,20 +906,6 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md,
}
}
/* Do we have Lime Ik attribute */
if ((attribute=belle_sdp_media_description_get_attribute(media_desc,"Ik"))!=NULL) {
if (belle_sdp_attribute_get_value(attribute)!=NULL) {
stream->haveLimeIk = 1;
}
}
/* get ready to parse also lime-Ik */
if ((attribute=belle_sdp_media_description_get_attribute(media_desc,"lime-Ik"))!=NULL) {
if (belle_sdp_attribute_get_value(attribute)!=NULL) {
stream->haveLimeIk = 1;
}
}
/* Get ICE candidate attributes if any */
sdp_parse_media_ice_parameters(media_desc, stream);
......@@ -1046,6 +1032,14 @@ int sdp_to_media_description( belle_sdp_session_description_t *session_desc, Sa
/* Get session RTCP-XR attributes if any */
sdp_parse_session_rtcp_xr_parameters(session_desc, &desc->rtcp_xr);
/* Do we have Lime Ik attribute */
value = belle_sdp_session_description_get_attribute_value(session_desc,"Ik");
if (value) desc->haveLimeIk = TRUE;
/* get ready to parse also lime-Ik */
value = belle_sdp_session_description_get_attribute_value(session_desc,"lime-Ik");
if (value) desc->haveLimeIk = TRUE;
/* Get the custom attributes, parse some of them that are relevant */
for (custom_attribute_it = belle_sdp_session_description_get_attributes(session_desc); custom_attribute_it != NULL; custom_attribute_it = custom_attribute_it->next) {
belle_sdp_attribute_t *attr = (belle_sdp_attribute_t *)custom_attribute_it->data;
......
......@@ -97,7 +97,6 @@ SalMediaDescription *sal_media_description_new(){
md->streams[i].rtp_port = 0;
md->streams[i].rtcp_port = 0;
md->streams[i].haveZrtpHash = 0;
md->streams[i].haveLimeIk = 0;
}
return md;
}
......@@ -367,9 +366,8 @@ bool_t sal_stream_description_has_zrtp(const SalStreamDescription *sd) {
return FALSE;
}
bool_t sal_stream_description_has_limeIk(const SalStreamDescription *sd) {
if (sd->haveLimeIk==1) return TRUE;
return FALSE;
bool_t sal_media_description_has_limeIk(const SalMediaDescription *md) {
return md->haveLimeIk;
}
bool_t sal_media_description_has_avpf(const SalMediaDescription *md) {
......
......@@ -287,7 +287,6 @@ typedef struct SalStreamDescription{
bool_t set_nortpproxy; /*Formely set by ICE to indicate to the proxy that it has nothing to do*/
bool_t rtcp_mux;
uint8_t haveZrtpHash; /**< flag for zrtp hash presence */
uint8_t haveLimeIk; /**< flag for lime Ik presence */
uint8_t zrtphash[128];
char dtls_fingerprint[256];
SalDtlsRole dtls_role;
......@@ -328,7 +327,7 @@ typedef struct SalMediaDescription{
bool_t ice_lite;
bool_t set_nortpproxy;
bool_t accept_bundles; /* Set to TRUE if RTP bundles can be accepted during offer answer. This field has no appearance on the SDP.*/
bool_t pad[1];
bool_t haveLimeIk; /**< flag for lime Ik presence */
} SalMediaDescription;
typedef struct SalMessage{
......@@ -371,8 +370,8 @@ bool_t sal_stream_description_has_avpf(const SalStreamDescription *sd);
bool_t sal_stream_description_has_implicit_avpf(const SalStreamDescription *sd);
bool_t sal_stream_description_has_srtp(const SalStreamDescription *sd);
bool_t sal_stream_description_has_dtls(const SalStreamDescription *sd);
bool_t sal_stream_description_has_limeIk(const SalStreamDescription *sd);
bool_t sal_stream_description_has_ipv6(const SalStreamDescription *md);
bool_t sal_media_description_has_limeIk(const SalMediaDescription *md);
bool_t sal_media_description_has_avpf(const SalMediaDescription *md);
bool_t sal_media_description_has_implicit_avpf(const SalMediaDescription *md);
bool_t sal_media_description_has_srtp(const SalMediaDescription *md);
......
......@@ -416,7 +416,7 @@ void MS2AudioStream::render(const OfferAnswerContext &params, CallSession::State
if ((requestedMediaEncryption == LinphoneMediaEncryptionZRTP) || (params.remoteStreamDescription->haveZrtpHash == 1)) {
// However, when we are receiver, if peer offers a lime-Ik attribute, we shall delay the start (and ZRTP Hello Packet sending)
// until the ACK has been received to ensure the caller got our 200 Ok (with lime-Ik in it) before starting its ZRTP engine
if (!params.localIsOfferer && sal_stream_description_has_limeIk(params.remoteStreamDescription)) {
if (!params.localIsOfferer && sal_media_description_has_limeIk(params.remoteMediaDescription)) {
mStartZrtpLater = true;
} else {
startZrtpPrimaryChannel(params);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment