mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	Don't make chan_sip export global symbols.
During testing, it was discovered that having chan_sip export global symbols was problematic. The biggest problem was that load order was affected. Trying to use realtime could be problematic since in all likelihood the necessary realtime driver(s) would not be loaded before chan_sip. In addition, it was found that it was impossible to use the Digium Phone Module for Asterisk since it must be loaded before chan_sip since it must hook into chan_sip's configuration parsing. The solution is to use a virtual table in the same manner that other modules in Asterisk do, like app_voicemail. (closes issue ASTERISK-20545) Reported by: kmoore ........ Merged revisions 374842 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -7342,7 +7342,8 @@ static int initialize_udptl(struct sip_pvt *p) | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
| int ast_sipinfo_send( | ||||
| 
 | ||||
| static int sipinfo_send( | ||||
| 		struct ast_channel *chan, | ||||
| 		struct ast_variable *headers, | ||||
| 		const char *content_type, | ||||
| @@ -33298,6 +33299,12 @@ static const struct ast_data_entry sip_data_providers[] = { | ||||
| 	AST_DATA_ENTRY("asterisk/channel/sip/peers", &peers_data_provider), | ||||
| }; | ||||
| 
 | ||||
| static const struct ast_sip_api_tech chan_sip_api_provider = { | ||||
| 	.version = AST_SIP_API_VERSION, | ||||
| 	.name = "chan_sip", | ||||
| 	.sipinfo_send = sipinfo_send, | ||||
| }; | ||||
| 
 | ||||
| /*!
 | ||||
|  * \brief Load the module | ||||
|  * | ||||
| @@ -33316,6 +33323,10 @@ static int load_module(void) | ||||
| 		return AST_MODULE_LOAD_FAILURE; | ||||
| 	} | ||||
| 
 | ||||
| 	if (ast_sip_api_provider_register(&chan_sip_api_provider)) { | ||||
| 		return AST_MODULE_LOAD_FAILURE; | ||||
| 	} | ||||
| 
 | ||||
| 	/* the fact that ao2_containers can't resize automatically is a major worry! */ | ||||
| 	/* if the number of objects gets above MAX_XXX_BUCKETS, things will slow down */ | ||||
| 	peers = ao2_t_container_alloc(HASH_PEER_SIZE, peer_hash_cb, peer_cmp_cb, "allocate peers"); | ||||
| @@ -33477,6 +33488,8 @@ static int unload_module(void) | ||||
| 	struct ao2_iterator i; | ||||
| 	int wait_count; | ||||
| 
 | ||||
| 	ast_sip_api_provider_unregister(); | ||||
| 
 | ||||
| 	ast_websocket_remove_protocol("sip", sip_websocket_callback); | ||||
| 
 | ||||
| 	network_change_event_unsubscribe(); | ||||
| @@ -33652,7 +33665,7 @@ static int unload_module(void) | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
| AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "Session Initiation Protocol (SIP)", | ||||
| AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Session Initiation Protocol (SIP)", | ||||
| 		.load = load_module, | ||||
| 		.unload = unload_module, | ||||
| 		.reload = reload, | ||||
|   | ||||
| @@ -1,6 +0,0 @@ | ||||
| { | ||||
| 	global: | ||||
| 		LINKER_SYMBOL_PREFIX*ast_sipinfo_send; | ||||
| 	local: | ||||
| 		*; | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user