Commit Graph

32339 Commits

Author SHA1 Message Date
Snuffy
b9b50774f5 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:11 -06:00
Friendly Automation
3818759e9c Merge "func_odbc: acf_odbc_read() and cli_odbc_read() unicode support" into 16 2020-01-02 09:39:57 -06:00
Friendly Automation
a992180091 Merge "res_fax: wrap v21 detected Asterisk initiated negotiation with config option" into 16 2020-01-02 08:41:28 -06:00
Boris P. Korzun
e54299cd3e 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:49 -06:00
George Joseph
66ae6f7194 Merge "chan_sip: voice frames are no longer transmitted after emitting a COLP" into 16 2019-12-31 08:38:36 -06:00
Jean Aunis
82a870c8c7 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:44:39 -06:00
Sean Bright
efa13eb0a0 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 17:31:50 -06:00
George Joseph
c6dc24fc8e Merge "config.c: Skip UTF-8 BOMs if present when reading config files" into 16 2019-12-27 13:12:30 -06:00
Joshua C. Colp
3e0a2485c4 Merge "app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR." into 16 2019-12-19 18:40:33 -06:00
Friendly Automation
2770830495 Merge "main/file.c: Limit media cache usage to remote files." into 16 2019-12-19 10:59:27 -06:00
Friendly Automation
7172230cd0 Merge "chan_sip: in case of tcp/tls, be less annoying about tx errors." into 16 2019-12-19 10:05:11 -06:00
Friendly Automation
a3edac10a6 Merge "confbridge: Add support for specifying maximum sample rate." into 16 2019-12-19 10:00:25 -06:00
Sean Bright
a78758d0a2 config.c: Skip UTF-8 BOMs if present when reading config files
ASTERISK-28667 #close

Change-Id: I4767ed365c98f3e1587b7653321048a31d8a53b2
2019-12-19 04:48:20 -06:00
George Joseph
4b658c82b9 Merge "res_rtp_asterisk: Add frame list cleanups to ast_rtp_read" into 16 2019-12-18 09:01:36 -06:00
Joshua C. Colp
a55566b680 Merge "sip_to_pjsip.py: Fix trustrpid typo" into 16 2019-12-18 07:32:29 -06:00
Joshua C. Colp
82e2f0c662 Merge "configure: Add check for MySQL client bool and my_bool type usage." into 16 2019-12-18 06:37:29 -06:00
Friendly Automation
d11534515b Merge "res_pjsip_session: Set stream state on created streams for incoming SDP." into 16 2019-12-18 05:42:46 -06:00
Pascal Cadotte Michaud
b8e635916f sip_to_pjsip.py: Fix trustrpid typo
ASTERISK-28664 #close

Change-Id: I6c28b1002fd7075ae0ed36f026f8c1855c9418a6
2019-12-17 13:18:09 -05:00
George Joseph
b058e2b409 Merge "res_pjsip_nat: Restore original contact for REGISTER responses" into 16 2019-12-16 11:03:10 -06:00
Joshua C. Colp
7167fd6d46 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:36:02 -04:00
Joshua C. Colp
5622df0a94 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:54:05 +00:00
Friendly Automation
298dd7832b Merge "PJSIP_CONTACT: add missing argument documentation" into 16 2019-12-16 06:57:42 -06:00
Joshua Colp
8af35e7aa4 Merge "ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging." into 16 2019-12-16 06:05:09 -06:00
Joshua C. Colp
186c4e9b36 res_pjsip_session: Set stream state on created streams for incoming SDP.
A previous review, 13174, made a change whereby on an incoming offer SDP
the pending topology was initialized to the configured. This caused a problem
for bundle with WebRTC where bundle could reference a stream that did not
actually exist if the configuration had both audio and video but the
offer SDP only contained audio.

This change undoes that review and instead fixes the original problem it
sought to solve by setting the state of created streams based on the
contents of the offer SDP. This way the stream state is not inactive
until negotiation later completes.

ASTERISK-28659

Change-Id: Ic5ae5a86437d3e686ac5afd91d133cc916198355
2019-12-16 07:23:33 -04:00
Kevin Harwell
d17bbcb9f1 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:05:23 -06:00
Frederic LE FOLL
aa06c6ea29 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-12 19:21:22 +01:00
Asterisk Development Team
9240fcd8bb Update CHANGES and UPGRADE.txt for 16.7.0 2019-12-12 06:03:22 -05:00
Jaco Kroon
77941efad9 ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging.
Due to use in res_rtp_asterisk there is a need to be able to apply an
ACL without logging any invalid/denies.  It's probably sensible to at
least validate the ACL once directly after load and report invalid ACLs.

Change-Id: I256169229d945ca7c1bbf228fc492d91df345843
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2019-12-12 01:42:59 -06:00
Pascal Cadotte Michaud
2d2b28bfa4 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:08 -06:00
George Joseph
4631e77078 Merge "Revert "PJSIP_CONTACT: add missing argument documentation"" into 16 2019-12-11 10:35:59 -06:00
Joshua Colp
9c29c3fb3e Revert "PJSIP_CONTACT: add missing argument documentation"
This reverts commit 174e6426aa.

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: I2c9656fb40b2d2f56f54caa35c8be02cc92babd0
2019-12-11 07:01:12 -06:00
George Joseph
8af0dea0c7 res_rtp_asterisk: Add frame list cleanups to ast_rtp_read
In Asterisk 16+, there are a few places in ast_rtp_read where we've
allocated a frame list but return a null frame instead of the list.
In these cases, any frames left in the list won't be freed.  In the
vast majority of the cases, the list is empty when we return so
there's nothing to free but there have been leaks reported in the
wild that can be traced back to frames left in the list before
returning.

The escape paths now all have logic to free frames left in the
list.

ASTERISK-28609
Reported by: Ted G

Change-Id: Ia1d7075857ebd26b47183c44b1aebb0d8f985f7a
2019-12-10 11:48:35 -07:00
Friendly Automation
59799b10bf Merge "res_pjsip_registrar.c: Prevent potential double free if AOR is not found" into 16 2019-12-09 10:28:31 -06:00
Joshua Colp
585e5288c8 Merge "app_queue: Fix old confusing comment about when the members are called" into 16 2019-12-09 05:43:23 -06:00
Jaco Kroon
055737d645 chan_sip: in case of tcp/tls, be less annoying about tx errors.
chan_sip.c:3782 __sip_xmit: sip_xmit of 0x7f1478069230 (len 600) to
213.150.203.60:1492 returned -2: Interrupted system call

returned -2 implies this wasn't actually an OS error, so errno makes no
sense either.  Internal error was already logged higher up, and -2
generally means that either there isn't a valid connection available, or
the pipe notification failed, and that is already correctly logged.

ASTERISK-28651 #close

Change-Id: I46eb82924beeff9dfd86fa6c7eb87d2651b950f2
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2019-12-07 13:58:32 +02:00
George Joseph
63b8664bfa res_pjsip_nat: Restore original contact for REGISTER responses
RFC3261 Section 10 "Registrations", specifically paragraph
"10.2.4: Refreshing Bindings", states that a user agent compares
each contact address (in a 200 REGISTER response) to see if it
created the contact.  If the Asterisk endpoint has the
rewrite_contact option set however, the contact host and port sent
back in the 200 response will be the rewritten one and not the
one sent by the user agent.  This prevents the user agent from
matching its own contact.  Some user agents get very upset when
this happens and will not consider the registration successful.
While this is rare, it is acceptable behavior especially if more
than 1 user agent is allowed to register to a single endpoint/aor.

This commit updates res_pjsip_nat (where rewrite_contact is
implemented) to store the original incoming Contact header in
a new "x-ast-orig-host" URI parameter before rewriting it, and to
restore the original host and port to the Contact headers in the
outgoing response.

This is only done if the request is a REGISTER and rewrite_contact
is enabled.

pjsip_message_filter was also updated to ensure that if a request
comes in with any existing x-ast-* URI parameters, we remove them
so they don't conflict.  Asterisk will never send a request
with those headers in it but someone might just decide to add them
to a request they craft and send to Asterisk.

NOTE: If a device changes its contact address and registers again,
it's a NEW registration.  If the device didn't unregister the
original registration then all existing behavior based
on aor/remove_existing and aor/max_contacts apply.

ASTERISK-28502
Reported-by: Ross Beer

Change-Id: Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e
2019-12-06 12:47:42 -06:00
George Joseph
7f2bbff48c Merge "channel.c: Resolve issue with receiving SIP INFO packets for DTMF" into 16 2019-12-06 12:40:42 -06:00
Friendly Automation
439d42a594 Merge "res_pjsip_outbound_registration: add support for SRV failover" into 16 2019-12-06 09:20:15 -06:00
Friendly Automation
c1176286a2 Merge "res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases" into 16 2019-12-06 08:55:24 -06:00
Joshua Colp
440ffa4b3d Merge "chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime." into 16 2019-12-05 07:53:41 -06:00
Friendly Automation
7620d1256c Merge "PJSIP_CONTACT: add missing argument documentation" into 16 2019-12-04 18:33:36 -06:00
Kevin Harwell
1ea4f0e7c5 Merge "res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled" into 16 2019-12-04 18:02:50 -06:00
Kevin Harwell
7f843116d3 Merge "parking: Fall back to parker channel name even if it matches parkee." into 16 2019-12-04 17:34:46 -06:00
Sean Bright
68ce999351 res_pjsip_registrar.c: Prevent potential double free if AOR is not found
The simple fix here is simply to NULL out username and password after we call
ast_free on them. Unfortunately, I noticed that we weren't checking for
allocation failures for username and password, and adding those checks made
things noisy and cumbersome.

So instead we partially rollback the recent LGTM patch, and move the alloca
calls into find_aor_name().

ASTERISK-28641 #close
Reported by: Ross Beer

Change-Id: Ic9d01624e717a020be0b0aee31f0814e7f1ffbe2
2019-12-04 16:18:24 -06:00
Sean Bright
5c20cc4c3a res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases
We're appropriately sizing the id_domain_alias buffer, but then copying the data
into the id_domain one. We were then using the uninitialized id_domain_alias
buffer we just allocated.

This is ASTERISK~28641 adjacent, but significant enough to warrant its own
patch.

Change-Id: I81c38724d18deab8c6573153e2b99dbb6e2f33d9
2019-12-04 16:15:09 -06:00
Walter Doekes
161e762742 app_queue: Fix old confusing comment about when the members are called
ASTERISK-28644

Change-Id: I2771a931d00a8fc2b9f9a4d1a33ea8f1ad24e06b
2019-12-04 11:38:40 -06:00
Sean Bright
fbc80db350 res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled
We need to copy the endpoint name before we call ao2_cleanup() on it,
otherwise we might try to access memory that has been reclaimed.

ASTERISK-28445 #close
Reported by: Bernhard Schmidt

Change-Id: I404b952608aa606e0babd3c4108346721fb726b3
2019-12-03 16:42:03 -05:00
George Joseph
dd07ac6a3a Merge "media_cache.c: Various CLI improvements" into 16 2019-12-02 16:02:13 -06:00
George Joseph
43d4c0e3c9 channel.c: Resolve issue with receiving SIP INFO packets for DTMF
The problem is essentially the same as in ASTERISK~28245. Besides
the direct media scenario we have an additional scenario where a
special client is involved. This device mutes audio by default in
transmit direction (no rtp frames) and activates audio only by a
foot switch. In this situation dtmf input (pin for conferences,
transfer features codes , etc) using SIP INFO mode is not
understood properly especially when SIP INFO messages are sent
quickly.

This patch ensures that SIP INFO frames are properly queued and
processed in the above scenario. The patch also corrects situations
where successive dtmf events are received quicker than the
signalled event duration (plus minimum gap/pause) allows, i.e. DTMF
events have to be buffered in the ast channel read queue and
emulation has to be processed asynchronously at slower speed.

Reported by: Thomas Arimont
patches:
  trigger_dtmf_emulation.patch submitted by Thomas Arimont (license 5525)

Change-Id: I309bf61dd065c9978c8e48f5b9a936ab47de64c2
2019-12-02 08:39:26 -06:00
George Joseph
80199cd67f CI: Turn off shallow cloning altogether
Change-Id: I73ed4aef33a92f20080128aafc34e19fd4457196
2019-12-02 07:53:36 -05:00