Commit Graph

29473 Commits

Author SHA1 Message Date
Corey Farrell
26a400c67a CLI: Refactor cli_complete.
* Stop using "_COMMAND NUMMATCHES" on remote consoles.  Using this
  command had doubled the amount of work needed from the Asterisk
  daemon for each completion request.
* Fix code formatting.
* Remove static buffer used to send the command, use the same buffer
  that will receive the results.
* Move sort from ast_cli_display_match_list.

Change-Id: Ie2211b519a3d4bec45bf46e0095bdd01d384cb69
2017-11-21 09:56:29 -05:00
Corey Farrell
e723331f4f CLI: Rewrite ast_el_strtoarr to use vector's internally.
This rewrites ast_el_strtoarr to use vector's internally, but still
return the original NULL terminated array of strings.

Change-Id: Ibfe776cbe14f750effa9ca360930acaccc02e957
2017-11-21 09:56:26 -05:00
Corey Farrell
e07d94111d CLI: Refactor ast_cli_display_match_list.
* Stop estimating line count, just print until we run out of matches.
* Stop freeing entries, the caller does that anyways.
* Stop calculating / returning numoutput, it was ignored.

Change-Id: I7f92afa8bea92241a95227587367424c8c32a5cb
2017-11-21 09:56:23 -05:00
Joshua Colp
0fd8db7ec2 Merge "ccss: Remove silly usage of RAII_VAR." into 13 2017-11-21 08:17:23 -06:00
Joshua Colp
a8ac9a551d Merge "cli: Remove silly usage of RAII_VAR." into 13 2017-11-21 07:55:03 -06:00
Joshua Colp
090ce0cd1b Merge "loader: Fix comments in struct ast_module." into 13 2017-11-21 07:14:32 -06:00
Joshua Colp
4e6a0d5683 Merge "menuselect: Remove ineffective weak attribute detection." into 13 2017-11-21 06:50:53 -06:00
Joshua Colp
29bf57ff2f Merge "CLI: Create ast_cli_completion_vector." into 13 2017-11-21 05:23:58 -06:00
Joshua Colp
4045cb4df9 Merge "README: Send people to secure websites where available." into 13 2017-11-21 05:23:50 -06:00
Joshua Colp
3ce96d2e03 Merge "Build: Fix issues building without SSL." into 13 2017-11-21 05:23:28 -06:00
Joshua Colp
1aba7dd229 Merge "Build: Fix OSX build issues." into 13 2017-11-21 05:23:18 -06:00
Corey Farrell
84fd41729e loader: Fix comments in struct ast_module.
Make the comments follow doxygen format, move comments to the line
before each field they describe.

Change-Id: Ic445468398b5e88f13910f7c2f70bd15aad33a27
2017-11-20 19:25:02 -05:00
Joshua Colp
1e68c8e738 Merge "res_pjsip: Use sorcery prefix operation for contact lookup" into 13 2017-11-20 16:53:25 -06:00
Joshua Colp
9b34aaddd9 Merge changes from topic 'alloc-check-acl' into 13
* changes:
  acl: Fix allocation related issues.
  acl: Update logger message to match 15+.
2017-11-20 16:48:15 -06:00
Corey Farrell
df6161b70e cli: Remove silly usage of RAII_VAR.
Change-Id: I81aacfee7cd26e4fc5eef07bca582700c2975bd7
2017-11-20 15:32:29 -05:00
Joshua Colp
da89afc2e2 Merge "bridge_basic: Ignore answer from transfer target when they've timed out." into 13 2017-11-20 14:30:05 -06:00
Corey Farrell
1e2b38adf5 ccss: Remove silly usage of RAII_VAR.
Change-Id: I5ce40035e0a940e4e56f6322c1dcd47fbd509b98
2017-11-20 15:25:57 -05:00
Joshua Colp
bef287ccf2 Merge "doxygen: Remove obsolete contents." into 13 2017-11-20 13:46:22 -06:00
Joshua Colp
3356c796a0 Merge "res_fax: Remove checks for unsigned values being >= 0." into 13 2017-11-20 12:51:18 -06:00
Joshua Colp
be3a33f3d1 Merge "res_snmp: Declare RONLY if net-snmp headers do not." into 13 2017-11-20 12:18:22 -06:00
Joshua Colp
b611cd6f9c Merge "tests: Fix warnings found on Mac." into 13 2017-11-20 11:32:47 -06:00
Joshua Colp
9c8894c4af Merge "app_minivm: Fix possible uninitialized return value." into 13 2017-11-20 10:22:12 -06:00
Joshua Colp
e0f9d4d808 Merge "res_pjsip: Fix warning by deferring implicit type cast." into 13 2017-11-20 09:44:36 -06:00
Corey Farrell
6a5ab65c88 Build: Fix issues building without SSL.
* Fix conditional in libasteriskssl.
* Use variables produced by configure to link the SSL and uuid libraries
  into libasteriskpj.so instead of hard-coding them.

ASTERISK-27431

Change-Id: I3977931fd3ef8c4e4376349ccddb354eb839b58d
2017-11-19 15:19:46 -05:00
Corey Farrell
366cc259bc res_pjsip: Fix warning by deferring implicit type cast.
Mac doesn't like the comparison of -1 to an enum, so store the result of
ast_sip_str_to_dtmf to an int so we can check for the negative return
value.  ast_sip_str_to_dtmf returns an int so this is only delaying the
implicit type cast.

Change-Id: I0c262c1719ee951aae1f437d733a301cf5f8ad29
2017-11-19 14:28:41 -05:00
Corey Farrell
69113388e9 Build: Fix OSX build issues.
OSX does not support 'readlink -f' or 'sed -r'.  Replace readlink with
the GNU make macro 'realpath'.  Replace sed with grep in one place, cut
in the other.

ASTERISK-27332

Change-Id: I5d34ecca905384decb22ead45c913ae5e8aff748
2017-11-19 14:27:28 -05:00
Corey Farrell
5fe2e7bfdc tests: Fix warnings found on Mac.
test_pbx used raise without explicitly including signal.h.  On Mac for
some reason nothing else includes it.

test_logger checked if an unsigned int was negative.  Switch the
variable to 'int' so that error check can be effective.

Change-Id: Ie1db5dd1818ac25cc2ae41b644f848b5865b1362
2017-11-18 21:16:03 -06:00
Corey Farrell
d68e54b7ab res_snmp: Declare RONLY if net-snmp headers do not.
Some net-snmp builds do not provide the RONLY declare, only
NETSNMP_OLDAPI_RONLY.  Map RONLY to NETSNMP_OLDAPI_RONLY to get around
this error.

Change-Id: Ida5c7ad9406515825485c4d3b4a34fd6ad0da577
2017-11-18 20:28:30 -06:00
Corey Farrell
0f270cbe9e res_fax: Remove checks for unsigned values being >= 0.
It's impossible for gwtimeout or fdtimeout to be less than 0 because
they are unsigned int's.  Remove checks and unreachable branches.

Change-Id: Ib2286960621e6ee245e40013c84986143302bc78
2017-11-18 20:05:11 -06:00
Corey Farrell
3dca4c7742 app_minivm: Fix possible uninitialized return value.
Declare 'res' initialized to -1 to deal with earlier error paths that
could cause 'res' to be returned uninitialized.

Change-Id: I8ac2a5755bf4174d89ef893e924c940f702b104e
2017-11-18 19:37:06 -06:00
Corey Farrell
5f0b4a1645 README: Send people to secure websites where available.
We should be sending people to secure web URL's where available.
Update README's and docs.

Change-Id: Id5b1e049b0b18b49a784f1254605aefa244ce19a
2017-11-17 21:11:13 -05:00
Corey Farrell
a369bfc4b2 doxygen: Remove obsolete contents.
Remove doxygen contents that have nothing to do with the current state
of Asterisk.

Change-Id: Ic072cc8641f9533a202990ccf275ce87e3efd95c
2017-11-17 20:58:28 -05:00
Sean Bright
3c72064d3f res_pjsip: Use reasonable buffer lengths for endpoint identification
Domains themselves can be up to 255 characters long (per RFC 1035), so
our current buffer sizes are wholly inadequate for many use cases.

Change-Id: If3f30a68307f1365a1fe06bc4b854c62842c9292
2017-11-17 11:22:10 -05:00
Corey Farrell
455b1bdeb0 menuselect: Remove ineffective weak attribute detection.
menuselect detects compiler support for multiple styles of weak
functions.  This is a remnant from 2013 when OPTIONAL_API required weak
functions.  It is no longer correct for menuselect to switch
dependencies from optional to required based on lack of weak function
support.

Note an issue remains - dependencies should switch from optional to
required based on OPTIONAL_API being enabled or disabled.  I don't think
this is possible.  menuselect needs to know at startup if OPTIONAL_API
is enabled or disabled, so the only way to fix this is to remove
OPTIONAL_API from menuselect and create a configure option.  I've left
the code that switches in place but it's preprocessed out.

Additionally removed:
- WEAKREF variable from Asterisk makeopts.in.
- Related disabled code from test_utils.
- Pointless AC_REVISION call from menuselect/configure.ac.

Change-Id: Ifa702e5f98eb45f338b2f131a93354632a8fb389
2017-11-17 10:48:33 -05:00
Joshua Colp
ef8ee3ee69 Merge "Build: Make function constructor/destructor attributes mandatory." into 13 2017-11-17 09:18:39 -06:00
Corey Farrell
549542e50e acl: Fix allocation related issues.
Add checks for allocation errors, cleanup and report failure when they
occur.

* ast_duplicate_acl_list: Replace log warnings with errors, add missing
  line-feed.
* ast_append_acl: Add missing line-feed to logger message.
* ast_append_ha: Avoid ast_strdupa in loop by moving debug message to
  separate function.
* ast_ha_join: Use two separate calls to ast_str_append to avoid using
  ast_strdupa in a loop.

Change-Id: Ia19eaaeb0b139ff7ce7b971c7550e85c8b78ab76
2017-11-17 09:35:22 -05:00
Corey Farrell
2852dac480 acl: Update logger message to match 15+.
This patch causes a logger message to be the same as it is in 15+.  This
will allow a follow-up patch to be cherry-picked to all 3 branches.

Change-Id: Ic0665a3d49987e4eb6df28dcd9e90b1c3ca191e0
2017-11-17 09:34:25 -05:00
Corey Farrell
0b8b153d3c CLI: Create ast_cli_completion_vector.
This is a rewrite of ast_cli_completion_matches using a vector to build
the list.  The original function calls the vector version, NULL
terminates the vector and extracts the elements array.

One change in behavior the results are now sorted and deduplicated. This
will solve bugs where some duplicate checking was done before the list
was sorted.

Change-Id: Iede20c5b4d965fa5ec71fda136ce9425eeb69519
2017-11-17 09:28:43 -05:00
Jenkins2
2e9c7f9b8f Merge "aoc: Fix memory management issues." into 13 2017-11-17 06:50:57 -06:00
Joshua Colp
0a7bbb068b bridge_basic: Ignore answer from transfer target when they've timed out.
This is a fun one.

Given the following attended transfer scenario:

1. Transfer target is called
2. Transferer hangs up
3. Transfer target call attempt reaches timeout
4. Transfer target is told to hang up
5. Transfer target answers before channel is hung up
6. Transferer recall target is called

A crash would occur. This is because the transfer target call
attempt, despite being told to hang up, would raise a recall
target answer before the recall target had been answered. As it
had not answered there would be no recall target channel and it
would implode.

This change makes it so that if the transfer target has been
hung up we don't tell the attended transfer code that it has
answered. We also clear out the stimulus that the recall target
has been answered after telling the transfer target to hang up,
in case it was able to raise the information before we told it
to hangup.

ASTERISK-27361

Change-Id: Ifb8b255a9c4d2c5c1b8ad77bf54f659ed286df99
2017-11-17 12:42:25 +00:00
Corey Farrell
69055724ce aoc: Fix memory management issues.
aoc_publish_blob failed to check for msg allocation error and never
released msg.

Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5
2017-11-16 21:34:41 -05:00
Sean Bright
60cfe00c4e res_pjsip_transport_websocket: Give transport a meaningful description
We were not \0 terminating this string, so any attempt to print it would
in the best case show an empty string and in the worst case potentially
crash.

Change-Id: I63d96ef8f7516ac02a0f91e22dfa8acdc615042c
2017-11-16 17:29:06 -05:00
Sean Bright
db2677133c res_pjsip: Use sorcery prefix operation for contact lookup
This improves performance for registrations assuming that
res_config_astdb is not in use.

Change-Id: I86f37aa9ef07a4fe63448cb881bbadd996834bb1
2017-11-16 16:48:29 -05:00
Joshua Colp
71c0478a04 Merge "ast_coredumper: Add ability to use directory other than /tmp" into 13 2017-11-16 15:44:27 -06:00
Joshua Colp
8d55b132b9 Merge "sorcery: Add ast_sorcery_retrieve_by_prefix()" into 13 2017-11-16 10:59:23 -06:00
Jenkins2
9fb2da7963 Merge "pjsip / hep: Provide correct local address for Websockets." into 13 2017-11-16 10:57:28 -06:00
Jenkins2
cb74309a51 Merge "chan_pjsip.c: Improve answer failure log messages." into 13 2017-11-16 09:29:16 -06:00
Joshua Colp
5df5f3e86d Merge "audiohook.c: Fix freeing a frame and still using it." into 13 2017-11-16 07:58:57 -06:00
Richard Mudgett
8a7dd5cc44 chan_pjsip.c: Improve answer failure log messages.
* Balanced the session->inv_session refs on answer failure.

Change-Id: I33542d639d37e692cb46550b972a5fcfc3b804b8
2017-11-15 16:50:51 -06:00
Richard Mudgett
7f916d621a audiohook.c: Fix freeing a frame and still using it.
Memory corruption happened to the media frame caches when an audio hook
freed a frame when it shouldn't.  I think the freed frame was because a
jitter buffer interpolated a missing frame and the audio hook
unconditionally freed it.

* Made audiohook.c:audio_audiohook_write_list() not free an interpolated
frame if it is the same frame as what was passed into the routine.

* Made plc.c:normalise_history() use memmove() instead of memcpy() on a
memory block that could overlap.  Found by valgrind investigating this
issue.

ASTERISK-27238
ASTERISK-27412

Change-Id: I548d86894281fc4529aefeb9f161f2131ecc6fde
2017-11-15 16:06:41 -06:00