res_phoneprov: Refactor phoneprov to allow pluggable config providers
authorGeorge Joseph <george.joseph@fairview5.com>
Thu, 9 Oct 2014 17:46:23 +0000 (17:46 +0000)
committerGeorge Joseph <george.joseph@fairview5.com>
Thu, 9 Oct 2014 17:46:23 +0000 (17:46 +0000)
commitcc595f7353c4b2c5fc71223a8b1ded601e068e04
tree3776420c0b61f53ede590342ebd6e835fd278c1c
parent0f50e8856b23aa835a1107af5a995019c374ba51
res_phoneprov: Refactor phoneprov to allow pluggable config providers

This patch makes res_phoneprov more modular so other modules (like pjsip)
can provide configuration information instead of res_phoneprov relying solely
on users.conf and sip.conf.  To accomplish this a new ast_phoneprov public API
is now exposed which allows config providers to register themselves, set
defaults (server profile, etc) and add user extensions.

* ast_phoneprov_provider_register registers the provider and provides callbacks
  for loading default settings and loading users.
* ast_phoneprov_provider_unregister clears the defaults and users.
* ast_phoneprov_add_extension should be called once for each user/extension
  by the provider's load_users callback to add them.
* ast_phoneprov_delete_extension deletes one extension.
* ast_phoneprov_delete_extensions deletes all extensions for the provider.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/3970/
........

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

Merged revisions 424964 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
configs/samples/phoneprov.conf.sample
include/asterisk/chanvars.h
include/asterisk/phoneprov.h [new file with mode: 0644]
main/chanvars.c
res/res_phoneprov.c
res/res_phoneprov.exports.in [new file with mode: 0644]