Commit Graph

32302 Commits

Author SHA1 Message Date
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
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
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
Joshua Colp
328a6b2381 Merge "res_pjsip_t38: T.38 error correction mode selection at 200 ok received" into 16 2019-12-02 06:41:18 -06:00
Frederic LE FOLL
31173f6586 chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.
During capabilities selection (joint capabilities of us and peer,
configured capability for this peer, or general configured
capabilities), if sip_new() does not keep framing information,
then directmedia activation will fail for any framing different
from default framing.

ASTERISK-28637

Change-Id: I99257502788653c2816fc991cac7946453082466
2019-11-27 19:16:59 +01:00
Joshua Colp
c91b28c72d parking: Fall back to parker channel name even if it matches parkee.
ASTERISK-28631

Change-Id: Ia74d084799fbb9bee3403e30d2391aacd46243cc
2019-11-25 07:57:12 -05:00
Sean Bright
bd3cb1b300 media_cache.c: Various CLI improvements
* Use ast_cli_completion_add() to improve performance when large number of
  cached items are present.

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

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

Change-Id: Iedb0a2c3541e49561bc231dca2dcc0ebd8612902
2019-11-22 16:38:12 -05:00
Asterisk Development Team
9eb86a8110 Update CHANGES and UPGRADE.txt for 16.6.2 2019-11-21 16:11:21 -05:00
Salah Ahmed
efef44985d res_pjsip_t38: T.38 error correction mode selection at 200 ok received
if asterisk offer T38 SDP with none error correction scheme and
the endpoint respond with redundancy EC scheme, asterisk switch
to that mode. Since we configure the endpoint as none EC mode
we should not switch to any other mode except none.
following logic implemented in code.

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

ASTERISK-28621

Change-Id: I343c62253ea4c8b7ee17abbfb377a4d484a14b19
2019-11-21 16:09:40 -05:00
Friendly Automation
5802e32d47 Merge "chan_sip.c: Prevent address change on unauthenticated SIP request." into 16 2019-11-21 13:36:30 -06:00
Ben Ford
8cdaa93e65 chan_sip.c: Prevent address change on unauthenticated SIP request.
If the name of a peer is known and a SIP request is sent using that
peer's name, the address of the peer will change even if the request
fails the authentication challenge. This means that an endpoint can
be altered and even rendered unusuable, even if it was in a working
state previously. This can only occur when the nat option is set to the
default, or auto_force_rport.

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

ASTERISK-28589 #close

Change-Id: I581c5ed1da60ca89f590bd70872de2b660de02df
2019-11-21 09:46:05 -06:00
George Joseph
7574be5110 manager.c: Prevent the Originate action from running the Originate app
If an AMI user without the "system" authorization calls the
Originate AMI command with the Originate application,
the second Originate could run the "System" command.

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

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

ASTERISK-28580
Reported by: Eliel Sardañons

Change-Id: Ic4c9dedc34c426f03c8c14fce334a71386d8a5fa
2019-11-21 09:40:41 -06:00
George Joseph
a1eb0d7355 Merge "chan_dahdi: PRI span status may stay "Down, Active" after a short alarm" into 16 2019-11-21 09:22:01 -06:00
Friendly Automation
17f52679b2 Merge "app_senddtmf: Add receive mode to AMI Action PlayDTMF" into 16 2019-11-21 08:34:24 -06:00
Pascal Cadotte Michaud
174e6426aa PJSIP_CONTACT: add missing argument documentation
add missing argument "rtt" and "status" to the documentation

ASTERISK-28626
Change-Id: I8419e4c8203e411b87d93dc395acdbcf7526dedf
2019-11-21 08:59:50 -05:00
Kevin Harwell
f8e4473e16 Merge "func_curl.c: Support custom http headers" into 16 2019-11-20 16:17:33 -06:00
Kevin Harwell
3cd57aaff2 res_pjsip_outbound_registration: add support for SRV failover
ASTERISK-28624

Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561
2019-11-20 12:56:08 -06:00
Friendly Automation
337d735ab8 Merge "app_amd: Fixed timeout issue" into 16 2019-11-20 09:58:58 -06:00
Friendly Automation
a78bc75714 Merge "res_pjsip_registrar: Fix uninitlized variable warning" into 16 2019-11-20 08:06:52 -06:00
George Joseph
d075d8913b CI: Fix missing script block in jenkinsfiles
Change-Id: I9f44a3d5085ea7880fad1a3883a4820907e29ea3
(cherry picked from commit 95213b01d2)
2019-11-19 13:13:07 -05:00
George Joseph
ce8a23fdf9 CI: Fix missing script block in jenkinsfiles
Change-Id: Ib4b6e4887695f230ea7a5b0c879b29fc5a13be4f
(cherry picked from commit d60f23ecbd)
2019-11-19 13:03:31 -05:00
George Joseph
e649d6f33d Merge "CI: Increase clone depth and do better cleanup" into 16 2019-11-19 11:16:33 -06:00
George Joseph
919bc0c7be CI: Increase clone depth and do better cleanup
The original clone depth of 10 was causing the need to rebase
changes whose parent was older than the 10 commits.  The clone
depth has been increased to 100.

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

Change-Id: I0d7366e87cea714e5dbc9488caf718802fce75ca
2019-11-19 11:58:18 -05:00
Friendly Automation
b7c0711c5c Merge "serializer: set high/low alert levels on whole pool" into 16 2019-11-19 10:14:20 -06:00
Sean Bright
61a3e7e79b res_pjsip_registrar: Fix uninitlized variable warning
Fixes: error: ‘domain_name’ may be used uninitialized in this function

Found with gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

Change-Id: I44413b49ea1205aa25538142161deb73883c79e8
2019-11-19 10:32:49 -05:00
George Joseph
46cc0a3660 Merge "parking: Fix case where we can't get the parker." into 16 2019-11-19 09:23:42 -06:00
Michael Cargile
cf5b7f3a0b app_amd: Fixed timeout issue
ASTERISK_28143 attempted to fix an issue where calls with no audio would never
timeout. It did so by adding AST_FRAME_NULL as a frame type to process in its
calculations. Unfortunately these frames seem to show up at irregular time
intervals. This resulted in app_amd returning prematurely most of the time.

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

ASTERISK-28608

Change-Id: I642a21b02d389b17e40ccd5357754b034c3daa42
2019-11-19 09:58:08 -05:00
Frederic LE FOLL
faf353e931 chan_dahdi: PRI span status may stay "Down, Active" after a short alarm
Upon a short PRI disconnection, libpri may maintain Q.921 layer 'up' and
may thus not send PRI_EVENT_DCHAN_DOWN / PRI_EVENT_DCHAN_UP events.
If pri_event_alarm() clears DCHAN_UP status bit upon alarm detection
and no Q.921 reconnection sequence occurs, chan_dahdi will keep
seeing span status "Down" at the end of alarm.

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

ASTERISK-28615

Change-Id: Ibe27df4971fd4c82cc6850020bce4a8b2692c996
2019-11-19 02:17:20 -05:00
George Joseph
eb8f255d44 Merge "func_env: Prevent FILE() from reading garbage at end-of-file" into 16 2019-11-18 13:03:25 -06:00
George Joseph
921ad6b7c8 Merge "res_rtp_asterisk: Always return provided DTLS packet length." into 16 2019-11-18 13:02:45 -06:00
George Joseph
9f9b3d8af0 Merge "bridge_softmix: clear hold when joining a softmix bridge" into 16 2019-11-18 11:49:10 -06:00
lvl
8894a56452 app_senddtmf: Add receive mode to AMI Action PlayDTMF
ASTERISK-28614

Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664
2019-11-18 09:33:59 -06:00
Joshua Colp
eb54e381fd res_rtp_asterisk: Always return provided DTLS packet length.
OpenSSL can not tolerate if the packet sent out does not
match the length that it provided to the sender. This change
lies and says that each time the full packet was sent. If
a problem does occur then a retransmission will occur as
appropriate.

ASTERISK-28576

Change-Id: Id42455b15c9dc4eb987c8c023ece6fbf3c22a449
2019-11-18 08:34:05 -06:00
Sean Bright
e39ddb1cb1 func_env: Prevent FILE() from reading garbage at end-of-file
If the last line of a file does not have a terminating EOL sequence, we
potentially add garbage to the value returned from the FILE() function.

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

ASTERISK-26481 #close

Change-Id: I50dd4fcf416fb3c83150040a1a79a59d9eb1ae01
2019-11-18 08:32:27 -06:00
Kevin Harwell
3891a953cf bridge_softmix: clear hold when joining a softmix bridge
MOH continues to play to a channel if that channel was on hold prior to
entering a softmix bridge. MOH will not stop even if the original "holder"
attempts an unhold.

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

ASTERISK-28618

Change-Id: I66ccd4efc80f5b4c3dd68186b379eb442916392b
2019-11-18 08:31:02 -06:00
Kevin Harwell
30c0af7257 various files - fix some alerts raised by lgtm code analysis
This patch fixes several issues reported by the lgtm code analysis tool:

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

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

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

Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
2019-11-18 08:30:05 -06:00
Martin Tomec
37dcdd485a func_curl.c: Support custom http headers
When user wants to send json data, the default Content-Type header
is incorect (application/x-www-form-urlencoded). This patch allows
to set any custom headers so the Content-Type header can be
overriden. User can set multiple headers by multiple calls of
curlopt(). This approach is not consistent with other parameters,
but is more readable in dialplan than one call with multiple
headers.

ASTERISK-28613

Change-Id: I4dd68c3f4e25362ef941d73a3861f58348dcfbf9
2019-11-18 05:54:06 -06:00
Joshua Colp
b9bbf39449 parking: Fix case where we can't get the parker.
ASTERISK-28616

Change-Id: Iabe31ae38d01604284fcc5c2438d44e29a32ea4d
2019-11-15 05:46:53 -05:00
Joshua Colp
e7320bbbf0 parking: Use channel snapshot instead of channel.
There exists a scenario where a thread can hold a lock on the
channels container while trying to lock a bridge. At the same
time another thread can hold the lock for said bridge while
attempting to retrieve a channel. This causes a deadlock.

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

ASTERISK-28616

Change-Id: I68ceb1d62c7378addcd286e21be08a660a7cecf2
2019-11-14 17:19:57 -06:00