Commit Graph

31806 Commits

Author SHA1 Message Date
Sean Bright 58b55f2a30 sched: Make sched_settime() return void because it cannot fail
Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5
2019-01-17 10:02:35 -06:00
Sean Bright 2b8602e8cf res_pjsip_transport_websocket: Don't assert on 0 length payloads
When --enable-dev-mode is used, pjsip_tpmgr_receive_packet() 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 09:35:55 -06:00
Joshua C. Colp b19210214f Merge "res_pjsip: add option to enable ContactStatus event when contact is updated" 2019-01-14 08:38:14 -06:00
Joshua C. Colp c2e02645b4 Merge "stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure." 2019-01-14 08:26:32 -06:00
Joshua C. Colp a3f1f82272 Merge "res_pjsip_sdp_rtp: Only enable abs-send-time when WebRTC is enabled." 2019-01-14 08:03:27 -06:00
Joshua C. Colp 2bbcc76f79 Merge "RTP: reset DTMF last seqno/timestamp on RTP renegotiation" 2019-01-14 08:03:03 -06:00
Joshua C. Colp b4523ef334 Merge "app_voicemail: Fix Channel variable VM_MESSAGEFILE for "urgent" voicemail" 2019-01-14 06:19:45 -06:00
mohitdhiman d60ee2eeae 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: I97ce73da390af20fd082fb09d722a6fe9cb2f39d
2019-01-14 17:07:35 +05:30
Alexei Gradinari f0546d1d87 res_pjsip: add option to enable ContactStatus event when contact is updated
The commit I2f97ebfa79969a36a97bb7b9afd5b6268cf1a07d removed sending out
the ContactStatus AMI event when a contact is updated.
Thist change broke things which rely on old behavior.

This patch adds a new PJSIP global configuration option
'send_contact_status_on_update_registration' to be able to preserve old
ContactStatus behavior.
By default new behavior, i.e. the ContactStatus event will not be sent when a
device refreshes its registration.

Change-Id: I706adf7584e7077eb6bde6d9799ca408bc82ce46
2019-01-11 10:52:18 -05:00
Joshua Colp 18e206381a res_pjsip_sdp_rtp: Only enable abs-send-time when WebRTC is enabled.
For video streams it was possible for the abs-send-time information
to be placed into RTP streams even if not negotiated. Depending on
the endpoint in use this could cause video to not flow.

We now only enable abs-send-time for negotiation if WebRTC is enabled.

ASTERISK-28230

Change-Id: I0eb682302f8da3a4ea3c42e839208d55f825ed0c
2019-01-07 10:35:18 -05:00
Diederik de Groot 7bd30905fd 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-05 18:39:47 +01:00
Alexei Gradinari f662a26ea0 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
2019-01-04 10:58:39 -05:00
Joshua C. Colp 28dbb06e8c Merge "ast_coredumper: Refactor the pid determination process" 2019-01-04 08:27:04 -06:00
Friendly Automation 95dd00af3d Merge "stasis: Fix ABI between DEVMODE and non-DEVMODE." 2019-01-03 17:39:22 -06:00
Friendly Automation 9a92d814ea Merge "stasic.c: Fix printf format type mismatches with arguments." 2019-01-03 05:38:16 -06:00
Bryan Boatright 2c48b5d9bf 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:58 -05:00
Joshua Colp b7b080a0aa 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 12:35:27 -05:00
Richard Mudgett 7c08ff51d7 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:11:07 -05:00
George Joseph 192d9dd9c5 Merge "backtrace.c: Fix casting pointer to/from integral type." 2019-01-02 09:51:36 -06:00
Corey Farrell 110934706f
stasis: Fix ABI between DEVMODE and non-DEVMODE.
Eliminate differences with DEVMODE prototypes for public functions.

ASTERISK-28212 #close

Change-Id: I872c04842ab6b61e9dd6d37e4166bc619aa20626
2018-12-26 13:36:13 -05:00
George Joseph 4c084c6b1b Revert "stasis_cache: Stop caching stasis subscription change messages"
This reverts commit 5ec6d2c33e.

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: I1e83a433e4202574181bc128dce876ef24936a52
2018-12-26 10:29:35 -06:00
George Joseph 809e836265 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:38 -05:00
Richard Mudgett 314782e874 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:59 -05:00
Friendly Automation 31bacc2354 Merge "res/res_ari: Add additional hangup reasons" 2018-12-19 05:12:15 -06:00
Friendly Automation 673d631095 Merge "app_voicemail: Don't delete mailbox state unless mailbox is deleted" 2018-12-19 05:08:00 -06:00
George Joseph 3464093f85 Merge "res_pjsip: Patch for res_pjsip_* module load/reload crash" 2018-12-18 10:42:49 -06:00
George Joseph 2e21910ca1 Merge "res_rtp_asterisk: Remove some unused structure fields." 2018-12-18 10:42:26 -06:00
George Joseph c23c8d92d5 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:22 -05:00
Joshua C. Colp 768be60fbe Merge "res_format_attr_h264.c: Make sure profile-level-id fmtp attribute is set" 2018-12-17 09:34:47 -06:00
Sean Bright 357219dfb3 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:57:06 -05:00
Joshua C. Colp 0eaa736541 Merge "bridge_builtin_features.c: Set auto(mix)mon variables on both channels" 2018-12-14 08:37:38 -06:00
Sean Bright 5b12dfa6dd 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:59 -05:00
Joshua C. Colp b701c8b8a0 Merge "confbridge: announce to the marked users when they join an empty conference" 2018-12-13 08:00:06 -06:00
Sean Bright 3db1df301e 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:54:10 -05:00
Joshua C. Colp e12ba0a600 Merge "utils: Don't set or clear flags that don't need setting or clearing" 2018-12-12 13:12:19 -06:00
Friendly Automation 4e8aa3b68c Merge "stasis: Add statistics gathering in developer mode." 2018-12-12 13:08:23 -06:00
Joshua C. Colp a28f0382e8 Merge "Use non-blocking socket() and pipe() wrappers" 2018-12-12 11:31:00 -06:00
Alexei Gradinari cb1a08bdcb 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:15:49 -05:00
Joshua C. Colp fe07093660 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:53 -05:00
Friendly Automation 1f8062c6a6 Merge "stasis: Allow filtering by formatter" 2018-12-12 11:09:19 -06:00
Joshua C. Colp 3ee040e9cd Merge "build: Update config.guess and config.sub" 2018-12-12 11:05:30 -06:00
George Joseph 5a0a292843 Merge "pjproject_bundled: check whether UPDATE is supported on outgoing calls" 2018-12-12 10:51:57 -06:00
George Joseph 5d4d723844 Merge "Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit"" 2018-12-11 14:18:25 -06:00
Sean Bright 42ff856216 Use non-blocking socket() and pipe() wrappers
Change-Id: I050ceffe5a133d5add2dab46687209813d58f597
2018-12-11 12:29:09 -05:00
Sean Bright bedf16b041 utils: Don't set or clear flags that don't need setting or clearing
Change-Id: I0e7fb507ac09b15e45e1ff8501ecfca67afa5217
2018-12-11 10:08:07 -05:00
George Joseph 82473227be Merge "CI: Various updates to buildAsterisk.sh" 2018-12-11 09:07:59 -06:00
Joshua C. Colp 6b017a51e0 Merge "utils: Wrap socket() and pipe() to reduce syscalls" 2018-12-11 09:01:38 -06:00
Sean Bright 00b36bb045 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:31 -05:00
George Joseph d1598dbc7d Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit"
This reverts commit 3f53041267.

Pending resolution of ASTERISK_28200

Change-Id: Iad4f3614cac95b00fdbb2b799aab8ae6285ec988
2018-12-11 09:28:48 -05:00
Sebastian Damm a24bb1c4b6 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 11:20:44 +01:00