mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	resource_channels.c: Fix wrong external media parameter parse
Fixed ARI external media handler to accept body parameters. ASTERISK-29622 Change-Id: I49509c48a6cbc0fb4165bfa4f834b5e8b9ace20d
This commit is contained in:
		
				
					committed by
					
						 Friendly Automation
						Friendly Automation
					
				
			
			
				
	
			
			
			
						parent
						
							16b0f460f6
						
					
				
				
					commit
					3c31b6aaa2
				
			| @@ -2188,6 +2188,18 @@ void ast_ari_channels_external_media(struct ast_variable *headers, | ||||
|  | ||||
| 	ast_assert(response != NULL); | ||||
|  | ||||
| 	/* Parse any query parameters out of the body parameter */ | ||||
| 	if (args->variables) { | ||||
| 		struct ast_json *json_variables; | ||||
|  | ||||
| 		ast_ari_channels_external_media_parse_body(args->variables, args); | ||||
| 		json_variables = ast_json_object_get(args->variables, "variables"); | ||||
| 		if (json_variables | ||||
| 			&& json_to_ast_variables(response, json_variables, &variables)) { | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (ast_strlen_zero(args->app)) { | ||||
| 		ast_ari_response_error(response, 400, "Bad Request", "app cannot be empty"); | ||||
| 		return; | ||||
| @@ -2222,17 +2234,6 @@ void ast_ari_channels_external_media(struct ast_variable *headers, | ||||
| 		args->direction = "both"; | ||||
| 	} | ||||
|  | ||||
| 	if (args->variables) { | ||||
| 		struct ast_json *json_variables; | ||||
|  | ||||
| 		ast_ari_channels_external_media_parse_body(args->variables, args); | ||||
| 		json_variables = ast_json_object_get(args->variables, "variables"); | ||||
| 		if (json_variables | ||||
| 			&& json_to_ast_variables(response, json_variables, &variables)) { | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (strcasecmp(args->encapsulation, "rtp") == 0 && strcasecmp(args->transport, "udp") == 0) { | ||||
| 		external_media_rtp_udp(args, variables, response); | ||||
| 	} else if (strcasecmp(args->encapsulation, "audiosocket") == 0 && strcasecmp(args->transport, "tcp") == 0) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user