summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2018-01-09translate: Avoid absolute value on unsigned substraction.Alexander Traud
ast_format_get_sample_rate(.) returns an unsigned type. The difference of a substraction between two unsigned types does not get implicitly converted to a signed type. Therefore, using abs(.) did not make sense. ASTERISK-27549 Change-Id: Ib904d9ee0d46b6fdd1476fbc464fbbf813304017
2018-01-08Merge "editline: Avoid comparison between pointer and zero character ↵Jenkins2
constant." into 13
2018-01-06editline: Avoid comparison between pointer and zero character constant.Alexander Traud
gcc 7.2 warned about this. ASTERISK-27559 Change-Id: I48960dda9cf0a11b6a9426f775e632363f8caa74
2018-01-04pbx: Prevent execution of NULL pointer.Corey Farrell
pbx_extension_helper has a check for q->swo.exec == NULL but it doesn't actually return so we would still run the function. Fix the return. Move the 'int res' variable into the only scope which uses it. Change-Id: I0693af921fdc7f56b6a72a21fb816ed08b960a69
2018-01-04aco: Fix NULL dereference in error path.Corey Farrell
Change-Id: Id505167cf0f9414a3c144fa2c1e181a2cf288694
2018-01-03Merge "core: Use macros to generate ao2_container callbacks where possible." ↵Jenkins2
into 13
2018-01-03Merge "aco: Add missing aco_option_type_string for OPT_TIMELEN_T." into 13Joshua Colp
2018-01-02cdr: submit: fix logic of test for batch modeTzafrir Cohen
ASTERISK-27539 #close Change-Id: I33cdf329d2bb4486dcae975c450f6aae94c515f7
2018-01-02aco: Add missing aco_option_type_string for OPT_TIMELEN_T.Corey Farrell
ASTERISK-27117 Change-Id: I8f6c34bb30830be9f7a40823723eb4dcaaa91c61
2018-01-01core: Use macros to generate ao2_container callbacks where possible.Corey Farrell
This uses AO2_STRING_FIELD_HASH_FN and AO2_STRING_FIELD_CMP_FN where possible in the Asterisk core. This removes CMP_STOP from the result of CMP_FN callbacks for the following structure types: * ast_bucket_metadata * ast_bucket_scheme * generic_monitor_instance_list (ccss.c) * named_acl Change-Id: Ide4c1449a894bce70dea1fef664dade9b57578f1
2017-12-28stasis_channels.c: Misc cleanup.Richard Mudgett
* Use current OBJ_SEARCH_xxx defines instead of the deprecated versions. * Fix hash_cb and cmp_cb container functions to correctly use the OBJ_SEARCH_xxx values. * Remove incorrect usage of CMP_STOP. Most uses in the system have no effect. This allows the collapse of channel_role_single_cmp_cb() and channel_role_multi_cmp_cb() into channel_role_cmp_cb(). * Remove unnecessary usage of RAII_VAR(). Change-Id: I02c405518cab22aa2a082b61e2353bf7cd629a70
2017-12-28Merge "manager.c: Update AMI Status event documentation" into 13Jenkins2
2017-12-28Merge "cdr: Missing NULL check and unlock." into 13Jenkins2
2017-12-28manager.c: Update AMI Status event documentationRichard Mudgett
The AMI Status event had linkedid listed twice and was missing the effective connected line name and number headers. NOTE: The linkedid and other standard channel snapshot fields in the XML documentation are part of the <channel_snapshot/> XML template defined in doc/appdocsxml.xslt. * Cached the effective connected line party id so it doesn't get calculated four times. Change-Id: I004c4c4f9e7b40ef55035c831702721bec82496c
2017-12-25cdr: Missing NULL check and unlock.Corey Farrell
* handle_dial_message: Missing a check for NULL peer. * ast_cdr_register: Missing unlock on allocation failure. ast_cdr_register is fixed by reordering so the new structure is allocated and initialized before locking the list. Change-Id: I5799b99270d1a7a716a555c31ac85f4b00ce8686
2017-12-24loader: Add volatile to resource_being_loaded.Corey Farrell
Some compiler optimizers seem to assume that dlopen will not use __attribute__((constructor)) functions to call back to the program. This was causing resource_being_loaded to be optimized away completely. ASTERISK-27531 #close Tested By: abelbeck Change-Id: If17a3b889e06811a0e7119f0539d052494d6ece9
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-21Merge "Fix Common Typo's." into 13Jenkins2
2017-12-21Merge "bridge: Old channel video source not set to NULL after unref." into 13Jenkins2
2017-12-20Fix Common Typo's.Corey Farrell
Fix instances of: * Retreive * Recieve * other then * different then * Repeated words ("the the", "an an", "and and", etc). * othterwise, teh ASTERISK-24198 #close Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-20bridge: Old channel video source not set to NULL after unref.Corey Farrell
The bridge holds onto the old channel video source after it's been released. This can lead to use after free errors. ASTERISK-27229 #close Change-Id: Ib2dab61677dd8a21f7ad53cdc9b8ca93297838b3
2017-12-20core: Fix unused variable error in handle_show_sysinfo.Corey Farrell
Apparently in OSX it's possible for OSX to HAVE_SYSCTL but not HAVE_SYSINFO or HAVE_SWAPCTL. In this case freeswap caused an unused variable error. ASTERISK-26563 #close Change-Id: I8ec5b1897b786cc1abaf62264aa75039eea05510
2017-12-20Merge "CLI: Address multiple issues." into 13Joshua Colp
2017-12-20Merge "bridge: Stop music on hold on adding an arbitrary channel to a ↵Jenkins2
bridge" into 13
2017-12-20Merge "core: Fix multiple trivial issues in the core." into 13Joshua Colp
2017-12-19Merge "Remove constant conditionals (dead-code)." into 13Jenkins2
2017-12-19CLI: Address multiple issues.Corey Farrell
* listen uses the variable `s` for the result from ast_poll() then overwrites it with the result of accept(). Create a separate variable poll_result to avoid confusion since ast_poll does not return a file descriptor. * Resolve fd leak that would occur if setsockopt failed in listen. * Reserve an extra byte while processing completion results from remote daemon. This fixes a bug where completion processing used strstr() on a string that was not '\0' terminated. This was no risk to the Asterisk daemon, the bug was only reachable the remote console process. * Resolve leak in handle_showchan when the channel is not found. * Multiple leaks and a deadlock in pbx_config CLI completion. * Fix leaks in "manager show command". Change-Id: I8f633ceb1714867ae30ef4e421858f77c14485a9
2017-12-19Merge "main/app: Fix leaks." into 13Jenkins2
2017-12-19bridge: Stop music on hold on adding an arbitrary channel to a bridgeIvan Poddubny
When a channel that is on hold gets added to a bridge by the Bridge AMI action or the dialplan application of the same name, music continues to play, causing "robotic sound". This commit adds a call to ast_moh_stop to stop the music. Also, it makes the AMI Park action use the right MOH class when the channel gets parked. Reported by: Zane Conkle ASTERISK-25079 #close Change-Id: I4b129c5a20c15e63968842460ac5a1a85903cf9f
2017-12-19Merge "rtp_engine.c: Eliminate rtcp_report_to_json() RAII_VAR usage." into 13Jenkins2
2017-12-19Remove constant conditionals (dead-code).Corey Farrell
Some variables are set and never changed, making them constant. This means that code in the 'false' block of the conditional is unreachable. In chan_skinny and res_config_ldap I used preprocessor directive `#if 0` as I'm unsure if the unreachable code could be enabled in the future. Change-Id: I62e2aac353d739fb3c983cf768933120f5fba059
2017-12-19core: Fix multiple trivial issues in the core.Corey Farrell
* Fix small leaks in from error condition in translate.c. * Check new file descriptor is less than 0, not less than or equal. Change-Id: Id7782775486175c739e0c4bf3ea5e17e3f452a99
2017-12-18main/app: Fix leaks.Corey Farrell
* ast_linear_stream would leak a file descriptor if it failed to allocate lin. * ast_control_tone leaked zone and ts if ast_playtones_start failed. Additionally added whitespace to ast_linear_stream, pulled assignments out of conditionals for improved readability. Change-Id: I6d1a10cf9161b1529d939b9b2d63ea36d395b657
2017-12-18ast_json_pack(): Use safer json ref mechanism.Richard Mudgett
Change-Id: I49204db2e57ae96eee43909c18ed007c09ac817e
2017-12-18rtp_engine.c: Eliminate rtcp_report_to_json() RAII_VAR usage.Richard Mudgett
Change-Id: I58a22c2ca82e91d7537409b7b3af2d735827a54d
2017-12-18Merge "CLI: Fix 'core set debug channel' completion bug." into 13Joshua Colp
2017-12-18Merge "CLI: Remove special handling of 'core set verbose' from rasterisk." ↵Jenkins2
into 13
2017-12-18Merge "aco: Minimize use of regex." into 13Jenkins2
2017-12-18Merge "aco: Create ways to minimize use of regex." into 13Jenkins2
2017-12-18CLI: Fix 'core set debug channel' completion bug.Corey Farrell
The completion generator is missing a return so typing "core set debug all off <tab>" causes the command to actually execute. Change-Id: Ibf6462088a74eee66967732b50445783ebefc20b
2017-12-18Merge "loader: Use vector to build apha sorted module lists." into 13George Joseph
2017-12-18Merge "loader: Replace priority heap with vector." into 13George Joseph
2017-12-18Merge "cdr: Minor optimizations." into 13Jenkins2
2017-12-18Merge "loader: Rework of load_dynamic_module." into 13George Joseph
2017-12-18Merge "loader: Minor fix to module registration." into 13Jenkins2
2017-12-15cdr: Minor optimizations.Corey Farrell
* bridge_candidate_process: remove SCOPED_AO2LOCK and return value. * handle_standard_bridge_enter_message: replace recursive call with goto statement. ASTERISK-24297 Change-Id: Id2eaa0822fb8dc799f63422bb3aa89de9d4ee2a2
2017-12-15loader: Use vector to build apha sorted module lists.Corey Farrell
Change-Id: I9c519f4dec3cda98b2f34d314255a31d49a6a467
2017-12-15loader: Replace priority heap with vector.Corey Farrell
This is needed for future changes which will require being able to process the load priority out of order. Change-Id: Ia23421197f09789940510b03ebbbf3bf24d51bea
2017-12-15loader: Rework of load_dynamic_module.Corey Farrell
* Split off load_dlopen to perform actual dlopen, check results and log warnings when needed. * Use flags which minimize number of calls to dlopen required. First attempt always uses RTLD_GLOBAL when global_symbols_only is enabled, RTLD_LOCAL when it is not. This patch significantly reduces the number of dlopen's performed. With 299 modules my system ran dlopen 857 times before this patch, 655 times after this patch. Change-Id: Ib2c9903cfddcc01aed3e01c1e7fe4a3fb9af0f8b
2017-12-15loader: Minor fix to module registration.Corey Farrell
This protects the module loader itself against crashing if dlopen is called on a module from outside loader.c. * Expand scope of lock inside ast_module_register to include reading of resource_being_loaded. * NULL check resource_being_loaded. * Set resource_being_loaded NULL as soon as dlopen returns. This fixes some error paths where it was not NULL'ed. * Create module_destroy function to deduplicate code from ast_module_unregister and modules_shutdown. * Resolve leak that occured if a module did not successfully register. * Simplify checking for successful registration. Change-Id: I40f07a315e55b92df4fc7faf525ed6d4f396e7d2