summaryrefslogtreecommitdiff
path: root/res/res_pjproject.c
AgeCommit message (Collapse)Author
2018-02-28pjproject: Add cache_pools debugging option.Richard Mudgett
The pool cache gets in the way of finding use after free errors of memory pool contents. Tools like valgrind and MALLOC_DEBUG don't know when a pool is released because it gets put into the cache instead of being freed. * Added the "cache_pools" option to pjproject.conf. Disabling the option helps track down pool content mismanagement when using valgrind or MALLOC_DEBUG. The cache gets in the way of determining if the pool contents are used after free and who freed it. To disable the pool caching simply disable the cache_pools option in pjproject.conf and restart Asterisk. Sample pjproject.conf setting: [startup] cache_pools=no * Made current users of the caching pool factory initialization and destruction calls call common routines to create and destroy cached pools. ASTERISK-27704 Change-Id: I64d5befbaeed2532f93aa027a51eb52347d2b828
2018-01-24Remove redundant module checks and references.Corey Farrell
This removes references that are no longer needed due to automatic references created by module dependencies. In addition this removes most calls to ast_module_check as they were checking modules which are listed as dependencies. Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
2017-11-07res_pjproject.c: Fix ast_strdup() alloc failure.Richard Mudgett
Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead
2017-11-06res_pjproject: Handle error from adding to the buildopts vector.Corey Farrell
Change-Id: I076c7bd207c7989a23005395ce1735392657be65
2017-10-09res_pjproject: Fix cleanup of buildopts vector.Corey Farrell
ASTERISK-27306 Change-Id: I3bed0edf3f55b1d4adcbabb25ec14f11dc766c72
2017-01-24PJPROJECT logging: Fix detection of max supported log level.Richard Mudgett
The mechanism used for detecting the maximum log level compiled into the linked pjproject did not work. The API call simply stores the requested level into an integer and does no range checking. Asterisk was assuming that there was range checking and limited the new value to the allowable range. To get the actual maximum log level compiled into the linked pjproject we need to get and save off the initial set log level from pjproject. This is the maximum log level supported. * Get and save off the initial log level setting before altering it to the desired level on startup. This has to be done by a macro rather than calling a core function to avoid incorrectly linking pjproject. * Split the initial log level warning messages to warn if the linked pjproject cannot support the requested startup level and if it is too low to get the pjproject buildopts for "pjproject show buildopts". * Adjust the CLI "pjproject set log level" to check the saved max log level and to generate normal output messages instead of a warning message. ASTERISK-26743 #close Change-Id: I40aa76653e2a1dece66c3f8734594b4f0471cfb4
2016-11-30PJPROJECT logging: Made easier to get available logging levels.Richard Mudgett
Use of the new logging is as simple as issuing the new CLI command or setting the new pjproject.conf option. Other options that can affect the logging are how you have the pjproject log levels mapped to Asterisk log types in pjproject.conf and if you have configured Asterisk to log the DEBUG type messages. Altering the pjproject.conf level mapping shouldn't be necessary for most installations as the default mapping is sensible. Configuring Asterisk to log the DEBUG message type is standard practice for collecting debug information. * Added CLI "pjproject set log level" command to dynamically adjust the maximum pjproject log message level. * Added CLI "pjproject show log level" command to see the currently set maximum pjproject log message level. * Added pjproject.conf startup section "log_level" option to set the initial maximum pjproject log message level so all messages could be captured from initialization. * Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into bundled pjproject. Pjproject will use the currently set run time log level to determine if a log message is generated just like Asterisk verbose and debug logging levels. * In log_forwarder(), made always log enabled and mapped pjproject log messages. DEBUG mapped log messages are no longer gated by the current Asterisk debug logging level. * Removed RAII_VAR() from res_pjproject.c:get_log_level(). ASTERISK-26630 #close Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
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-21res_pjproject.c: Replace inlined DEBUG_ATLEAST() with macro.Richard Mudgett
Change-Id: I8799fb0a347ad76e747dafd0eacf1ea1086b9a8c
2016-02-18res_pjproject: Add ability to map pjproject log levels to Asterisk log levelsGeorge Joseph
Warnings and errors in the pjproject libraries are generally handled by Asterisk. In many cases, Asterisk wouldn't even consider them to be warnings or errors so the messages emitted by pjproject directly are either superfluous or misleading. A good exampe of this are the level-0 errors pjproject emits when it can't open a TCP/TLS socket to a client to send an OPTIONS. We don't consider a failure to qualify a UDP client an "ERROR", why should a TCP/TLS client be treated any differently? A config file for res_pjproject has bene added (pjproject.conf) and a new log_mappings object allows mapping pjproject levels to Asterisk levels (or nothing). The defaults if no pjproject.conf file is found are the same as those that were hard-coded into res_pjproject initially: 0,1 = LOG_ERROR, 2 = LOG_WARNING, 3,4,5 = LOG_DEBUG<level> Change-Id: Iba7bb349c70397586889b8f45b8c3d6c6c8c3898
2016-02-01build_system: Fix some warnings highlighted by clangGeorge Joseph
Fix some warnings found with clang. Change-Id: I5195b6189b148c2ee3ed4a19d015a6d4ef3e77bd
2016-01-21res_pjsip: Add CLI "pjsip dump endpt [details]"Richard Mudgett
Dump the res_pjsip endpt internals. In non-developer mode we will not document or make easily accessible the "details" option even though it is still available. The user has to know it exists to use it. Presumably they would also be aware of the potential crash warning below. Warning: PJPROJECT documents that the function used by this CLI command may cause a crash when asking for details because it tries to access all active memory pools. Change-Id: If2d98a3641c9873364d1daaad971376311aef3cb
2016-01-20res_pjproject: Add module providing pjproject logging and utilsGeorge Joseph
res_pjsip_log_forwarder has been renamed to res_pjproject and enhanced as follows: As a follow-on to the recent 'Add CLI "pjsip show buildopts"' patch, a new ast_pjproject_get_buildopt function has been added. It allows the caller to get the value of one of the buildopts. The initial use case is retrieving the runtime value of PJ_MAX_HOSTNAME to insure we don't send a hostname greater than pjproject can handle. Since it can differ between the version of pjproject that Asterisk was compiled against and the version of pjproject that Asterisk is running against, we can't use the PJ_MAX_HOSTNAME macro directly in Asterisk source code. Change-Id: Iab6e82fec3d7cf00c1cf6185c42be3e7569dee1e
2016-01-18pjsip_loging_refactor: Rename res_pjsip_log_forwarder to res_pjprojectGeorge Joseph
Change-Id: I5387821f29e5caa0cba0b7d62b0fc0d341e7e20b