mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 20:48:07 +00:00
Fix ICE roles.
This commit is contained in:
parent
6857091ea9
commit
6066dbc529
1 changed files with 11 additions and 5 deletions
|
|
@ -396,6 +396,7 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc, IceS
|
|||
sdp_bandwidth_t *sbw=NULL;
|
||||
sdp_attribute_t *attr;
|
||||
int media_attribute_nb;
|
||||
bool_t ice_session_just_created = FALSE;
|
||||
bool_t ice_lite = FALSE;
|
||||
|
||||
addr=sdp_message_c_addr_get (msg, -1, 0);
|
||||
|
|
@ -517,7 +518,10 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc, IceS
|
|||
int nb;
|
||||
|
||||
/* Allocate the ICE session if it has not been done yet. */
|
||||
if (*ice_session == NULL) *ice_session = ice_session_new();
|
||||
if (*ice_session == NULL) {
|
||||
*ice_session = ice_session_new();
|
||||
ice_session_just_created = TRUE;
|
||||
}
|
||||
/* Allocate the ICE check list if it has not been done yet. */
|
||||
if (ice_session_check_list(*ice_session, i) == NULL) {
|
||||
ice_session_add_check_list(*ice_session, ice_check_list_new());
|
||||
|
|
@ -552,10 +556,12 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc, IceS
|
|||
}
|
||||
}
|
||||
if (*ice_session != NULL) {
|
||||
if (ice_lite == TRUE) {
|
||||
ice_session_set_role(*ice_session, IR_Controlling);
|
||||
} else {
|
||||
ice_session_set_role(*ice_session, IR_Controlled);
|
||||
if (ice_session_just_created == TRUE) {
|
||||
if (ice_lite == TRUE) {
|
||||
ice_session_set_role(*ice_session, IR_Controlling);
|
||||
} else {
|
||||
ice_session_set_role(*ice_session, IR_Controlled);
|
||||
}
|
||||
}
|
||||
if ((ice_ufrag != NULL) && (ice_pwd != NULL)) {
|
||||
ice_session_set_remote_credentials(*ice_session, ice_ufrag, ice_pwd);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue