Commit Graph

30741 Commits

Author SHA1 Message Date
Valentin Vidic
efde1ab138 channel.c: Fix segfault with Monitor(wav,file,i)
If the Monitor is started with the i option the read_stream will be
NULL. One code path in channel.c checks if write_stream is set but than
uses read_stream instead causing a segfault.

ASTERISK-28249

Change-Id: I1bae9126537be54895c7fea2d08dd9488d8cc525
2019-01-20 12:51:19 -06:00
Sean Bright
28da2948d1 sched: Make sched_settime() return void because it cannot fail
Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5
2019-01-17 11:01:29 -05:00
Sean Bright
d87fc1c591 res_pjsip_transport_websocket: Don't assert on 0 length payloads
If an external pjproject is used and built with assertions enabled, we
will assert if passed a payload length of 0, so treat empty frames as if
we didn't receive them.

Change-Id: I9c5fdccd89cc8d2f3ed7e3ee405ef0fc78178f48
2019-01-14 10:39:03 -05:00
Friendly Automation
5254ebf09f Merge "res_pjsip: add option to disable ContactStatus event when contact is updated" into 13 2019-01-14 08:30:59 -06:00
Joshua C. Colp
94f9c681d4 Merge "stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure." into 13 2019-01-14 08:26:55 -06:00
Friendly Automation
c7a7638236 Merge "RTP: reset DTMF last seqno/timestamp on RTP renegotiation" into 13 2019-01-14 08:01:00 -06:00
Friendly Automation
7de0b919c9 Merge "app_voicemail: Fix Channel variable VM_MESSAGEFILE for "urgent" voicemail" into 13 2019-01-11 18:28:11 -06:00
Alexei Gradinari
4a8564cafa res_pjsip: add option to disable ContactStatus event when contact is updated
This patch adds a new PJSIP global configuration option
'send_contact_status_on_update_registration' to be able to have the same
performance benefits as version 16.

By default old behavior, i.e. the ContactStatus event will be sent when a
device refreshes its registration.

Change-Id: I706adf7584e7077eb6bde6d9799ca408bc82ce46
2019-01-11 11:52:29 -05:00
mohitdhiman
84a7b4d356 stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure.
During Bridging of two channels if masquerade operation is performed on a
channel (clone channel) which was created with endpoint details
(ast_channel_alloc_with_endpoint()) and the original channel which is created
without endpoint details (ast_channel_alloc()) then both the channels must
exchange their endpoint details or else after masquerade when clone channel
is being destroyed the endpoint cleanup callbacks will be destroyed too and
after call completion unique_id of original channel will still be there in
ast_endpoint structure's channel_ids container.

ASTERISK-28197

Change-Id: Ied0451f378a3f2a36acc8c0984959a69895efa17
2019-01-11 19:23:50 +05:30
Diederik de Groot
790626ec82 RAII: Change order or variables in clang version
This prevents use-after-scope issues when unwinding the stack,
which happens in reverse order. The varname variable needs to
remain alive for the destruction to be able to access it.
Issue was found using clang + address-sanitizer.

ASTERISK-28232 #close

Change-Id: I00811c34ae910836a5fb6d22304528aef92624db
2019-01-08 20:33:48 -05:00
Joshua C. Colp
d309f1d9f7 Merge "ast_coredumper: Refactor the pid determination process" into 13 2019-01-04 08:25:51 -06:00
George Joseph
e3439d3011 Merge "stasis: Fix ABI between DEVMODE and non-DEVMODE." into 13 2019-01-04 07:55:58 -06:00
Bryan Boatright
250812df09 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 12:01:44 -06:00
Richard Mudgett
b26ec935ec 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 11:10:29 -06:00
George Joseph
7f2a953691 Merge "backtrace.c: Fix casting pointer to/from integral type." into 13 2019-01-02 09:51:28 -06:00
Corey Farrell
240f339938 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:30:07 -05:00
George Joseph
96f8b19b1f Revert "stasis_cache: Stop caching stasis subscription change messages"
This reverts commit 94a4eea7f6.

This commit caused issues with polling when combined with
the revert commit "Revert "app_voicemail: Remove need to subscribe
to stasis"

ASTERISK-28222
Reported by: abelbeck

Change-Id: I0aaab5218a282706dfc6fcbbaeead228d599b99b
2018-12-26 10:43:55 -06:00
George Joseph
a39dd50436 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:16:53 -05:00
Alexei Gradinari
f9face3612 RTP: reset DTMF last seqno/timestamp on RTP renegotiation
The remote side may start a new stream when renegotiating RTP.
Need to reset the DTMF last sequence number and the timestamp
of the last END packet on RTP renegotiation.

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 SPA5XX and codec g722.
On SIP session update the SPA50X resets stream and a new timestamp is twice
smaller then the previous.

ASTERISK-28162 #close

Change-Id: Ic72b4497e74d801b27a635559c1cf29c16c95254
2018-12-19 16:27:12 -05:00
Richard Mudgett
a551539048 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 12:48:40 -06:00
Joshua C. Colp
5dc38c2fa9 Merge "app_voicemail: Don't delete mailbox state unless mailbox is deleted" into 13 2018-12-19 05:14:16 -06:00
George Joseph
1036959a49 Merge "res_rtp_asterisk: Remove some unused structure fields." into 13 2018-12-18 10:42:17 -06:00
George Joseph
e137086163 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 09:33:50 -07:00
Friendly Automation
ead94ad621 Merge "res_format_attr_h264.c: Make sure profile-level-id fmtp attribute is set" into 13 2018-12-17 08:26:29 -06:00
Sean Bright
a2336adfb9 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:42:31 -05:00
Friendly Automation
4cfc25d4e6 Merge "bridge_builtin_features.c: Set auto(mix)mon variables on both channels" into 13 2018-12-14 08:32:56 -06:00
Sean Bright
560747dca4 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:37 -05:00
Friendly Automation
c01a770fc0 Merge "confbridge: announce to the marked users when they join an empty conference" into 13 2018-12-13 07:55:12 -06:00
Sean Bright
92cc094d4e 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:16 -05:00
Friendly Automation
70a2f51786 Merge "utils: Don't set or clear flags that don't need setting or clearing" into 13 2018-12-12 13:11:17 -06:00
Friendly Automation
ac5c4316ef Merge "stasis: Add statistics gathering in developer mode." into 13 2018-12-12 13:08:59 -06:00
Friendly Automation
212f2a3aa3 Merge "Use non-blocking socket() and pipe() wrappers" into 13 2018-12-12 11:26:50 -06:00
Joshua C. Colp
e5605232df 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 13:14:04 -04:00
Friendly Automation
a03202e551 Merge "stasis: Allow filtering by formatter" into 13 2018-12-12 11:09:22 -06:00
Joshua C. Colp
e557a72566 Merge "build: Update config.guess and config.sub" into 13 2018-12-12 11:03:14 -06:00
George Joseph
6109126e2d Merge "pjproject_bundled: check whether UPDATE is supported on outgoing calls" into 13 2018-12-12 10:52:10 -06:00
Friendly Automation
53bda83f5e Merge "Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit"" into 13 2018-12-11 14:14:33 -06:00
Sean Bright
b84fd37ef0 Use non-blocking socket() and pipe() wrappers
Change-Id: I050ceffe5a133d5add2dab46687209813d58f597
2018-12-11 12:03:54 -05:00
George Joseph
232a56d0af Merge "CI: Various updates to buildAsterisk.sh" into 13 2018-12-11 09:07:39 -06:00
Sean Bright
3f3035680b utils: Don't set or clear flags that don't need setting or clearing
Change-Id: I0e7fb507ac09b15e45e1ff8501ecfca67afa5217
2018-12-11 10:07:27 -05:00
Joshua C. Colp
a2e4621d77 Merge "utils: Wrap socket() and pipe() to reduce syscalls" into 13 2018-12-11 09:02:39 -06:00
Sean Bright
93f00ebe59 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:11 -05:00
George Joseph
1ef993911f Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit"
This reverts commit cf620ce0f6.

Pending resolution of ASTERISK_28200

Change-Id: If18ab1166db0d634ce8a099bd7460251e9c682e1
2018-12-11 09:29:25 -05:00
Joshua C. Colp
e8a8729ed4 Merge "chan_sip: Fix leak using contact ACL" into 13 2018-12-10 07:05:31 -06:00
Alexei Gradinari
6392e452f2 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-07 15:22:29 -05:00
Giuseppe Sucameli
f4afd097af 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-07 11:58:03 -05:00
George Joseph
21a5ad0fd9 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 06:57:15 -07:00
Sean Bright
8c312c54ed 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 08:57:02 -05:00
George Joseph
30934a0145 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 08:37:45 -07:00
George Joseph
d9252612a7 Merge "test_websocket_client.c: Disable websocket_client_create_and_connect test." into 13 2018-12-05 08:18:14 -06:00