[Asterisk-code-review] chan sip.c: Start ICE checking in proper time. (asterisk[11])

Eugene Voityuk asteriskteam at digium.com
Mon Jun 22 08:41:27 CDT 2015


Eugene Voityuk has uploaded a new change for review.

  https://gerrit.asterisk.org/679

Change subject: chan_sip.c: Start ICE checking in proper time.
......................................................................

chan_sip.c: Start ICE checking in proper time.

Right now asterisk start ice checking on any sdp with
ice candidates which is wrong,
because browsers start ice checking onlyafter
they have remote description.
In current implementation, when any WebRTC extension
is sending INVITE with ICE candiddates,
it will immediatly start pj_ice_sess_start_check,
which will try to do checking and fill fire callback with failed status,
for this to happend you have ~7 seconds
(browser should set remote description before callback is failed),
if remote pick's up after callback is fire
you will have no audio in both directions.
This commit fixes this issue, by calling ice_start, only for responses.
I was also trying to add more logic to res_rtp_asterisk.c,
but that is beynd of my understatnding.

ASTERISK-24146

Change-Id: Ife7fd7d65026393bd4b09805aa788ea358ec3c35
---
M channels/chan_sip.c
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/79/679/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index de23063..f81a9fb 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10519,8 +10519,10 @@
 	/* Setup audio address and port */
 	if (p->rtp) {
 		if (sa && portno > 0) {
-			start_ice(p->rtp, (req->method != SIP_RESPONSE) ? 0 : 1);
-			ast_sockaddr_set_port(sa, portno);
+                        if(req->method == SIP_RESPONSE){
+                                start_ice(p->rtp,(req->method != SIP_RESPONSE) ? 0 : 1);
+                        }
+                        ast_sockaddr_set_port(sa, portno);
 			ast_rtp_instance_set_remote_address(p->rtp, sa);
 			if (debug) {
 				ast_verbose("Peer audio RTP is at port %s\n",
@@ -13265,6 +13267,7 @@
 		if (!doing_directmedia) {
 			if (ast_test_flag(&p->flags[2], SIP_PAGE3_ICE_SUPPORT)) {
 				add_ice_to_sdp(p->rtp, &a_audio);
+                                start_ice(p->rtp,0);
 			}
 
 			add_dtls_to_sdp(p->rtp, &a_audio);

-- 
To view, visit https://gerrit.asterisk.org/679
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife7fd7d65026393bd4b09805aa788ea358ec3c35
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Eugene Voityuk <eugene at thirdlane.com>



More information about the asterisk-code-review mailing list