mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Stasis Core: Refactor ACL Change events to go out over the stasis core msg bus
(issue ASTERISK-21103) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2481/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		
							
								
								
									
										21
									
								
								main/json.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								main/json.c
									
									
									
									
									
								
							| @@ -39,6 +39,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") | ||||
| #include "asterisk/localtime.h" | ||||
| #include "asterisk/module.h" | ||||
| #include "asterisk/utils.h" | ||||
| #include "asterisk/astobj2.h" | ||||
|  | ||||
| #include <jansson.h> | ||||
| #include <time.h> | ||||
| @@ -531,3 +532,23 @@ void ast_json_init(void) | ||||
| 	/* Setup to use Asterisk custom allocators */ | ||||
| 	ast_json_reset_alloc_funcs(); | ||||
| } | ||||
|  | ||||
| static void json_payload_destructor(void *obj) | ||||
| { | ||||
| 	struct ast_json_payload *payload = obj; | ||||
| 	ast_json_unref(payload->json); | ||||
| } | ||||
|  | ||||
| struct ast_json_payload *ast_json_payload_create(struct ast_json *json) | ||||
| { | ||||
| 	struct ast_json_payload *payload; | ||||
|  | ||||
| 	if (!(payload = ao2_alloc(sizeof(*payload), json_payload_destructor))) { | ||||
| 		return NULL; | ||||
| 	} | ||||
|  | ||||
| 	ast_json_ref(json); | ||||
| 	payload->json = json; | ||||
|  | ||||
| 	return payload; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user