Commit Graph

4468 Commits

Author SHA1 Message Date
Jenkins2 2de2a1001a Merge "endpoint identifiers: Some code cleanup." 2018-02-06 05:40:14 -06:00
Jenkins2 9255048d9e Merge "res_pjsip/config_domain_aliases.c: Add check for missing domain." 2018-02-05 16:11:20 -06:00
Jenkins2 0a784a91a3 Merge "res_sorcery_realtime.c: Fix ref leak if object failed to apply." 2018-02-05 13:05:40 -06:00
Jenkins2 b392c1013f Merge "res_pjsip.c: Fix documentation typos." 2018-02-03 10:52:58 -06:00
Richard Mudgett 1017db107c endpoint identifiers: Some code cleanup.
res_pjsip_endpoint_identifier_user.c:
* Fix copy/paste error in find_endpoint().  We were using a constant
"anonymous" string instead of the passed in endpoint_name when checking
the transport domain for an endpoint match.
* Eliminate RAII_VAR in find_endpoint().
* Remove always true check in find_transport_state_in_use().
* Remove useless CMD_STOP in find_transport_state_in_use().

res_pjsip_endpoint_identifier_anonymous.c:
* Eliminate RAII_VAR in anonymous_identify().
* Remove always true check in find_transport_state_in_use().
* Remove useless CMD_STOP in find_transport_state_in_use().

Change-Id: I86924c31db5bd225ca0c1219c761b668c6f91189
2018-02-02 18:03:06 -06:00
Richard Mudgett b71e469d68 res_pjsip/config_domain_aliases.c: Add check for missing domain.
What is the point of defining an alias and not saying what is being
aliased?

Change-Id: I98a892016ed61dcf5efeb6619fd748925103f0be
2018-02-02 17:55:14 -06:00
Richard Mudgett 0960de71ae res_pjsip.c: Fix documentation typos.
Change-Id: I82ae0b92bfa2ece84a5c684efd9eefdc83ebd068
2018-02-02 17:48:28 -06:00
Richard Mudgett bef49d90c1 res_sorcery_realtime.c: Fix ref leak if object failed to apply.
Change-Id: I3c7106ff77009754725cee790eadf5da44154ab6
2018-02-02 17:46:39 -06:00
Joshua Elson 73f92c2c52 res_pjsip_mwi.c: Fix null pointer crash
ASTERISK-27652 #close

Change-Id: I78a0d38bfd8d0d82830f3d53da04872d6b67284d
2018-02-01 15:33:23 -06:00
George Joseph b148453708 Merge "res_pjsip_pubsub: Prune subs with reliable transports at startup" 2018-02-01 11:26:49 -06:00
Jenkins2 b9efe5adf0 Merge "res_pjsip_registrar_expire: Delete empty module." 2018-02-01 10:41:20 -06:00
Jenkins2 a3e72c308b Merge "res_pjsip_session: Prevent crash during shutdown." 2018-01-31 17:11:57 -06:00
Corey Farrell 4e4428ef3c res_pjsip_registrar_expire: Delete empty module.
Verified nothing in the testsuite lists this module as a dependency.

Change-Id: I90c7d52c7e15e85fde3389d5eaccb05b97848813
2018-01-31 15:10:35 -06:00
Richard Mudgett 6c5e3226ec res_pjsip_registrar.c: Fix compiler error.
Need to include signal.h to define pthread_kill() and SIGURG.

Change-Id: I10ae3aa4bf8e7386ac29ade78c0f2caed8e674fa
2018-01-31 11:02:47 -06:00
Corey Farrell 60701b3252 res_pjsip_session: Prevent crash during shutdown.
pjproject does not have a function to reverse pjsip_inv_usage_init.
This means we need to ignore any calls to the functions once shutdown is
final.

ASTERISK-27571 #close

Change-Id: Ia550fcba563e2328f03162d79fb185f16b7c9b9d
2018-01-30 23:19:22 -06:00
George Joseph 2b9aa6b5bb res_pjsip_pubsub: Prune subs with reliable transports at startup
In an earlier release, inbound registrations on a reliable transport
were pruned on Asterisk restart since the TCP connection would have
been torn down and become unusable when Asterisk stopped.  This same
process is now also applied to inbound subscriptions.

Also fixed issues in res_pjsip_registrar where it wasn't handling the
monitoring correctly when multiple registrations came in over the same
transport.

To accomplish this, the pjsip_transport_event feature needed to
be refactored to allow multiple monitors (multiple subcriptions or
registrations from the same endpoint) to exist on the same transport.
Since this changed the API, any external modules that may have used the
transport monitor feature (highly unlikey) will need to be changed.

ASTERISK-27612
Reported by: Ross Beer

Change-Id: Iee87cf4eb9b7b2b93d5739a72af52d6ca8fbbe36
2018-01-30 09:29:51 -06:00
George Joseph 81db0aca0f res_pjsip_registrar_expire: Refactor into res_pjsip_register
res_pjsip_registrar_expire remains as an empty module for now.

Change-Id: Ib93698938bae548d2199cb542f3692d1a171239f
2018-01-29 12:49:53 -07:00
Jenkins2 a231e1d155 Merge "Remove redundant module checks and references." 2018-01-29 12:39:34 -06:00
Jenkins2 da5859246d Merge "Add missing OPTIONAL_API and ARI dependences." 2018-01-26 17:40:56 -06:00
Corey Farrell 527cf5a570 Remove redundant module checks and references.
This removes references that are no longer needed due to automatic
references created by module dependencies.

In addition this removes most calls to ast_module_check as they were
checking modules which are listed as dependencies.

Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
2018-01-24 13:37:29 -05:00
Jenkins2 7ce34f4e6a Merge "res_pjsip: Add AMI action 'PJSIPShowContacts'" 2018-01-24 07:56:50 -06:00
Sungtae Kim 5b8e71ab9f res_pjsip: Add AMI action 'PJSIPShowContacts'
Add an AMI action which provides information on all
configured Contacts.

ASTERISK-27581

Change-Id: I2eed42c74bbc725fad26b8b33b1a5b3161950c73
2018-01-23 10:37:27 +00:00
Corey Farrell 679fa5fb34 Add missing OPTIONAL_API and ARI dependences.
I've audited all modules that include any header which includes
asterisk/optional_api.h.  All modules which use OPTIONAL_API now declare
those dependencies in AST_MODULE_INFO using requires or optional_modules
as appropriate.

In addition ARI dependency declarations have been reworked.  Instead of
declaring additional required modules in res/ari/resource_*.c we now add
them to an optional array "requiresModules" in api-docs for each module.
This allows the AST_MODULE_INFO dependencies to include those missing
modules.

Change-Id: Ia0c70571f5566784f63605e78e1ceccb4f79c606
2018-01-22 12:16:58 -05:00
Sean Bright 5964061a21 res_pjsip: Document tlsv1_1 and tlsv1_2 methods
Change-Id: I67ed9039bf3f132fb20ee7a750e0aef0f704d7d3
2018-01-18 14:55:35 -06:00
Richard Mudgett 8494e78010 res_pjsip: Split type=identify to IP address and SIP header matching priorities
The type=identify endpoint identification method can match by IP address
and by SIP header.  However, the SIP header matching has limited
usefulness because you cannot specify the SIP header matching priority
relative to the IP address matching.  All the matching happens at the same
priority and the order of evaluating the identify sections is
indeterminate.  e.g., If you had two type=identify sections where one
matches by IP address for endpoint alice and the other matches by SIP
header for endpoint bob then you couldn't predict which endpoint is
matched when a request comes in that matches both.

* Extract the SIP header matching criteria into its own "header" endpoint
identification method so the user can specify the relative priority of the
SIP header and the IP address matching criteria in the global
endpoint_identifier_order option.  The "ip" endpoint identification method
now only matches by IP address.

ASTERISK-27491

Change-Id: I9df142a575b7e1e3471b7cda5d3ea156cef08095
2018-01-16 12:50:34 -06:00
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