mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Merge "res_pjsip: Fail global load if debug or default_from_user are empty"
This commit is contained in:
		| @@ -118,6 +118,18 @@ static int global_apply(const struct ast_sorcery *sorcery, void *obj) | ||||
| 	struct global_config *cfg = obj; | ||||
| 	char max_forwards[10]; | ||||
|  | ||||
| 	if (ast_strlen_zero(cfg->debug)) { | ||||
| 		ast_log(LOG_ERROR, | ||||
| 			"Global option 'debug' can't be empty.  Set it to a valid value or remove the entry to accept 'no' as the default\n"); | ||||
| 		return -1; | ||||
| 	} | ||||
|  | ||||
| 	if (ast_strlen_zero(cfg->default_from_user)) { | ||||
| 		ast_log(LOG_ERROR, | ||||
| 			"Global option 'default_from_user' can't be empty.  Set it to a valid value or remove the entry to accept 'asterisk' as the default\n"); | ||||
| 		return -1; | ||||
| 	} | ||||
|  | ||||
| 	snprintf(max_forwards, sizeof(max_forwards), "%u", cfg->max_forwards); | ||||
|  | ||||
| 	ast_sip_add_global_request_header("Max-Forwards", max_forwards, 1); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user