Browse code

rtpegnine: honour the 'setid_default' variable in all instances

Richard Fuchs authored on 31/01/2018 17:10:16
Showing 1 changed files
... ...
@@ -734,14 +734,6 @@ struct rtpp_set *get_rtpp_set(unsigned int set_id)
734 734
 	unsigned int my_current_id = 0;
735 735
 	int new_list;
736 736
 
737
-#if DEFAULT_RTPP_SET_ID > 0
738
-	if (set_id < DEFAULT_RTPP_SET_ID )
739
-	{
740
-		LM_ERR(" invalid rtpproxy set value [%u]\n", set_id);
741
-		return NULL;
742
-	}
743
-#endif
744
-
745 737
 	my_current_id = set_id;
746 738
 	/*search for the current_id*/
747 739
 	lock_get(rtpp_set_list->rset_head_lock);
... ...
@@ -798,7 +790,7 @@ struct rtpp_set *get_rtpp_set(unsigned int set_id)
798 790
 		rtpp_set_list->rset_last = rtpp_list;
799 791
 		rtpp_set_count++;
800 792
 
801
-		if(my_current_id == DEFAULT_RTPP_SET_ID){
793
+		if(my_current_id == setid_default){
802 794
 			default_rtpp_set = rtpp_list;
803 795
 		}
804 796
 	}
... ...
@@ -1010,7 +1002,7 @@ static int rtpengine_add_rtpengine_set(char * rtp_proxies, unsigned int weight,
1010 1002
 		rtp_proxies+=2;
1011 1003
 	}else{
1012 1004
 		rtp_proxies = p;
1013
-		my_current_id = DEFAULT_RTPP_SET_ID;
1005
+		my_current_id = setid_default;
1014 1006
 	}
1015 1007
 
1016 1008
 	for(;*rtp_proxies && isspace(*rtp_proxies);rtp_proxies++);
... ...
@@ -1490,10 +1482,6 @@ mod_init(void)
1490 1482
 		}
1491 1483
 	}
1492 1484
 
1493
-	/* any rtpproxy configured? */
1494
-	if (rtpp_set_list)
1495
-		default_rtpp_set = select_rtpp_set(DEFAULT_RTPP_SET_ID);
1496
-
1497 1485
 	if (rtp_inst_pv_param.s) {
1498 1486
 		rtp_inst_pv_param.len = strlen(rtp_inst_pv_param.s);
1499 1487
 		rtp_inst_pvar = pv_cache_get(&rtp_inst_pv_param);