summaryrefslogtreecommitdiff
path: root/res/res_phoneprov.c
AgeCommit message (Collapse)Author
2018-03-14loader: Convert reload_classes to built-in modules.Corey Farrell
* acl (named_acl.c) * cdr * cel * ccss * dnsmgr * dsp * enum * extconfig (config.c) * features * http * indications * logger * manager * plc * sounds * udptl These modules are now loaded at appropriate time by the module loader. Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so the module loader will abort startup on failure of these modules. Some of these modules are still initialized or shutdown from outside the module loader. logger.c is initialized very early and shutdown very late, manager.c is initialized by the module loader but is shutdown by the Asterisk core (too much uses it without holding references). Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2016-11-15Implement internal abstraction for iostreamsTimo Teräs
fopencookie/funclose is a non-standard API and should not be used in portable software. Additionally, the way FILE's fd is used in non-blocking mode is undefined behaviour and cannot be relied on. This introduces internal abstraction for io streams, that allows implementing the desired virtualization of read/write operations with necessary timeout handling. ASTERISK-24515 #close ASTERISK-24517 #close Change-Id: Id916aef418b665ced6a7489aef74908b6e376e85
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-06-20fix: memory leaks, resource leaks, out of bounds and bugsAlexei Gradinari
ASTERISK-26119 #close Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c
2016-02-11Resources/res_phoneprov: fix memory leak and heap-use-after-freeBadalyan Vyacheslav
* heap-use-after-free happens when we free "cfg" but then use "value" which refers to it * A memory leak occurs because in some cases it is not released "defaults" ASTERISK-25721 #close Reported by: Badalyan Vyacheslav Tested by: Badalyan Vyacheslav Change-Id: I3807d3f4726df6864430ec144cf6265d3f538469
2016-02-03logging: Remove/fix some message annoyancesGeorge Joseph
test_dlinklists doesn't need to NOTICE everyone that every macro worked. res_phoneprov doesn't need to VERBOSE everyone that a phoneprov extension or provider was registered. res_odbc was missing a newline at the end of one message. Change-Id: I6c06361518ef3711821795e535acd439782a995e
2015-05-13AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro.Rodrigo Ramírez Norambuena
Change-Id: Icf88f9f861c6b2a16e5f626ff25795218a6f2723
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-09res_pjsip_phoneprov_provider: Fix reference leak on unloadGeorge Joseph
res_pjsip_phoneprov_provider was leaking references to phoneprov objects due to a missing OBJ_NODATA in an ao2_callback in load_users(). Rather than adding the OBJ_NODATA, I changed load_users to use a more straightforward ao2_iterator. This plugged the leak but exposed an unload order issue between res_pjsip_phoneprov_provider, res_phoneprov and res_pjsip. res_pjsip_phoneprov_provider unloads first, then res_phoneprov, then res_pjsip. Since res_pjsip_phoneprov_provider uses res_pjsip's sorcery instance, when it unloads, it's objects are still in the sorcery instance. When res_pjsip unloads, it destroys all its objects including res_pjsip_phoneprov_provider's. The phoneprov destructor then attempts to unregister the extension from res_phoneprov but because res_phoneprov is already cleaned up, its users container is gone and we get a FRACK. Simple solution, check for the NULL users container before attempting to remove the entry. Duh. Ran tests/res_phoneprov/res_phoneprov_provider. No leaks in res_pjsip_phoneprov_provider and no FRACKs. Reported-by: Corey Farrell Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4608/ ASTERISK-24935 #close ........ Merged revisions 434545 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-27res/res_phoneprov: Fix crash on shutdown caused by container cleanupMatthew Jordan
In res_phoneprov, unloading the module first destroys the http_routes container, followed by the users. However, users may have a route in the http_routes container; the validity of this container is not checked in the users destructor. Hence, we hit an assert as the container has already been set to NULL. This patch does two things: (1) It adds a sanity check in the user destructor (because why not) (2) It switches the order of destruction, so that users are disposed of prior to the HTTP routes they may hold a reference to. Note that this crash was caught by the Test Suite (go go testing!) ........ Merged revisions 426174 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 426176 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-14res_phoneprov: Create accessor for ast_phoneprov_std_variable_lookupGeorge Joseph
Based on feedback from Richard, I created an accessor for res_phoneprov/ast_phoneprov_std_variable_lookup and added load priority to AST_MODULE_INFO. Tested-by: George Joseph Tested-by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/4076/ ........ Merged revisions 425480 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 425481 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-11res_phoneprov: Cleanup module load error handlingGeorge Joseph
Tested module load/reload interaction between res_phoneprov and res_pjsip_phoneprov_provider in cases where res_phoneprov didn't load correctly (usually misconfiguration or missing phoneprov.conf) Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4069/ ........ Merged revisions 425264 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 425265 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-10res/res_phoneprov: Bail on registration if res_phoneprov didn't loadMatthew Jordan
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 ........ Merged revisions 425221 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-09res/res_phoneprov: Don't cancel Asterisk load on module load failureMatthew Jordan
........ Merged revisions 424985 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 424986 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-09res_phoneprov: Refactor phoneprov to allow pluggable config providersGeorge Joseph
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
2014-09-26core: Don't allow free to mean ast_free (and malloc, etc..).Walter Doekes
This gets rid of most old libc free/malloc/realloc and replaces them with ast_free and friends. When compiling with MALLOC_DEBUG you'll notice it when you're mistakenly using one of the libc variants. For the legacy cases you can define WRAP_LIBC_MALLOC before including asterisk.h. Even better would be if the errors were also enabled when compiling without MALLOC_DEBUG, but that's a slightly more invasive header file change. Those compiling addons/format_mp3 will need to rerun ./contrib/scripts/get_mp3_source.sh. ASTERISK-24348 #related Review: https://reviewboard.asterisk.org/r/4015/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25Add module support level to ast_module_info structure. Print it in CLI ↵Mark Michelson
"module show" . ASTERISK-23919 #close Reported by Malcolm Davenport Review: https://reviewboard.asterisk.org/r/3802 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-03HTTP: Add persistent connection support.Richard Mudgett
Persistent HTTP connection support is needed due to the increased usage of the Asterisk core HTTP transport and the frequency at which REST API calls are going to be issued. * Add http.conf session_keep_alive option to enable persistent connections. * Parse and discard optional chunked body extension information and trailing request headers. * Increased the maximum application/json and application/x-www-form-urlencoded body size allowed to 4k. The previous 1k was kind of small. * Removed a couple inlined versions of ast_http_manid_from_vars() by calling the function. manager.c:generic_http_callback() and res_http_post.c:http_post_callback() * Add missing va_end() in ast_ari_response_error(). * Eliminated unnecessary RAII_VAR() use in http.c:auth_create(). ASTERISK-23552 #close Reported by: Scott Griepentrog Review: https://reviewboard.asterisk.org/r/3691/ ........ Merged revisions 417880 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking to the resource. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01Doxygen CleanupAndrew Latham
Start adding configuration file linking and pages. Add module loading doxygen block. Breaking up commits to keep it easy to track (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17Avoid cppcheck warnings; removing unused vars and a bit of cleanup.Walter Doekes
Patch by: junky Review: https://reviewboard.asterisk.org/r/1743/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-10Merged revisions 310240 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r310240 | twilson | 2011-03-10 10:05:45 -0600 (Thu, 10 Mar 2011) | 13 lines Add \r\n to remaining http headers passed to ast_http_send r309204 changed the behavior of ast_http_send. It now requires headers to be passed with trailing \r\n. This change updates the remaining instances in the code that did not pass the \r\n. (closes issue #18186) Reported by: nivaldomjunior Patches: res_phoneprov.c.diff uploaded by lathama (license 1028) manager.diff.txt uploaded by twilson (license 396) Tested by: lathama ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-15Don't send files twice and remove extra \r\n from headerTerry Wilson
After the manager http auth changes, we forgot to remove the manual sending of the file. Also, ast_http_send adds two \r\n to the header that is passed to it, so a trailing \r\n is removed from the Content-type header. It might be better to change ast_http_send, but I don't like changing the behavior of an API function. (closes issue #17239) Reported by: cjacobsen Patches: patch2.diff uploaded by cjacobsen (license 1029) Tested by: lathama, cjacobsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-24Instead of crashing, allocate our header ast_str before we try to use it.Sean Bright
(closes issue #16680) Reported by: lmadsen Patches: issue16680_20100122.patch uploaded by seanbright (license 71) Tested by: lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15Convert a few places to use ast_calloc_with_stringfields where applicable.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06Recorded merge of revisions 222152 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines Fix ao2_iterator API to hold references to containers being iterated. See Mantis issue for details of what prompted this change. Additional notes: This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK has become an enum instead of a macro, with a name that fits our naming policy; also, it is now necessary to call ao2_iterator_destroy() on any iterator that has been created. Currently this only releases the reference to the container being iterated, but in the future this could also release other resources used by the iterator, if the iterator implementation changes to use additional resources. (closes issue #15987) Reported by: kpfleming Review: https://reviewboard.asterisk.org/r/383/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-09gcc 4.4 fix: union instead of castTzafrir Cohen
gcc 4.4 has more strict rules for aliasing. It doesn't like a struct sockaddr_in pointer pointing to a struct sockaddr. So we make it a union. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-06Move function PP_EACH_USER and PP_EACH_EXTENSION documentation to XML.Eliel C. Sardanons
Move function PP_EACH_USER and PP_EACH_EXTENSION documentation to the new AstXML form. (issue #15245) Reported by: eliel Patches: res_phoneprov_static_conversion.txt uploaded by lmadsen (license 10) (with PP_EACH_USER add by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29fix typosJeff Peeler
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29Merge str_substitution branch.Tilghman Lesher
This branch adds additional methods to dialplan functions, whereby the result buffers are now dynamic buffers, which can be expanded to the size of any result. No longer are variable substitutions limited to 4095 bytes of data. In addition, the common case of needing buffers much smaller than that will enable substitution to only take up the amount of memory actually needed. The existing variable substitution routines are still available, but users of those API calls should transition to using the dynamic-buffer APIs. Reviewboard: http://reviewboard.digium.com/r/174/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23Support HTTP digest authentication for the http manager interface.Tilghman Lesher
(closes issue #10961) Reported by: ys Patches: digest_auth_r148468_v5.diff uploaded by ys (license 281) SVN branch http://svn.digium.com/svn/asterisk/team/group/manager_http_auth Tested by: ys, twilson, tilghman Review: http://reviewboard.digium.com/r/223/ Reviewed by: tilghman,russellb,mmichelson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18a few more namespace updates... res_ael_share still needs some work before ↵Kevin P. Fleming
this can be merged to other release branches git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09Don't leak memory if phoneprov.conf does not existTerry Wilson
(closes issue #14203) Reported by: jamesgolovich Patches: asterisk-phoneprovleak.diff.txt uploaded by jamesgolovich (license 176) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-30Fix some svn:keywordsTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17Polycom phones close the connection after reading a little bit of the ↵Terry Wilson
firmware files, we should stop sending in that case. Also, make that case print out a debug statement instead of a scary WARNING. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25This is basically a complete rollback of r155401, as it was determined thatSean Bright
it would be best to maintain API compatibility. Instead, this commit introduces ao2_callback_data() which is functionally identical to ao2_callback() except that it allows you to pass arbitrary data to the callback. Reviewed by Mark Michelson via ReviewBoard: http://reviewboard.digium.com/r/64 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14Cleanup whitespace issuesTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14Use Mark's new ast_str_case_hash function instead of jumping through hoops ↵Terry Wilson
to do insensitive case lookups git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-11Add LINEKEYS variable to allow for a user to set the number of keys assigned ↵Doug Bailey
to a line on a polycom phone git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07Add ability to pass arbitrary data to the ao2_callback_fn (called fromSean Bright
ao2_callback and ao2_find). Currently, passing OBJ_POINTER to either of these mandates that the passed 'arg' is a hashable object, making searching for an ao2 object based on outside criteria difficult. Reviewed by Russell and Mark M. via ReviewBoard: http://reviewboard.digium.com/r/36/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 ↵Kevin P. Fleming
branch, and add the ones needed for all the new code here too git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16func_strings isn't a dependency of this module anymoreTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16inter-module dependencies should be included in the source code, not just in ↵Kevin P. Fleming
sample config files git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16correct file name in messageKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09Make phoneprov case-insensitive to remove the func_strings dependency of the ↵Terry Wilson
default config git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-24Blanch the 404 error message for those with no sense of humorDoug Bailey
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiatingTilghman Lesher
when a file is invalid from when a file is missing. This is most important when we have two configuration files. Consider the following example: Old system: sip.conf users.conf Old result New result ======== ========== ========== ========== Missing Missing SIP doesn't load SIP doesn't load Missing OK SIP doesn't load SIP doesn't load Missing Invalid SIP doesn't load SIP doesn't load OK Missing SIP loads SIP loads OK OK SIP loads SIP loads OK Invalid SIP loads incompletely SIP doesn't load Invalid Missing SIP doesn't load SIP doesn't load Invalid OK SIP doesn't load SIP doesn't load Invalid Invalid SIP doesn't load SIP doesn't load So in the case when users.conf doesn't load because there's a typo that disrupts the syntax, we may only partially load users, instead of failing with an error, which may cause some calls not to get processed. Worse yet, the old system would do this with no indication that anything was even wrong. (closes issue #10690) Reported by: dtyoo Patches: 20080716__bug10690.diff.txt uploaded by Corydon76 (license 14) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29Merged revisions 140488 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r140488 | mmichelson | 2008-08-29 12:34:17 -0500 (Fri, 29 Aug 2008) | 22 lines After working on the ao2_containers branch, I noticed something a bit strange. In all cases where we provide a callback function to ao2_container_alloc, the callback function would only return 0 or CMP_MATCH. After inspecting the ao2_callback() code carefully, I found that if you're only looking for one specific item, then you should return CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue traversing the current bucket until the end searching for more matches. In cases like chan_iax2 where in 1.4, all the peers are shoved into a single bucket, this makes for potentially terrible performance since the entire bucket will be traversed even if the peer is one of the first ones come across in the bucket. All the changes I have made were for cases where the callback function defined was passed to ao2_container_alloc so that calls to ao2_find could find a unique instance of whatever object was being stored in the container. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140489 65c4cc65-6c06-0410-ace0-fbb531ad65f3