Commit Graph

4566 Commits

Author SHA1 Message Date
Jenkins2 39ba6aacf8 Merge "rtp: Add REMB RTP property and set it on PJSIP video RTP." 2018-03-21 10:38:32 -05:00
Joshua Colp 0bfc83ee4f Merge "BuildSystem: Remove unused dependency on libltdl." 2018-03-20 06:37:09 -05:00
Jenkins2 5843a19797 Merge "loader: Convert reload_classes to built-in modules." 2018-03-19 12:53:12 -05:00
Joshua Colp 115939caeb rtp: Add REMB RTP property and set it on PJSIP video RTP.
This change adds a property to RTP instances to indicate that
REMB support is enabled and that sending/receiving should be
passed through.

This also enables it on video RTP instances in PJSIP if
WebRTC support is enabled.

Finally the goog-remb extension is added to the SDP using
the rtcp-fb attribute to indicate our support for it.

Details about REMB can be found on the draft document for it:
https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03

Change-Id: I1902dda1c0882bd1a0d71b2f120684b44b97e789
2018-03-19 07:48:47 -06:00
Alexander Traud 10a978829e BuildSystem: Remove unused dependency on libltdl.
Asterisk does not need the development package of libltdl, because it does not
use any symbol of -lltdl directly. Instead, it uses the runtime package via the
shared library -lodbc. On the supported platforms, that shared library declares
its dependency on -lltdl correctly, otherwise AST_EXT_LIB_CHECK would have
failed.

ASTERISK-27745

Change-Id: Icd315809b8e7978203431f3afb66240dd3a040ba
2018-03-17 11:00:06 +01:00
Ross Beer 92158b7f37 res_pjsip_rfc3326.c: Account for more than one 'Reason' header
ASTERISK-27741

Change-Id: I0aa59a54735c6d20b95c54db1bd095dbf93e7adf
2018-03-14 17:49:56 -06:00
Joshua Colp 6d81a2a684 Merge "res_srtp: Add support for libsrtp2.x on openSUSE." 2018-03-14 06:16:40 -05:00
Corey Farrell 572a508ef2 loader: Convert reload_classes to built-in modules.
* acl (named_acl.c)
* cdr
* cel
* ccss
* dnsmgr
* dsp
* enum
* extconfig (config.c)
* features
* http
* indications
* logger
* manager
* plc
* sounds
* udptl

These modules are now loaded at appropriate time by the module loader.
Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
the module loader will abort startup on failure of these modules.

Some of these modules are still initialized or shutdown from outside the
module loader.  logger.c is initialized very early and shutdown very
late, manager.c is initialized by the module loader but is shutdown by
the Asterisk core (too much uses it without holding references).

Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
2018-03-14 05:20:12 -04:00
Jenkins2 4b7872c9db Merge "core: Remove ABI effects of MALLOC_DEBUG." 2018-03-13 13:54:19 -05:00
Jenkins2 1485719531 Merge "Replace direct checks of option_debug with DEBUG_ATLEAST macro." 2018-03-12 10:44:46 -05:00
Jenkins2 ffdd4b1c39 Merge "Complete deprecating legacy modules." 2018-03-12 07:50:01 -05:00
Jenkins2 114c25e706 Merge "res_pjsip_session: properly handle SDP from a forked call with early media" 2018-03-12 07:23:26 -05:00
Jenkins2 e5a6c72cd7 Merge "BuildSystem: Depend not implicitly but explicitly on external libraries." 2018-03-12 07:08:14 -05:00
Alexander Traud 9164be19d2 res_srtp: Add support for libsrtp2.x on openSUSE.
Since ASTERISK-27253, no symbols from the header srtp2/crypto_types.h are used
anymore. Therefore, its include statement can be removed. This allows to compile
Asterisk on platforms which do not offer this private header, like openSUSE.

ASTERISK-27733

Change-Id: I25c5cb8fa966043d1506ebef449e5a724412b4b6
2018-03-12 10:11:15 +01:00
Jenkins2 ffdc5c6398 Merge "res_http_post: Enable GMime in NetBSD." 2018-03-09 00:19:46 -06:00
Richard Mudgett e6738b79b3 Complete deprecating legacy modules.
The menuselect comment was updated to deprecate these modules but the
AST_MODULE_INFO block at the end of file was missed.

ASTERISK-27671

Change-Id: I63070b5c4d4f08af010c6034acd4793c1bcef839
2018-03-08 13:53:09 -06:00
Corey Farrell c8a521b6c8 Replace direct checks of option_debug with DEBUG_ATLEAST macro.
Checking option_debug directly is incorrect as it ignores file/module
specific debug settings.  This system-wide change replaces nearly all
direct checks for option_debug with the DEBUG_ATLEAST macro.

Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0
2018-03-07 16:03:01 -06:00
Ross Beer 88cef40f6e res_pjsip_rfc3326: Order of 'Reason' headers break many endpoints
ASTERISK-27554

Change-Id: If61c7faab7d2fa1031c056ed6268fe928e2391cf
2018-03-07 10:08:09 -06:00
lvl 3fb26df4ac res_pjsip_session: properly handle SDP from a forked call with early media
In handle_negotiated_sdp(), use session->active_media_state when
session->pending_media_state is empty.  The 200's SDP should be fed into
handle_negotiated_sdp_session_media() together with the already negotiated
state, which is now in session->active_media_state instead.  Only if both
the session's pending and active media are empty should
handle_negotiated_sdp() abort.

ASTERISK-27441

Change-Id: If0d5150ffe6f38d8a854831fef37942258d4629c
2018-03-06 13:35:22 -06:00
Alexander Traud 162fc4fba6 BuildSystem: Depend not implicitly but explicitly on external libraries.
ASTERISK-27722

Change-Id: Ie7b8c30d86cb00a54d6ac4e09e6f28f42d2bd52c
2018-03-06 14:33:14 +01:00
Alexander Traud 99b6a14737 res_http_post: Enable GMime in NetBSD.
ASTERISK-27719

Change-Id: I230c5f9f316b2e9465c093c13580f72ebbaf67a7
2018-03-05 15:15:03 +01:00
Jenkins2 debe4fe751 Merge "pjproject: Add cache_pools debugging option." 2018-03-05 08:09:11 -06:00
Richard Mudgett c711e4076a core: Remove ABI effects of MALLOC_DEBUG.
This allows asterisk to be compiled with MALLOC_DEBUG to load modules
built without MALLOC_DEBUG.  Now pre-compiled third-party modules will
still work regardless of MALLOC_DEBUG being enabled or not.

Change-Id: Ic07ad80b2c2df894db984cf27b16a69383ce0e10
2018-03-01 13:13:55 -06:00
Jenkins2 97485eefaf Merge "res_pjsip_refer.c: Fix attended transfer race condition crash." 2018-03-01 08:44:21 -06:00
Richard Mudgett 1a36a452bd pjproject: Add cache_pools debugging option.
The pool cache gets in the way of finding use after free errors of memory
pool contents.  Tools like valgrind and MALLOC_DEBUG don't know when a
pool is released because it gets put into the cache instead of being
freed.

* Added the "cache_pools" option to pjproject.conf.  Disabling the option
helps track down pool content mismanagement when using valgrind or
MALLOC_DEBUG.  The cache gets in the way of determining if the pool
contents are used after free and who freed it.

To disable the pool caching simply disable the cache_pools option in
pjproject.conf and restart Asterisk.

Sample pjproject.conf setting:
[startup]
cache_pools=no

* Made current users of the caching pool factory initialization and
destruction calls call common routines to create and destroy cached pools.

ASTERISK-27704

Change-Id: I64d5befbaeed2532f93aa027a51eb52347d2b828
2018-02-28 11:41:30 -06:00
Ben Ford 0be1c388e4 Add extended properties to rtp_engine for RTP retransmission support.
A couple of additional properties are needed in rtp_engine to enable
support for packet retransmission: AST_RTP_PROPERTY_RETRANS_RECV and
AST_RTP_PROPERTY_RETRANS_SEND. These will both be enabled automatically
if an endpoint has the webrtc option enabled. While this adds no
functionality currently, it will serve as a building block for future
changes for RTP retransmission support.

For more information, refer to the wiki page:
https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements

Change-Id: Ic598acd042a045f9d10e5bdccb66f4efc9e587cc
2018-02-23 12:56:00 -06:00
George Joseph 01510df672 Merge "res_rtp_asterisk: Fix ICE candidate nomination" 2018-02-23 08:26:50 -06:00
Richard Mudgett bb9c1938a0 res_pjsip_refer.c: Fix attended transfer race condition crash.
The transferrer's session channel was destroyed by the transferrer's
serializer thread in a race condition with the transfer target's
serializer thread during an attended transfer.  The transfer target's
serializer was attempting to clean up a deferred end status on behalf of
the transferrer's channel when it should have passed the action to the
transferrer's serializer.  When the transfer target's serializer lost the
race then both threads wind up trying to end the transferrer's session.

* Push the ast_sip_session_end_if_deferred() call onto the transferrer's
serializer to avoid a race condition that results in a crash.  The
session_end() function that could be called by
ast_sip_session_end_if_deferred() really must be executed by the
transferrer's serializer to avoid this kind of crash.

ASTERISK-27568

Change-Id: Iacda724e7cb24d7520e49b2fd7e504aa398d7238
2018-02-22 17:15:25 -06:00
Kevin Harwell 2220be2349 Merge "AST-2018-006: Properly handle WebSocket frames with 0 length payload." 2018-02-21 14:11:50 -06:00
George Joseph 5458175744 Merge "AST-2018-005: res_pjsip_transport_management: Move to core" 2018-02-21 10:42:28 -06:00
George Joseph a4db014fd6 Merge "AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)" 2018-02-21 10:42:19 -06:00
George Joseph 121cbc98cb Merge "AST-2018-005: Add a check for NULL tdata in ast_sip_failover_request" 2018-02-21 10:42:07 -06:00
Sean Bright 6436137959 AST-2018-006: Properly handle WebSocket frames with 0 length payload.
In ast_websocket_read() we were not adequately checking that the
payload_len was non-zero before passing it to ws_safe_read(). Calling
ws_safe_read with a len argument of 0 will result in a busy loop until
the underlying socket is closed.

ASTERISK-27658 #close

Change-Id: I9d59f83bc563f711df1a6197c57de473f6b0663a
2018-02-21 10:31:52 -06:00
George Joseph 758409de56 AST-2018-005: res_pjsip_transport_management: Move to core
Since res_pjsip_transport_management provides several attack
mitigation features, its functionality moved to res_pjsip and
this module has been removed.  This way the features will always
be available if res_pjsip is loaded.

ASTERISK-27618
Reported By: Sandro Gauci

Change-Id: I21a2d33d9dda001452ea040d350d7a075f9acf0d
2018-02-21 08:14:56 -07:00
George Joseph de871515ba AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)
pjsip_distributor:
   authenticate() creates a tdata and uses it to send a challenge or
   failure response.  When pjsip_endpt_send_response2() succeeds, it
   automatically decrements the tdata ref count but when it fails, it
   doesn't.  Since we weren't checking for a return status, we weren't
   decrementing the count ourselves on error and were therefore leaking
   tdatas.

res_pjsip_session:
   session_reinvite_on_rx_request wasn't decrementing the ref count
   if an error happened while sending a 491 response.
   pre_session_setup wasn't decrementing the ref count if
   while sending an error after a pjsip_inv_verify_request failure.

res_pjsip:
   ast_sip_send_response wasn't decrementing the ref count on error.

ASTERISK-27618
Reported By: Sandro Gauci

Change-Id: Iab33a6c7b6fba96148ed465b690ba8534ac961bf
2018-02-21 08:14:47 -07:00
George Joseph c53d8dcb68 AST-2018-005: Add a check for NULL tdata in ast_sip_failover_request
It was discovered that there are some corner cases where a pjsip tsx
might have no last_tx so calling ast_sip_failover_request with
a NULL last_tx as its tdata would cause a crash.

ASTERISK-27618
Reported By:  Sandro Gauci

Change-Id: Ic2b63f6d4ae617c4c19dcdec2a7a6156b54fd15b
2018-02-21 08:14:40 -07:00
Joshua Colp d424850d58 AST-2018-004: Restrict the number of Accept headers in a SUBSCRIBE.
When receiving a SUBSCRIBE request the Accept headers from it are
stored locally. This operation has a fixed limit of 32 Accept headers
but this limit was not enforced. As a result it was possible for
memory outside of the allocated space to get written to resulting
in a crash.

This change enforces the limit so only 32 Accept headers are
processed.

ASTERISK-27640
Reported By: Sandro Gauci

Change-Id: I99a814b10b554b13a6021ccf41111e5bc95e7301
2018-02-21 08:30:31 -06:00
Jenkins2 71de3deffe Merge "res_http_websocket: Don't leak memory on read failure" 2018-02-20 13:55:58 -06:00
Jenkins2 c80ecbc5ae Merge "res_pjsip_header_funcs: Various cleanups" 2018-02-19 18:02:32 -06:00
Jenkins2 f063ea650e Merge "res_pjsip: Use pjsip_sip_uri.user_param instead of other_param" 2018-02-19 08:54:56 -06:00
Thomas Guebels 4b555d7147 res_rtp_asterisk: Fix ICE candidate nomination
If the ICE role is not set right away, we might have a role conflict
that stays undetected and ICE finishing with successful tests and no
candidate nominated. This was introduced by ASTERISK-27088.

To avoid this, we set the role as soon as before but only if the ICE
state permits it: still checking and not yet nominating candidates or
completed.

ASTERISK-27646

Change-Id: I5dbc69ad63cacbb067922850fbb113d479bd729c
2018-02-19 07:38:02 -06:00
Sean Bright 8b18247af6 res_http_websocket: Don't leak memory on read failure
Change-Id: Ic449ea832bc81a1671c0e910c5fbe8c683e3da89
2018-02-19 07:24:51 -06:00
Jenkins2 ddc607f85a Merge "Deprecate legacy modules." 2018-02-19 06:59:00 -06:00
Sean Bright e4a5c9ccf4 res_pjsip_header_funcs: Various cleanups
* Prefer strcasecmp() over stricmp()
 * Use a list with no lock since we never actually lock
 * Minor cleanups to error messages

Change-Id: I8446f44795ee8f3072e1c1f9193c6912dfc0c42b
2018-02-18 08:07:17 -06:00
Sean Bright 65a4084060 res_pjsip: Endpoint destruction does not free DTLS configuration
ASTERISK-27679 #close
Reported by: Mak Dee

Change-Id: I89a2783a11be0763bf123d1619ed176b6225cf42
2018-02-16 13:38:21 -06:00
Alexander Traud 5fd59014a5 res_calendar: Specialized calendars depend on symbols of general calendar.
ASTERISK-27680

Change-Id: Ifb77912e424fe3710a025c18526fada673ec0b79
2018-02-16 13:52:37 +01:00
Sean Bright 303e43f8a6 res_pjsip: Use pjsip_sip_uri.user_param instead of other_param
There is a dedicated slot in the pjsip_sip_uri for the 'user'
parameter, so use that instead of adding to the list of generic URI
parameters.

Change-Id: I0a0ce8a60ecee27489735bf56fd707719d8c2ed6
2018-02-15 13:36:25 -06:00
Corey Farrell 9f74afbdcf Deprecate legacy modules.
* app_fax (replaced by res_fax).
* res_config_sqlite (replaced by res_config_sqlite3).
* res_monitor (replaced by app_mixmonitor).

This is related to ASTERISK~23657 but does not resolve that ticket.
Resolving that ticket would require complete removal of res_monitor.

ASTERISK-27671 #close

Change-Id: I16a3edd61fc1abd4a7b2e9357693ed663f62dd49
2018-02-13 13:56:03 -05:00
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
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