Commit Graph

32114 Commits

Author SHA1 Message Date
Joshua C. Colp
92ee1bdfbb Merge "app_queue: Fix crash when using 'b' option on non-ringall queue." into 16 2019-01-03 05:12:49 -06:00
Bryan Boatright
92298434bd app_voicemail: Fix Channel variable VM_MESSAGEFILE for "urgent" voicemail
If a voicemail is marked "urgent" then the VM_MESSAGEFILE channel variable is
not updated correctly since urgent messages are in a different directory. The
fix is to update the channel variable when the path to the urgent message is
created.

ASTERISK-28225

Change-Id: I8efbace06e6122ea0793f7bdb073d4378e8274ca
2019-01-02 13:16:20 -05:00
Joshua Colp
2d9482695d app_queue: Fix crash when using 'b' option on non-ringall queue.
When using the 'b' option to Queue with a queue that was not configured
for ring all a crash would occur as the wrong pointer would be used.

ASTERISK-28218

Change-Id: If1390f64e321047dff24fd2410c95dde74904980
2019-01-02 17:34:44 +00:00
Richard Mudgett
f196078705 stasic.c: Fix printf format type mismatches with arguments.
An int64_t is not likely the same size as a long.

* Changed the int64_t values in the statistics structs to longs so casting
is not necessary when generating the formatted CLI output.  The offending
members did not need to be int64_t anyway as they were only set by an int
type variable which was already truncating bits.

* Reordered the statistics structs to reduce potential padding bytes.

Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962
2019-01-02 12:10:58 -05:00
George Joseph
4ff64bfc2c Merge "backtrace.c: Fix casting pointer to/from integral type." into 16 2019-01-02 09:51:19 -06:00
Corey Farrell
44a7faca21 stasis: Fix ABI between DEVMODE and non-DEVMODE.
Create compatibility stubs for maximum ABI compatibility.

ASTERISK-28212 #close

Change-Id: I872c04842ab6b61e9dd6d37e4166bc619aa20626
2018-12-26 13:37:16 -05:00
George Joseph
ff2ed4eeee Revert "stasis_cache: Stop caching stasis subscription change messages"
This commit caused issues with polling when combined with
the revert commit "Revert "app_voicemail: Remove need to subscribe to stasis"

This reverts commit 17d6d9e1e7.

ASTERISK-28222
Reported by: abelbeck

Change-Id: Ib6a16cbe2c0b74c76c64264f525ab647959c1483
2018-12-26 10:29:51 -06:00
George Joseph
3efe5061d5 ast_coredumper: Refactor the pid determination process
In order to get a dump of the running process, we need to find the
pid of the main asterisk process.  This can be tricky if there are
also instances of "asterisk -r" running or if an alternate location
for asterisk.conf was specified on the command line with the -C
option that also specified an alternation location for the pid file.

So now...

1. We find the asterisk executable with "which" or the --asterisk-bin
   command line option.
2. If there's only 1 process with an executable path that matches,
   we use that pid.  If not...
3. We try "<asterisk-bin> -rx 'core show settings'" and parse the
   output to find the pidfile, then read that for the pid.  If that
   didn't work...
4. We get a list of all the pids matching <asterisk-bin> and look
   in /proc/<pid>/cmdline for a -C argument and retry the "core show
   settings" using the same -C option.  We can't parse the output
   of "ps" to get the -C path because it may contain spaces.  The
   contents of /proc/<pid>/cmdline are delimited by NULLs.  For BSDs
   we may have to mount /proc first. :(

ASTERISK-28221
Reported by: Andrew Nagy

Change-Id: I8aa1f3f912f949df2b5348908803c636bde1d57c
2018-12-24 14:17:32 -05:00
Richard Mudgett
59717b5e85 backtrace.c: Fix casting pointer to/from integral type.
The backtrace library bfd.h include file does not get the sizes of
pointers and ints right on some platforms.  On my old test box the size
of bfd_vma is 8 while the size of a pointer is 4.  gcc on the box
complains of the integer casting to/from pointers size mismatch.

* uintptr_t to the rescue by doing an appropriate two stage cast.

Change-Id: Icb2621583f50c8728de08a3c824d95fe53cc45d0
2018-12-19 13:50:51 -05:00
Joshua C. Colp
08e6cb6480 Merge "res/res_ari: Add additional hangup reasons" into 16 2018-12-19 05:14:41 -06:00
Friendly Automation
0110532bf9 Merge "app_voicemail: Don't delete mailbox state unless mailbox is deleted" into 16 2018-12-19 05:05:54 -06:00
George Joseph
4cbe04de77 Merge "res_pjsip: Patch for res_pjsip_* module load/reload crash" into 16 2018-12-18 10:43:11 -06:00
George Joseph
955129e9a4 Merge "res_rtp_asterisk: Remove some unused structure fields." into 16 2018-12-18 10:42:07 -06:00
George Joseph
aebb822d1f app_voicemail: Don't delete mailbox state unless mailbox is deleted
The free_user function was automatically deleting the stasis mailbox
state but this only makes sense when the mailbox is actually
deleted, not just the structure freed.  This was causing issues
where leave_voicemail would publish the mwi message to stasis and
delete the state before the message could be processed by
res_pjsip_mwi.

* Removed the delete of state from free_user().

* Created a new free_user_final() function that both frees the data
  structure and deletes the state.  This function is only called
  during module load/unload where it's appropriate to delete the
  state.

ASTERISK-28215

Change-Id: I305e8b3c930e9ac41d901e5dc8a58fd7904d98dd
2018-12-18 11:40:12 -05:00
Friendly Automation
9b57199a7a Merge "res_format_attr_h264.c: Make sure profile-level-id fmtp attribute is set" into 16 2018-12-17 08:27:36 -06:00
Sean Bright
970805180e res_rtp_asterisk: Remove some unused structure fields.
All of the fields that were removed were no longer referenced except for
'lastrxts' and 'rxseqno' which were only ever written to.

Change-Id: I5a5d31eb33e97663843698f58d0d97f22a76627c
2018-12-14 12:56:27 -05:00
Joshua C. Colp
9e159914dc Merge "bridge_builtin_features.c: Set auto(mix)mon variables on both channels" into 16 2018-12-14 09:37:04 -06:00
Sean Bright
f60afac587 res_format_attr_h264.c: Make sure profile-level-id fmtp attribute is set
The profile-iop octet (the 2nd) of profile-level-id can be zero
according to RFC 6184 Section 8.1. So we ignore its value when deciding
to include profile-level-id in the outgoing SDP.

ASTERISK-27959 #close
Reported by: David Kuehling

Change-Id: Id28cd916a3d7748058fe9609b585d07d9e243f73
2018-12-13 17:03:54 -05:00
Joshua C. Colp
84d693a689 Merge "utils: Don't set or clear flags that don't need setting or clearing" into 16 2018-12-13 08:23:42 -06:00
Joshua C. Colp
b924594104 Merge "confbridge: announce to the marked users when they join an empty conference" into 16 2018-12-13 08:00:21 -06:00
Sean Bright
640aac768b bridge_builtin_features.c: Set auto(mix)mon variables on both channels
This is how features behaved up through Asterisk 11, but was changed
when the new bridging framework was implemented in Asterisk 12.

Reported by rrittgarn in #asterisk.

Change-Id: I72cf86223947a8118c75f46e2c603dbc11e3125b
2018-12-13 08:52:40 -05:00
Friendly Automation
67e91d012b Merge "stasis: Add statistics gathering in developer mode." into 16 2018-12-12 13:12:04 -06:00
Joshua C. Colp
36db878adc Merge "Use non-blocking socket() and pipe() wrappers" into 16 2018-12-12 11:31:20 -06:00
Alexei Gradinari
2610379605 confbridge: announce to the marked users when they join an empty conference
Currently the file sound_only_person is not played when a marked
user (with announce_only_user=yes) joins an empty conference.

This patch fixes it.

ASTERISK-28201 #close

Change-Id: I85b67687e6b220939c3af8091d83a70a7b174cf4
2018-12-12 12:16:15 -05:00
Joshua C. Colp
68ec7d93e8 stasis: Add statistics gathering in developer mode.
This change adds statistics gathering to Stasis topics,
subscriptions, and message types. These can be viewed using
CLI commands and provide insight into how Stasis is used
and how long certain operations take to execute.

These are only available when Asterisk is compiled in
developer mode and do not have any impact under normal
operation.

ASTERISK-28117

Change-Id: I94411b53767f89ee01714daaecf0c2f1666e863f
2018-12-12 12:14:44 -05:00
Friendly Automation
ff147bcf92 Merge "stasis: Allow filtering by formatter" into 16 2018-12-12 11:09:28 -06:00
Joshua C. Colp
569e556656 Merge "pjproject_bundled: check whether UPDATE is supported on outgoing calls" into 16 2018-12-12 11:01:39 -06:00
Joshua C. Colp
88af756419 Merge "build: Update config.guess and config.sub" into 16 2018-12-12 11:01:18 -06:00
George Joseph
66820f19c2 Merge "Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit"" into 16 2018-12-11 14:17:35 -06:00
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