Review Board 1.7.16


WebRTC: Add SHA-256 support, change DTLS-SRTP negotiation, add finer grain control of things.

Review Request #3679 - Created June 26, 2014 and submitted

Joshua Colp
sha256-a-harsh-reality
ASTERISK-22961, ASTERISK-23026
Reviewers
asterisk-dev
Asterisk
This change does the following:

1. Adds SHA-256 support for DTLS-SRTP. This is done in an extensible way so if we need to add other hashes it should be relatively easy to.
2. Adds the ability to force "AVP" for DTLS streams for greater interoperability.
3. Sets the ICE role to controlled or controlling depending on offer/answer.
4. Provides the ability to verify only fingerprint, certificate, or both.
5. Adds DTLS negotiation to RTCP.
6. Changes DTLS negotiation to occur after ICE negotiation completes.
7. Adds handling of DTLS traffic before ICE negotiation has formally completed.
Tested inbound and outbound calls against:

Chrome
Yandex Browser
Opera
Maxthon
Firefox

Note that hold/unhold only currently works against Chrome based browsers.

Changes between revision 1 and 2

1 2 3
1 2 3

  1. /channels/chan_sip.c: Loading...
  2. /channels/sip/include/sip.h: Loading...
  3. /configs/sip.conf.sample: Loading...
  4. /include/asterisk/rtp_engine.h: Loading...
  5. /main/rtp_engine.c: Loading...
  6. /res/res_rtp_asterisk.c: Loading...
/branches/11/channels/chan_sip.c /channels/chan_sip.c
Diff Revision 1 Diff Revision 2
[20] 2575 lines
[+20] [+] static void sip_websocket_callback(struct ast_websocket *session, struct ast_variable *parameters, struct ast_variable *headers)
2576

    
   
2576

   
2577
	if (ast_websocket_set_nonblock(session)) {
2577
	if (ast_websocket_set_nonblock(session)) {
2578
		goto end;
2578
		goto end;
2579
	}
2579
	}
2580

    
   
2580

   

    
   
2581
	if (ast_websocket_set_timeout(session, sip_cfg.websocket_write_timeout)) {

    
   
2582
		goto end;

    
   
2583
	}

    
   
2584

   
2581
	while ((res = ast_wait_for_input(ast_websocket_fd(session), -1)) > 0) {
2585
	while ((res = ast_wait_for_input(ast_websocket_fd(session), -1)) > 0) {
2582
		char *payload;
2586
		char *payload;
2583
		uint64_t payload_len;
2587
		uint64_t payload_len;
2584
		enum ast_websocket_opcode opcode;
2588
		enum ast_websocket_opcode opcode;
2585
		int fragmented;
2589
		int fragmented;
[+20] [20] 29684 lines
[+20] [+] static int reload_config(enum channelreloadreason reason)
32270
			ast_set2_flag(&global_flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT);
32274
			ast_set2_flag(&global_flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT);
32271
		} else if (!strcasecmp(v->name, "parkinglot")) {
32275
		} else if (!strcasecmp(v->name, "parkinglot")) {
32272
			ast_copy_string(default_parkinglot, v->value, sizeof(default_parkinglot));
32276
			ast_copy_string(default_parkinglot, v->value, sizeof(default_parkinglot));
32273
		} else if (!strcasecmp(v->name, "refer_addheaders")) {
32277
		} else if (!strcasecmp(v->name, "refer_addheaders")) {
32274
			global_refer_addheaders = ast_true(v->value);
32278
			global_refer_addheaders = ast_true(v->value);

    
   
32279
		} else if (!strcasecmp(v->name, "websocket_write_timeout")) {

    
   
32280
			if (sscanf(v->value, "%30d", &sip_cfg.websocket_write_timeout) != 1

    
   
32281
				|| sip_cfg.websocket_write_timeout < 0) {

    
   
32282
				ast_log(LOG_WARNING, "'%s' is not a valid websocket_write_timeout value at line %d. Using default '%d'.\n", v->value, v->lineno, AST_DEFAULT_WEBSOCKET_WRITE_TIMEOUT);

    
   
32283
				sip_cfg.websocket_write_timeout = AST_DEFAULT_WEBSOCKET_WRITE_TIMEOUT;

    
   
32284
			}
32275
		}
32285
		}
32276
	}
32286
	}
32277

    
   
32287

   
32278
	/* Override global defaults if setting found in general section */
32288
	/* Override global defaults if setting found in general section */
32279
	ast_copy_flags(&global_flags[0], &setflags[0], mask[0].flags);
32289
	ast_copy_flags(&global_flags[0], &setflags[0], mask[0].flags);
[+20] [20] 2750 lines
/branches/11/channels/sip/include/sip.h
Diff Revision 1 Diff Revision 2
 
/branches/11/configs/sip.conf.sample
Diff Revision 1 Diff Revision 2
 
/branches/11/include/asterisk/rtp_engine.h
Diff Revision 1 Diff Revision 2
 
/branches/11/main/rtp_engine.c
Diff Revision 1 Diff Revision 2
 
/branches/11/res/res_rtp_asterisk.c
Diff Revision 1 Diff Revision 2
 
  1. /channels/chan_sip.c: Loading...
  2. /channels/sip/include/sip.h: Loading...
  3. /configs/sip.conf.sample: Loading...
  4. /include/asterisk/rtp_engine.h: Loading...
  5. /main/rtp_engine.c: Loading...
  6. /res/res_rtp_asterisk.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.