Revision 58fb2cdc src/janus_instance.c

View differences:

src/janus_instance.c
132 132
	if (ji && (*ji))
133 133
	{
134 134
		if ((*ji)->janus_pid != INVALID_PID)
135
			kill((*ji)->janus_pid, SIGTERM);
135
			kill((*ji)->janus_pid, SIGHUP);
136 136
			
137 137
		if ((*ji)->heartbeat)
138 138
			task_manager_destroy_task((*ji)->tm, &((*ji)->heartbeat));
......
349 349
				}
350 350
				else // the child
351 351
				{
352
					fd = creat(ji->logfile, 'w');
352
					fd = creat(ji->logfile, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
353 353
					dup2(fd, 1);   // make stdout go to file
354 354
					dup2(fd, 2);   // make stderr go to file - you may choose to not do this
355 355
					close(fd);
......
523 523
	struct mg_connection * conn;
524 524
	int8_t res = -1;
525 525
	char * uri;
526
	char * fmt = "{\"transaction\":\"random_str\",\"janus\":\"message\",\"body\":{\"request\":\"create\",\"room\":%s}}";
526
	char * fmt = "{\"transaction\":\"random_str\",\"janus\":\"message\",\"body\":{\"request\":\"create\",\"room\":%s,\"publishers\":1,\"bitrate\":128000,\"record\":false,\"description\":\"Room %s\",\"fir_freq\":100}}";
527 527

  
528 528
	char buff[280];
529 529
	void ** data;
......
533 533
		uri = janus_instance_videoroom_handle_path(janus);
534 534
		if (uri)
535 535
		{
536
			sprintf(buff, fmt, room_id);
536
			sprintf(buff, fmt, room_id, room_id);
537 537
		   debug("Conctating Janus to create a new video room\n");	
538 538
			conn = mg_connect_http(janus->mongoose_srv, janus_instance_videoroom_creation_handler, uri, NULL, buff);
539 539
			if (conn)
......
581 581
	struct mg_connection * conn;
582 582
	int8_t res = -1;
583 583
	char * uri;
584
	char * fmt = "{\"transaction\":\"random_str\",\"janus\":\"message\",\"body\":{\"request\":\"rtp_forward\",\"room\":%s,\"publisher_id\":%"PRId64", \"host\": %s,\"audio_port\":%"PRId16",\"video_port\":%"PRId16",\"audio_pt\":111,\"video_pt\":98}}";
584
	char * fmt = "{\"transaction\":\"random_str\",\"janus\":\"message\",\"body\":{\"request\":\"rtp_forward\",\"room\":%s,\"publisher_id\":%"PRId64", \"host\": \"%s\",\"audio_port\":%"PRId16",\"video_port\":%"PRId16",\"audio_pt\":111,\"video_pt\":98}}";
585 585

  
586 586
	char buff[280];
587 587

  
......
591 591
		if (uri)
592 592
		{
593 593
			sprintf(buff, fmt, room_id, participant_id, rtp_dest, audio_port, video_port);
594
		   debug("Conctating Janus to create a new video room\n");	
594
		    debug("Conctating Janus to create a new video room\n");	
595 595
			conn = mg_connect_http(janus->mongoose_srv, janus_instance_generic_handler, uri, NULL, buff);
596 596
			if (conn)
597 597
				res = 0;

Also available in: Unified diff