]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
5 years agochan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.
Frederic LE FOLL [Wed, 27 Nov 2019 18:11:33 +0000 (19:11 +0100)] 
chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.

During capabilities selection (joint capabilities of us and peer,
configured capability for this peer, or general configured
capabilities), if sip_new() does not keep framing information,
then directmedia activation will fail for any framing different
from default framing.

ASTERISK-28637

Change-Id: I99257502788653c2816fc991cac7946453082466

5 years agoMerge "media_cache.c: Various CLI improvements" into 17
George Joseph [Mon, 2 Dec 2019 22:01:42 +0000 (16:01 -0600)] 
Merge "media_cache.c: Various CLI improvements" into 17

5 years agoCI: Turn off shallow cloning altogether
George Joseph [Mon, 2 Dec 2019 12:48:01 +0000 (05:48 -0700)] 
CI: Turn off shallow cloning altogether

Change-Id: I73ed4aef33a92f20080128aafc34e19fd4457196

5 years agomedia_cache.c: Various CLI improvements
Sean Bright [Fri, 22 Nov 2019 21:31:29 +0000 (16:31 -0500)] 
media_cache.c: Various CLI improvements

* Use ast_cli_completion_add() to improve performance when large number of
  cached items are present.

* Only complete one URI for commands that only accept a single URI.

* Change command documentation to wrap at 80 characters to improve
  readability.

Change-Id: Iedb0a2c3541e49561bc231dca2dcc0ebd8612902

5 years agores_pjsip_t38: T.38 error correction mode selection at 200 ok received
Salah Ahmed [Fri, 15 Nov 2019 17:34:26 +0000 (11:34 -0600)] 
res_pjsip_t38: T.38 error correction mode selection at 200 ok received

if asterisk offer T38 SDP with none error correction scheme and
the endpoint respond with redundancy EC scheme, asterisk switch
to that mode. Since we configure the endpoint as none EC mode
we should not switch to any other mode except none.
following logic implemented in code.

1. If asterisk offer none, and anything except none in answer
   will be ignored.
2. If asterisk offer fec, answer with fec, redundancy and none will
   be accepted.
3. If asterisk offer redundancy, answer with redundancy and none
   will be accepted.

ASTERISK-28621

Change-Id: I343c62253ea4c8b7ee17abbfb377a4d484a14b19

5 years agoMerge "manager.c: Prevent the Originate action from running the Originate app" into 17
Friendly Automation [Thu, 21 Nov 2019 20:03:02 +0000 (14:03 -0600)] 
Merge "manager.c:  Prevent the Originate action from running the Originate app" into 17

5 years agochan_sip.c: Prevent address change on unauthenticated SIP request.
Ben Ford [Mon, 21 Oct 2019 19:55:06 +0000 (14:55 -0500)] 
chan_sip.c: Prevent address change on unauthenticated SIP request.

If the name of a peer is known and a SIP request is sent using that
peer's name, the address of the peer will change even if the request
fails the authentication challenge. This means that an endpoint can
be altered and even rendered unusuable, even if it was in a working
state previously. This can only occur when the nat option is set to the
default, or auto_force_rport.

This change checks the result of authentication first to ensure it is
successful before setting the address and the nat option.

ASTERISK-28589 #close

Change-Id: I581c5ed1da60ca89f590bd70872de2b660de02df

5 years agomanager.c: Prevent the Originate action from running the Originate app
George Joseph [Thu, 24 Oct 2019 17:41:23 +0000 (11:41 -0600)] 
manager.c:  Prevent the Originate action from running the Originate app

If an AMI user without the "system" authorization calls the
Originate AMI command with the Originate application,
the second Originate could run the "System" command.

Action: Originate
Channel: Local/1111
Application: Originate
Data: Local/2222,app,System,touch /tmp/owned

If the "system" authorization isn't set, we now block the
Originate app as well as the System, Exec, etc. apps.

ASTERISK-28580
Reported by: Eliel Sardañons

Change-Id: Ic4c9dedc34c426f03c8c14fce334a71386d8a5fa

5 years agoMerge "chan_dahdi: PRI span status may stay "Down, Active" after a short alarm" into 17
George Joseph [Thu, 21 Nov 2019 15:23:42 +0000 (09:23 -0600)] 
Merge "chan_dahdi: PRI span status may stay "Down, Active" after a short alarm" into 17

5 years agoMerge "app_senddtmf: Add receive mode to AMI Action PlayDTMF" into 17
Friendly Automation [Thu, 21 Nov 2019 14:38:53 +0000 (08:38 -0600)] 
Merge "app_senddtmf: Add receive mode to AMI Action PlayDTMF" into 17

5 years agoMerge "app_amd: Fixed timeout issue" into 17
Kevin Harwell [Wed, 20 Nov 2019 22:14:47 +0000 (16:14 -0600)] 
Merge "app_amd: Fixed timeout issue" into 17

5 years agoMerge "func_curl.c: Support custom http headers" into 17
Friendly Automation [Wed, 20 Nov 2019 15:49:42 +0000 (09:49 -0600)] 
Merge "func_curl.c: Support custom http headers" into 17

5 years agoMerge "res_pjsip_registrar: Fix uninitlized variable warning" into 17
George Joseph [Wed, 20 Nov 2019 14:59:38 +0000 (08:59 -0600)] 
Merge "res_pjsip_registrar: Fix uninitlized variable warning" into 17

5 years agoCI: Fix missing script block in jenkinsfiles
George Joseph [Tue, 19 Nov 2019 18:11:06 +0000 (11:11 -0700)] 
CI: Fix missing script block in jenkinsfiles

Change-Id: I9f44a3d5085ea7880fad1a3883a4820907e29ea3
(cherry picked from commit 95213b01d2d5e72e38b40c30fa5d0c8cf4b37b16)

5 years agoCI: Fix missing script block in jenkinsfiles
George Joseph [Tue, 19 Nov 2019 17:40:09 +0000 (10:40 -0700)] 
CI: Fix missing script block in jenkinsfiles

Change-Id: Ib4b6e4887695f230ea7a5b0c879b29fc5a13be4f
(cherry picked from commit d60f23ecbdb748b188da424c92335152941c7673)
(cherry picked from commit ce8a23fdf966dc6824678f3cb722753db06baa7a)

5 years agoCI: Increase clone depth and do better cleanup
George Joseph [Tue, 19 Nov 2019 14:51:56 +0000 (07:51 -0700)] 
CI: Increase clone depth and do better cleanup

The original clone depth of 10 was causing the need to rebase
changes whose parent was older than the 10 commits.  The clone
depth has been increased to 100.

Workspace cleanup was only happening for successful builds which
wasn't enough to keep the 8G workspace in-memory drives on the
docker slaves from filling up.  Now the workspaces are cleaned up
after every build regardless of success/failure.  If you need to
preserve builds temporarily, you can log into Jenkins/Manage
Jenkins/Configure System and change the CLEANUP_WS_* environment
variable for the job type you're troubleshooting to "FALSE".

Change-Id: I0d7366e87cea714e5dbc9488caf718802fce75ca

5 years agoMerge "serializer: set high/low alert levels on whole pool" into 17
Friendly Automation [Tue, 19 Nov 2019 16:13:55 +0000 (10:13 -0600)] 
Merge "serializer: set high/low alert levels on whole pool" into 17

5 years agores_pjsip_registrar: Fix uninitlized variable warning
Sean Bright [Tue, 19 Nov 2019 15:31:59 +0000 (10:31 -0500)] 
res_pjsip_registrar: Fix uninitlized variable warning

Fixes: error: ‘domain_name’ may be used uninitialized in this function
Found with gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

Change-Id: I44413b49ea1205aa25538142161deb73883c79e8

5 years agoapp_amd: Fixed timeout issue
Michael Cargile [Tue, 5 Nov 2019 18:16:48 +0000 (13:16 -0500)] 
app_amd: Fixed timeout issue

ASTERISK_28143 attempted to fix an issue where calls with no audio would never
timeout. It did so by adding AST_FRAME_NULL as a frame type to process in its
calculations. Unfortunately these frames seem to show up at irregular time
intervals. This resulted in app_amd returning prematurely most of the time.

* Removed AST_FRAME_NULL from the calculations
* Added a check to see how much time has actually passed since app_amd began

ASTERISK-28608

Change-Id: I642a21b02d389b17e40ccd5357754b034c3daa42

5 years agochan_dahdi: PRI span status may stay "Down, Active" after a short alarm
Frederic LE FOLL [Thu, 7 Nov 2019 17:54:22 +0000 (18:54 +0100)] 
chan_dahdi: PRI span status may stay "Down, Active" after a short alarm

Upon a short PRI disconnection, libpri may maintain Q.921 layer 'up' and
may thus not send PRI_EVENT_DCHAN_DOWN / PRI_EVENT_DCHAN_UP events.
If pri_event_alarm() clears DCHAN_UP status bit upon alarm detection
and no Q.921 reconnection sequence occurs, chan_dahdi will keep
seeing span status "Down" at the end of alarm.

This patch modifies pri_event_alarm() in order to keep DCHAN_UP bit
unchanged. libpri will send a PRI_EVENT_DCHAN_DOWN event if it detects
a disconnection of Q.921 layer and this will clear DCHAN_UP if required.

ASTERISK-28615

Change-Id: Ibe27df4971fd4c82cc6850020bce4a8b2692c996

5 years agoapp_senddtmf: Add receive mode to AMI Action PlayDTMF
lvl [Thu, 7 Nov 2019 17:05:39 +0000 (17:05 +0000)] 
app_senddtmf: Add receive mode to AMI Action PlayDTMF

ASTERISK-28614

Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664

5 years agoMerge "parking: Fix case where we can't get the parker." into 17
Friendly Automation [Mon, 18 Nov 2019 21:19:49 +0000 (15:19 -0600)] 
Merge "parking: Fix case where we can't get the parker." into 17

5 years agoMerge "various files - fix some alerts raised by lgtm code analysis" into 17
George Joseph [Mon, 18 Nov 2019 17:42:03 +0000 (11:42 -0600)] 
Merge "various files - fix some alerts raised by lgtm code analysis" into 17

5 years agoMerge "func_env: Prevent FILE() from reading garbage at end-of-file" into 17
Friendly Automation [Mon, 18 Nov 2019 16:40:21 +0000 (10:40 -0600)] 
Merge "func_env: Prevent FILE() from reading garbage at end-of-file" into 17

5 years agoMerge "res_rtp_asterisk: Always return provided DTLS packet length." into 17
Friendly Automation [Mon, 18 Nov 2019 16:37:09 +0000 (10:37 -0600)] 
Merge "res_rtp_asterisk: Always return provided DTLS packet length." into 17

5 years agoserializer: set high/low alert levels on whole pool
Alexei Gradinari [Thu, 7 Nov 2019 16:56:57 +0000 (11:56 -0500)] 
serializer: set high/low alert levels on whole pool

The current code sets alert levels starting from index 1.
Need to set on whole pool starting from index 0.

Change-Id: I5decbb43160954fb9a512f04302637fc666b6f5d

5 years agores_rtp_asterisk: Always return provided DTLS packet length.
Joshua Colp [Thu, 14 Nov 2019 10:19:04 +0000 (06:19 -0400)] 
res_rtp_asterisk: Always return provided DTLS packet length.

OpenSSL can not tolerate if the packet sent out does not
match the length that it provided to the sender. This change
lies and says that each time the full packet was sent. If
a problem does occur then a retransmission will occur as
appropriate.

ASTERISK-28576

Change-Id: Id42455b15c9dc4eb987c8c023ece6fbf3c22a449

5 years agofunc_env: Prevent FILE() from reading garbage at end-of-file
Sean Bright [Wed, 13 Nov 2019 20:25:22 +0000 (15:25 -0500)] 
func_env: Prevent FILE() from reading garbage at end-of-file

If the last line of a file does not have a terminating EOL sequence, we
potentially add garbage to the value returned from the FILE() function.

There is no overflow potential here as we are reading from a buffer of a
known size, we are just reading too much of it.

ASTERISK-26481 #close

Change-Id: I50dd4fcf416fb3c83150040a1a79a59d9eb1ae01

5 years agobridge_softmix: clear hold when joining a softmix bridge
Kevin Harwell [Wed, 13 Nov 2019 23:24:48 +0000 (17:24 -0600)] 
bridge_softmix: clear hold when joining a softmix bridge

MOH continues to play to a channel if that channel was on hold prior to
entering a softmix bridge. MOH will not stop even if the original "holder"
attempts an unhold.

For the most part a softmix bridge ignores holds, so a participating channel
shouldn't join while on hold. This patch checks to see if the channel joining
the softmix bridge is currently on hold. If so then it indicates an unhold.

ASTERISK-28618

Change-Id: I66ccd4efc80f5b4c3dd68186b379eb442916392b

5 years agovarious files - fix some alerts raised by lgtm code analysis
Kevin Harwell [Wed, 23 Oct 2019 17:36:17 +0000 (12:36 -0500)] 
various files - fix some alerts raised by lgtm code analysis

This patch fixes several issues reported by the lgtm code analysis tool:

https://lgtm.com/projects/g/asterisk/asterisk

Not all reported issues were addressed in this patch. This patch mostly fixes
confirmed reported errors, potential problematic code points, and a few other
"low hanging" warnings or recommendations found in core supported modules.
These include, but are not limited to the following:

* innapropriate stack allocation in loops
* buffer overflows
* variable declaration "hiding" another variable declaration
* comparisons results that are always the same
* ambiguously signed bit-field members
* missing header guards

Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25

5 years agofunc_curl.c: Support custom http headers
Martin Tomec [Thu, 7 Nov 2019 17:54:06 +0000 (17:54 +0000)] 
func_curl.c: Support custom http headers

When user wants to send json data, the default Content-Type header
is incorect (application/x-www-form-urlencoded). This patch allows
to set any custom headers so the Content-Type header can be
overriden. User can set multiple headers by multiple calls of
curlopt(). This approach is not consistent with other parameters,
but is more readable in dialplan than one call with multiple
headers.

ASTERISK-28613

Change-Id: I4dd68c3f4e25362ef941d73a3861f58348dcfbf9

5 years agoparking: Fix case where we can't get the parker.
Joshua Colp [Fri, 15 Nov 2019 10:46:37 +0000 (06:46 -0400)] 
parking: Fix case where we can't get the parker.

ASTERISK-28616

Change-Id: Iabe31ae38d01604284fcc5c2438d44e29a32ea4d

5 years agoparking: Use channel snapshot instead of channel.
Joshua Colp [Tue, 12 Nov 2019 11:00:44 +0000 (07:00 -0400)] 
parking: Use channel snapshot instead of channel.

There exists a scenario where a thread can hold a lock on the
channels container while trying to lock a bridge. At the same
time another thread can hold the lock for said bridge while
attempting to retrieve a channel. This causes a deadlock.

This change fixes this scenario by retrieving a channel snapshot
instead of a channel, as information present in the snapshot
is all that is needed.

ASTERISK-28616

Change-Id: I68ceb1d62c7378addcd286e21be08a660a7cecf2

5 years agoMerge "res_pjsip_session: initialize pending's topology to endpoint's" into 17
Kevin Harwell [Thu, 14 Nov 2019 19:12:20 +0000 (13:12 -0600)] 
Merge "res_pjsip_session: initialize pending's topology to endpoint's" into 17

5 years agores_pjsip_session: initialize pending's topology to endpoint's
Kevin Harwell [Tue, 12 Nov 2019 18:36:37 +0000 (12:36 -0600)] 
res_pjsip_session: initialize pending's topology to endpoint's

Found during some testing, there is a race condition between selecting an
appropriate bridge type for a call versus the applying of media on the callee's
session. In some instances a native bridge type would have been chosen, but
due to the callee's media not yet being established at bridge compatibility
check time the simple bridge type is picked instead.

When using chan_pjsip this initiates a topology change event. The topologies
are then compared for the two sessions. However, when the topology was created
for the caller its streams are initialized to "inactive". This topology is then
used as a base when creating the callee's topology, and streams. Soon after
the caller's topology's stream(s) get updated based on the sdp (get set to
sendrecv in the failing scenario).

Now when the topology change event is raised, and the two topologies are
compared, the comparison fails due to a stream state mismatch (sendrecv vs
inactive). And since they differ a reinvite is sent out (to the caller in
this case).

This patch makes it such that when the caller's topology is initially created
it gets created based on its configured endpoint's media topology. When the
endpoint's topology is created its stream's state(s) are initialized to
sendrecv instead of inactive. Subsequently, now when the callee's topology is
created its topology streams are now initialized to sendrecv. Thus when the
topology change event occurs due to the mentioned scenario the stream states
match for the given sessions, and the reinvite is not sent unless due to some
other valid mismatch.

Note, this patch only changes one pending media state's creation point. It's
possible other places *could* be changed, however for now it was deemed best
to only alter what's here.

Change-Id: I6ba3a6a75f64824a1b963044c37acbe951c389c7

5 years agostasis: Don't hold app_registry and session locks unnecessarily
George Joseph [Wed, 6 Nov 2019 11:47:17 +0000 (04:47 -0700)] 
stasis: Don't hold app_registry and session locks unnecessarily

resource_events:stasis_app_message_handler() was locking the session,
then attempting to determine if the app had debug enabled which
locked the app_registry container.  res_stasis:__stasis_app_register
was locking the app_registry container then calling app_update
which caused app_handler (which locks the session) to run.
The result was a deadlock.

* Updated resource_events:stasis_app_message_handler() to determine
  if debug was set (which locks the app_registry) before obtaining the
  session lock.

* Updated res_stasis:__stasis_app_register to release the app_registry
  container lock before calling app_update (which locks the sesison).

ASTERISK-28423
Reported by Ross Beer

Change-Id: I58c69d08cb372852a63933608e4d6c3e456247b4

5 years agoBuild: Fix compile issues with seldom used modules
George Joseph [Tue, 29 Oct 2019 13:23:54 +0000 (07:23 -0600)] 
Build:  Fix compile issues with seldom used modules

The following modules needed tweaks for API changes.

addons/cdr_mysql.c
addons/chan_ooh323.c
apps/app_meetme.c

ASTERISK-28604

Change-Id: Ib40e513ae55b5114be035cdc929abb6a8ce2d06d

5 years agores_pjsip_outbound_registration: Extend documentation for "max_retries".
Joshua Colp [Fri, 25 Oct 2019 11:46:41 +0000 (11:46 +0000)] 
res_pjsip_outbound_registration: Extend documentation for "max_retries".

If the "max_retries" option is set to 0 then upon failure no
further attemps are made, so explicitly document the behavior.

ASTERISK-28602

Change-Id: I1e30daae9dd6c49ce18744164214d3def505acbf

5 years agoMerge "res_calendar: Resolve memory leak on calendar destruction" into 17
Joshua Colp [Tue, 29 Oct 2019 15:24:49 +0000 (10:24 -0500)] 
Merge "res_calendar: Resolve memory leak on calendar destruction" into 17

5 years agores_calendar: Resolve memory leak on calendar destruction
Sean Bright [Thu, 24 Oct 2019 14:15:14 +0000 (10:15 -0400)] 
res_calendar: Resolve memory leak on calendar destruction

Calling ne_uri_parse allocates memory that needs to be freed with a
corresponding call to ne_uri_free.

ASTERISK-28572 #close

Change-Id: I8a6834da27000a6807d89cb7a157b2a88fcb5e61

5 years agores_ari_events: Add module reference when a WebSocket is open.
Joshua Colp [Thu, 24 Oct 2019 10:21:31 +0000 (07:21 -0300)] 
res_ari_events: Add module reference when a WebSocket is open.

This change ensures that the module isn't unloaded when a
WebSocket is open. Previously it was possible to unload the
module manually or during shutdown which could cause a crash
when any active WebSockets were terminated.

ASTERISK-28585

Change-Id: I85c71ab112f99875b586419a34c08c8b34c14c5c

5 years agoMerge "ExternalMedia: Change return object from ExternalMedia to Channel" into 17
George Joseph [Mon, 21 Oct 2019 18:53:10 +0000 (13:53 -0500)] 
Merge "ExternalMedia:  Change return object from ExternalMedia to Channel" into 17

5 years agoMerge "utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN" into 17
Friendly Automation [Mon, 21 Oct 2019 18:31:34 +0000 (13:31 -0500)] 
Merge "utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN" into 17

5 years agoMerge "app_voicemail.c: Support multiple file formats for forwarded messages." into 17
Joshua Colp [Mon, 21 Oct 2019 15:31:47 +0000 (10:31 -0500)] 
Merge "app_voicemail.c: Support multiple file formats for forwarded messages." into 17

5 years agoMerge "Crash during "pjsip show channelstats" execution" into 17
Friendly Automation [Mon, 21 Oct 2019 12:26:19 +0000 (07:26 -0500)] 
Merge "Crash during "pjsip show channelstats" execution" into 17

5 years agoutils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN
Sean Bright [Fri, 18 Oct 2019 18:47:20 +0000 (14:47 -0400)] 
utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN

ASTERISK-28590 #close

Change-Id: I51abce00c04d0a06550bda5205580705185b9c1c

5 years agoMerge "res_rtp_asterisk: Remove a log message that slipped in." into 17
Joshua Colp [Fri, 18 Oct 2019 14:37:45 +0000 (09:37 -0500)] 
Merge "res_rtp_asterisk: Remove a log message that slipped in." into 17

5 years agoExternalMedia: Change return object from ExternalMedia to Channel
George Joseph [Fri, 18 Oct 2019 11:36:12 +0000 (05:36 -0600)] 
ExternalMedia:  Change return object from ExternalMedia to Channel

When we created the External Media addition to ARI we created an
ExternalMedia object to be returned from the channels/externalMedia
REST endpoint.  This object contained the channel object that was
created plus local_address and local_port attributes (which are
also in the Channel variables).  At the time, we thought that
creating an ExternalMedia object would give us more flexibility
in the future but as we created the sample speech to text
application, we discovered that it doesn't work so well with ARI
client libraries that a) don't have the ExternalMedia object
defined and/or b) can't promote the embedded channel structure
to a first-class Channel object.

This change causes the channels/externalMedia REST endpoint to
return a Channel object (like channels/create and channels/originate)
instead of the ExternalMedia object.

Change-Id: If280094debd35102cf21e0a31a5e0846fec14af9

5 years agoCrash during "pjsip show channelstats" execution
Salah Ahmed [Fri, 18 Oct 2019 09:22:22 +0000 (11:22 +0200)] 
Crash during "pjsip show channelstats" execution

During execution "pjsip show channelstats" cli command by an
external module asterisk crashed. It seems this is a separate
thread running to fetch and print rtp stats. The crash happened on
the ao2_lock method, just before it going to read the rtp stats on
a rtp instance. According to gdb backtrace log, it seems the
session media was already cleaned up at that moment.

ASTERISK-28578

Change-Id: I3e05980dd4694577be6d39be2c21a5736bae3c6f

5 years agores_rtp_asterisk: Remove a log message that slipped in.
Joshua Colp [Thu, 17 Oct 2019 10:50:28 +0000 (07:50 -0300)] 
res_rtp_asterisk: Remove a log message that slipped in.

This was only supposed to be for testing, so now it can be
removed.

Change-Id: I3dfc2e776e70b3196aeed5688372ea80c0214b59

5 years agoREADME-SERIOUSLY.bestpractices.md: Speling correetions.
Sean Bright [Wed, 16 Oct 2019 21:06:52 +0000 (17:06 -0400)] 
README-SERIOUSLY.bestpractices.md: Speling correetions.

ASTERISK-28586 #close

Change-Id: I43dc4e8bd9dc685b17695b215a5360314074734f

5 years agoMerge "test_res_rtp: Enable FIR and REMB nominal tests." into 17
Joshua Colp [Wed, 16 Oct 2019 12:43:55 +0000 (07:43 -0500)] 
Merge "test_res_rtp: Enable FIR and REMB nominal tests." into 17

5 years agoapp_voicemail.c: Support multiple file formats for forwarded messages.
cmaj [Fri, 27 Sep 2019 00:24:12 +0000 (18:24 -0600)] 
app_voicemail.c: Support multiple file formats for forwarded messages.

If you specify multiple formats in voicemail.conf, eg. "format = gsm|wav"
and are using realtime ODBC backend, only the first format gets stored
in the database. So when you forward a message later on, there is a bug
generating the email, related to the stored format (GSM) being different
than the desired email format (WAV) specified for the user. Sox can
handle this, but Asterisk needs to tell sox exactly what to do.

ASTERISK-22192

Change-Id: I7321e7f7e7c58adbf41dd4fd7191c887b9b2eafd

5 years agoMerge "res_pjsip_mwi: potential double unref, and potential unwanted double link...
George Joseph [Mon, 14 Oct 2019 17:00:51 +0000 (12:00 -0500)] 
Merge "res_pjsip_mwi: potential double unref, and potential unwanted double link" into 17

5 years agotest_res_rtp: Enable FIR and REMB nominal tests.
Joshua Colp [Mon, 14 Oct 2019 11:19:23 +0000 (11:19 +0000)] 
test_res_rtp: Enable FIR and REMB nominal tests.

Now that both FIR and REMB are being sent in compound packets
these tests can be enabled.

This also extends the REMB nominal test to cover the REMB
contents itself.

Change-Id: Ibfee526ad780eefcce5dd787f53785382210024a

5 years agoMerge "pbx: deadlock when outgoing dialed channel hangs up too quickly" into 17
Friendly Automation [Mon, 14 Oct 2019 11:56:25 +0000 (06:56 -0500)] 
Merge "pbx: deadlock when outgoing dialed channel hangs up too quickly" into 17

5 years agoMerge "cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12" into 17
Friendly Automation [Mon, 14 Oct 2019 11:29:35 +0000 (06:29 -0500)] 
Merge "cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12" into 17

5 years agocdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12
Christoph Moench-Tegeder [Tue, 8 Oct 2019 18:40:30 +0000 (20:40 +0200)] 
cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12

PostgreSQL 12 finally removed column adsrc from table pg_catalog.pg_attrdef
(column default values), which has been deprecated since version 8.0.
Since then, the official/correct/supported way to retrieve the column
default value from the catalog is function pg_catalog.pg_get_expr().

This change breaks compatibility with pre-8.0 PostgreSQL servers,
but has reached end-of-support more than a decade ago.
cdr_pgsql and res_config_pgsql still have support for pre-7.3
servers, but cleaning that up is perhaps a topic for a major release,
not this bugfix.

ASTERISK-28571

Change-Id: I834cb3addf1937e19e87ede140bdd16cea531ebe

5 years agoMerge "pjproject_bundled: Replace earlier reverts with official fixes." into 17
George Joseph [Fri, 11 Oct 2019 14:32:36 +0000 (09:32 -0500)] 
Merge "pjproject_bundled:  Replace earlier reverts with official fixes." into 17

5 years agores_pjsip_mwi: potential double unref, and potential unwanted double link
Kevin Harwell [Thu, 10 Oct 2019 20:30:06 +0000 (15:30 -0500)] 
res_pjsip_mwi: potential double unref, and potential unwanted double link

When creating an unsolicited MWI aggregate subscription it was possible for
the subscription object to be double unref'ed. This patch removes the explicit
unref as it is not needed since the RAII_VAR will handle it at function end.

Less concerning there was also a bug that could potentially allow the aggregate
subscription object to be added to the unsolicited container twice. This patch
ensures it is added only once.

ASTERISK-28575

Change-Id: I9ccfdb5ea788bc0c3618db183aae235e53c12763

5 years agotest_taskprocessor.c: Fix test failure on Ubuntu
csavinovich [Wed, 9 Oct 2019 21:00:31 +0000 (16:00 -0500)] 
test_taskprocessor.c: Fix test failure on Ubuntu

Fixes a failure in /main/taskprocesor unit test, only occurring in Ubuntu.
Newer versions of GCC require variable initialization.

Change-Id: I2994d8aab9307a8c2c7330584f287a27144a580c

5 years agoMerge "Revert "app_voicemail: Cleanup stale lock files on module load"" into 17
Friendly Automation [Thu, 10 Oct 2019 15:05:37 +0000 (10:05 -0500)] 
Merge "Revert "app_voicemail: Cleanup stale lock files on module load"" into 17

5 years agoMerge changes from topic "pjsip_shutdown" into 17
George Joseph [Thu, 10 Oct 2019 14:13:48 +0000 (09:13 -0500)] 
Merge changes from topic "pjsip_shutdown" into 17

* changes:
  res_pjsip_mwi: use an ao2_global object for mwi containers
  res_pjsip/res_pjsip_mwi: use centralized serializer pools

5 years agoMerge "serializer: move/add asterisk serializer pool functionality" into 17
George Joseph [Thu, 10 Oct 2019 14:09:22 +0000 (09:09 -0500)] 
Merge "serializer: move/add asterisk serializer pool functionality" into 17

5 years agoMerge "chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel" into 17
Friendly Automation [Thu, 10 Oct 2019 13:43:57 +0000 (08:43 -0500)] 
Merge "chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel" into 17

5 years agopjproject_bundled: Replace earlier reverts with official fixes.
George Joseph [Wed, 9 Oct 2019 14:32:45 +0000 (08:32 -0600)] 
pjproject_bundled:  Replace earlier reverts with official fixes.

Issues in pjproject 2.9 caused us to revert some of their changes
as a work around.  This introduced another issue where pjproject
wouldn't build with older gcc versions such as that found on
CentOS 6.  This commit replaces the reverts with the official
fixes for the original issues and allows pjproject to be built
on CentOS 6 again.

ASTERISK-28574
Reported-by: Niklas Larsson
Change-Id: I06f8507bea553d1a01b0b8874197d35b9d47ec4c

5 years agopbx: deadlock when outgoing dialed channel hangs up too quickly
Kevin Harwell [Wed, 9 Oct 2019 20:17:59 +0000 (15:17 -0500)] 
pbx: deadlock when outgoing dialed channel hangs up too quickly

Here's the basic scenario that occurred when executing an AMI fast originate
while at the same time something else locks the channels container, and also
wants a lock on the dialed channel:

1. pbx_outgoing_attempt obtains a lock on a dialed channel
2. concurrently another thread obtains a lock on the channels container, and
   subsequently requests a lock on the dialed channel. It waits on #1. For
   instance, "core show channel <dialed channel"
3. the outgoing call does not fail, but ends before the pbx_outgoing_attempt
   function exits
4. pbx_outgoing_attempt function exits, the outgoing structure destructs, and
   attempts to hang up the dialed channel
5. hang up tries to obtain the channels container lock, but can't due to #2.
6. Asterisk is deadlocked.

The solution was to allow the pbx_outgoing_exec function to "steal" ownership
of the dialed channel, and handle hanging it up. The channel now is either hung
up prior to it being potentially locked by the initiating thread, or if locked
the hang up takes place in a different thread, thus alleviating the deadlock.

ASTERISK-28561
patches:
  iliketrains.diff submitted by Joshua Colp (license 5000)

Change-Id: I51b42b92dde8f2215b69bb509e28667ee3a3853a

5 years agoMerge "cdr_mysql: Don't clean up on unload unless we can unregister from CDRs" into 17
Friendly Automation [Tue, 8 Oct 2019 12:27:22 +0000 (07:27 -0500)] 
Merge "cdr_mysql: Don't clean up on unload unless we can unregister from CDRs" into 17

5 years agoRevert "app_voicemail: Cleanup stale lock files on module load"
Sean Bright [Mon, 7 Oct 2019 19:02:39 +0000 (14:02 -0500)] 
Revert "app_voicemail: Cleanup stale lock files on module load"

This reverts commit fd2e8d0da7ba539470ed73d463d8bc641f7843af.

Reason for revert: Problematic for users who store their voicemail
on network storage devices, or share voicemail storage between
multiple Asterisk instances.

ASTERISK-28567 #close

Change-Id: I3ff4ca983d8e753fe2971f3439bd154705693c41

5 years agochan_pjsip: Prevent segfault when running PlayDTMF on hungup channel
lvl [Tue, 1 Oct 2019 11:29:11 +0000 (13:29 +0200)] 
chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel

ASTERISK-28086 #close

Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea

5 years agores_pjsip_mwi: use an ao2_global object for mwi containers
Kevin Harwell [Wed, 2 Oct 2019 17:18:50 +0000 (12:18 -0500)] 
res_pjsip_mwi: use an ao2_global object for mwi containers

On shutdown it's possible for the unsolicited mwi container to be freed before
other dependent threads are done using it. This patch ensures this can no
longer happen by wrapping the container in an ao2_global object. The solicited
container was also changed too.

ASTERISK-28552

Change-Id: I8f812286dc19a34916acacd71ce2ec26e1042047

5 years agoserializer: move/add asterisk serializer pool functionality
Kevin Harwell [Wed, 2 Oct 2019 17:17:43 +0000 (12:17 -0500)] 
serializer: move/add asterisk serializer pool functionality

Serializer pools have previously existed in Asterisk. However, for the most
part the code has been duplicated across modules. This patch abstracts the
code into an 'ast_serializer_pool' object. As well the code is now centralized
in serializer.c/h.

In addition serializer pools can now optionally be monitored by a shutdown
group. This will prevent the pool from being destroyed until all serializers
have completed.

Change-Id: Ib1e906144b90ffd4d5ed9826f0b719ca9c6d2971

5 years agores_pjsip/res_pjsip_mwi: use centralized serializer pools
Kevin Harwell [Wed, 2 Oct 2019 17:18:09 +0000 (12:18 -0500)] 
res_pjsip/res_pjsip_mwi: use centralized serializer pools

Both res_pjsip and res_pjsip_mwi made use of serializer pools. However, they
both implemented their own serializer pool functionality that was pretty much
identical in each of the source files. This patch removes the duplicated code,
and uses the new 'ast_serializer_pool' object instead.

Additionally res_pjsip_mwi enables a shutdown group on the pool since if the
timing was right the module could be unloaded while taskprocessor threads still
needed to execute, thus causing a crash.

Change-Id: I959b0805ad024585bbb6276593118be34fbf6e1d

5 years agoMerge "channel/chan_pjsip: add dialplan function for music on hold" into 17
Friendly Automation [Mon, 7 Oct 2019 13:01:36 +0000 (08:01 -0500)] 
Merge "channel/chan_pjsip: add dialplan function for music on hold" into 17

5 years agocdr_mysql: Don't clean up on unload unless we can unregister from CDRs
Sean Bright [Fri, 4 Oct 2019 20:31:22 +0000 (16:31 -0400)] 
cdr_mysql: Don't clean up on unload unless we can unregister from CDRs

ASTERISK-28566 #close

Change-Id: I6daa4e5128e9406d04d3aed670c3bae98d38d40c

5 years agostasis_state: Create internal stasis_state_proxy object.
Corey Farrell [Fri, 20 Sep 2019 14:08:02 +0000 (10:08 -0400)] 
stasis_state: Create internal stasis_state_proxy object.

This improves the way which stasis_state reference counting works.
Since manager->states holds onto the proxy object instead of the real
object this allows stasis_state objects to be freed when appropriate
without use of a special state_remove function.  Additionally each
distinct eid associated with the state holds a reference to the state to
prevent early release and potentially allow easier debug of leaks.

Change-Id: I400e0db4b9afa3d5cb4ac7dad60907897e73f9a9

5 years agostasis: Pass bumped topic_all reference to proxy_dtor.
Joshua Colp [Tue, 1 Oct 2019 14:01:17 +0000 (14:01 +0000)] 
stasis: Pass bumped topic_all reference to proxy_dtor.

This avoids use of the global variable and ensures topic_all remains
active until all topics are freed.

ASTERISK-28553
patches:
  ASTERISK-28553.patch by coreyfarrell (license 5909)

Change-Id: I9a8cd8977f3c3a6aa00783f8336d2cfb9c2820f1

5 years agoMerge "res_pjsip_pubsub: add endpoint to some warning" into 17
Friendly Automation [Tue, 1 Oct 2019 11:28:54 +0000 (06:28 -0500)] 
Merge "res_pjsip_pubsub: add endpoint to some warning" into 17

5 years agochannel/chan_pjsip: add dialplan function for music on hold
Torrey Searle [Thu, 19 Sep 2019 08:56:26 +0000 (10:56 +0200)] 
channel/chan_pjsip: add dialplan function for music on hold

Add a new dialplan function PJSIP_MOH_PASSTHROUGH that allows
the on-hold behavior to be controlled on a per-call basis

ASTERISK-28542 #close

Change-Id: Iebe905b2ad6dbaa87ab330267147180b05a3c3a8

5 years agores_pjsip_pubsub: add endpoint to some warning
Alexei Gradinari [Tue, 24 Sep 2019 19:18:14 +0000 (15:18 -0400)] 
res_pjsip_pubsub: add endpoint to some warning

There are some warning messages which are not informative without endpoint:
"No registered subscribe handler for event presence.winfo"
"No registered publish handler for event presence"

This patch adds an endpoint name to these messages.

Change-Id: Ia2811ec226d8a12659b4f9d4d224b48289650827

5 years agores_pjsip_transport_websocket: Don't put brackets around local_name if IPv6
Sean Bright [Fri, 27 Sep 2019 14:54:53 +0000 (10:54 -0400)] 
res_pjsip_transport_websocket: Don't put brackets around local_name if IPv6

ASTERISK-28544 #close

Change-Id: I8e62c444d107674c298f472e3545661de8a80dce

5 years agoMerge "basic-pbx: Bring forward queue configuration from 13" into 17
George Joseph [Fri, 27 Sep 2019 13:59:17 +0000 (08:59 -0500)] 
Merge "basic-pbx: Bring forward queue configuration from 13" into 17

5 years agoMerge "pbx: Prevent Realtime switch crash on invalid priority" into 17
George Joseph [Fri, 27 Sep 2019 13:58:30 +0000 (08:58 -0500)] 
Merge "pbx: Prevent Realtime switch crash on invalid priority" into 17

5 years agoMerge "res_musiconhold: Add new 'playlist' mode" into 17
George Joseph [Fri, 27 Sep 2019 13:57:23 +0000 (08:57 -0500)] 
Merge "res_musiconhold: Add new 'playlist' mode" into 17

5 years agoMerge "taskprocessor.c: Added "like" support to 'core show taskprocessors'" into 17
George Joseph [Fri, 27 Sep 2019 13:56:28 +0000 (08:56 -0500)] 
Merge "taskprocessor.c: Added "like" support to 'core show taskprocessors'" into 17

5 years agobasic-pbx: Bring forward queue configuration from 13
Jonathan Rose [Fri, 27 Mar 2015 22:34:48 +0000 (22:34 +0000)] 
basic-pbx: Bring forward queue configuration from 13

Original commit: cfbf5fbe918bc34f3d600760fc0b6f13a3a9a0ed

Change-Id: I34a841d73c429ca8d944481f8dccb756ee231c9c

5 years agoMerge "res_pjsip_registrar: Validate Contact URI before adding to responses" into 17
George Joseph [Thu, 26 Sep 2019 12:08:12 +0000 (07:08 -0500)] 
Merge "res_pjsip_registrar: Validate Contact URI before adding to responses" into 17

5 years agopbx: Prevent Realtime switch crash on invalid priority
Sean Bright [Wed, 25 Sep 2019 16:01:33 +0000 (12:01 -0400)] 
pbx: Prevent Realtime switch crash on invalid priority

pbx_extension_helper takes two 'context' arguments. One (con) is a
pointer directly to a 'struct ast_context' and the other (context) is
the name of the context. In all cases, one of these arguments is NULL
and the other is non-NULL.

Functions that are ultimately called by pbx_extension_helper expect that
'context' will be non-NULL, so we set it unconditionally on entry into
this function.

ASTERISK-28534 #close

Change-Id: Ifbbc5e71440afd80efd441f7a9d72e8b10b6f47d

5 years agotaskprocessor.c: Added "like" support to 'core show taskprocessors'
Ben Ford [Tue, 24 Sep 2019 20:44:14 +0000 (15:44 -0500)] 
taskprocessor.c: Added "like" support to 'core show taskprocessors'

Added "like" support for 'core show taskprocessors'. Now you
can specify a specific set of taskprocessors (or just one) by
adding the keyword "like" to the above command, followed by
your search criteria.

Change-Id: I021e740201e9ba487204b5451e46feb0e3222464

5 years agoUpdate CHANGES and UPGRADE.txt for 17.0.0-rc2
Asterisk Development Team [Wed, 25 Sep 2019 17:21:13 +0000 (12:21 -0500)] 
Update CHANGES and UPGRADE.txt for 17.0.0-rc2

5 years agoMerge "core: Fix ABI mismatch of ao2_global_obj." into 17
George Joseph [Wed, 25 Sep 2019 13:10:40 +0000 (08:10 -0500)] 
Merge "core: Fix ABI mismatch of ao2_global_obj." into 17

5 years agoMerge "res_pjsip_pubsub: change warning to debug" into 17
George Joseph [Wed, 25 Sep 2019 12:04:28 +0000 (07:04 -0500)] 
Merge "res_pjsip_pubsub: change warning to debug" into 17

5 years agoMerge "taskprocessor.c: Add CLI commands to reset taskprocessor stats." into 17
Friendly Automation [Wed, 25 Sep 2019 11:43:05 +0000 (06:43 -0500)] 
Merge "taskprocessor.c: Add CLI commands to reset taskprocessor stats." into 17

5 years agores_musiconhold: Add new 'playlist' mode
Sean Bright [Wed, 18 Sep 2019 11:56:05 +0000 (07:56 -0400)] 
res_musiconhold: Add new 'playlist' mode

Allow the list of files to be played to be provided explicitly in the
music class's configuration. The primary driver for this change is to
allow URLs to be used for MoH.

Change-Id: I9f43b80b43880980b18b2bee26ec09429d0b92fa

5 years agores_pjsip_registrar: Validate Contact URI before adding to responses
Sean Bright [Tue, 24 Sep 2019 22:43:13 +0000 (18:43 -0400)] 
res_pjsip_registrar: Validate Contact URI before adding to responses

If a permanent contact URI associated with an AOR is invalid, we add a
Contact header to REGISTER responses with a NULL URI, causing a crash.

ASTERISK-28463 #close

Change-Id: Id2b643e58b975bc560aab1c111e6669d54db9102

5 years agoMerge "core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option." into 17
Friendly Automation [Wed, 25 Sep 2019 11:02:19 +0000 (06:02 -0500)] 
Merge "core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option." into 17

5 years agoMerge "pjproject_bundled: Revert pjproject 2.9 commits causing leaks" into 17
George Joseph [Tue, 24 Sep 2019 20:37:27 +0000 (15:37 -0500)] 
Merge "pjproject_bundled:  Revert pjproject 2.9 commits causing leaks" into 17

5 years agores_pjsip_pubsub: change warning to debug
Kevin Harwell [Tue, 24 Sep 2019 16:21:12 +0000 (11:21 -0500)] 
res_pjsip_pubsub: change warning to debug

The following message:

"Subscription request from endpoint <blah> rejected. Expiration of 0 is invalid"

Would sometimes spam the log with warnings if Asterisk restarted and a bunch
of clients sent unsubscribes. This patch changes it from a warning to a debug
message.

Change-Id: I841ec42f65559f3135e037df0e55f89b6447a467

5 years agocore: Fix ABI mismatch of ao2_global_obj.
Corey Farrell [Mon, 23 Sep 2019 02:04:44 +0000 (22:04 -0400)] 
core: Fix ABI mismatch of ao2_global_obj.

astobj2.c declares DEBUG_THREADS_LOOSE_ABI to avoid overhead of debug
threads tracking information in the internal structures of astobj2.
Unfortunately this means that ao2_global_obj contains the statically
allocated debug threads tracking fields which are used by initialization
and cleanup but main/astobj2.c believed those fields and associated
space did not exist.

Change-Id: Icef41ad97d88a8c1d1515e034ec8133cab3b1527

5 years agotaskprocessor.c: Add CLI commands to reset taskprocessor stats.
Ben Ford [Tue, 24 Sep 2019 14:40:35 +0000 (09:40 -0500)] 
taskprocessor.c: Add CLI commands to reset taskprocessor stats.

Added two new CLI commands to reset stats for taskprocessors. You can
reset stats for a single, specific taskprocessor ('core reset
taskprocessor <taskprocessor>'), or you can reset all taskprocessors
('core reset taskprocessors'). These commands will reset the counter for
the number of tasks processed as well as the max queue size.

Change-Id: Iaf17fc4ae29396ab0c6ac92408fc7bdc2f12362d