]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_phoneprov: Refactor phoneprov to allow pluggable config providers
authorGeorge Joseph <george.joseph@fairview5.com>
Thu, 9 Oct 2014 17:41:12 +0000 (17:41 +0000)
committerGeorge Joseph <george.joseph@fairview5.com>
Thu, 9 Oct 2014 17:41:12 +0000 (17:41 +0000)
commit1d06ead110b753d755705a93d3568aedde6008b2
tree5bbed0bfce64631af4d87e38804f29d57d6364a2
parent84967c876007dc6b3d9289e495c8e393cb9d56c0
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@424963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
configs/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]