]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
5 years agochan_sip: chan_sip does not process 400 response to an INVITE.
Frederic LE FOLL [Mon, 22 Jun 2020 09:08:47 +0000 (11:08 +0200)] 
chan_sip: chan_sip does not process 400 response to an INVITE.

chan_sip handle_response() function, for a 400 response to an INVITE,
calls handle_response_invite() and does not generate ACK.
handle_response_invite() does not recognize 400 response and has no
default response processing for unexpected responses, thus it does not
generate ACK either.
The ACK on response repetition comes from handle_response() mechanism
"We must re-send ACKs to re-transmitted final responses".

According to code history, 400 response specific processing was
introduced with commit
"channels/chan_sip: Add improved support for 4xx error codes"
This commit added support for :
- 400/414/493 in handle_response_subscribe() handle_response_register()
  and handle_response().
- 414/493 only in handle_response_invite().

This fix adds 400 response support in handle_response_invite().

ASTERISK-28957

Change-Id: Ic71a087e5398dfc7273946b9ec6f9a36960218ad

5 years agores_corosync: Fix crash in huge distributed environment.
Università di Bologna - CESIA VoIP [Wed, 3 Jun 2020 10:05:20 +0000 (12:05 +0200)] 
res_corosync: Fix crash in huge distributed environment.

1) Fix memory-leaks
   Added code to release ast_events extracted from corosync and stasis messages

2) Clean stasis cache when a member of the corosync cluster leaves the group
   Added code to remove from the stasis cache of the members remained on the
   group all the messages with the EID of the left member.
   If the device states of the left member remain in the stasis cache of other
   members, they will not be updated anymore and high priority cached values,
   like BUSY, will take precedence over current device states.

3) Stop corosync event propagation when node is not joined to the group
   Updated dispatch_thread_handler code to detect when asterisk is not joined
   to the corosync group and added some condition in publish_event_to_corosync
   code to send corosync messages only when joined.
   When a node is not joined its corosync daemon can't send messages:
   the cpg_mcast_joined function append new messages to the FIFO buffer until
   it's full and then it blocks indefinitely.
   In this scenario if the stasis_message_cb callback, registered by
   res_corosync to handle stasis messages, try to send a corosync messages,
   the thread of the stasis thread-pool will be blocked until the node join
   the corosync cluster.

ASTERISK-28888
Reported by: Università di Bologna - CESIA VoIP

Change-Id: Ie8e99bc23f141a73c13ae6fb1948d148d4de17f2

5 years agores_http_websocket: Add payload masking to the websocket client
Moises Silva [Sat, 13 Jun 2020 16:29:13 +0000 (16:29 +0000)] 
res_http_websocket: Add payload masking to the websocket client

ASTERISK-28949

Change-Id: Id465030f2b1997b83d408933fdbabe01827469ca

5 years agochan_dadhi: Fix setvar in dahdi channels
Guido Falsi [Thu, 18 Jun 2020 10:14:26 +0000 (12:14 +0200)] 
chan_dadhi: Fix setvar in dahdi channels

The change to how setvar works for various channels performed in
ASTERISK~23756 missed some required change in the dahdi channel,
where the variables are actually set while reading configuration.
This change should fix the issue.

ASTERISK-28955

Change-Id: Ibfeb7f8cbdd735346dc4028de6a265f24f9df274

5 years agoapp_stream_echo: Fix state of added streams.
Joshua C. Colp [Thu, 18 Jun 2020 08:49:37 +0000 (05:49 -0300)] 
app_stream_echo: Fix state of added streams.

When stream support was added to Asterisk the stream state
was used inconsistently, resulting in odd behavior. This
was then standardized to be the state of a stream from the
perspective of Asterisk.

This change updates the StreamEcho dialplan application
to use the correct state, send only, since we are only
sending to the endpoint and not expecting them to send us
multiple video streams.

ASTERISK-28954

Change-Id: I35bfd533ef1184ffe62586b22bbd253c82872a56

5 years agores_pjsip_session: Preserve label on incoming re-INVITE.
Joshua C. Colp [Wed, 17 Jun 2020 08:58:44 +0000 (05:58 -0300)] 
res_pjsip_session: Preserve label on incoming re-INVITE.

When a re-INVITE is received we create a new set of
streams that are then swapped in as the active streams.
We did not preserve the SDP label from the previous
streams, resulting in the label getting lost.

This change ensures that if an SDP label is present
on the previous stream then it is set on the new stream.

ASTERISK-28953

Change-Id: I9dd63b88b562fe96ce5c791a3dae5bcaca258445

5 years agores_sorcery_memory_cache: Disallow per-object expire with full backend.
Joshua C. Colp [Wed, 10 Jun 2020 09:35:50 +0000 (06:35 -0300)] 
res_sorcery_memory_cache: Disallow per-object expire with full backend.

The AMI action and CLI command did not take into account the properties
of full backend caching. This resulted in an expired object remaining
removed until a full backend update occurred, instead of having the
object updated when needed.

This change makes it so that the AMI action and CLI command for object
expire will now fail instead of putting the cache into an undesired
state. If full backend caching is enabled then only operations
which act on the entire cache are available.

ASTERISK-28942

Change-Id: Id662d888f177ab566c8e802ad583083b742d21f4

5 years agoapp_queue: Read latest wrapuptime instead of (possibly stale) copy
Walter Doekes [Tue, 16 Jun 2020 13:18:11 +0000 (15:18 +0200)] 
app_queue: Read latest wrapuptime instead of (possibly stale) copy

Before this changeset, it was possible that a queue member (agent) was
called even though they just got out of a call, and wrapuptime seconds
hadn't passed yet.

This could happen if a member ended a call _between_ a new call attempt
and asterisk trying that particular member for a new call.

In that case, Asterisk would check the hangup time of the
call-before-the-last-call instead of the hangup time of the-last-call.

ASTERISK-28952

Change-Id: Ie0cab8f0e8d639c01cba633d4968ba19873d80b3

5 years agoapp_queue: Remove stale code in try_calling
Walter Doekes [Mon, 15 Jun 2020 11:53:31 +0000 (13:53 +0200)] 
app_queue: Remove stale code in try_calling

Because ring_entry() is not called, outgoing->chan is not touched here
either.

ASTERISK-28950
ASTERISK-28644

Change-Id: I564613715dfaf45af868251eb75a451f512af90f

5 years agores_pjsip: Include <pjsip_ua.h> instead of internal "pjsua-lib/pjsua.h"
Walter Doekes [Mon, 15 Jun 2020 12:09:19 +0000 (14:09 +0200)] 
res_pjsip: Include <pjsip_ua.h> instead of internal "pjsua-lib/pjsua.h"

Change-Id: I24b5453df412232cf7f9a171ea4a34b35ad3ae78

5 years agopjproject: Upgrade bundled version to pjproject 2.10
Kevin Harwell [Fri, 15 May 2020 21:08:20 +0000 (16:08 -0500)] 
pjproject: Upgrade bundled version to pjproject 2.10

This patch makes the usual necessary changes when upgrading to a new
version pjproject. For instance, version number bump, patches removed
from third-party, new *.md5 file added, etc..

This patch also includes a change to the Asterisk pjproject Makefile to
explicitly create the 'source/pjsip-apps/lib' directory. This directory
is no longer there by default so needs to be added so the Asterisk
malloc debug can be built.

This patch also includes some minor changes to Asterisk that were a result
of the upgrade. Specifically, there was a backward incompatibility change
made in 2.10 that modified the "expires header" variable field from a
signed to an unsigned value. This potentially effects comparison. Namely,
those check for a value less than zero. This patch modified a few locations
in the Asterisk code that may have been affected.

Lastly, this patch adds a new macro PJSIP_MINVERSION that can be used to
check a minimum version of pjproject at compile time.

ASTERISK-28899 #close

Change-Id: Iec8821c6cbbc08c369d0e3cd2f14e691b41d0c81

5 years agocore_unreal / core_local: Add multistream and re-negotiation.
Joshua C. Colp [Wed, 3 Jun 2020 16:47:42 +0000 (13:47 -0300)] 
core_unreal / core_local: Add multistream and re-negotiation.

When requesting a Local channel the requested stream topology
or a converted stream topology will now be placed onto the
resulting channels.

Frames written in on streams will now also preserve the stream
identifier as they are queued on the opposite channel.

Finally when a stream topology change is requested it is
immediately accepted and reflected on both channels. Each
channel also receives a queued frame to indicate that the
topology has changed.

ASTERISK-28938

Change-Id: I4e9d94da5230d4bd046dc755651493fce1d87186

5 years agores_ari: Fix create channel request channelId parameter parsing
sungtae kim [Fri, 12 Jun 2020 10:16:14 +0000 (10:16 +0000)] 
res_ari: Fix create channel request channelId parameter parsing

If channelId parameters were passed in the body, the Asterisk doesn't parsing it correctly.

Fixed it to parse the channelId, other_channel_id parameter correclty.

ASTERISK-28948

Change-Id: I59b49161a94869169ee19c1ffab5afcef7026157

5 years agores_rtp_asterisk: Don't assume setting retrans props means to enable.
Joshua C. Colp [Mon, 8 Jun 2020 11:27:53 +0000 (08:27 -0300)] 
res_rtp_asterisk: Don't assume setting retrans props means to enable.

The "value" passed in when setting an RTP property determines
whether it should be enabled or disabled. The RTP send and
receive retrans props did not examine this to know if the
buffers should be enabled. They assumed they always should be.

This change makes it so that the "value" passed in is
respected.

ASTERISK-28939

Change-Id: I9244cdbdc5fd065c7f6b02cbfa572bc55c7123dc

5 years agobridge_softmix: Add additional old states for adding new source.
Joshua C. Colp [Wed, 10 Jun 2020 17:11:16 +0000 (14:11 -0300)] 
bridge_softmix: Add additional old states for adding new source.

There are three states that an old stream can be in to allow
becoming a source stream in a new stream:

1. Removed
2. Inactive
3. Sendonly

This change adds the two missing ones, inactive and sendonly,
so if a stream transitions from those to a state where they are
providing video to Asterisk we properly re-negotiate the other
participants.

ASTERISK-28944

Change-Id: Id8256b9b254b403411586284bbaedbf50452de01

5 years agores_fax: Don't start a gateway if either channel is hung up
George Joseph [Wed, 3 Jun 2020 16:23:31 +0000 (10:23 -0600)] 
res_fax: Don't start a gateway if either channel is hung up

When fax_gateway_framehook is called and a gateway hasn't already
been started, the framehook gets the t38 state for both the current
channel and the peer.  That call trickles down to the channel
driver which determines the state.  If either channel is hung up
(or in the process of being hung up), the channel driver's tech_pvt
is going to be NULL which, in the case of chan_pjsip, will cause a
segfault.

* Added a hangup check for both the channel and peer channel
  before starting a fax gateway.

* Added a check for NULL tech_pvt to chan_pjsip_queryoption
  so we don't attempt to reference a tech_pvt that's already
  gone.

ASTERISK-28923
Reported by: Yury Kirsanov

Change-Id: I4e10e63b667bbb68c1c8623f977488f5d807897c

5 years agoapp_confbridge: Plug ref leak of bridge channel with send_events
George Joseph [Mon, 8 Jun 2020 00:02:00 +0000 (18:02 -0600)] 
app_confbridge: Plug ref leak of bridge channel with send_events

When send_events is enabled for a user, we were leaking a reference
to the bridge channel in confbridge_manager.c:send_message().  This
also caused the bridge snapshot to not be destroyed.

Change-Id: I87a7ae9175e3cd29f6d6a8750e0ec5427bd98e97

5 years agocli.c: Fix compiler error.
Ben Ford [Mon, 8 Jun 2020 19:34:10 +0000 (14:34 -0500)] 
cli.c: Fix compiler error.

Added default variable value to fix a compiler error.

Change-Id: I7b592adbb1274dc5464dea1c5e5de0685c928553

5 years agoCompiler fixes for gcc 10
Kevin Harwell [Mon, 1 Jun 2020 23:25:48 +0000 (18:25 -0500)] 
Compiler fixes for gcc 10

This patch fixes a few compile warnings/errors that now occur when using gcc
10+.

Also, the Makefile.rules check to turn off partial inlining in gcc versions
greater or equal to 8.2.1 had a bug where it only it only checked against
versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
any version above the specified version is correctly compared.

Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9

5 years agores_ari: Fix create request body parameter parsing.
sungtae kim [Tue, 9 Jun 2020 11:57:24 +0000 (11:57 +0000)] 
res_ari: Fix create request body parameter parsing.

If parameters were passed in the body as JSON to the
create route they were not being parsed before checking
to ensure that required fields were set.

This change moves the parsing so it occurs before
checking.

ASTERISK-28940

Change-Id: I898b4c3c7ae1cde19a6840e59f498822701cf5cf

5 years agobridge_channel: Don't queue unmapped frames.
Joshua C. Colp [Fri, 5 Jun 2020 09:45:18 +0000 (06:45 -0300)] 
bridge_channel: Don't queue unmapped frames.

If a frame is written to a channel in a bridge we
would normally queue this frame up and the channel
thread would then act upon it. If this frame had no
stream mapping on the channel it would then be
discarded.

This change adds a check before the queueing occurs
to determine if a mapping exists. If it does not
exist then the frame is not even queued at all. This
stops a frame duplication from happening and from
the channel thread having to wake up and deal with
it.

Change-Id: I17189b9b1dec45fc7e4490e8081d444a25a00bda

5 years agopjsip: Prevent invalid memory access when attempting to contact a non-sip URI
Walter Doekes [Fri, 5 Jun 2020 09:30:29 +0000 (11:30 +0200)] 
pjsip: Prevent invalid memory access when attempting to contact a non-sip URI

You cannot cast a pjsip_uri to a pjsip_sip_uri using pjsip_uri_get_uri,
without checking that it's a PJSIP_URI_SCHEME_IS_SIP(S).

ASTERISK-28936

Change-Id: I9f572b3677e4730458e9402719e580f8681afe2a

5 years agores_fax: Don't consume frames given to fax gateway on write.
Joshua C. Colp [Wed, 27 May 2020 08:47:07 +0000 (05:47 -0300)] 
res_fax: Don't consume frames given to fax gateway on write.

In a particular fax gateway scenario whereby it would
have to translate using the read translation path on a
channel the frame being translated would be consumed.
When the frame is in the write path it is not permitted
to free the frame as the caller expects it to continue
to exist.

This change makes it so that the frame is only consumed
on the read path where it is acceptable to free it.

ASTERISK-28900

Change-Id: I011c321288a1b056d92b37c85e229f4a28ee737d

5 years agopjproject_bundled: Honor --without-pjproject.
Alexander Traud [Tue, 2 Jun 2020 11:24:11 +0000 (13:24 +0200)] 
pjproject_bundled: Honor --without-pjproject.

The previous change missed that 'make' uses 'PJPROJECT_BUNDLED' anyway.

ASTERISK-28929

Change-Id: I7ef0e78a06ea391b59d95b99d46bbed3fec4fed9

5 years agores_pjsip_logger: use the correct pointer when logging tx_messages to pcap
Pirmin Walthert [Thu, 4 Jun 2020 06:50:35 +0000 (08:50 +0200)] 
res_pjsip_logger: use the correct pointer when logging tx_messages to pcap

When writing tx messages to pcap files, Asterisk is using the wrong
pointer resulting in lots of wasted space. This patch fixes it to use
the correct pointer.

ASTERISK-28932 #close

Change-Id: I5b8253dd59a083a2ca2c81f232f1d14d33c6fd23

5 years agobridge.c: Fixed null pointer exception
sungtae kim [Fri, 29 May 2020 01:03:24 +0000 (03:03 +0200)] 
bridge.c: Fixed null pointer exception

If the bridge show all command could not get the bridge snapshot, it causes null pointer exception.
Fixed it to check the snapshot is null.

ASTERISK-28920

Change-Id: I3521fc1b832bfc69644d0833f2c78177e1e51f58

5 years agoScope Tracing: A new facility for tracing scope enter/exit
George Joseph [Thu, 14 May 2020 18:24:19 +0000 (12:24 -0600)] 
Scope Tracing:  A new facility for tracing scope enter/exit

What's wrong with ast_debug?

  ast_debug is fine for general purpose debug output but it's not
  really geared for scope tracing since it doesn't present its
  output in a way that makes capturing and analyzing flow through
  Asterisk easy.

How is scope tracing better?

  Scope tracing uses the same "cleanup" attribute that RAII_VAR
  uses to print messages to a separate "trace" log level.  Even
  better, the messages are indented and unindented based on a
  thread-local call depth counter.  When output to a separate log
  file, the output is uncluttered and easy to follow.

  Here's an example of the output. The leading timestamps and
  thread ids are removed and the output cut off at 68 columns for
  commit message restrictions but you get the idea.

--> res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001
--> res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173
--> res_pjsip_session.c:3669 handle_incoming_response PJSIP/
--> chan_pjsip.c:3265 chan_pjsip_incoming_response_after
--> chan_pjsip.c:3194 chan_pjsip_incoming_response P
    chan_pjsip.c:3245 chan_pjsip_incoming_respon
<-- chan_pjsip.c:3194 chan_pjsip_incoming_response P
<-- chan_pjsip.c:3265 chan_pjsip_incoming_response_after
<-- res_pjsip_session.c:3669 handle_incoming_response PJSIP/
<-- res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173
<-- res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001

  The messages with the "-->" or "<--" were produced by including
  the following at the top of each function:

  SCOPE_TRACE(1, "%s\n", ast_sip_session_get_name(session));

  Scope isn't limited to functions any more than RAII_VAR is.  You
  can also see entry and exit from "if", "for", "while", etc blocks.

  There is also an ast_trace() macro that doesn't track entry or
  exit but simply outputs a message to the trace log using the
  current indent level.  The deepest message in the sample
  (chan_pjsip.c:3245) was used to indicate which "case" in a
  "select" was executed.

How do you use it?

  More documentation is available in logger.h but here's an overview:

  * Configure with --enable-dev-mode.  Like debug, scope tracing
    is #ifdef'd out if devmode isn't enabled.

  * Add a SCOPE_TRACE() call to the top of your function.

  * Set a logger channel in logger.conf to output the "trace" level.

  * Use the CLI (or cli.conf) to set a trace level similar to setting
    debug level... CLI> core set trace 2 res_pjsip.so

Summary Of Changes:

  * Added LOG_TRACE logger level.  Actually it occupies the slot
    formerly occupied by the now defunct "event" level.

  * Added core asterisk option "trace" similar to debug.  Includes
ability to specify global trace level in asterisk.conf and CLI
commands to turn on/off and set levels.  Levels can be set
globally (probably not a good idea), or by module/source file.

  * Updated sample asterisk.conf and logger.conf.  Tracing is
    disabled by default in both.

  * Added __ast_trace() to logger.c which keeps track of the indent
    level using TLS. It's #ifdef'd out if devmode isn't enabled.

  * Added ast_trace() and SCOPE_TRACE() macros to logger.h.
    These are all #ifdef'd out if devmode isn't enabled.

Why not use gcc's -finstrument-functions capability?

  gcc's facility doesn't allow access to local data and doesn't
  operate on non-function scopes.

Known Issues:

  The only know issue is that we currently don't know the line
  number where the scope exited.  It's reported as the same place
  the scope was entered.  There's probably a way to get around it
  but it might involve looking at the stack and doing an 'addr2line'
  to get the line number.  Kind of like ast_backtrace() does.
  Not sure if it's worth it.

Change-Id: Ic5ebb859883f9c10a08c5630802de33500cad027

5 years agores_pjsip_logger.c: correct the return value checks when writing to pcap
Pirmin Walthert [Fri, 29 May 2020 09:28:57 +0000 (11:28 +0200)] 
res_pjsip_logger.c: correct the return value checks when writing to pcap
files

fwrite() does return the number of elements written and not the
number of bytes. However asterisk is currently comparing the return
value to the size of the written element what means that asterisk logs
five WARNING messages on every packet written to the pcap file.

This patch changes the code to check for the correct value, which will
always be 1.

ASTERISK-28921 #close

Change-Id: I2455032d9cb4c5a500692923f9e2a22e68b08fc2

5 years agoUpdate CHANGES and UPGRADE.txt for 17.5.0
Asterisk Development Team [Thu, 28 May 2020 12:07:45 +0000 (07:07 -0500)] 
Update CHANGES and UPGRADE.txt for 17.5.0

5 years agoARI: Bump non-breaking version number to 5.1.1
Joshua C. Colp [Thu, 28 May 2020 11:55:21 +0000 (08:55 -0300)] 
ARI: Bump non-breaking version number to 5.1.1

The channel create call now allows setting variables.

Change-Id: I5e5bd34e0eb3df6e7feb2095e00a91c742ad5113

5 years agores_pjsip: Use correct pool for storing the contact_user value.
Joshua C. Colp [Wed, 27 May 2020 14:35:42 +0000 (11:35 -0300)] 
res_pjsip: Use correct pool for storing the contact_user value.

When replacing the user portion of the Contact URI the code
was using the ephemeral pool instead of the tdata pool. This
could cause the Contact user value to become invalid after a
period of time.

The code will now use the tdata pool which persists for the
lifetime of the message instead.

ASTERISK-28794

Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5

5 years agores_pjsip_nat.c: remove x-ast-orig-host from request URI and To header
Pirmin Walthert [Wed, 13 May 2020 12:06:19 +0000 (14:06 +0200)] 
res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header

While asterisk is filtering out the x-ast-orig-host parameter from the
contact on response messages, it is not filtering it out from the
request URI and the to header on SIP requests (for example INVITE).

ASTERISK-28884 #close

Change-Id: Id032b33098a1befea9b243ca994184baecccc59e

5 years agobridge: Don't try to match audio formats.
Joshua C. Colp [Mon, 18 May 2020 14:05:56 +0000 (11:05 -0300)] 
bridge: Don't try to match audio formats.

When bridging channels we were trying to match the audio
formats of both sides in combination with the configured
formats. While this is allowed in SDP in practice this
causes extra reinvites and problems. This change ensures
that audio streams use the formats of the first existing
active audio stream. It is only when other stream types
(like video) exist that this will result in re-negotiation
occurring for those streams only.

ASTERISK-28871

Change-Id: I22f5a3e7db29e00c165e74d05d10856f6086fe47

5 years agores_srtp: Set all possible flags while selecting the Crypto Suite.
Alexander Traud [Mon, 18 May 2020 15:10:01 +0000 (17:10 +0200)] 
res_srtp: Set all possible flags while selecting the Crypto Suite.

The flags of a previous selection could have been set within the
object 'srtp', for example, when the previous selection returned
failure after setting just 'some' flags. Now, not to clutter the
code, all possible flags are cleared first, and then the selected
flags are set as before.

ASTERISK-28903

Change-Id: I1b9d7aade7d5120244ce7e3a8865518cbd6e0eee

5 years agores_sorcery_config: Always reload configuration on errors.
Joshua C. Colp [Tue, 19 May 2020 12:55:32 +0000 (09:55 -0300)] 
res_sorcery_config: Always reload configuration on errors.

When a configuration file in Asterisk is loaded
information about it is stored such that on a
reload it is not reloaded if nothing has changed.
This can be problematic when an error exists in
a configuration file in PJSIP since the error
will be output at start and not subsequently on
reload if the file is unchanged.

This change makes it so that if an error is
encountered when res_sorcery_config is loading
a configuration file a reload will always read
in the configuration file, allowing the error
to be seen easier.

Change-Id: If2e05a017570f1f5f4f49120da09601e9ecdf9ed

5 years agobridge_softmix: Always remove audio from mixed frame.
Joshua C. Colp [Tue, 19 May 2020 09:18:58 +0000 (06:18 -0300)] 
bridge_softmix: Always remove audio from mixed frame.

When receiving audio from a channel we determine if it
is talking or silence based on a threshold value. If
this threshold is met we always mix the audio into the
conference bridge. If this threshold is not met we also
mix the audio into the conference bridge UNLESS the
drop silence option is enabled.

The code that removed the audio from the mixed frame
assumed that it was always not present if it did not
meet the threshold to be considered talking. This is
incorrect. If it has been stated that the audio was
mixed into the mixed frame then it has been mixed into
the mixed frame. By not removing audio that was
considered non-talking it was possible for a channel
to receive a slight echo of audio of itself at times.

This change ensures that the audio is always removed
from the mixed frame going back to the channel so it
no longer receives the slight echo.

ASTERISK-28898

Change-Id: I7b1b582cc1bcdb318ecc60c9d2e3d87ae31d55cb

5 years agores_pjsip_logger: Expand functionality to improve logging.
Joshua C. Colp [Thu, 30 Apr 2020 22:57:08 +0000 (19:57 -0300)] 
res_pjsip_logger: Expand functionality to improve logging.

The PJSIP packet logger now has the following CLI commands:

pjsip set logger pcap <filename>

When used this will create a pcap file containing the incoming
and outgoing SIP packets, in unencrypted form.

pjsip set logger verbose <on / off>

This allows you to toggle logging to verbose on and off.

pjsip set logger host <IP/subnet mask> add

This allows you to add an additional IP address or subnet
mask to logging, allowing you to log multiple instead of
just a single IP address or all traffic.

The normal "pjsip set logger host" CLI command has also been
expanded to allow subnet masks as well.

ASTERISK-28895

Change-Id: If5859161a72b0d7dd2d1f92d45bed88e0cd07d0e

5 years agores_musiconhold: Added check for dot character in path of playlist entries to avoid...
Nicholas John Koch [Wed, 13 May 2020 18:32:35 +0000 (20:32 +0200)] 
res_musiconhold: Added check for dot character in path of playlist entries to avoid warnings

A warning was triggered that there may be a problem regarding file
extension (which is correct and should not be set anyway). The warning
also appeared if there was dot within the path itself.

E.g.
[sales-queue-hold]
mode=playlist
entry=/var/www/domain.tld/moh/funky_music

The music played correctly but you get a warning message.

Now there will be a check if the position of a potential dot character
is after the last position of a slash character. This dot charachter
will be treated as a extension naming. Dots within the path then ignored.

ASTERISK-28892
Reported-By: Nicholas John Koch
Change-Id: I2ec35a613413affbf5fcc01c8c181eba24865b9e

5 years agores_rtp_asterisk.c: Fixed memory leak
sungtae kim [Mon, 18 May 2020 16:31:58 +0000 (16:31 +0000)] 
res_rtp_asterisk.c: Fixed memory leak

Added freeifaddrs() for memory releasing.

ASTERISK-28904

Change-Id: I109403866e85a30659351946903a679de9727a8f

5 years agoari: Allow variables to be set on channel create.
Joshua C. Colp [Tue, 12 May 2020 23:15:41 +0000 (20:15 -0300)] 
ari: Allow variables to be set on channel create.

This change adds the same variable functionality that
is available for originating a channel to the create
call. Now when creating a channel you can specify
dialplan variables to set instead of having to do another
API call.

ASTERISK-28896

Change-Id: If13997ba818136d7c070585504fc4164378aa992

5 years agopjsip_resolver.c: Ensure AAAA dns requests are made.
Roger James [Sun, 10 May 2020 10:01:56 +0000 (11:01 +0100)] 
pjsip_resolver.c: Ensure AAAA dns requests are made.

1. Modify sip_resolve and sip_resolve_callback to request AAAA lookups
   when an IPV6 transport type has been requested.

2. Rename all occurrences of pjsip_transport_get_type_name to
   pjsip_transport_get_type_desc. This ensures that the log/debug info
   shows whether the transport is IPv6 or IPv4.

3. Do not add the constant PJSIP_TRANSPORT_IPV6 to existing transport
   types. This results in invalid values. Use a bitwise or instead.

ASTERISK-26780
Patches:
    pjsip_resolver.c uploaded by Peter Sokolov (License #7070)

Change-Id: I8b1e298f8efa682d0a7644113258fe76d9889c58

5 years agopjproject: Fix race condition when building with parallel make
Guido Falsi [Fri, 8 May 2020 11:11:47 +0000 (13:11 +0200)] 
pjproject: Fix race condition when building with parallel make

Pjproject makefiles miss some dependencies which can cause race
conditions when building with parallel make processes. This patch
adds such dependencies correctly.

ASTERISK-28879 #close
Reported-by: Dmitry Wagin <dmitry.wagin@ya.ru>
Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22

5 years agores_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.
Roger James [Sat, 9 May 2020 07:46:51 +0000 (08:46 +0100)] 
res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.

Changed source and destination address fields in struct
pjsip_history_entry so that they are long enough to hold an IPv6
address.

ASTERISK-28854

Change-Id: Id65bb9aa961e9ecbcb500815e18170f774e34d3e

5 years agotcptls: Fix notice when TLS is enabled but not supported.
traud [Wed, 1 Apr 2020 13:38:44 +0000 (15:38 +0200)] 
tcptls: Fix notice when TLS is enabled but not supported.

ASTERISK-28797

Change-Id: Iab364a2c2519fd9d11d1c28293fda43d61b64c28

5 years agoapp_osplookup: Avoid a format truncation.
traud [Sat, 4 Apr 2020 09:28:06 +0000 (11:28 +0200)] 
app_osplookup: Avoid a format truncation.

Ensure that output buffers for the osp_convert_inout
function have sufficient space for additional data
such as brackets and ports.

ASTERISK-28804

Change-Id: Ie54c8241ff0cc653910539c2db00ff2a4869750b

5 years agoapp.c: make sure that no non-async-signal-safe syscalls are used after
Pirmin Walthert [Tue, 14 Apr 2020 16:02:19 +0000 (18:02 +0200)] 
app.c: make sure that no non-async-signal-safe syscalls are used after
fork before exec

Posix does only allow async-signal-safe syscalls after fork before exec.
As asterisk ignores this, functions like TrySystem or System sometimes
end up in a deadlocked child process. The patch prevents the use of
non-async-signal-safe syscalls.

ASTERISK-28776

Change-Id: Idc76365c0592ee3f3b3bd72a4f48f7a098978e8e

5 years agostreams: Fix one memory leak and one formats ref issue
George Joseph [Mon, 4 May 2020 16:31:57 +0000 (10:31 -0600)] 
streams: Fix one memory leak and one formats ref issue

ast_stream_topology_create_from_format_cap() was setting the
stream->formats directly but not freeing the default formats.  This
causes a memory leak.

* ast_stream_topology_create_from_format_cap() now calls
  ast_stream_set_formats() which properly cleans up the existing
  stream formats.

When cloning a stream, the source stream's format caps _pointer_ is
copied to the new stream and it's reference count bumped.  If
either stream is set to "removed", this will cause _both_ streams
to have their format caps cleared.

* ast_stream_clone() now creates a new format caps object and copies
  the formats from the source stream instead of just copying the
  pointer.

ASTERISK-28870

Change-Id: If697d81c3658eb7baeea6dab413b13423938fb53

5 years agoapp_queue: track masquerades in app_queue to avoid leaked stasis subscriptions
Nathan Bruning [Wed, 8 Apr 2020 23:41:55 +0000 (01:41 +0200)] 
app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions

Add a new "masquarade" channel event, and use it in app_queue to track unique id's.

Testcase is submitted as https://gerrit.asterisk.org/c/testsuite/+/14210

ASTERISK-28829 #close
ASTERISK-25844 #close

Change-Id: Ifc5f9f9fd70903f3c6e49738d3bc632b085d2df6

5 years agoRemove #include <sys/cdefs.h>
Jaco Kroon [Mon, 4 May 2020 08:29:44 +0000 (10:29 +0200)] 
Remove #include <sys/cdefs.h>

These are not provided by standards, and as a result causes failure to
compile on musl.

https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E

Change-Id: I6a357cefd106c72cfecafd898638f6b5692c2e05

5 years agopjproject: Remove bashism from configure.m4 script
Guido Falsi [Sun, 3 May 2020 10:30:15 +0000 (12:30 +0200)] 
pjproject: Remove bashism from configure.m4 script

The configure.m4 script for pjproject contains some += syntax, which
is specific to bash, replacing it with string substitutions makes
the script compatible with traditional Bourne shells.

ASTERISK-28866 #close
Reported-by: Christoph Moench-Tegeder <cmt@FreeBSD.org>
Change-Id: I382a78160e028044598b7da83ec7e1ff42b91c05

5 years agoapp_voicemail: Add workaround for a gcc 10 issue with -Wrestrict
George Joseph [Thu, 30 Apr 2020 15:56:03 +0000 (09:56 -0600)] 
app_voicemail: Add workaround for a gcc 10 issue with -Wrestrict

The gcc 10 -Wrestrict option was causing "overlap" errors when
snprintf was copying one char[256] structure member to another
char[256] member in the same structure.

Using ast_alloca instead of declaring the structure inline
solves the issue.

Here's a link to the "enhancement":
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-10/msg00570.html

We may follow up with a gcc bug report.

Change-Id: Ie0099adcb0a9727bd9aa99e024dd912a67eaf534

5 years agopjsip: Increase maximum ICE candidate count.
Joshua C. Colp [Tue, 28 Apr 2020 15:31:28 +0000 (12:31 -0300)] 
pjsip: Increase maximum ICE candidate count.

In practice it has been seen that some users come
close to our maximum ICE candidate count of 32.
In case people have gone over this increases the
count to 64, giving ample room.

ASTERISK-28859

Change-Id: I35cd68948ec0ada86c14eb53092cdaf8b62996cf

5 years agocore_local: Local calls are always secure.
Alexander Traud [Mon, 27 Apr 2020 15:28:01 +0000 (17:28 +0200)] 
core_local: Local calls are always secure.

In a Dialplan, the channel drivers 'chan_sip' and 'chan_iax2' support
the channel items 'secure_bridge_media' and 'secure_bridge_signaling'.
That way, a channel can be forced to use encryption even if not
specified in its configuration.

However, when the Local Proxy kicks in, for example, in case of a
forwarding (SIP status 302), Local Proxy stated it does not know those
items. Consequently, such a call could not be proxied how clever your
Dialplan was. Because local calls within Asterisk are always secure,
Local Proxy accepts such a request now.

ASTERISK-22920

Change-Id: I4c143bb70f686790953cc04c5a4b810bbb03636c

5 years agores_rtp_asterisk: Protect access to nochecksums with #ifdef
Guido Falsi [Sun, 26 Apr 2020 10:56:47 +0000 (12:56 +0200)] 
res_rtp_asterisk: Protect access to nochecksums with #ifdef

Recently code accessing nochecksums variable has been added without including #ifdef SO_NO_CHECK protection, while the variable is created only when such constant is defined.

ASTERISK-28852 #close

Change-Id: I381718893b80599ab8635f2b594a10c1000d595e

5 years agocore/dns: Add system include required on FreeBSD
Guido Falsi [Sun, 26 Apr 2020 11:08:49 +0000 (13:08 +0200)] 
core/dns: Add system include required on FreeBSD

While testing the latest RC on FreeBSD I noticed this new file fails to build. On FreeBSD inlcuding resolv.h requires sockaddr_in to be defined, and it's defined in netinet/in.h. So I added this include.

ASTERISK-28853 #close

Change-Id: I6997daf3956e6eb70ab6cb358628d162fad80079

5 years agochan_mobile: Add smoother to make SIP/RTP endpoints happy.
Peter Turczak [Fri, 17 Apr 2020 07:39:09 +0000 (08:39 +0100)] 
chan_mobile: Add smoother to make SIP/RTP endpoints happy.

In contrast to RFC 3551, section 4.2, several SIP/RTP clients misbehave
severly (up to crashing). This patch adds another smoother for the audio
received via bt. Therefore the audio frames sent to the core will be
CHANNEL_FRAME_SIZE.

ASTERISK-28832 #close

Change-Id: Ic5f9e2f35868ae59cc9356afbd1388b779a1267f

5 years agoapp_fax: SpanDSP headers do not use ast_malloc; ignore that.
Alexander Traud [Wed, 22 Apr 2020 17:38:13 +0000 (19:38 +0200)] 
app_fax: SpanDSP headers do not use ast_malloc; ignore that.

Since Asterisk 14, app_fax did not compile at all because Asterisk
requires that not malloc but ast_malloc is used everywhere. However,
the system headers of SpanDSP use malloc. Because we cannot (and do
not need to) change system headers, let us ignore this.

ASTERISK-28848

Change-Id: I31f7a6b92a07032c5cef1c16b8901b107fe35546

5 years agoUpdate CHANGES and UPGRADE.txt for 17.4.0
Asterisk Development Team [Thu, 23 Apr 2020 16:04:29 +0000 (11:04 -0500)] 
Update CHANGES and UPGRADE.txt for 17.4.0

5 years agostream: Enforce formats immutability and ensure formats exist.
Joshua C. Colp [Tue, 21 Apr 2020 09:52:24 +0000 (06:52 -0300)] 
stream: Enforce formats immutability and ensure formats exist.

Some places in Asterisk did not treat the formats on a stream
as immutable when they are.

The ast_stream_get_formats function is now const to enforce this
and parts of Asterisk have been updated to take this into account.
Some violations of this were also fixed along the way.

An additional minor tweak is that streams are now allocated with
an empty format capabilities structure removing the need in various
places to check that one is present on the stream.

ASTERISK-28846

Change-Id: I32f29715330db4ff48edd6f1f359090458a9bfbe

5 years agores_ari_channels: Fixed endpoint 80 characters limit
sungtae kim [Tue, 21 Apr 2020 15:40:14 +0000 (15:40 +0000)] 
res_ari_channels: Fixed endpoint 80 characters limit

Fixed it to copy the entire string from the requested endpoint body except tech-prefix.

ASTERISK-28847

Change-Id: I91b5f6708a1200363f3267b847dd6a0915222c25

5 years agofax: Fix crashes in PJSIP re-negotiation scenarios.
Joshua C. Colp [Mon, 20 Apr 2020 15:18:24 +0000 (12:18 -0300)] 
fax: Fix crashes in PJSIP re-negotiation scenarios.

This change fixes a few re-negotiation issues
uncovered with fax.

1. The fax support uses its own mechanism for
re-negotiation by conveying T.38 information in
its own frames. The new support for re-negotiating
when adding/removing/changing streams was also
being triggered for this causing multiple re-INVITEs.
The new support will no longer trigger when
transitioning between fax.

2. In off-nominal re-negotiation cases it was
possible for some state information to be left
over and used by the next re-negotiation. This
is now cleared.

ASTERISK-28811
ASTERISK-28839

Change-Id: I8ed5924b53be9fe06a385c58817e5584b0f25cc2

5 years agores_pjsip: Fixed format of IPv6 addresses for external media addresses
DanielYK [Wed, 15 Apr 2020 20:13:39 +0000 (22:13 +0200)] 
res_pjsip: Fixed format of IPv6 addresses for external media addresses

ASTERISK-28835

Change-Id: I66289afd164c5cdd6c5caa39e79d629a467e7a26

5 years agochan_sip: externhost/externaddr with non-default TCP/TLS ports.
Alexander Traud [Mon, 20 Apr 2020 18:11:42 +0000 (20:11 +0200)] 
chan_sip: externhost/externaddr with non-default TCP/TLS ports.

ASTERISK-28372
Reported by: Anton Satskiy

ASTERISK-24428
Reported by: sstream

Change-Id: I2b7432a9bf3b09dc8515297ff955636db7a6224c

5 years agocdr_odbc: Sync load- and build-time deps.
Alexander Traud [Fri, 17 Apr 2020 10:41:02 +0000 (12:41 +0200)] 
cdr_odbc: Sync load- and build-time deps.

MODULEINFO is checked while buidling/linking the module.
AST_MODULE_INFO is checked while loading/running the module.

ASTERISK-28838

Change-Id: I55dc05ce19552d0415c9045021b42bd82ef44e52

5 years agores_pjsip: Sync load- and build-time deps.
Alexander Traud [Fri, 17 Apr 2020 09:47:01 +0000 (11:47 +0200)] 
res_pjsip: Sync load- and build-time deps.

MODULEINFO is checked while buidling/linking the module.
AST_MODULE_INFO is checked while loading/running the module.

ASTERISK-28838

Change-Id: I4bb868532ca217fec1351885d99eb55c21b58042

5 years agoconfbridge: Add support for disabling text messaging.
Joshua C. Colp [Thu, 16 Apr 2020 13:15:42 +0000 (10:15 -0300)] 
confbridge: Add support for disabling text messaging.

When in a conference bridge it may be necessary to have
text messages disabled for specific participants or for
all. This change adds a configuration option, "text_messaging",
which can be used to enable or disable this on the
user profile. By default existing behavior is preserved
as it defaults to "yes".

ASTERISK-28841

Change-Id: I30b5d9ae6f4803881d1ed9300590d405e392bc13

5 years agores_pjsip_refer: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 09:18:25 +0000 (11:18 +0200)] 
res_pjsip_refer: Add build-time dependency.

ASTERISK-28838

Change-Id: Ic693c3f464e35ec0db242afdb0a1415806af4e25

5 years agoapp_getcpeid: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 10:17:52 +0000 (12:17 +0200)] 
app_getcpeid: Add build-time dependency.

ASTERISK-28838

Change-Id: I68b78e7e4718be82507247433127ce3992a5ba96

5 years agocurl: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 11:51:31 +0000 (13:51 +0200)] 
curl: Add build-time dependency.

ASTERISK-28838

Change-Id: I34724e799e1ffaf723eb2c358abe8934dbadcd52

5 years agores_pjsip: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 09:55:32 +0000 (11:55 +0200)] 
res_pjsip: Add build-time dependency.

ASTERISK-28838

Change-Id: Icb08304744ae3f34dce6ccb76f94379b8382a074

5 years agopjproject_bundled: Honor --without-pjproject.
Alexander Traud [Wed, 15 Apr 2020 18:01:58 +0000 (20:01 +0200)] 
pjproject_bundled: Honor --without-pjproject.

ASTERISK-28837

Change-Id: Id057324912a3cfe6f50af372675626bb515907d9

5 years agores_rtp_asterisk: Resolve loop when receive buffer is flushed
Pirmin Walthert [Tue, 14 Apr 2020 15:48:07 +0000 (17:48 +0200)] 
res_rtp_asterisk: Resolve loop when receive buffer is flushed

When the receive buffer was flushed by a received packet while it
already contained a packet with the same sequence number, Asterisk
never left the while loop which tried to order the packets.

This change makes it so if the packet is in the receive buffer it
is retrieved and freed allowing the buffer to empty.

ASTERISK-28827

Change-Id: Idaa376101bc1ac880047c49feb6faee773e718b3

5 years agoinstall_prereq: Add libcap for high bits in DiffServ/ToS.
Alexander Traud [Wed, 15 Apr 2020 12:16:00 +0000 (14:16 +0200)] 
install_prereq: Add libcap for high bits in DiffServ/ToS.

works automatically; see Mantis 7047 (now ASTERISK-6863)

Change-Id: I27d2c109180bd857b6757fd532de48eddb78aee6

5 years agochan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.
Alexander Traud [Wed, 15 Apr 2020 06:20:46 +0000 (08:20 +0200)] 
chan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.

ASTERISK-27195
Reported by: Joshua Roys

Change-Id: I6e72ecb874200dec7a3865c7babaf5ac0d3101de

5 years agoBuildSystem: Only if found LibPRI, check its optional parts.
Alexander Traud [Wed, 15 Apr 2020 11:09:11 +0000 (13:09 +0200)] 
BuildSystem: Only if found LibPRI, check its optional parts.

Change-Id: If8445f899ee4ce0c606c484943d4ce0c8e43b5da

5 years agores_rtp_asterisk: Free payload when error on insertion to data buffer
Pirmin Walthert [Tue, 14 Apr 2020 15:31:15 +0000 (17:31 +0200)] 
res_rtp_asterisk: Free payload when error on insertion to data buffer

When the ast_data_buffer_put rejects to add a packet, for example because
the buffer already contains a packet with the same sequence number, the
payload will never be freed, resulting in a memory leak.

The data buffer will now return an error if this situation occurs
allowing the caller to free the payload. The res_rtp_asterisk module
has also been updated to do this.

ASTERISK-28826

Change-Id: Ie6c49495d1c921d5f997651c7d0f79646f095cf1

5 years agoBuildSystem: Only if found external PJProject, check its optional parts.
Alexander Traud [Tue, 14 Apr 2020 11:26:34 +0000 (13:26 +0200)] 
BuildSystem: Only if found external PJProject, check its optional parts.

Change-Id: I11d5693d25c166c99d8cebffc16184d58f6362de

5 years agores_rtp_asterisk.c: Check for first DTMF having timestamp set to 0
bernard merindol [Wed, 8 Apr 2020 10:29:42 +0000 (12:29 +0200)] 
res_rtp_asterisk.c: Check for first DTMF having timestamp set to 0

When the first DTMF receive in RF2833 codec have TimeStamp at 0
is not processed.

ASTERISK-28812

Change-Id: I3196803a062dd2daee4938c9a778c3810cb7e504

5 years agofunc_volume: Accept decimal number as argument
Jean Aunis [Tue, 7 Apr 2020 12:05:22 +0000 (14:05 +0200)] 
func_volume: Accept decimal number as argument

Allow voice volume to be multiplied or divided by a floating point number.

ASTERISK-28813

Change-Id: I5b42b890ec4e1f6b0b3400cb44ff16522b021c8c

5 years agores_rtp_asterisk: iterate all local addresses looking to populate ICE.
Jaco Kroon [Tue, 3 Dec 2019 18:35:20 +0000 (20:35 +0200)] 
res_rtp_asterisk: iterate all local addresses looking to populate ICE.

By using pjproject to give us a list of candidates, and then filtering,
if the host has >32 addresses configured, then it is possible that we
end up filtering out all 32 of those, and ending up with no candidates
at all.  Instead, get getifaddrs (which pjsip is using underlying
anyway) to retrieve all local addresses, and iterate those, adding the
first 32 addresses not excluded by the ICE ACL.

In our setup at any point in time We've got between 6 and 328 addresses
on any given system.  The lower limit is the lower limit but the upper
limit is growing on a near daily basis currently.

Change-Id: I109eaffc3e2b432f00bf958e3caa0f38cacb4edb
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
5 years agopjproject_bundled: Repair ./configure --with-ssl without ARG.
Alexander Traud [Fri, 10 Apr 2020 13:13:34 +0000 (15:13 +0200)] 
pjproject_bundled: Repair ./configure --with-ssl without ARG.

ASTERISK-28758
Reported by: Patrick Wakano
Reported by: Dmitriy Serov

Change-Id: Ifb6b85c559d116739af00bc48d1f547caa85efac

5 years agores_pjsip: document legal dtls_verify endpoint options.
Jaco Kroon [Sat, 11 Apr 2020 19:03:39 +0000 (21:03 +0200)] 
res_pjsip: document legal dtls_verify endpoint options.

Change-Id: I7fa7c5c8a7ddb0bd525982f58bff3264ebbd9a1b

5 years agoBuildSystem: Search for Python/C API when possibly needed only.
Alexander Traud [Sun, 12 Apr 2020 14:53:50 +0000 (16:53 +0200)] 
BuildSystem: Search for Python/C API when possibly needed only.

The Python/C API is used only if the Test Framework was enabled in Asterisk
'make menuselect'. The Test Framework is available only if the Developer Mode
was enabled in Asterisk './configure --enable-dev-mode'. And that Python/C API
is used only if the PJProject was found and not disabled in Asterisk; the user
did not go for './configure --without-pjproject'.

Furthermore, because version 2 of that Python/C API is required (currently) and
because some platforms do not offer a generic version 2, the script searches
for 2.7 explicitly as well.

To avoid version mismatch between the Python/C API and the Python environment,
the script searches for the latter in the same versions, in the same the order
as well. Because this Python/C API is just for (some) Asterisk contributors,
the script also goes for the Python 3 environment as a last resort for all
other Asterisk users. This allows 'make full' even on minimal installations of
Ubuntu 18.04 LTS and newer.

Because the Python/C API is Asterisk contributor specific, the Python packages
are removed from the script './contrib/scripts/install_prereq' as this script
is intended for Asterisk users. Asterisk contributors have to install much more
packages in any case, like:
sudo apt install autoconf automake git git-review python2.7-dev

ASTERISK-28824
ASTERISK-27717

Change-Id: Id46d357e18869f64dcc217b8fdba821b63eeb876

5 years agochan_sip: TCP/TLS client without server.
traud [Wed, 1 Apr 2020 16:52:58 +0000 (18:52 +0200)] 
chan_sip: TCP/TLS client without server.

It is possible to configure a TCP/TLS client without having a TCP/TLS
server. In that case, no error or warning was printed but the headers
Contact and Via in SIP REGISTER were "(null)".

ASTERISK-28798

Change-Id: I387ca5cb6a65f1eb675a29c5e41df8ec6c242ab2

5 years agores_rtp_asterisk: Build without PJProject.
Alexander Traud [Mon, 13 Apr 2020 16:27:28 +0000 (18:27 +0200)] 
res_rtp_asterisk: Build without PJProject.

Change-Id: Ifc5059cd867e77b9c92ed9f4b895a9a91200d3ec

5 years ago_pjsua: Build even with Clang.
Alexander Traud [Mon, 13 Apr 2020 17:05:48 +0000 (19:05 +0200)] 
_pjsua: Build even with Clang.

Change-Id: Iebf7687613aa0295ea3c82256460b337f1595be2

5 years agochan_pjsip: digit_begin - constant DTMF tone if RTP is not setup yet
Kevin Harwell [Wed, 8 Apr 2020 19:33:47 +0000 (14:33 -0500)] 
chan_pjsip: digit_begin - constant DTMF tone if RTP is not setup yet

If chan_pjsip is configured for DTMF_RFC_4733, and the core triggers a
digit begin before media, or rtp has been setup then it's possible the
outgoing channel will hear a constant DTMF tone upon answering.

This happens because when there is no media, or rtp chan_pjsip notifies
the core to initiate inband DTMF. However, upon digit end if media, and
rtp become available then chan_pjsip does not notify the core to stop
inband DTMF. Thus the tone continues playing.

This patch makes it so chan_pjsip only notifies the core to start
inband DTMF in only the required cases. Now if there is no media, or
rtp availabe upon digit begin chan_pjsip does nothing, but tells the
core it handled it.

ASTERISK-28817 #close

Change-Id: I0dbea9fff444a2595fb18c64b89653e90d2f6eb5

5 years agobridge_softmix_binaural: Show state in menuselect.
Alexander Traud [Thu, 9 Apr 2020 13:25:24 +0000 (15:25 +0200)] 
bridge_softmix_binaural: Show state in menuselect.

ASTERISK-28819

Change-Id: Iba7ee7bc7936d7a156171c8fc0f1670e864e7600

5 years agoBuildSystem: Remove doc/tex and doc/pdf leftovers.
traud [Tue, 7 Apr 2020 17:44:49 +0000 (19:44 +0200)] 
BuildSystem: Remove doc/tex and doc/pdf leftovers.

Furthermore, the nowhere used compress is removed.

ASTERISK-28816

Change-Id: I77daab80cfabb56d51c3ea6b1d14bd9b9fbc577c

5 years agoBuildSystem: Allow space in path.
Alexander Traud [Thu, 9 Apr 2020 12:05:54 +0000 (14:05 +0200)] 
BuildSystem: Allow space in path.

ASTERISK-28818

Change-Id: Ib7f246896457d9e3b14d7f5199136d6545ce0b6f

5 years agores_rtp_asterisk: Avoid absolute value on unsigned subtraction.
traud [Mon, 6 Apr 2020 13:00:10 +0000 (15:00 +0200)] 
res_rtp_asterisk: Avoid absolute value on unsigned subtraction.

ASTERISK-28809

Change-Id: I269731715347c8e5ef7db1b6ffd3f8d15fc04be4

5 years agofunc_channel: allow reading 4 fields from dialplan
Sebastien Duthil [Tue, 31 Mar 2020 20:14:51 +0000 (16:14 -0400)] 
func_channel: allow reading 4 fields from dialplan

The following fields return an error when read from dialplan:

- exten
- context
- userfield
- channame

ASTERISK-28796 #close

Change-Id: Ieacaac629490f8710fdacc9de80ed5916c5f6ee2

5 years agoRevert "res_config_odbc: Preserve empty strings returned by the database"
Sean Bright [Mon, 6 Apr 2020 14:29:13 +0000 (09:29 -0500)] 
Revert "res_config_odbc: Preserve empty strings returned by the database"

This reverts commit a3a2fbaec685d931d56f669f2d4171220e9977ac.

Reason for revert: There is a lot of code that relies on the broken
behavior that this fixes.

Change-Id: I410c395a0168acbdaf89e616e3cb5e1312d190cb

5 years agotest_stasis: Avoid always true warning with clang.
traud [Mon, 6 Apr 2020 11:56:39 +0000 (13:56 +0200)] 
test_stasis: Avoid always true warning with clang.

ASTERISK-28808

Change-Id: I5e76831373532d7b8065d024e66cd1fb75dedd80

5 years agochan_unistim: Avoid tautological warnings with clang.
traud [Fri, 3 Apr 2020 17:25:37 +0000 (19:25 +0200)] 
chan_unistim: Avoid tautological warnings with clang.

ASTERISK-28803

Change-Id: I15449621b68d0ad4d57b7c337c1167adb15135af

5 years agomain/backtrace: binutils-2.34 fix.
Jaco Kroon [Wed, 1 Apr 2020 09:00:14 +0000 (11:00 +0200)] 
main/backtrace: binutils-2.34 fix.

My tester missed this one previously, have confirmed a positive build
this time round.

Change-Id: Id06853375954a200f03f9a1b9c97fe0b10d31fbf

5 years agores_pjsip: Don't set endpoint to unavailable in all cases.
Joshua C. Colp [Thu, 26 Mar 2020 22:42:27 +0000 (19:42 -0300)] 
res_pjsip: Don't set endpoint to unavailable in all cases.

When an AOR is modified endpoints are updated that reference
the AOR so they can start receiving updates and reflect the
correct state. If this is the case then we shouldn't change
the endpoint to be offline if it does not reference the AOR
but instead only when the endpoint is completely updated for
all its AORs.

ASTERISK-28056
patches:
  pjsip_options-aor.diff submitted by jhord (license 6978)

Change-Id: I3ee00023be2393113cd4e056599f23f3499ef164

5 years agochannel: write to a stream on multi-frame writes
Kevin Harwell [Tue, 31 Mar 2020 17:52:44 +0000 (12:52 -0500)] 
channel: write to a stream on multi-frame writes

If a frame handling routine returns a list of frames (vs. a single frame)
those frames are never passed to a tech's write_stream handler even if one is
available. For instance, if a codec translation occurred and that codec
returned multiple frames then those particular frames were always only sent
to the tech's "write" handler. If that tech (pjsip for example) was stream
capable then those frames were essentially ignored. Thus resulting in bad
audio.

This patch makes it so the "write_stream" handler is appropriately called
for all cases, and for all frames if available.

ASTERISK-28795 #close

Change-Id: I868faea0b73a07ed5a32c2b05bb9cf4b586f739d

5 years agotest_utils: Avoid incorrect error message on load.
traud [Tue, 24 Mar 2020 11:43:37 +0000 (12:43 +0100)] 
test_utils: Avoid incorrect error message on load.

In case of no OpenSSL headers, the module was built but did not load.

ASTERISK-28789

Change-Id: Ie007e84296bcf2bd4237f19d68ba5f932b84cd02

5 years agodial.c: Removed dial string 80 character limitation
sungtae kim [Thu, 26 Mar 2020 22:18:17 +0000 (22:18 +0000)] 
dial.c: Removed dial string 80 character limitation

The dial application had 80 characters of destination length
limitation. But this limitation causes unexpected dial string
cut if the dial string is long.

Removed unnecessary limited buffer to support longer dial
destination.

ASTERISK-27946

Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330