Revision 49f09b14

View differences:

conf/janus.plugin.sip.cfg.sample
12 12
; sent in the form of OPTIONS requests, at the given interval inseconds.
13 13
; (0 to disable)
14 14
keepalive_interval = 120
15
; Indicate if the server is behind NAT. If so, the server will use STUN
16
; to guess its own public IP address and use it in the Contat header of
17
; outgoing requests
18
behind_nat = no
15 19

  
plugins/janus_sip.c
134 134

  
135 135
static char *local_ip = NULL;
136 136
static int keepalive_interval = 120;
137
static gboolean behind_nat = FALSE;
137 138

  
138 139
static GThread *handler_thread;
139 140
static GThread *watchdog;
......
392 393
	if(item && item->value)
393 394
	        keepalive_interval = atoi(item->value);
394 395
	JANUS_LOG(LOG_VERB, "SIP keep-alive interval set to %d seconds\n", keepalive_interval);
396
	item = janus_config_get_item_drilldown(config, "general", "behind_nat");
397
	if(item && item->value)
398
	        behind_nat = janus_is_true(item->value);
395 399
	item = janus_config_get_item_drilldown(config, "general", "autodetect_ignore");
396 400
	if(item && item->value) {
397 401
		gchar **list = g_strsplit(item->value, ",", -1);
......
1122 1126
				char outbound_options[256] = "use-rport no-validate";
1123 1127
				if (keepalive_interval > 0)
1124 1128
				        strcat(outbound_options, " options-keepalive");
1129
				if (!behind_nat)
1130
				        strcat(outbound_options, " no-natify");
1125 1131
				JANUS_LOG(LOG_VERB, "%s --> %s\n", username_text, proxy_text);
1126 1132
				nua_register(session->stack->s_nh_r,
1127 1133
					NUTAG_M_USERNAME(session->account.username),

Also available in: Unified diff