Commit Graph

31985 Commits

Author SHA1 Message Date
Sean Bright
9febdba05b Use non-blocking socket() and pipe() wrappers
Change-Id: I050ceffe5a133d5add2dab46687209813d58f597
2018-12-11 12:28:35 -05:00
Sean Bright
16ae8330d2 utils: Don't set or clear flags that don't need setting or clearing
Change-Id: I0e7fb507ac09b15e45e1ff8501ecfca67afa5217
2018-12-11 10:08:02 -05:00
George Joseph
cd8101dbd1 Merge "CI: Various updates to buildAsterisk.sh" into 16 2018-12-11 09:07:49 -06:00
Joshua C. Colp
3336a348cc Merge "utils: Wrap socket() and pipe() to reduce syscalls" into 16 2018-12-11 09:02:16 -06:00
Sean Bright
9c9519796b build: Update config.guess and config.sub
Pulled from the authoritative respository at:

  https://git.savannah.gnu.org/cgit/config.git/tree/

Change-Id: I748708ce24d4d47ff1f395075d0b08d3da3355e0
2018-12-11 09:34:24 -05:00
George Joseph
df0b59564e Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit"
This reverts commit 331c906c48.

Pending resolution of ASTERISK_28200

Change-Id: Ie7172707b603c1da3f200613bd4473335af75128
2018-12-11 09:28:18 -05:00
Sebastian Damm
59cf552dd3 res/res_ari: Add additional hangup reasons
The ARI DELETE /channels command takes a "reason" parameter
Previously, there were only five reasons implemented
This patch adds more reasons to choose from for more
complex setups

ASTERISK-28198 #close

Change-Id: I85996f1076c9946d65c778413f040a845a90fecc
2018-12-11 05:22:27 -05:00
Joshua C. Colp
29af7f37ac Merge "chan_sip: Fix leak using contact ACL" into 16 2018-12-10 07:05:10 -06:00
Sean Bright
8a18fb81c1 utils: Wrap socket() and pipe() to reduce syscalls
Some platforms provide an implementation of socket() and pipe2() that allow the
caller to specify that the resulting file descriptors should be non-blocking.

Using these allows us to potentially elide 3 calls into 1 by avoiding extraneous
calls to fcntl() to set the O_NONBLOCK flag afterwards.

In passing, change ast_alertpipe_init() to use pipe2() directly instead of the
wrapper if it is available.

Change-Id: I3ebe654fb549587537161506c6c950f4ab298bb0
2018-12-07 09:04:55 -05:00
George Joseph
79899db740 stasis: Allow filtering by formatter
A subscriber can now indicate that it only wants messages
that have formatters of a specific type.  For instance,
manager can indicate that it only wants messages that have a
"to_ami" formatter.  You can combine this with the existing
filter for message type to get only messages with specific
formatters or messages of specific types.

ASTERISK-28186

Change-Id: Ifdb7a222a73b6b56c6bb9e4ee93dc8a394a5494c
2018-12-07 08:58:51 -05:00
Giuseppe Sucameli
6071ad77f5 chan_sip: Fix leak using contact ACL
Free old peer's contactacl before overwrite it within build_peer.

ASTERISK-28194

Change-Id: Ie580db6494e50cee0e2a44b38e568e34116ff54c
2018-12-05 17:17:11 -05:00
David M. Lee
1657508ddd Removing registrar_expire from basic-pbx config
The module has been removed, so it shouldn't be in the default config any more.

Change-Id: Ie7e09f00f9c9a885574e29478250de4c2cefd9f1
2018-12-05 15:28:03 -06:00
George Joseph
a6c2662404 CI: Various updates to buildAsterisk.sh
* Added ---no-configure, --no-menuselect, --no-make and --no-alembic
  options that prevent those actions from being performed.  Useful
  for testing and re-running portions of the build after fixing
  earlier failures.

* Added "set -e" to abort the script on command failure.
  Not sure why this wasn't there in the first place.

* Fixed a few echos that were redirecting to stderr when they shouldn't
  have been.

* Catch more alembic failures by actually trying to generate the SQL.

Change-Id: I9f395fa4e9254be7299e7c1014f1a13db78faffb
2018-12-05 12:02:54 -05:00
George Joseph
36bf94c3a8 Merge "test_websocket_client.c: Disable websocket_client_create_and_connect test." into 16 2018-12-05 08:17:50 -06:00
Kevin Harwell
12a30c71d8 pjsip_add_use_callerid_contact: fixed alembic script
Change-Id: I413f1583c797fb79651786cd8d0b003599f8ed10
2018-12-03 17:45:57 -06:00
Sean Bright
27806fd04d core: Add some documentation to the malloc_trim code
This adds documentation to handle_cli_malloc_trim() indicating how it
can be useful when debugging OOM conditions.

Change-Id: I1936185e78035bf123cd5e097b793a55eeebdc78
2018-12-03 17:47:18 -05:00
George Joseph
b5d3ddeef3 Merge "core: Merge malloc_trim patch" into 16 2018-12-03 16:26:42 -06:00
George Joseph
8071697653 Merge "app_queue: Revert broken queue channel reference patch" into 16 2018-12-03 15:08:46 -06:00
Chris-Savinovich
1f09c61804 core: Merge malloc_trim patch
We've had multiple opportunities where Richard Mudgett's
malloc_trim patch has been useful. Let's get it
pushed up to gerrit and merged.

Since malloc_trim is only available in libc, an entry is
added to configure.ac to create a definition for
HAVE_MALLOC_TRIM.

Change-Id: Ia38308c550149d9d6eae4ca414a649957de9700c
2018-12-03 15:07:17 -05:00
Chris-Savinovich
60e548ffa5 test_websocket_client.c: Disable websocket_client_create_and_connect test.
This test was occasionally failing, with:

  WARNING[5812]: http.c:1939 httpd_helper_thread: Failed to set
      TCP_NODELAY on HTTP connection: Bad file descriptor
  ERROR[5812]: iostream.c:91 ast_iostream_nonblock: Failed to get
      fcntl() flags for file descriptor: Bad file descriptor
  ERROR[5812]: iostream.c:569 ast_iostream_close: close() failed: Bad
      file descriptor

Disabled for now by making the test explicit only.

Change-Id: I778f6cbb6104c6b4e89737a2eaf1a9540888d351
2018-12-02 08:55:18 -05:00
Pirmin Walthert
5de36abd5a pjproject_bundled: check whether UPDATE is supported on outgoing calls
In ASTERISK-27095 an issue had been fixed because of which chan_pjsip was not
trying to send UPDATE messages when connected_line_method was set to invite.
However this only solved the issue for incoming INVITES. For outgoing INVITES
(important when transferring calls) the options variable needs to be updated
at a different place.

ASTERISK-28182 #close
Reported-by: nappsoft

Change-Id: I76cc06da4ca76ddd6dce814a8b97cc66b98aaf29
2018-11-30 09:33:49 -05:00
George Joseph
a2a8a41db3 Revert "app_voicemail: Remove need to subscribe to stasis"
This reverts commit 29115e2384.

That commit closed a long standing hole which allowed subscriptions
to mailboxes that weren't configured in voicemail.conf.  This
caused an issue with FreePBX which depdended on that behavior.
The commit is being reverted until FreePBX can handle the new
behavior.

ASTERISK-28151
Reported by: Ronald Raikes

Change-Id: I57b7b85e75d7dd97c742b5c69d718a0f61260c15
2018-11-29 12:26:16 -07:00
Kevin Harwell
618f081c3c Merge "test_cel: Plug a few ref leaks" into 16 2018-11-29 12:57:19 -06:00
Jenkins2
e67537dd98 Merge "jansson: Upgrade to 2.12." into 16 2018-11-29 12:14:06 -06:00
lvl
aa004295f9 app_queue: Revert broken queue channel reference patch
Revert commit 6409e7b11a, and add
NULL checks for all app_queue event handling code.

Related issues: ASTERISK~25185, ASTERISK~27006, ASTERISK~25844

ASTERISK-28125

Change-Id: I37334ea184ebb56e54471496b82937d4927815a0
2018-11-27 15:26:33 -05:00
George Joseph
a5e77e9c37 test_cel: Plug a few ref leaks
These are only a few of the leaks.  The large number of macros
and return paths in this file would make a weeks worth of work
to plug them all.

Change-Id: Ie2369fa944023d44767871c5c30974cb077ffb56
2018-11-26 17:19:43 -05:00
George Joseph
0ad0e89ba3 Merge "astobj2: Create function to copy weak proxied objects from container." into 16 2018-11-26 13:49:47 -06:00
Joshua Colp
450ca98220 Merge "RTP: need to reset DTMF last seqno/timestamp on voice packet with marker bit" into 16 2018-11-26 13:47:10 -06:00
Joshua Colp
53d0664781 Merge "func_strings: HASHKEY - negative array index can cause corruption" into 16 2018-11-26 07:43:35 -06:00
Corey Farrell
606304eb54 jansson: Upgrade to 2.12.
This brings in jansson-2.12, removes all patches that were merged
upstream.  README is created in third-party/jansson/patches to explain
how to add patches but also because the patches folder must exist for
the build process to succeed.

Change-Id: If0f2d541c50997690660c21fb7b03d625a5cdadd
2018-11-26 07:16:07 -05:00
Alexei Gradinari
331c906c48 RTP: need to reset DTMF last seqno/timestamp on voice packet with marker bit
The marker bit set on the voice packet indicates the start
of a new stream and a new time stamp.
Need to reset the DTMF last sequence number and the timestamp
of the last END packet.

If the new time stamp is lower then the timestamp of the last DTMF END packet
the asterisk drops all DTMF frames as out of order.

This bug was caught using Cisco ip-phone SPA50X and codec g722.
On SIP session update the SPA50X resets stream indicating it with market bit
and a new timestamp is twice smaller then the previous.

ASTERISK-28162 #close

Change-Id: If9c5742158fa836ad549713a9814d46a5d2b1620
2018-11-23 11:18:47 -05:00
Corey Farrell
ed7a5664b6 astobj2: Eliminate usage of legacy ao2_container_alloc routine.
Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
ao2_container_alloc_list.

ao2_container_alloc is now restricted to modules only and is being
removed from Asterisk 17.

Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
2018-11-21 09:56:12 -05:00
Corey Farrell
0d2b39065f astobj2: Create function to copy weak proxied objects from container.
Create ao2_container_dup_weakproxy_objs to perform a similar function to
ao2_container_dup.  This function expects the source container to have
weakproxy objects, inserts the associated non-weak objects into the
destination container.  Orphaned weakproxy objects are ignored.

Create test for this new function and for ao2_weakproxy_find.

Change-Id: I898387f058057e08696fe9070f8cd94ef3a27482
2018-11-21 08:48:25 -05:00
Sungtae Kim
1b6df87816 res_pjsip: Patch for res_pjsip_* module load/reload crash
The session_supplements for the pjsip makes crashes when the module
load/unload.

ASTERISK-28157

Change-Id: I5b82be3a75d702cf1933d8d1417f44aa10ad1029
2018-11-21 07:04:24 -05:00
Joshua Colp
0e096aefac Merge "app_queue: Cleanup queue_ref / queue_unref routines." into 16 2018-11-20 05:05:21 -06:00
Jenkins2
5f9a17bcdb Merge "stasis: Remove stringfields and lock from change message." into 16 2018-11-20 05:03:56 -06:00
Kevin Harwell
72e532136c func_strings: HASHKEY - negative array index can cause corruption
This patch makes it so only matching non-empty key names, and keys created by
the HASH function are eligible for inclusion in the comma separated string. It
also fixes a bug where it was possible to write to a negative index if the
result buffer was empty.

ASTERISK-28159
patches:
  ASTERISK-28159.diff submitted by Michael Walton (license 6502)

Change-Id: I6e57fe7307dfd856271753aed5ba64c59b511487
2018-11-19 14:41:52 -05:00
George Joseph
729967e99c CI: Get job timeouts from environment
The job timeouts were hard coded in the jenkinsfiles which
means changes had to go through gerrit.  Now they are taken
from the following environment variables (and their defaults) that
can be set in Jenkins configuration...

TIMEOUT_GATES =      "60 MINUTES"
TIMEOUT_DAILIES =    "3 HOURS"
TIMEOUT_REF_DEBUG =  "24 HOURS"
TIMEOUT_UNITTESTS =  "30 MINUTES"

Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab
2018-11-19 13:05:03 -05:00
Joshua C. Colp
d05c219aad stasis: Remove stringfields and lock from change message.
When a subscribe or unsubscribe occurs a message is published
containing this information. This change makes it so that the
message no longer uses stringfields or a lock, as both are not
really needed for the message.

Change-Id: I3f4831931d79f94fd979baf48048738df5dc1632
2018-11-19 12:00:28 -05:00
Joshua Colp
3506f84a37 Merge "test_res_pjsip_scheduler: Fix possible write after free in scheduler_policy." into 16 2018-11-19 09:38:41 -06:00
Joshua Colp
2d4146d005 Merge "res/res_ari: Fix null endpoint handle" into 16 2018-11-19 09:37:32 -06:00
Joshua Colp
d388977efb Merge "bridge_native_rtp.c: Fail native bridge if no framing match." into 16 2018-11-19 09:35:58 -06:00
Joshua Colp
7f813cdec8 Merge "res_pjsip_caller_id: Use static pj_str_t for fromto header names." into 16 2018-11-19 08:40:13 -06:00
Joshua Colp
cc0157d0d3 Merge "stasis: Add internal filtering of messages." into 16 2018-11-19 08:37:05 -06:00
Corey Farrell
f9b9bdd0b0 app_queue: Cleanup queue_ref / queue_unref routines.
This replaces the inline functions with macros.  This removes the need
to directly use __ao2_ref, opts instead for standard ao2_bump and
ao2_cleanup macros.

Change-Id: If4e04e9bab2e3c883188437cb9f487b3e498a21b
2018-11-19 08:00:03 -05:00
George Joseph
41eab5b3b8 backtrace: Refactor ast_bt_get_symbols so it doesn't crash
We've been seeing crashes in libbfd when we attempt to generate
a stack trace from multiple threads.  It turns out that libbfd
is NOT thread-safe.  It can cache the bfd structure and give it to
multiple threads without protecting itself.  To get around this,
we've added a global mutex around the bfd functions and also have
refactored the use of those functions to be more efficient and
to provide more information about inlined functions.

Also added a few more tests to test_pbx.c.  One just calls
ast_assert() and the other calls ast_log_backtrace().  Neither are
run by default.

WARNING:  This change necessitated changing the return value of
ast_bt_get_symbols() from an array of strings to a VECTOR of
strings.  However, the use of this function outside Asterisk is not
likely.

ASTERISK-28140

Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621
2018-11-19 05:48:42 -07:00
Sungtae Kim
cb83350230 res/res_ari: Fix null endpoint handle
The res_ari(POST /channels/create handler) deos not check the endpoint
parameter length. And it causes core
dump.
Fixed it to check the parameter length. Also fixed memory leak.

ASTERISK-28169

Change-Id: Ibf10a9eb8a2e3a9ee1e13fbe748b2ecf955c3993
2018-11-19 06:22:10 -05:00
George Joseph
e0a4df64cd Merge "pjsip: New function PJSIP_PARSE_URI to parse URI and return part of URI" into 16 2018-11-18 16:11:21 -06:00
Alexei Gradinari
e6005f1227 pjsip: New function PJSIP_PARSE_URI to parse URI and return part of URI
New dialplan function PJSIP_PARSE_URI added to parse an URI and return
a specified part of the URI.

This is useful when need to get part of the URI instead of cutting it
using a CUT function.

For example to get 'user' part of Remote URI
${PJSIP_PARSE_URI(${CHANNEL(pjsip,remote_uri)},user)}

ASTERISK-28144 #close

Change-Id: I5d828fb87f6803b6c1152bb7b44835f027bb9d5a
2018-11-18 13:27:15 -07:00
George Joseph
2ca3813c52 Merge "pjproject-bundled: Use AST_DEVMODE for conditional compilation." into 16 2018-11-18 14:13:37 -06:00