Commit Graph

31482 Commits

Author SHA1 Message Date
Friendly Automation
46dc85f207 Merge "app_voicemail: Prevent crash when saving message with realtime voicemail" into 13 2020-01-20 09:10:58 -06:00
Joshua Colp
84670cd9aa Merge "pbx.c: Include filesystem cache in free memory calculation" into 13 2020-01-20 07:09:53 -06:00
Andrew Siplas
419fd1da11 chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"
The no-entry timeout set to 999999 == 16⅔ minutes, change to INT_MAX
to match behavior of "no timeout" defined in comment.

ASTERISK-28702 #close

Change-Id: I4ea015986e061374385dba247b272f7aac60bf11
2020-01-18 16:54:01 -05:00
Friendly Automation
0f89e6e4c0 Merge "res_realtime: Fix 'realtime update2' argument handling" into 13 2020-01-17 08:33:23 -06:00
Joshua Colp
5e30a3e7ee Merge "app_voicemail: Set globals to default values when voicemail.conf missing" into 13 2020-01-17 08:32:07 -06:00
Sean Bright
bfc93cc954 chan_pjsip: Ignore RTP that we haven't negotiated
If chan_pjsip receives an RTP packet whose payload differs from the
channel's native format, and asymmetric_rtp_codec is disabled (the
default), Asterisk will switch the channel's native format to match
that of the incoming packet without regard to the negotiated payloads.

We now keep track of the formats that have been negotiated and check
before switching payloads which results in these packets being dropped
instead of causing the session to terminate.

ASTERISK-28139 #close
Reported by: Paul Brooks

Change-Id: Icc3b85cee1772026cee5dc1b68459bf9431c14a3
2020-01-17 08:59:22 -05:00
Sean Bright
ee05a43951 app_voicemail, say: Fix various leading whitespace problems
In af90afd90c, Japanese language support
was added to app_voicemail and main/say.c, but the leading whitespace
is not consistent with Asterisk coding guidelines. This patch fixes
that.

Whitespace only, no functional change.

ASTERISK~23324
Reported by: Kevin McCoy

Change-Id: I72c725f5930084673749bd7c9cc426a987f08e87
2020-01-16 14:55:18 -05:00
Sean Bright
884b86e7c0 pbx.c: Include filesystem cache in free memory calculation
ASTERISK-28695 #close
Reported by: Kevin Flyn

Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8
2020-01-16 13:37:44 -05:00
Sean Bright
d514fa3300 chan_sip.c: Stop handling continuation lines after reading headers
lws2sws() does not stop trying to handle header continuation lines
even after all headers have been found. This is problematic if the
first character of a SIP message body is a space or tab character, so
we update to recognize the end of the message header.

ASTERISK-28693 #close
Reported by: Frank Matano

Change-Id: Idec8fa58545cd3fd898cbe0075d76c223f8d33df
2020-01-16 10:16:23 -05:00
Sean Bright
6906e0aa3c app_voicemail: Prevent crash when saving message with realtime voicemail
ast_store_realtime() is not NULL tolerant, so we need to initialize
the field values we pass to it to the empty string to avoid a crash.

ASTERISK-23739 #close
Reported by: Stas Kobzar

Change-Id: I756c5dd0299c77f4274368f7c99eb0464367466c
2020-01-15 16:52:00 -05:00
Joshua Colp
9ba3bddd37 Merge "res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY" into 13 2020-01-15 06:44:23 -06:00
Joshua Colp
3a135e5827 Merge "app_queue: Deprecate the QueueMemberPause.Reason field" into 13 2020-01-15 06:43:56 -06:00
Sean Bright
d0a412fced app_voicemail: Set globals to default values when voicemail.conf missing
If voicemail.conf exists but is empty, the config parsing process will
default a number of global variables to non-zero values. On the other
hand, if voicemail.conf is missing (arguably semantically equivalent
to an empty file), this process is skipped and the globals are
defaulted to 0.

Set the globals to the same values they would be set to if a
configuration were present. This allows voicemail configuration to be
done completely by Realtime without the need to create an empty
voicemail.conf file.

ASTERISK-27622 #close
Reported by: Jim Van Meggelen

Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409
2020-01-14 17:30:34 -05:00
Sean Bright
1a4fcaadb2 app_queue: Deprecate the QueueMemberPause.Reason field
The QueueMemberPause AMI event includes two fields that return the
reason a member was paused.

* In release branches, deprecate Reason in favor of PausedReason.
* In master, remove the Reason field entirely.

ASTERISK-28349 #close
Reported by: Niksa Baldun

Change-Id: I01da58f2b0ab927baeee754870f62b51b7b3d296
2020-01-14 13:51:18 -06:00
Joshua Colp
9b22061e2c Merge "res_pjsip_endpoint_identifier_ip: Document support for hostnames" into 13 2020-01-14 12:44:30 -06:00
Joshua Colp
a902641833 Merge "func_curl: Add 'followlocation' option to CURLOPT()" into 13 2020-01-14 12:29:48 -06:00
Sean Bright
5e868fc11f res_realtime: Fix 'realtime update2' argument handling
The change in 9b99ef50b5 updated the
syntax of the 'realtime update2' CLI command but did not correctly
update the calls to ast_update2_realtime().

The issue this addresses was originally opened because we aren't
allowing a SQL NULL to be set as part of the update, but this is a
limitation of the Realtime API and is not a bug.

Additionally, this patch:

* Corrects the example in the command documentation to reflect
  'update2' instead of 'update.'

* Fixes the leading spacing of the command documentation.

* Checks that the required 'NULL' literal argument is present where we
  expect it to be.

ASTERISK-21794 #close
Reported by: Cédric Bassaget

Change-Id: Idda63a5dc50d5f9bcb34c27ea3238d90f733b2cd
2020-01-14 11:05:29 -05:00
Joshua Colp
8bf22b8abb Merge "app_record: Do not hang up if beep audio is missing" into 13 2020-01-14 09:10:16 -06:00
Joshua Colp
0d1fcf0626 Merge "netsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr." into 13 2020-01-14 09:08:13 -06:00
Sean Bright
53967ebd0f func_curl: Add 'followlocation' option to CURLOPT()
We allow for 'maxredirs' to be set, but this value is ignored when
followlocation is not enabled which, by default, it is not.

ASTERISK-17491 #close
Reported by: candrews

Change-Id: I96a4ab0142f2fb7d2e96ff976f6cf7b2982c761a
2020-01-13 08:25:03 -06:00
Walter Doekes
e99f70f112 chan_sip: Always process updated SDP on media source change
Fixes no-audio issues when the media source is changed and
strictrtp is enabled (default).

If the peer media source changes, the SDP session version also changes.
If it is lower than the one we had stored, chan_sip would ignore it.

This changeset keeps track of the remote media origin identifier,
comparing that as well. If it changes, the session version needn't be
higher for us to accept the SDP.

Common scenario where this would've caused problems: a separate media
gateway that informs the caller about premium rates before handing off
the call to the final destination.

(An alternative fix would be to set ignoresdpversion=yes on the peer.)

ASTERISK-28686

Change-Id: I88fdbc5aeb777b583e7738c084254c482a7776ee
2020-01-13 11:13:56 +01:00
Sean Bright
b8963987a6 res_pjsip_endpoint_identifier_ip: Document support for hostnames
ASTERISK-25429 #close
Reported by: Joshua C. Colp

Change-Id: I7cdfc6026821636acc2465094b7fcde8471a3824
2020-01-10 16:13:49 -05:00
Sean Bright
6648472a28 res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY
ASTERISK-27775 #close
Reported by: AvayaXAsterisk

Change-Id: Iad158e908e34675ad98f74d09c5e73024e50c257
2020-01-10 15:49:44 -05:00
Friendly Automation
3e446508b4 Merge "netsock2: backport ast_sockaddr_copy_sockaddr to asterisk 13." into 13 2020-01-10 08:45:48 -06:00
Jaco Kroon
e7d2ab666b netsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr.
ast_addressfamily_to_sockaddrize will determine the size that's
required, and ast_sockaddr_from_sockaddr then wraps this new function
and ast_sockaddr_copy_sockaddr to copy arbitrary sockaddr's (without
knowing the address family) into the ast_sockaddr structure.

Change-Id: Iee604e96e9096c79b477d6e5ff310cf0b06dae86
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2020-01-10 08:28:55 +02:00
Kevin Harwell
fa700acf39 Merge "res_pjsip_pubsub: Add ability to persist generator state information." into 13 2020-01-09 17:28:49 -06:00
Joshua Colp
4cefb2f3cb Merge "res_pjsip_endpoint_identifier_ip.c: Add port matching support" into 13 2020-01-09 15:07:45 -06:00
Joshua Colp
81899e71e7 Merge "app_agent_pool: Update XML docs for AgentLogin" into 13 2020-01-09 15:06:21 -06:00
Corey Farrell
7601a5f0f8 app_record: Do not hang up if beep audio is missing
Additionally alter the warning to mention that it was "beep" which could
not be streamed to give admins a better clue about what the warning
means.

ASTERISK-28682

Change-Id: If5aed21226a173117ed17589f44826dd1ba6576e
2020-01-09 06:14:53 -05:00
Kevin Harwell
ba5b0c5c36 app_agent_pool: Update XML docs for AgentLogin
This patch fixes some wrongly formatted documentation for the AgentLogin
application. A couple of "see also" links should contain only the function
name, and no parameters.

Change-Id: I3f788b47dce3292e311f8a9856938d59a0bd0661
2020-01-08 13:54:44 -06:00
George Joseph
83077366de CI: Update buildAsterisk.sh to do a "make full"
If you do a "make all" when building Asterisk the xml documentation
produced will be missing certain AMI events where their
documentation is located not at the top of the c source file but
embedded further down next to the event's manager_event()
registration call.  See main/manager_mwi.c for an example.

"make full" does produce the correct documentation so we're changing
it in the build script.  A separate commit/issue will address the
problem with "make all".

ASTERISK-28507
Reported by: David Lee

Change-Id: I4a22635d6eef99eacecc0efb69e28360eebdb86c
2020-01-08 11:11:26 -07:00
Joshua Colp
379050504d Merge "stasis.c: Use correct topic name in stasis_topic_pool_delete_topic" into 13 2020-01-08 09:41:02 -06:00
Joshua C. Colp
9720b29d8e res_pjsip_pubsub: Add ability to persist generator state information.
Some body generators, such as dialog-info+xml, require storing state
information which is then conveyed in the NOTIFY request itself. Up
until now there was no way for such body generators to persist this
information.

Two new API calls have been added to allow body generators to set and
get persisted data. This data is persisted out alongside the normal
persistence information and allows the body generator to restore
state information or to simply use this for normal storage of state.
State is stored in the form of JSON and it is up to the body
generator to interpret this as needed.

The dialog-info+xml body generator has been updated to take advantage
of this to persist the version number.

ASTERISK-27759

Change-Id: I5fda56c624fd13c17b3c48e0319b77079e9e27de
2020-01-08 15:19:41 +00:00
Friendly Automation
1d3739fcbd Merge "sig_pri: Fix deadlock caused by sig_pri_queue_hangup" into 13 2020-01-08 08:57:10 -06:00
Sean Bright
49bb7d85cd res_pjsip_endpoint_identifier_ip.c: Add port matching support
Adds source port matching support when IP matching is used:

  [example]
  type = identify
  match = 1.2.3.4:5060/32, 1.2.3.4:6000/32, asterisk.org:4444

If the IP matches but the source port does not, we reject and search for
alternatives. SRV lookups are still performed if enabled (srv_lookups = yes),
unless the configured FQDN includes a port number in which case just a host
lookup is performed.

ASTERISK-28639 #close
Reported by: Mitch Claborn

Change-Id: I256d5bd5d478b95f526e2f80ace31b690eebba92
2020-01-08 09:34:50 -05:00
George Joseph
aa84bc31e2 Merge "app_chanisavail.c: Simplify dialplan using ChanIsAvail." into 13 2020-01-07 14:28:13 -06:00
Friendly Automation
0b7569a977 Merge "res_pjsip_config_wizard: Fix change detection for wizard settings" into 13 2020-01-07 12:38:14 -06:00
Friendly Automation
1577f6d923 Merge "features.c: Make Bridge application tolerate unspecified channel." into 13 2020-01-07 11:51:37 -06:00
Friendly Automation
b929ac2c64 Merge "app_dial.c: Simplify dialplan using Dial." into 13 2020-01-07 11:35:59 -06:00
Friendly Automation
beb7987fed Merge "app_page.c: Simplify dialplan using Page." into 13 2020-01-07 10:54:04 -06:00
Friendly Automation
4db92ee97e Merge "app_softhangup.c: Reduce unnecessary warning to verbose message." into 13 2020-01-07 10:50:29 -06:00
Friendly Automation
3a86c176a6 Merge "app_chanspy.c: Reduce log message level from notice to verbose." into 13 2020-01-07 09:59:28 -06:00
George Joseph
e642d46b05 Merge "contrib/valgrind: Fix use of frame-level suppression" into 13 2020-01-07 09:56:49 -06:00
George Joseph
9249c30b87 sig_pri: Fix deadlock caused by sig_pri_queue_hangup
The change to add setting hangupsource to sig_pri_queue_hangup()
made in https://gerrit.asterisk.org/c/asterisk/+/12857 casued
deadlocks when a hangup request was received from the core at the
same time a hanguprequest was received from the remote end via the
D channel.

Although the PRI's channel private structure was being unlocked
before setting the hangupsource, the PRI's own lock was still being
held during the process.  If channel actions were also coming from
the core, a deadlock on the PRI could result.  This deadlock could
then escalate to the entire DAHDI subsystem via DAHDI's global
interface list lock, especially if someone used the PRI CLI commands.

Fix:

* We now unlock the PRI as well as the PRI's channel private
  structure before setting the hangupsource, then relock both
  afterwards.

ASTERISK-28605
Reported by: Dirk Wendland

Change-Id: Id74aaa5d4e3746063dbe9deed188eb65193cb9c9
2020-01-07 07:19:54 -06:00
Richard Mudgett
3a8290d1f2 app_chanisavail.c: Simplify dialplan using ChanIsAvail.
Dialplan has to be careful about passing an empty device list or empty
positions in the list.  As a result, dialplan has to check for these
conditions before using ChanIsAvail.  Simplify dialplan by making
ChanIsAvail handle these conditions gracefully.

* Made tolerate empty positions in the device list.

* Simplified the code and eliminated some unnecessary indention.

ASTERISK-28638

Change-Id: I9e4b67e2cbf26b2417c2d03485b8568e898931d3
2020-01-06 19:11:23 -06:00
George Joseph
e4e5e07e3d stasis.c: Use correct topic name in stasis_topic_pool_delete_topic
When a topic is created for an object, its name is only
<object>:<uniqueid>
For example:
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020

When a topic is added to a pool, its name has the pool's topic
name prepended.  For example:
bridge:all/bridge:cb68b3a8-fce7-4738-8a17-d7847562f020

The topic_pool_entry's name however, is only what was passed
in to stasis_topic_pool_get_topic which is
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
That's actually correct because the entry is qualified by the
pool that's in.

When you're ready to delete the entry from the pool, you retrieve
the tropic name from the object but since it now has the pool's
topic name prepended, it won't be found in the pool container.

Fix:

* Modified stasis_topic_pool_delete_topic() to skip past the
pool topic's name, if it was prepended to the topic name,
before searching the container for a pool entry.

ASTERISK-28633
Reported by: Joeran Vinzens

Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6
2020-01-06 09:52:23 -06:00
Richard Mudgett
f6f25601a4 app_dial.c: Simplify dialplan using Dial.
Dialplan has to be careful about passing an empty destination list or
empty positions in the list.  As a result, dialplan has to check for
these conditions before using Dial.  Simplify dialplan by making Dial
handle these conditions gracefully.

* Made tolerate empty positions in the dialed device list.

* Reduced some message log levels from notice to verbose.

ASTERISK-28638

Change-Id: I6edc731aff451f8bdfaee5498078dd18c3a11ab9
2020-01-05 21:23:49 -06:00
Richard Mudgett
4414def9f9 app_page.c: Simplify dialplan using Page.
Dialplan has to be careful about passing an empty destination list or
empty positions in the list.  As a result, dialplan has to check for
these conditions before using Page.  Simplify dialplan by making Page
handle these conditions gracefully.

* Made tolerate empty positions in the paged device list.

* Reduced some warnings associated with the 's' option to verbose
messages.  The warning level for those messages really serves no purpose
as that is why the 's' option exists.

ASTERISK-28638

Change-Id: I95b64a6d6800cd1a25279c88889314ae60fc21e3
2020-01-05 21:20:44 -06:00
Richard Mudgett
9997710f8f features.c: Make Bridge application tolerate unspecified channel.
The Bridge application was inconsistent if the channel to bridge with is
not specified.  If no parameters are given then a warning is issued and
the current channel is hung up.  If options are given but no channel is
specified then a warning is issued and the current channel is not hung up.

* Made the Bridge application give a verbose message instead of a warning
if the channel to bridge with is not specified and made not hang up the
current channel.  As a result dialplan no longer needs to check if a
channel name is passed before calling Bridge and simply needs to check the
BRIDGERESULT channel variable instead.  This is something you likely want
your dialplan to do anyway.

* Fixed up L() option warning message.  It is up to the caller to
determine if the channel is hung up because of the warning.  Dial() hangs
up the current channel while Bridge() does not.

Change-Id: I44349a8dc3912397f28852777de04f19e7bb9c73
2020-01-05 21:17:06 -06:00
Richard Mudgett
aed10616e5 app_chanspy.c: Reduce log message level from notice to verbose.
Change-Id: Ica5f38ccd8cdc077aef14d0c50425e0b29ac7e0a
2020-01-05 21:12:27 -06:00