[asterisk-commits] mjordan: branch 13 r425221 - in /branches/13: ./ res/res_phoneprov.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 10 09:31:05 CDT 2014


Author: mjordan
Date: Fri Oct 10 09:31:02 2014
New Revision: 425221

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=425221
Log:
res/res_phoneprov: Bail on registration if res_phoneprov didn't load

If res_phoneprov failed to fully load (due to not being configured), the
providers container will be NULL. If a module attempts to register a phone
provisioning provider, it should check for the presence of the container.
If there is no providers container, it should return an error.

This patch makes the ast_phoneprov_provider_register function do that...
otherwise this would be a silly commit message.
........

Merged revisions 425220 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    branches/13/   (props changed)
    branches/13/res/res_phoneprov.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: branches/13/res/res_phoneprov.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_phoneprov.c?view=diff&rev=425221&r1=425220&r2=425221
==============================================================================
--- branches/13/res/res_phoneprov.c (original)
+++ branches/13/res/res_phoneprov.c Fri Oct 10 09:31:02 2014
@@ -1502,6 +1502,11 @@
 		return -1;
 	}
 
+	if (!providers) {
+		ast_log(LOG_WARNING, "Provider '%s' cannot be registered: res_phoneprov not loaded.\n", provider_name);
+		return -1;
+	}
+
 	provider = find_provider(provider_name);
 	if (provider) {
 		ast_log(LOG_ERROR, "There is already a provider registered named '%s'.\n", provider_name);




More information about the asterisk-commits mailing list