summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2018-02-23 08:26:50 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2018-02-23 08:26:50 -0600
commit01510df6728301a91a76b29a2b40ad6f6dc6d556 (patch)
tree1000e791e7544d795e8015b044330c86a14042d9 /res
parentd4fc1bdad67c26eb340624e06e81f86ab55aaa20 (diff)
parent4b555d7147f5180456eae4986df6344ee4142f06 (diff)
Merge "res_rtp_asterisk: Fix ICE candidate nomination"
Diffstat (limited to 'res')
-rw-r--r--res/res_rtp_asterisk.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 913fbad1c..d3273b463 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1036,6 +1036,15 @@ static void ast_rtp_ice_set_role(struct ast_rtp_instance *instance, enum ast_rtp
}
rtp->role = role;
+
+ if (!rtp->ice->real_ice->is_nominating && !rtp->ice->real_ice->is_complete) {
+ pj_thread_register_check();
+
+ pj_ice_sess_change_role(rtp->ice->real_ice, role == AST_RTP_ICE_ROLE_CONTROLLED ?
+ PJ_ICE_SESS_ROLE_CONTROLLED : PJ_ICE_SESS_ROLE_CONTROLLING);
+ } else {
+ ast_debug(3, "Not setting ICE role because state is %s\n", rtp->ice->real_ice->is_nominating ? "nominating" : "complete" );
+ }
}
/*! \pre instance is locked */