Commit Graph

31298 Commits

Author SHA1 Message Date
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
Richard Mudgett
1cd2e340e0 app_softhangup.c: Reduce unnecessary warning to verbose message.
Why log a warning for something your dialplan explicitly asked for?

Change-Id: I167b90daf4c7d75dd4b7ef94849f6cef05aa43a7
2020-01-05 21:08:12 -06:00
Sean Bright
430350ed53 res_pjsip_config_wizard: Fix change detection for wizard settings
ast_sorcery_changeset_create() is not commutative and will fail to detect
differences between two variable lists depending on what changed, so switch to
ast_variable_lists_match().

ASTERISK-28492 #close
Reported by: Jean-Denis Girard

Change-Id: I7b3256983ddfaa2138d3de92a444a53b5193a4e1
2020-01-05 11:12:03 -05:00
Sean Bright
0d252feab6 res_agi: Improve GET FULL VARIABLE documentation
ASTERISK-28673 #close
Reported by: Jonathan Harris

Change-Id: I591afdec669622bfa19243aabec31b579652c92f
2020-01-03 11:27:23 -05:00
Snuffy
c00c448c05 contrib/valgrind: Fix use of frame-level suppression
Fix use of frame-level wildcard usage in suppression file.

ASTERISK-27243 #close
Reported-by: Richard Kenner

Change-Id: I1c0c64c5f305d2c9aa124e11f1f64a2eec52dc51
2020-01-02 09:44:21 -06:00
Friendly Automation
20c411065b Merge "func_odbc: acf_odbc_read() and cli_odbc_read() unicode support" into 13 2020-01-02 09:34:10 -06:00
Joshua Colp
5a3826e334 Merge "res_fax: wrap v21 detected Asterisk initiated negotiation with config option" into 13 2020-01-02 08:43:59 -06:00
Boris P. Korzun
d95b719891 func_odbc: acf_odbc_read() and cli_odbc_read() unicode support
Added ast_odbc_ast_str_SQLGetData() considers SQL_DESC_OCTET_LENGTH
column attribute for correct allocating the buffer.

ASTERISK-28497 #close

Change-Id: I50e86c8a277996f13d4a4b9b318ece0d60b279bf
2020-01-02 08:28:56 -06:00
George Joseph
7e66d2578e Merge "db: Initialize condition primitive before use" into 13 2019-12-31 08:36:14 -06:00
Jean Aunis
72548ca9e5 chan_sip: voice frames are no longer transmitted after emitting a COLP
The SIP transaction state was reset when emitting an UPDATE or a re-INVITE
related to a COLP, preventing RTP packets to be emitted.

ASTERISK-28647

Change-Id: Ie7a30fa7a97f711e7ba6cc17f221a0993d48bd8b
2019-12-30 01:43:35 -06:00
Sean Bright
401056fd27 db: Initialize condition primitive before use
The db_init() function ultimately calls db_sync() which signals the
condition before it is initialized.

Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab
2019-12-27 18:29:45 -05:00
Friendly Automation
1a96383e29 Merge "config.c: Skip UTF-8 BOMs if present when reading config files" into 13 2019-12-27 10:08:57 -06:00
Jaco Kroon
e8ca2af820 netsock2: backport ast_sockaddr_copy_sockaddr to asterisk 13.
This function is already present in 15, 16 and master.

Change-Id: I491ddecdccc87620c264567c549217e48f3d4ff1
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2019-12-22 18:07:50 +02:00
Joshua C. Colp
49520c0ec6 Merge "chan_sip: in case of tcp/tls, be less annoying about tx errors." into 13 2019-12-19 18:39:01 -06:00
Friendly Automation
1254747497 Merge "app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR." into 13 2019-12-19 10:49:37 -06:00
Friendly Automation
66970af0d3 Merge "confbridge: Add support for specifying maximum sample rate." into 13 2019-12-19 09:55:22 -06:00
Sean Bright
6ceb4c25fb config.c: Skip UTF-8 BOMs if present when reading config files
ASTERISK-28667 #close

Change-Id: I4767ed365c98f3e1587b7653321048a31d8a53b2
2019-12-19 05:48:37 -05:00
Friendly Automation
b9d465935b Merge "sip_to_pjsip.py: Fix trustrpid typo" into 13 2019-12-18 07:12:09 -06:00
Friendly Automation
a451aafae0 Merge "configure: Add check for MySQL client bool and my_bool type usage." into 13 2019-12-18 06:26:31 -06:00
Friendly Automation
f7fcb601ab Merge "json: Support older jansson versions." into 13 2019-12-18 06:18:41 -06:00
Pascal Cadotte Michaud
8654d6cb20 sip_to_pjsip.py: Fix trustrpid typo
ASTERISK-28664 #close

Change-Id: I6c28b1002fd7075ae0ed36f026f8c1855c9418a6
2019-12-17 13:15:56 -05:00
Friendly Automation
172e2f651b Merge "app_voicemail: warning when is compiling" into 13 2019-12-17 11:55:07 -06:00
Joshua C. Colp
c1faa9ecda json: Support older jansson versions.
The use of '?' is a fairly new addition to jansson and is not
supported in the version of jansson that can be used by 13.
This change returns to previous supported behavior and removes
usage of '?'.

ASTERISK-28663

Change-Id: I6d596007ae85e8724d928865d99968f679be1142
2019-12-17 14:11:52 +00:00
Frederic LE FOLL
b07bccd0bd app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.
Temporary channel lifespan is very short and CDR deactivation request
through ast_cdr_set_property() may happen when CDR is not available
yet. Use CDR_PROP() dialplan function instead, it will first wait
for pending CDR insertion requests to be processed.

ASTERISK-28636

Change-Id: I1cbe09e8d2169c0962c1195133ff260d291f2074
2019-12-16 22:43:01 +01:00
George Joseph
028a2f2d9a Merge "res_pjsip_nat: Restore original contact for REGISTER responses" into 13 2019-12-16 11:02:34 -06:00
Joshua C. Colp
7cea1c4306 configure: Add check for MySQL client bool and my_bool type usage.
Instead of trying to use the defined MySQL client version from the
header use a configure check to determine whether the bool or my_bool
type should be used for defining a boolean.

ASTERISK-28604

Change-Id: Id2225b3785115de074c50c123ff1a68005b4a9c7
2019-12-16 12:39:20 -04:00
Joshua C. Colp
ca35de4282 confbridge: Add support for specifying maximum sample rate.
ConfBridge has the ability to move between different sample
rates for mixing the conference bridge. Up until now there has
only been the ability to set the conference bridge to mix at
a specific sample rate, or to let it move between sample rates
as necessary. This change adds the ability to configure a
conference bridge with a maximum sample rate so it can move
between sample rates but only up to the configured maximum.

ASTERISK-28658

Change-Id: Idff80896ccfb8a58a816e4ce9ac4ebde785963ee
2019-12-16 15:53:40 +00:00
Friendly Automation
7004fb6175 Merge "PJSIP_CONTACT: add missing argument documentation" into 13 2019-12-16 06:52:37 -06:00
Joshua Colp
089b7529df Merge "ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging." into 13 2019-12-16 06:04:29 -06:00
Kevin Harwell
754fca9297 res_fax: wrap v21 detected Asterisk initiated negotiation with config option
A previous patch:

Gerrit Change-Id: I73bb24799bfe1a48adae9c034a2edbae54cc2a39

made it so a T.38 Gateway tries to negotiate with both sides by sending T.38
negotiation request to both endpoints supported T.38 versus the previous
behavior of forwarding negotiation to the "other" channel once a preamble
was detected.

This had the unfortunate side effect of breaking some setups. Specifically
ones that set the max datagram option on an endpoint configuration (configured
max datagram was not propagated since Asterisk now initiates negotiations).

This patch adds a configuration option, "negotiate_both", that when enabled
makes it so Asterisk initiates the negotiation requests to both endpoints vs.
the previous behavior of waiting, and forwarding the request.

The default is disabled keeping with the old behavior.

ASTERISK-28660

Change-Id: I5deb875f3485e20bc75119ec743090655d864a1a
2019-12-13 14:23:51 -06:00
Stanislav
22f9c57f43 app_voicemail: warning when is compiling
Change-Id: Ib53eba1a66e25fbeba61c620bd3edd462f699ada

ASTERISK-28628

Change-Id: Ib53eba1a66e25fbeba61c620bd3edd462f699ada
2019-12-12 13:29:30 -06:00
Asterisk Development Team
51482dec75 Update CHANGES and UPGRADE.txt for 13.30.0 2019-12-12 06:01:37 -05:00
Pascal Cadotte Michaud
644ae311bb PJSIP_CONTACT: add missing argument documentation
add missing argument "rtt" and "status" to the documentation

The change to the dtd file allow an enumlist to contain one or many
configOptionToEnum or enum.

This is different from the previous patch I submitted when you could have a
configOptionToEnum or (a configOptionToEnum followed by one or manu enums) or
(one or many enums)

ASTERISK-28626

Change-Id: Ia71743ee7ec813f40297b0ddefeee7909db63b6d
2019-12-11 11:16:26 -06:00
George Joseph
d4df66dc8a Merge "Revert "PJSIP_CONTACT: add missing argument documentation"" into 13 2019-12-11 10:35:45 -06:00
Joshua Colp
c1cfca5ef1 Revert "PJSIP_CONTACT: add missing argument documentation"
This reverts commit 3778e1abcd.

Reason for revert: Regression in XML validation.

validity error : Content model of enumlist is not determinist:
(configOptionToEnum | (configOptionToEnum , enum+) | enum+)

As we are preparing to do releases and this is not critical
I am reverting this for now until resolved.

Change-Id: I07b539d0406e8af08934a91223e850444bde1b75
2019-12-11 07:01:01 -06:00