Commit Graph

4443 Commits

Author SHA1 Message Date
Jenkins2 d677ff47ae Merge "res_stasis_recording: Allow symbolic links in configured recordings dir." 2018-01-16 09:42:25 -06:00
Corey Farrell 9cfdb81e91 loader: Add dependency fields to module structures.
* Declare 'requires' and 'enhances' text fields on module info structure.
* Rename 'nonoptreq' to 'optional_modules'.
* Update doxygen comments.

Still need to investigate dependencies among modules I cannot compile.

Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
2018-01-15 13:25:51 -05:00
Jenkins2 6f1f16d887 Merge "config_transport: Enable TCP_NODELAY on TLS transports" 2018-01-15 10:40:27 -06:00
George Joseph cabe80631b config_transport: Enable TCP_NODELAY on TLS transports
We did this for TCP transports already but I'm not sure why we
didn't do it for TLS transports.

ASTERISK_27474 #not_final_fix

Change-Id: I5b1ef4b882f7b859e718236686b7898751dbb262
2018-01-13 13:57:03 -06:00
Corey Farrell de7f2a6cb4 res_stasis_recording: Allow symbolic links in configured recordings dir.
If any component of ast_config_AST_RECORDING_DIR is a symbolic link we
would incorrectly assume the ARI user was trying to escape the recording
path.  Create additional check to check the recording directory's
realpath, only deny access if both do not match.

This is needed by the testsuite when run by 'run-local'.

Change-Id: I9145e841865edadcb5f75cead3471ad06bbb56c0
2018-01-12 19:57:38 -05:00
Alexander Traud eb9b85baec res_config_pgsql: Avoid typecasting an int to unsigned char.
clang 5.0 warned about this.

ASTERISK-27576

Change-Id: If41f400a51973c06cdb9b75462e535b616bfe385
2018-01-12 16:24:17 +01:00
Jenkins2 e4ee41da4d Merge "res_pjsip_endpoint_identifier_ip.c: Remove unnecessary requirement." 2018-01-11 13:36:02 -06:00
Jenkins2 97a0e8591f Merge "res_pjsip.c: Update the endpoint identification documentation." 2018-01-11 08:42:52 -06:00
Joshua Colp 43305a0d18 Merge "res_pjsip.c: Fix ident_to_str() and refactor ident_handler()." 2018-01-11 04:55:21 -06:00
Joshua Colp d7e90997e4 Merge "res_pjsip_endpoint_identifier_ip.c: Allow multiple IdentifyDetail AMI events." 2018-01-10 07:16:14 -06:00
Joshua Colp 3e8b951509 Merge "res_pjsip: Add AMI action 'PJSIPShowAuths'" 2018-01-10 06:55:29 -06:00
Joshua Colp f2c583624b Merge "res_stasis: Reduce RAII_VAR usage." 2018-01-10 06:54:40 -06:00
Jenkins2 9397c2535c Merge "res_pjsip_session: Always bundle streams if WebRTC is enabled." 2018-01-09 14:23:42 -06:00
Richard Mudgett 8f3167c5f1 res_pjsip.c: Update the endpoint identification documentation.
* Endpoint identify_by documentation.
* IP/Header endpoint identifier documentation.

Change-Id: Id92f00b495acca7be945daf749d2abd7f76a0b5a
2018-01-09 13:38:59 -06:00
Richard Mudgett 42a61d9db6 res_pjsip_endpoint_identifier_ip.c: Remove unnecessary requirement.
The requirement that "ip" must be in the endpoint identify_by list to
allow the type=identify method to identify the endpoint is not necessary.
The "ip" identifier method can match one and only one endpoint.  To even
work, the "ip" identifier method configuration must explicitly specify the
identified endpoint.  Therefore, why bother configuring the type=identify
identifier in the first place?  The requirement only adds the potential
for configuration errors for no benefit.  Even worse, those configuration
errors cannot be detected when the configuration loads.  The requirement
was introduced with the ASTERISK_27206 patch.

* Remove the code change that enforces the requiremnt.  Listing the "ip"
method in the identify_by value is simply documentation.

Change-Id: Ia057f92a33fb5d9f51dc5d5692e3d5ee1a6f2c11
2018-01-09 12:34:41 -06:00
Richard Mudgett a7bbb18e5c res_pjsip.c: Fix ident_to_str() and refactor ident_handler().
* Extracted sip_endpoint_identifier_type2str() and
sip_endpoint_identifier_str2type() to simplify the calling functions.

* Fixed pjsip_configuration.c:ident_to_str() building the endpoint's
identify_by value string.

Change-Id: Ide876768a8d5d828b12052e2a75008b0563fc509
2018-01-09 12:25:02 -06:00
Richard Mudgett be488eb14a res_pjsip_endpoint_identifier_ip.c: Allow multiple IdentifyDetail AMI events.
The AMI PJSIPShowEndpoint action could only list one IdentifyDetail AMI
event per endpoint.  However, there is no reason that multiple
type=identify sections cannot identify the same endpoint.

* Reworked format_ami_endpoint_identify() to generate as many
IdentifyDetail AMI events as there are matching identifiers.

Change-Id: Ie146792aef72d78e05416ab5b27bc552a30399db
2018-01-09 12:08:13 -06:00
Jenkins2 2f8ae56651 Merge "res_pjsip.c: Fix endpoint identifier registration name search." 2018-01-09 08:23:57 -06:00
Joshua Colp 2e4bd3a8d5 Merge "res_stasis: Fix dial bridge unload." 2018-01-09 07:01:45 -06:00
Jenkins2 832f058719 Merge "res_pjsip_endpoint_identifier_ip.c: Fix apply identify validation." 2018-01-09 05:46:34 -06:00
Joshua Colp a21841bf40 res_pjsip_session: Always bundle streams if WebRTC is enabled.
Some WebRTC clients can't handle renegotiation with the addition of
streams that include an offer to bundle. They instead expect the
newly added streams to already be bundled. This change does such a thing
if WebRTC support is enabled on an endpoint.

ASTERISK-27566

Change-Id: I7fe9b7ac35a2798627d9c2c8369129f407af6461
2018-01-09 04:42:36 -06:00
Corey Farrell 55a540272f res_stasis: Reduce RAII_VAR usage.
In addition to being a micro-optimization (RAII_VAR has overhead), this
change improves output of REF_DEBUG.  Unfortunately when RAII_VAR calls
ao2_cleanup it does so from a generated _dtor_varname function.  For
example this caused _dtor_app to release a reference instead of
__stasis_app_unregister.

Change-Id: I4ce67120583a446babf9adeec678b71d37fcd9e5
2018-01-08 18:51:45 -05:00
Jenkins2 8e18209cad Merge "res_stasis: Fix app_is_subscribed_bridge_id." 2018-01-08 11:25:45 -06:00
Sungtae Kim faeb9e1b26 res_pjsip: Add AMI action 'PJSIPShowAuths'
Add an AMI action which provides information on all
configured Auths.

ASTERISK-27547

Change-Id: I1a88a75b38a2b1dd9d1de6c0307b20a3f584c817
2018-01-08 18:16:33 +01:00
Jenkins2 94e7a7675b Merge "General: Avoid implicit conversion to char when changes value to negative." 2018-01-08 06:51:40 -06:00
Corey Farrell 8b3083cac5 res_stasis: Fix dial bridge unload.
If the dial bridge has been created it must be released by calling
ast_bridge_destroy, simply releasing the ao2 reference is not enough.

Also move stasis_app_control_shutdown earlier in unload to ensure the
bridge cannot be created or grabbed after the app_bridges container is
released.

Change-Id: I372302de94ca63876069e2585a049c5060e5e767
2018-01-07 23:00:33 -05:00
Corey Farrell 6870ba5f26 res_stasis: Fix app_is_subscribed_bridge_id.
Instead of searching for bridge_id provided in an argument this function
always searched for BRIDGE_ALL first.  Rewrite this function to work
like the similar functions for channel and endpoint functions.

Change-Id: Ib5caca69e11727c5c8a7284a1d00621f40f1e60a
2018-01-07 21:21:13 -05:00
Alexander Traud 7e9781c25e General: Silence modules on (un)load.
Some (normally optional) modules created notices, warnings, and even errors
in normal situations like (un)load. This cluttered the command-line interface
(CLI) on start and while stopping gracefully. However, when an user went for
the script './contrib/scripts/install_prereq', those modules get compiled-in
because their prerequisites were met at compile time. Furthermore, because of
ASTERISK_27475, the former talkative module 'res_curl' is built as side-effect.

ASTERISK-27553

Change-Id: I9f105f46d72553994e820679bfde3478a551b281
2018-01-06 20:13:07 -06:00
Alexander Traud f84fcc1fc1 General: Avoid implicit conversion to char when changes value to negative.
clang 5.0 warned about this.

ASTERISK-27557

Change-Id: I7cceaa88e147cbdf81a3a7beec5c1c20210fa41e
2018-01-06 22:12:40 +01:00
Richard Mudgett b20b5758d9 res_pjsip_endpoint_identifier_ip.c: Fix apply identify validation.
The ip_identify_apply() did not validate the configuration for simple
static configuration errors or deal well with address resolution errors.

* Added missing configuration validation checks.
* Fixed address resolution error handling.
* Demoted an error message to a warning since it does not fail applying
the identify object configuration.

Change-Id: I8b519607263fe88e8ce964f526a45359fd362b6e
2018-01-05 18:49:28 -06:00
Richard Mudgett 705e6c04b3 res_pjsip.c: Fix endpoint identifier registration name search.
If an endpoint identifier name in the endpoint_identifier_order list is a
prefix to the identifier we are registering, we could install it in the
wrong position of the list.

Assuming
endpoint_identifier_order=username,ip,anonymous

then registering the "ip_only" identifier would put the identifier in the
wrong position of the priority list.

* Fix incorrect strncmp() string prefix matching.

Change-Id: Ib8819ec4b811da8a27419fd93528c54d34f01484
2018-01-05 18:08:12 -06:00
Corey Farrell 73bf5035b8 res_pjsip_history: Add missing unlock to CLI command.
Change-Id: I872060a30543776a176a316309602d924a23eb29
2018-01-04 10:30:48 -05:00
Joshua Colp 2fac32a37a Merge "loader: Create ast_module_running_ref." 2018-01-04 07:12:43 -06:00
Joshua Colp 25399f74aa Merge "res_pjsip_session: Check if sequence header is missing" 2018-01-04 07:01:04 -06:00
Corey Farrell 55f1d69c43 loader: Create ast_module_running_ref.
This function returns NULL if the module in question is not running.  I
did not change ast_module_ref as most callers do not check the result
and they always call ast_module_unref.

Make use of this function when running registered items from:
* app_stack API's
* bridge technologies
* CLI commands
* File formats
* Manager Actions
* RTP engines
* Sorcery Wizards
* Timing Interfaces
* Translators
* AGI Commands
* Fax Technologies

ASTERISK-20346 #close

Change-Id: Ia16fd28e188b2fc0b9d18b8a5d9cacc31df73fcc
2018-01-03 17:23:36 -05:00
Jenkins2 7f4facc5e4 Merge "res_pjsip: Add AMI action 'PJSIPShowAors'" 2018-01-03 15:29:36 -06:00
Kevin Harwell 62f862e2cd res_pjsip_session: Check if sequence header is missing
The pjsip_msg_find_hdr function can return NULL. This patch adds a check
when searching for the sequence header to make sure a NULL pointer is never
de-referenced.

Change-Id: I19af23aeeded65be016be92360e8cb7ffe51fad2
2018-01-03 10:46:25 -06:00
Sungtae Kim ffbf5be116 res_pjsip: Add AMI action 'PJSIPShowAors'
Add an AMI action which provides information on all
configured AORs.

ASTERISK-27537

Change-Id: If8b990a00909e5b6c0f04a3b8dccd9903dc445eb
2018-01-02 12:24:38 +00:00
Sean Bright 15f8b9b8bf ice: Increase foundation buffer size
Per RFC 5245, the foundation specified with an ICE candidate can be up
to 32 characters but we are only allowing for 31.

ASTERISK-27498 #close
Reported by: Michele Prà

Change-Id: I05ce7a5952721a76a2b4c90366168022558dc7cf
2017-12-31 11:34:41 -05:00
Kevin Harwell 553306548c AST-2017-014: res_pjsip - Missing contact header can cause crash
Those SIP messages that create dialogs require a contact header to be present.
If the contact header was missing from the message it could cause Asterisk to
crash.

This patch checks to make sure SIP messages that create a dialog contain the
contact header. If the message does not and it is required Asterisk now returns
a "400 Missing Contact header" response. Also added NULL checks when retrieving
the contact header that were missing as a "just in case".

ASTERISK-27480 #close

Change-Id: I1810db87683fc637a9e3e1384a746037fec20afe
2017-12-22 15:34:39 -06:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Corey Farrell 1b80ffa495 Fix Common Typo's.
Fix instances of:
* Retreive
* Recieve
* other then
* different then
* Repeated words ("the the", "an an", "and and", etc).
* othterwise, teh

ASTERISK-24198 #close

Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-20 12:40:01 -05:00
Jenkins2 78fb99e5a3 Merge "res_rtp_asterisk: Avoid close the rtp/rtcp fd twice." 2017-12-20 07:55:33 -06:00
Corey Farrell b3e839debd Remove constant conditionals (dead-code).
Some variables are set and never changed, making them constant.  This
means that code in the 'false' block of the conditional is unreachable.

In chan_skinny and res_config_ldap I used preprocessor directive `#if 0`
as I'm unsure if the unreachable code could be enabled in the future.

Change-Id: I62e2aac353d739fb3c983cf768933120f5fba059
2017-12-19 09:42:19 -05:00
Aaron An 81474dfb23 res_rtp_asterisk: Avoid close the rtp/rtcp fd twice.
When RTCP-MUX enabled. rtp->s is the same as rtcp->s, check this before
close the file descriptor. Close the FD twice will hangs the asterisk
under heavy load.

ASTERISK-27299 #close
Reported-by: Aaron An
Tested-by: AaronAn

Change-Id: I870a072d73fd207463ac116ef97100addbc0820a
2017-12-19 10:39:55 +08:00
Joshua Colp 5224fd3ab4 Merge changes from topic 'faster-aco'
* changes:
  aco: Minimize use of regex.
  aco: Create ways to minimize use of regex.
2017-12-18 14:41:41 -06:00
Jenkins2 eb23919e69 Merge "res_smdi: Fix shutdown ref." 2017-12-15 12:24:43 -06:00
Jenkins2 c9bcd888a2 Merge "res_rtp_asterisk.c: Disable packet flood detection for video streams." 2017-12-15 12:15:42 -06:00
Jenkins2 6a0505eee0 Merge "res_hep: hepv3_is_loaded() should check if we are enabled" 2017-12-15 11:52:37 -06:00
Joshua Colp 73bd9d6488 Merge "res_clialiases: Fix completion pass-through." 2017-12-15 11:17:02 -06:00