Commit Graph

5691 Commits

Author SHA1 Message Date
Jenkins2
7c4733bf7f Merge "stasis_cache: Remove silly usage of RAII_VAR." into 13 2018-01-11 05:46:07 -06:00
Jenkins2
ffec53b528 Merge "stasis_cache_pattern: Remove silly usage of RAII_VAR." into 13 2018-01-11 05:42:47 -06:00
Corey Farrell
dedf0ff2bf stasis_cache: Remove silly usage of RAII_VAR.
Change-Id: Ifa95e5801c949df296c7e4376347730fb0ed52ef
2018-01-09 12:10:27 -05:00
Corey Farrell
8a6b3537b1 stasis_cache_pattern: Remove silly usage of RAII_VAR.
Change-Id: Ic98a51f555062cd863b6db3f8d76065943a9dea3
2018-01-09 12:09:08 -05:00
Alexander Traud
b45fb3a6ec translate: Avoid absolute value on unsigned substraction.
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-09 10:45:57 -06:00
Jenkins2
d680ade35c Merge "editline: Avoid comparison between pointer and zero character constant." into 13 2018-01-08 05:52:55 -06:00
Alexander Traud
a68da30069 editline: Avoid comparison between pointer and zero character constant.
gcc 7.2 warned about this.

ASTERISK-27559

Change-Id: I48960dda9cf0a11b6a9426f775e632363f8caa74
2018-01-06 06:46:19 -06:00
Corey Farrell
0f141351f9 pbx: Prevent execution of NULL pointer.
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-04 17:07:03 -05:00
Corey Farrell
ec74570598 aco: Fix NULL dereference in error path.
Change-Id: Id505167cf0f9414a3c144fa2c1e181a2cf288694
2018-01-04 09:33:07 -06:00
Jenkins2
9e47e113e1 Merge "core: Use macros to generate ao2_container callbacks where possible." into 13 2018-01-03 07:49:58 -06:00
Joshua Colp
3fa33de301 Merge "aco: Add missing aco_option_type_string for OPT_TIMELEN_T." into 13 2018-01-03 06:51:59 -06:00
Tzafrir Cohen
00b0c67144 cdr: submit: fix logic of test for batch mode
ASTERISK-27539 #close

Change-Id: I33cdf329d2bb4486dcae975c450f6aae94c515f7
2018-01-02 09:18:16 -06:00
Corey Farrell
dd528c53c0 aco: Add missing aco_option_type_string for OPT_TIMELEN_T.
ASTERISK-27117

Change-Id: I8f6c34bb30830be9f7a40823723eb4dcaaa91c61
2018-01-02 00:39:32 -06:00
Corey Farrell
5b395a7b97 core: Use macros to generate ao2_container callbacks where possible.
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
2018-01-01 19:17:15 -05:00
Richard Mudgett
751fd9b628 stasis_channels.c: Misc cleanup.
* 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-28 13:37:31 -06:00
Jenkins2
e4d536b64d Merge "manager.c: Update AMI Status event documentation" into 13 2017-12-28 13:35:30 -06:00
Jenkins2
9792bb0aa9 Merge "cdr: Missing NULL check and unlock." into 13 2017-12-28 10:32:29 -06:00
Richard Mudgett
5de8f49294 manager.c: Update AMI Status event documentation
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-28 09:15:54 -06:00
Corey Farrell
d62c87bb8d cdr: Missing NULL check and unlock.
* 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-25 20:53:02 -06:00
Corey Farrell
92fb393cab loader: Add volatile to resource_being_loaded.
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-24 00:34:58 -05:00
Sean Bright
ce3d56920b Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:14:07 -05:00
Jenkins2
d85290ca48 Merge "Fix Common Typo's." into 13 2017-12-21 08:34:31 -06:00
Jenkins2
0097ad91ef Merge "bridge: Old channel video source not set to NULL after unref." into 13 2017-12-21 05:47:18 -06:00
Corey Farrell
82b6ba976f Fix Common Typo's.
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-20 12:54:13 -05:00
Corey Farrell
be3800c49d bridge: Old channel video source not set to NULL after unref.
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-20 10:26:38 -06:00
Corey Farrell
d05ec48145 core: Fix unused variable error in handle_show_sysinfo.
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-20 10:16:48 -06:00
Joshua Colp
616659d620 Merge "CLI: Address multiple issues." into 13 2017-12-20 08:34:37 -06:00
Jenkins2
b100233801 Merge "bridge: Stop music on hold on adding an arbitrary channel to a bridge" into 13 2017-12-20 08:11:54 -06:00
Joshua Colp
f1d50c0fb0 Merge "core: Fix multiple trivial issues in the core." into 13 2017-12-20 07:01:01 -06:00
Jenkins2
b539ea2a38 Merge "Remove constant conditionals (dead-code)." into 13 2017-12-19 19:13:20 -06:00
Corey Farrell
9adffca9c7 CLI: Address multiple issues.
* 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-19 16:43:32 -05:00
Jenkins2
dba037d422 Merge "main/app: Fix leaks." into 13 2017-12-19 14:10:02 -06:00
Ivan Poddubny
fef23297b7 bridge: Stop music on hold on adding an arbitrary channel to a bridge
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-19 20:52:09 +01:00
Jenkins2
bde7c0420a Merge "rtp_engine.c: Eliminate rtcp_report_to_json() RAII_VAR usage." into 13 2017-12-19 11:04:03 -06:00
Corey Farrell
d6b2f457d9 Remove constant conditionals (dead-code).
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-19 08:52:33 -06:00
Corey Farrell
381ed4f1cc core: Fix multiple trivial issues in the core.
* 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-19 09:19:46 -05:00
Corey Farrell
67b5a4e616 main/app: Fix leaks.
* 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-18 20:36:32 -06:00
Richard Mudgett
5801917a75 ast_json_pack(): Use safer json ref mechanism.
Change-Id: I49204db2e57ae96eee43909c18ed007c09ac817e
2017-12-18 18:05:32 -06:00
Richard Mudgett
46ed7afdd9 rtp_engine.c: Eliminate rtcp_report_to_json() RAII_VAR usage.
Change-Id: I58a22c2ca82e91d7537409b7b3af2d735827a54d
2017-12-18 18:02:51 -06:00
Joshua Colp
b14d165927 Merge "CLI: Fix 'core set debug channel' completion bug." into 13 2017-12-18 15:58:34 -06:00
Jenkins2
cbb71df228 Merge "CLI: Remove special handling of 'core set verbose' from rasterisk." into 13 2017-12-18 13:41:07 -06:00
Jenkins2
56a931f64c Merge "aco: Minimize use of regex." into 13 2017-12-18 13:32:31 -06:00
Jenkins2
b6d03c086b Merge "aco: Create ways to minimize use of regex." into 13 2017-12-18 13:14:07 -06:00
Corey Farrell
5cdc65cf1e CLI: Fix 'core set debug channel' completion bug.
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-18 12:36:03 -06:00
George Joseph
43903f1e83 Merge "loader: Use vector to build apha sorted module lists." into 13 2017-12-18 10:24:49 -06:00
George Joseph
d6ea23d60e Merge "loader: Replace priority heap with vector." into 13 2017-12-18 10:24:43 -06:00
Jenkins2
d1a68d90b0 Merge "cdr: Minor optimizations." into 13 2017-12-18 08:36:07 -06:00
George Joseph
1b50eb2d9f Merge "loader: Rework of load_dynamic_module." into 13 2017-12-18 08:29:36 -06:00
Jenkins2
b270d5b5a2 Merge "loader: Minor fix to module registration." into 13 2017-12-18 07:48:17 -06:00
Corey Farrell
b3b7367e6b cdr: Minor optimizations.
* 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-15 11:29:25 -05:00