summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2017-04-12modules: change module LOAD_FAILUREs to LOAD_DECLINESGeorge Joseph
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-04-07Merge "core: Improve/simplify handling of required headers."Joshua Colp
2017-04-05pjproject_bundled: Add 3 upstream patchesGeorge Joseph
0035-r5572-svn-backport-dialog-transaction-deadlock.patch 0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch 0037-r5576-svn-backport-session-timer-crash.patch Also removed the progress bar from wget download to stdout. ASTERISK-26905 #close Reported-by: Ross Beer Change-Id: I268fb3cf71a3bb24283ff0d24bd8b03239d81256
2017-04-03core: Improve/simplify handling of required headers.Corey Farrell
* Report failures if configure finds a required header is missing. * Deduplicate includes between asterisk.h, astmm.h and compat.h. * Unconditionally include headers in compat.h if required elsewhere. Change-Id: Ie67d0185ca71fbfb81c9bdfaebe46a49e3c56dc5
2017-04-03Merge "sdp: Add support for setting connection address and clean up state."Mark Michelson
2017-03-30Forward declare 'struct ast_json' in asterisk.hCorey Farrell
The ast_json structure is used in many Asterisk headers and is often the only part of json.h used. This adds a forward declaration to asterisk.h and removes the include of json.h from many headers. The declaration has been left in endpoints.h and stasis.h to avoid problems with source files that use ast_json functions without directly including json.h. ari.h continues to include json.h as it uses enum ast_json_encoding_format. Change-Id: Id766aabce6bed56626d27e8d29f559b5e687b769
2017-03-30Merge "CEL: Remove header declarations of non-existant functions."zuul
2017-03-30sdp: Add support for setting connection address and clean up state.Joshua Colp
This change cleans up state management for media streams by moving RTP instances into their own session structure and adding additional details that are not relevant to the core (such as connection address). These can live either in the local capabilities or joint capabilities. The ability to set explicit connection address information for the purposes of direct media and NAT has also been added at the global and stream specific level. ASTERISK-26900 Change-Id: If7e5307239a9534420732de11c451a2705b6b681
2017-03-30astobj2: Prevent potential deadlocks with ao2_global_obj_releaseSean Bright
The ao2_global_obj_release() function holds an exclusive lock on the global object while it is being dereferenced. Any destructors that run during this time that call ao2_global_obj_ref() will deadlock because a read lock is required. Instead, we make the global object inaccessible inside of the write lock and only dereference it once we have released the lock. This allows the affected destructors to fail gracefully. While this doesn't completely solve the referenced issue (the error message about not being able to create an IQ continues to be shown) it does solve the backtrace spew that accompanied it. ASTERISK-21009 #close Reported by: Marcello Ceschia Change-Id: Idf40ae136b5070dba22cb576ea8414fbc9939385
2017-03-30CEL: Remove header declarations of non-existant functions.Corey Farrell
ast_cel_alloc and ast_cel_destroy do not exist in code, remove them from the headers. Change-Id: I99ce848e2e109e7d61771559f559b9e57973e45c
2017-03-29Merge "core: Remove embedded module support"George Joseph
2017-03-29Merge "channel: Remove old epoll support and fixed max number of file ↵zuul
descriptors."
2017-03-27channel: Remove old epoll support and fixed max number of file descriptors.Joshua Colp
This change removes the old epoll support which has not been used or maintained in quite some time. The fixed number of file descriptors on a channel has also been removed. File descriptors are now contained in a growable vector. This can be used like before by specifying a specific position to store a file descriptor at or using a new API call, ast_channel_fd_add, which adds a file descriptor to the channel and returns its position. Tests have been added which cover the growing behavior of the vector and the new API call. ASTERISK-26885 Change-Id: I1a754b506c009b83dfdeeb08c2d2815db30ef928
2017-03-27core: Remove embedded module supportSean Bright
This has not worked for some time and is no longer actively maintained. Change-Id: I5110b0db69c152761b58fa025cb0a53b0e544d99
2017-03-24Merge "rtp_engine: allocate RTP dynamic payloads per session"zuul
2017-03-23AMI: Updated versionKevin Harwell
Updated the AMI version for the following reason (see CHANGES for more details): The 'PJSIPShowEndpoint' command's response event of 'IdentifyDetail' now contains a new optional parameter, 'MatchHeader'. Change-Id: Ie206913ef1dcfa6a2ebe3282da2387e52d6f05b9
2017-03-22Merge "res_pjsip_session: Enable RFC3578 overlap dialing support."Joshua Colp
2017-03-22rtp_engine: allocate RTP dynamic payloads per sessionKevin Harwell
Dynamic payload types were statically defined in Asterisk. This unfortunately limited the number of dynamic payloads that could be registered. With this patch dynamic payload type numbers are now assigned dynamically and per RTP instance. However, in order to limit any issues where some clients expect the old statically defined value this patch makes it so the value Asterisk used to pre- designate is used for the dynamic assignment if available. An option, "rtp_use_dynamic", has also been added (can be set in asterisk.conf) that turns the new dynamic behavior on or off. When off it reverts back to using statically defined payload values. This option defaults to "yes" in Asterisk 15. ASTERISK-26515 #close patches: ASTERISK-26515.diff submitted by jcolp (license 5000 Change-Id: I7653465c5ebeaf968f1a1cc8f3f4f5c4321da7fc
2017-03-22res_pjsip_session: Enable RFC3578 overlap dialing support.Richard Begg
Support for RFC3578 overlap dialling (i.e. 484 Response to partially matched destinations) as currently provided by chan_sip is missing from res_pjsip. This patch adds a new endpoint attribute (allow_overlap) [defaults to yes] which when set to yes enables 484 responses to partial destination matches rather than the current 404. ASTERISK-26864 Change-Id: Iea444da3ee7c7d4f1fde1d01d138a3d7b0fe40f6
2017-03-21Merge "autochan/mixmonitor/chanspy: Fix unsafe channel locking and references."zuul
2017-03-21res_hep: Capture actual transport type in useSean Bright
Rather than hard-coding UDP, allow consumers of the HEP API to specify which protocol is in use. Update the PJSIP provider to pass in the current protocol type. ASTERISK-26850 #close Change-Id: I54bbb0a001cfe4c6a87ad4b6f2014af233349978
2017-03-20thread safety: Don't use getprotobyname()Sean Bright
POSIX does not require getprotobyname() to be thread safe and some implementations use static memory which causes issues when multiple threads are used. Further, our usage of it today is just to ultimately get IPPROTO_TCP for calls to setsockopt(). So instead we just use IPPROTO_TCP directly. Change-Id: I2e14e58674808f7ce99b2f5e900d0f90d0d8da48
2017-03-16Merge "res_pjsip: Symmetric transports"Joshua Colp
2017-03-16Merge "RFC sdp: Initial SDP creation"Joshua Colp
2017-03-16res_pjsip: Symmetric transportsGeorge Joseph
A new transport parameter 'symmetric_transport' has been added. When a request from a dynamic contact comes in on a transport with this option set to 'yes', the transport name will be saved and used for subsequent outgoing requests like OPTIONS, NOTIFY and INVITE. It's saved as a contact uri parameter named 'x-ast-txp' and will display with the contact uri in CLI, AMI, and ARI output. On the outgoing request, if a transport wasn't explicitly set on the endpoint AND the request URI is not a hostname, the saved transport will be used and the 'x-ast-txp' parameter stripped from the outgoing packet. * config_transport was modified to accept and store the new parameter. * config_transport/transport_apply was updated to store the transport name in the pjsip_transport->info field using the pjsip_transport->pool on UDP transports. * A 'multihomed_on_rx_message' function was added to pjsip_message_ip_updater that, for incoming requests, retrieves the transport name from pjsip_transport->info and retrieves the transport. If transport->symmetric_transport is set, an 'x-ast-txp' uri parameter containing the transport name is added to the incoming Contact header. * An 'ast_sip_get_transport_name' function was added to res_pjsip. It takes an ast_sip_endpoint and a pjsip_sip_uri and returns a transport name if endpoint->transport is set or if there's an 'x-ast-txp' parameter on the uri and the uri host is an ipv4 or ipv6 address. Otherwise it returns NULL. * An 'ast_sip_dlg_set_transport' function was added to res_pjsip which takes an ast_sip_endpoint, a pjsip_dialog, and an optional pjsip_tpselector. It calls ast_sip_get_transport_name() and if a non-NULL is returned, sets the selector and sets the transport on the dialog. If a selector was passed in, it's updated. * res_pjsip/ast_sip_create_dialog_uac and ast_sip_create_dialog_uas were modified to call ast_sip_dlg_set_transport() instead of their original logic. * res_pjsip/create_out_of_dialog_request was modified to call ast_sip_get_transport_name() and pjsip_tx_data_set_transport() instead of its original logic. * Existing transport logic was removed from endpt_send_request since that can only be called after a create_out_of_dialog_request. * res_pjsip/ast_sip_create_rdata was converted to a wrapper around a new 'ast_sip_create_rdata_with_contact' function which allows a contact_uri to be specified in addition to the existing parameters. (See below) * res_pjsip_pubsub/internal_pjsip_evsub_send_request was eliminated since all it did was transport selection and that is now done in ast_sip_create_dialog_uac and ast_sip_create_dialog_uas. * 'contact_uri' was added to subscription_persistence. This was necessary because although the parsed rdata contact header has the x-ast-txp parameter added (if appropriate), subscription_persistence_update stores the raw packet which doesn't have it. subscription_persistence_recreate was then updated to call ast_sip_create_rdata_with_contact with the persisted contact_uri so the recreated subscription has the correct transport info to send the NOTIFYs. * res_pjsip_session/internal_pjsip_inv_send_msg was eliminated since all it did was transport selection and that is now done in ast_sip_create_dialog_uac. * pjsip_message_ip_updater/multihomed_on_tx_message was updated to remove all traces of the x-ast-txp parameter from the outgoing headers. NOTE: This change does NOT modify the behavior of permanent contacts specified on an aor. To do so would require that the permanent contact's contact uri be updated with the x-ast-txp parameter and the aor sorcery object updated. If we need to persue this, we need to think about cloning permanent contacts into the same store as the dynamic ones on an aor load so they can be updated without disturbing the originally configured value. You CAN add the x-ast-txp parameter to a permanent contact's uri but it would be much simpler to just set endpoint->transport. Change-Id: I4ee1f51473da32ca54b877cd158523efcef9655f
2017-03-16Merge "Add rtcp-mux support"Joshua Colp
2017-03-15autochan/mixmonitor/chanspy: Fix unsafe channel locking and references.Richard Mudgett
Dereferencing struct ast_autochan.chan without first calling ast_autochan_channel_lock() is unsafe because the pointer could change at any time due to a masquerade. Unfortunately, ast_autochan_channel_lock() itself uses struct ast_autochan.chan unsafely and can result in a deadlock if the original channel happens to get destroyed after a masquerade in addition to the pointer getting changed. The problem is more likely to happen with v11 and earlier because masquerades are used to optimize out local channels on those versions. However, it could still happen on newer versions if the channel is executing a dialplan application when the channel is transferred or redirected. In this situation a masquerade still must be used. * Added a lock to struct ast_autochan to safely be able to use ast_autochan.chan while trying to get the channel lock in ast_autochan_channel_lock(). The locking order is the channel lock then the autochan lock. Locking in the other direction requires deadlock avoidance. * Fix unsafe ast_autochan.chan usages in app_mixmonitor.c. * Fix unsafe ast_autochan.chan usages in app_chanspy.c. * app_chanspy.c: Removed unused autochan parameter from next_channel(). ASTERISK-26867 Change-Id: Id29dd22bc0f369b44e23ca423d2f3657187cc592
2017-03-15Add rtcp-mux supportMark Michelson
This commit adds support for RFC 5761: Multiplexing RTP Data and Control Packets on a Single Port. Specifically, it enables the feature when using chan_pjsip. A new option, "rtcp_mux" has been added to endpoint configuration in pjsip.conf. If set, then Asterisk will attempt to use rtcp-mux with whatever it communicates with. Asterisk follows the rules set forth in RFC 5761 with regards to falling back to standard RTCP behavior if the far end does not indicate support for rtcp-mux. The lion's share of the changes in this commit are in res_rtp_asterisk.c. This is because it was pretty much hard wired to have an RTP and an RTCP transport. The strategy used here is that when rtcp-mux is enabled, the current RTCP transport and its trappings (such as DTLS SSL session) are freed, and the RTCP session instead just mooches off the RTP session. This leads to a lot of specialized if statements throughout. ASTERISK-26732 #close Reported by Dan Jenkins Change-Id: If46a93ba1282418d2803e3fd7869374da8b77ab5
2017-03-14RFC sdp: Initial SDP creationGeorge Joseph
* Added additional fields to ast_sdp_options. * Re-organized ast_sdp. * Updated field names to correspond to RFC4566 terminology. * Created allocs/frees for SDP children. * Created getters/setters for SDP children where appropriate. * Added ast_sdp_create_from_state. * Refactored res_sdp_translator_pjmedia for changes. Change-Id: Iefbd877af7f5a4d3c74deead1bff8802661b0d48
2017-03-07core: Add stream topology changing primitives with tests.Joshua Colp
This change adds a few things to facilitate stream topology changing: 1. Control frame types have been added for use by the channel driver to notify the application that the channel wants to change the stream topology or that a stream topology change has been accepted. They are also used by the indicate interface to the channel that the application uses to indicate it wants to do the same. 2. Legacy behavior has been adopted in ast_read() such that if a channel requests a stream topology change it is denied automatically and the current stream topology is preserved if the application is not capable of handling streams. Tests have also been written which confirm the multistream and non-multistream behavior. ASTERISK-26839 Change-Id: Ia68ef22bca8e8457265ca4f0f9de600cbcc10bc9
2017-03-01Merge "stream: Unit tests for stream read and tweaks framework"Joshua Colp
2017-03-01stream: Unit tests for stream read and tweaks frameworkGeorge Joseph
* Removed the AST_CHAN_TP_MULTISTREAM tech property. We now rely on read_stream being set to indicate a multi stream channel. * Added ast_channel_is_multistream convenience function. * Fixed issue where stream and default_stream weren't being set on a frame retrieved from the queue. * Now testing for NULL being returned from the driver's read or read_stream callback. * Fixed issue where the dropnondefault code was crashing on a NULL f. * Now enforcing that if either read_stream or write_stream are set when ast_channel_tech_set is called that BOTH are set. * Added the unit tests. ASTERISK-26816 Change-Id: If7792b20d782e71e823dabd3124572cf0a4caab2
2017-03-01SDP: Add initial SDP state machine.Mark Michelson
This introduces and documents the various states in the state machine. This also introduces API functions that induce state changes, and places TODO comments telling what needs to be done in addition to what is already there. Those TODOs will be replaced with real code in upcoming changes. Change-Id: I871c0eb480b4c84d83e91ac5628e7a673e8b89ed
2017-02-27bridge_native_rtp: Handle case where channel joins already suspended.Joshua Colp
The bridge_native_rtp module did not properly handle the case where a smart bridge operation occurs while a channel is suspended. In this scenario the module would incorrectly set up local or remote RTP bridging despite the media having to flow through Asterisk. The remote endpoint would see two media streams and experience wonky audio. The module has been changed so that it ensures both channels are not suspended when performing the native RTP bridging and this requirement has been documented in the bridge technology. ASTERISK-26781 Change-Id: Id4022d73ace837d4a293106445e3ade10dbc7c7c
2017-02-27Merge "channel: Add ast_read_stream function for reading frames from all ↵George Joseph
streams."
2017-02-24Merge "Binaural synthesis (confbridge): Adds binaural synthesis to ↵Joshua Colp
bridge_softmix."
2017-02-24Merge "channel: Add support for writing to a specific stream."zuul
2017-02-24channel: Add ast_read_stream function for reading frames from all streams.Joshua Colp
This change introduces an ast_read_stream function and callback in the channel technology which allows reading frames from all streams and not just the default streams. The stream number has also been added to frames. This is to allow the case where frames are queued onto the channel instead of being read directly from the driver. This change does impose a restriction on reading though: a chain of frames can only contain frames from the same stream. ASTERISK-26816 Change-Id: I5d7dc35e86694df91fd025126f6cfe0453aa38ce
2017-02-23channel: Add support for writing to a specific stream.Joshua Colp
This change adds an ast_write_stream function which allows writing a frame to a specific media stream. It also moves ast_write() to using this underneath by writing media frames provided to it to the default streams of the channel. Existing functionality (such as audiohooks, framehooks, etc) are limited to being applied to the default stream only. Unit tests have also been added which test the behavior of both non-multistream and multistream channels to confirm that the write() and write_stream() callbacks are invoked appropriately. ASTERISK-26793 Change-Id: I4df20d1b65bd4d787fce0b4b478e19d2dfea245c
2017-02-23Binaural synthesis (confbridge): Adds binaural synthesis to bridge_softmix.frahaase
Adds binaural synthesis to bridge_softmix (via convolution using libfftw3). Binaural synthesis is conducted at 48kHz. For a conference, only one spatial representation is rendered. The default rendering is applied for mono-capable channels. ASTERISK-26292 Change-Id: Iecdb381b6adc17c961049658678f6219adae1ddf
2017-02-22Merge "core: Show streams in "core show channel"."zuul
2017-02-22Merge "Add initial SDP state code."Joshua Colp
2017-02-22core: Show streams in "core show channel".Joshua Colp
The "core show channel" CLI command will now output the streams present on the channel with their details. ASTERISK-26811 Change-Id: I9c95b57aa09415005f0677a1949a0feb07e4987a
2017-02-22Merge "realtime: Centralize some common realtime backend code"Joshua Colp
2017-02-21Add initial SDP state code.Mark Michelson
This establishes the basic allocation/destruction of an SDP state object, plus some of the simpler getter methods involved. Subsequent tasks will deal with adding a state machine, creating SDPs from capabilities and options, and merging SDPs into a joint SDP. Change-Id: Ie3757ce186f04b65e9d1883f5aace53f24e53709
2017-02-21Merge changes from topic 'sdp_state_beginnings'Joshua Colp
* changes: Add SDP translator and PJMEDIA implementation. Add initial SDP options.
2017-02-21realtime: Centralize some common realtime backend codeSean Bright
All of the realtime backends create artificial ast_categorys to pass back into the core as query results. These categories have no filename or line number information associated with them and the backends differ slightly on how they create them. So create a couple helper macros to help make things more consistent. Also updated the call sites to remove redundant error messages about memory allocation failure. Note that res_config_ldap sets the category filename to the 'table name' but that is not read by anything in the core, so I've dropped it. Change-Id: I3a1fd91e0c807dea1ce3b643b0a6fe5be9002897
2017-02-20Merge "Binaural synthesis (confbridge): Adds ↵Joshua Colp
utils/conf_bridge_binaural_hrir_importer"
2017-02-17Add SDP translator and PJMEDIA implementation.Mark Michelson
This creates the following: * Asterisk's internal representation of an SDP * An API for translating SDPs from one format to another * An implementation of a translator for PJMEDIA Change-Id: Ie2ecd3cbebe76756577be9b133e84d2ee356d46b
2017-02-17Add initial SDP options.Mark Michelson
This is step one of adding an SDP API: defining some configurable settings for SDPs. This is based on options that are currently supported in Asterisk. Change-Id: I1ede91aafed403b12a9ccdfb91a88389baa7e5d7