Commit Graph

32367 Commits

Author SHA1 Message Date
George Joseph
2634e63f4d Merge "res_rtp_asterisk: Add frame list cleanups to ast_rtp_read" into 17 2019-12-18 08:58:13 -06:00
Friendly Automation
2725c885e8 Merge "sip_to_pjsip.py: Fix trustrpid typo" into 17 2019-12-18 07:26:25 -06:00
Joshua C. Colp
3104c03476 Merge "configure: Add check for MySQL client bool and my_bool type usage." into 17 2019-12-18 06:37:56 -06:00
Joshua C. Colp
58a6d4ecf5 Merge "res_pjsip_session: Set stream state on created streams for incoming SDP." into 17 2019-12-18 05:46:16 -06:00
Pascal Cadotte Michaud
69c9b74836 sip_to_pjsip.py: Fix trustrpid typo
ASTERISK-28664 #close

Change-Id: I6c28b1002fd7075ae0ed36f026f8c1855c9418a6
2019-12-17 13:19:21 -05:00
Joshua C. Colp
5a80c36d62 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 10:36:07 -06:00
Friendly Automation
c7966269f5 Merge "res_pjsip_nat: Restore original contact for REGISTER responses" into 17 2019-12-16 10:28:01 -06:00
Friendly Automation
a7a5bf0129 Merge "PJSIP_CONTACT: add missing argument documentation" into 17 2019-12-16 06:56:51 -06:00
Joshua Colp
895a66f772 Merge "ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging." into 17 2019-12-16 06:04:59 -06:00
Joshua C. Colp
c9147a759e 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 05:23:42 -06:00
Asterisk Development Team
08a6e8c553 Update CHANGES and UPGRADE.txt for 17.1.0 2019-12-12 06:04:48 -05:00
Jaco Kroon
6041fc8b9c 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:45:42 -06:00
Pascal Cadotte Michaud
39aff53cff 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:15:45 -06:00
George Joseph
87d5fb1196 Merge "Revert "PJSIP_CONTACT: add missing argument documentation"" into 17 2019-12-11 10:36:42 -06:00
Joshua Colp
6a89784b78 Revert "PJSIP_CONTACT: add missing argument documentation"
This reverts commit 450173a0ae.

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: I47a6714bb555b35a371861d434daf5b97c0cdcbd
2019-12-11 07:01:23 -06:00
George Joseph
86822722b6 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 12:48:20 -06:00
Friendly Automation
5fb0d1d562 Merge "res_pjsip_registrar.c: Prevent potential double free if AOR is not found" into 17 2019-12-09 10:34:41 -06:00
Friendly Automation
ffbfc09fc1 Merge "app_queue: Fix old confusing comment about when the members are called" into 17 2019-12-06 13:27:59 -06:00
George Joseph
fd14d7302f 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:54 -06:00
George Joseph
2526c8e562 Merge "channel.c: Resolve issue with receiving SIP INFO packets for DTMF" into 17 2019-12-06 12:41:09 -06:00
Friendly Automation
af079f5085 Merge "res_pjsip_outbound_registration: add support for SRV failover" into 17 2019-12-06 09:35:43 -06:00
Friendly Automation
6685a1862c Merge "res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases" into 17 2019-12-06 09:09:02 -06:00
Friendly Automation
e17bde758b Merge "PJSIP_CONTACT: add missing argument documentation" into 17 2019-12-04 18:45:22 -06:00
Friendly Automation
aa2765d366 Merge "chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime." into 17 2019-12-04 18:02:33 -06:00
Friendly Automation
478a602e70 Merge "res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled" into 17 2019-12-04 17:45:05 -06:00
Friendly Automation
77b5ec3e7a Merge "parking: Fall back to parker channel name even if it matches parkee." into 17 2019-12-04 17:07:48 -06:00
Sean Bright
4e057eb9d2 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:53 -06:00
Sean Bright
f26e5bacc0 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:19 -06:00
Walter Doekes
e1eb5e8dc2 app_queue: Fix old confusing comment about when the members are called
ASTERISK-28644

Change-Id: I2771a931d00a8fc2b9f9a4d1a33ea8f1ad24e06b
2019-12-04 11:38:56 -06:00
Frederic LE FOLL
3e73893e53 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-12-04 05:01:29 -06:00
Sean Bright
4d56adf8fb 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 15:44:43 -06:00
George Joseph
c0ab241cc0 Merge "media_cache.c: Various CLI improvements" into 17 2019-12-02 16:01:42 -06:00
George Joseph
88150323a2 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:36 -06:00
George Joseph
5b15a1c639 CI: Turn off shallow cloning altogether
Change-Id: I73ed4aef33a92f20080128aafc34e19fd4457196
2019-12-02 07:54:25 -05:00
Joshua Colp
41d58a4ce2 parking: Fall back to parker channel name even if it matches parkee.
ASTERISK-28631

Change-Id: Ia74d084799fbb9bee3403e30d2391aacd46243cc
2019-11-25 12:56:51 +00:00
Sean Bright
cc59e21409 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:17 -05:00
Salah Ahmed
4ac0299bfb 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:10:17 -05:00
Friendly Automation
e9b9141d09 Merge "manager.c: Prevent the Originate action from running the Originate app" into 17 2019-11-21 14:03:02 -06:00
Ben Ford
665a94cb76 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:26 -06:00
George Joseph
6b1ba58967 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:52 -06:00
George Joseph
6aa9ee1661 Merge "chan_dahdi: PRI span status may stay "Down, Active" after a short alarm" into 17 2019-11-21 09:23:42 -06:00
Friendly Automation
715e4d0e72 Merge "app_senddtmf: Add receive mode to AMI Action PlayDTMF" into 17 2019-11-21 08:38:53 -06:00
Pascal Cadotte Michaud
450173a0ae PJSIP_CONTACT: add missing argument documentation
add missing argument "rtt" and "status" to the documentation

ASTERISK-28626
Change-Id: I8419e4c8203e411b87d93dc395acdbcf7526dedf
2019-11-21 09:23:29 -05:00
Kevin Harwell
b1c9176b3f Merge "app_amd: Fixed timeout issue" into 17 2019-11-20 16:14:47 -06:00
Kevin Harwell
8c99930375 res_pjsip_outbound_registration: add support for SRV failover
ASTERISK-28624

Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561
2019-11-20 13:56:49 -05:00
Friendly Automation
ecdc5405f9 Merge "func_curl.c: Support custom http headers" into 17 2019-11-20 09:49:42 -06:00
George Joseph
8a02454ec6 Merge "res_pjsip_registrar: Fix uninitlized variable warning" into 17 2019-11-20 08:59:38 -06:00
George Joseph
2a92e6b576 CI: Fix missing script block in jenkinsfiles
Change-Id: I9f44a3d5085ea7880fad1a3883a4820907e29ea3
(cherry picked from commit 95213b01d2)
2019-11-19 13:13:22 -05:00
George Joseph
f0d1ce50af CI: Fix missing script block in jenkinsfiles
Change-Id: Ib4b6e4887695f230ea7a5b0c879b29fc5a13be4f
(cherry picked from commit d60f23ecbd)
(cherry picked from commit ce8a23fdf9)
2019-11-19 13:03:58 -05:00
George Joseph
46dceab33f 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:58 -05:00