summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2017-05-08Merge "stream: ast_stream_clone() cannot copy the opaque user data."Joshua Colp
2017-05-08Merge "bridge: Fix returning to dialplan when executing Bridge() from AMI."Joshua Colp
2017-05-05stream: ast_stream_clone() cannot copy the opaque user data.Richard Mudgett
ast_stream_clone() cannot copy the opaque user data stored on a stream. We don't know how to clone the data so it isn't copied into the clone. Change-Id: Ia51321bf38ecbfdcc53787ca77ea5fd2cabdf367
2017-05-04Merge "SDP: Replace SDP telephone_event option with dtmf option"Jenkins2
2017-05-04bridge: Fix returning to dialplan when executing Bridge() from AMI.Joshua Colp
When using the Bridge AMI action on the same channel multiple times it was possible for the channel to return to the wrong location in the dialplan if the other party hung up. This happened because the priority of the channel was not preserved across each action invocation and it would fail to move on to the next priority in other cases. This change makes it so that the priority of a channel is preserved when taking control of it from another thread and it is incremented as appropriate such that the priority reflects where the channel should next be executed in the dialplan, not where it may or may not currently be. The Bridge AMI action was also changed to ensure that it too starts the channels at the next location in the dialplan. ASTERISK-24529 Change-Id: I52406669cf64208aef7252a65b63ade31fbf7a5a
2017-05-03bridge_simple: Added support for streamsKevin Harwell
This patch is the first cut at adding stream support to the bridging framework. Changes were made to the framework that allows mapping of stream topologies to a bridge's supported media types. The first channel to enter a bridge initially defines the media types for a bridge (i.e. a one to one mapping is created between the bridge and the first channel). Subsequently added channels merge their media types into the bridge's adding to it when necessary. This allows channels with different sized topologies to map correctly to each other according to media type. The bridge drops any frame that does not have a matching index into a given write stream. For now though, bridge_simple will align its two channels according to size or first to join. Once both channels join the bridge the one with the most streams will indicate to the other channel to update its streams to be the same as that of the other. If both channels have the same number of streams then the first channel to join is chosen as the stream base. A topology change source was also added to a channel when a stream toplogy change request is made. This allows subsystems to know whether or not they initiated a change request. Thus avoiding potential recursive situations. ASTERISK-26966 #close Change-Id: I1eb5987921dd80c3cdcf52accc136393ca2d4163
2017-05-02SDP: Replace SDP telephone_event option with dtmf optionRichard Mudgett
The telephone_event option was used as a flag and a bit mapped value in different places when it is a boolean. It is also inadequate to configure the DTMF operation of the RTP instance created for the stream. Change-Id: Ib1addeaf0ce86f07039f2f979cab29405dc5239b
2017-05-02Merge "SDP: Make SDP translation to/from internal representation more const."Joshua Colp
2017-05-02Merge "stream: Make ast_stream_topology_create_from_format_cap() allow NULL ↵Joshua Colp
cap."
2017-05-01Merge "SDP: Make ast_sdp_state_set_remote_sdp() return error."Jenkins2
2017-05-01Merge "SDP: Misc cleanups (Mostly memory leaks)"Jenkins2
2017-05-01Merge "SDP API: Add SSRC-level attributes"Jenkins2
2017-04-27SDP: Make SDP translation to/from internal representation more const.Richard Mudgett
Change-Id: I473a174b869728604b37c60853896b0c458bc504
2017-04-27stream: Make ast_stream_topology_create_from_format_cap() allow NULL cap.Richard Mudgett
Change-Id: Ie29760c49c25d7022ba2124698283181a0dd5d08
2017-04-27SDP: Make ast_sdp_state_set_remote_sdp() return error.Richard Mudgett
Change-Id: I7707c9d872c476d897ff459008652b35142a35e1
2017-04-27SDP: Misc cleanups (Mostly memory leaks)Richard Mudgett
Change-Id: I74431b385da333f2c5f5a6d7c55e70b69a4f05d2
2017-04-27Merge "channel: Add ability to request an outgoing channel with stream ↵Jenkins2
topology."
2017-04-27Merge "res_pjsip_session: Add cleanup to ast_sip_session_terminate"Jenkins2
2017-04-27Merge "vector: defaults and indexes"Jenkins2
2017-04-27SDP API: Add SSRC-level attributesMark Michelson
RFC 5576 defines how SSRC-level attributes may be added to SDP media descriptions. In general, this is useful for grouping related SSRCes, indicating SSRC-level format attributes, and resolving collisions in RTP SSRC values. These attributes are used widely by browsers during WebRTC communications, including attributes defined by documents outside of RFC 5576. This commit introduces the addition of SSRC-level attributes into SDPs generated by Asterisk. Since Asterisk does not tend to use multiple SSRCs on a media stream, the initial support is minimal. Asterisk includes an SSRC-level CNAME attribute if configured to do so. This at least gives browsers (and possibly others) the ability to resolve SSRC collisions at offer-answer time. In order to facilitate this, the RTP engine API has been enhanced to be able to retrieve the SSRC and CNAME on a given RTP instance. res_rtp_asterisk currently does not provide meaningful CNAME values in its RTCP SDES items, and therefore it currently will always return an empty string as the CNAME value. A task in the near future will result in res_rtp_asterisk generating more meaningful CNAMEs. Change-Id: I29e7f23e7db77524f82a3b6e8531b1195ff57789
2017-04-27res_pjsip_session: Add cleanup to ast_sip_session_terminateGeorge Joseph
If you use ast_request to create a PJSIP channel but then hang it up without causing a transaction to be sent, the session will never be destroyed. This is due ot the fact that it's pjproject that triggers the session cleanup when the transaction ends. app_chanisavail was doing this to get more granular channel state and it's also possible for this to happen via ARI. * ast_sip_session_terminate was modified to explicitly call the cleanup tasks and unreference session if the invite state is NULL AND invite_tsx is NULL (meaning we never sent a transaction). * chan_pjsip/hangup was modified to bump session before it calls ast_sip_session_terminate to insure that session stays valid while it does its own cleanup. * Added test events to session_destructor for a future testsuite test. ASTERISK-26908 #close Reported-by: Richard Mudgett Change-Id: I52daf6f757184e5544c261f64f6fe9602c4680a9
2017-04-27channel: Add ability to request an outgoing channel with stream topology.Joshua Colp
This change extends the ast_request functionality by adding another function and callback to create an outgoing channel with a requested stream topology. Fallback is provided by either converting the requested stream topology into a format capabilities structure if the channel driver does not support streams or by converting the requested format capabilities into a stream topology if the channel driver does support streams. The Dial application has also been updated to request an outgoing channel with the stream topology of the calling channel. ASTERISK-26959 Change-Id: Ifa9037a672ac21d42dd7125aa09816dc879a70e6
2017-04-27Merge "sdp: Add support for T.38"Joshua Colp
2017-04-27Merge "SDP: Ensure SDPs "merge" properly."Joshua Colp
2017-04-26vector: defaults and indexesKevin Harwell
Added an pre-defined integer vector declaration. This makes integer vectors easier to declare and pass around. Also, added the ability to default a vector up to a given size with a default value. Lastly, added functionality that returns the "nth" index of a matching value. Also, updated a unit test to test these changes. Change-Id: Iaf4b51b2540eda57cb43f67aa59cf1d96cdbcaa5
2017-04-26Merge "res_pjsip_sdp_rtp: No rtpmap for static RTP payload IDs in SDP."Jenkins2
2017-04-25sdp: Add support for T.38Joshua Colp
This change adds a T.38 format which can be used in a stream topology to specify that a UDPTL stream needs to be created. The SDP API has been changed to understand T.38 and create the UDPTL session, add the attributes, and parse the attributes. This change does not change the boundary of the T.38 state machine. It is still up to the channel driver to implement and act on it (such as queueing control frames or reacting to them). ASTERISK-26949 Change-Id: If28956762ccb8ead562ac6c03d162d3d6014f2c7
2017-04-25SDP: Ensure SDPs "merge" properly.Mark Michelson
The gist of this work ensures that when a remote SDP is received, it is merged properly with the local capabilities. The remote SDP is converted into a stream topology. That topology is then merged with the current local topology on the SDP state. That new merged topology is then used to create an SDP. Finally, adjustments are made to RTP instances based on knowledge gained from the remote SDP. There are also a battery of tests in this commit that ensure that some basic SDP merges work as expected. While this may not sound like a big change, it has the property that it caused lots of ancillary changes. * The remote SDP is no longer stored on the SDP state. Biggest reason: there's no need for it. The remote SDP is used at the time it is being set and nowhere else. * Some new SDP APIs were added in order to find attributes and convert generic SDP attributes into rtpmap structures. * Writing tests made me realize that retrieving a value from an SDP options structure, the SDP options needs to be made const. * The SDP state machine was essentially gutted by a previous commit. Initially, I attempted to reinstate it, but I found that as it had been defined, it was not all that useful. What was more useful was knowing the role we play in SDP negotiation, so the SDP state machine has been transformed into an indicator of role. * Rather than storing separate local and joint stream state capabilities, it makes more sense to keep track of current stream state and update it as things change. Change-Id: I5938c2be3c6f0a003aa88a39a59e0880f8b2df3d
2017-04-24core: Use eventfd for alert pipes on Linux when possibleSean Bright
The primary win of switching to eventfd when possible is that it only uses a single file descriptor while pipe() will use two. This means for each bridge channel we're reducing the number of required file descriptors by 1, and - if you're using timerfd - we also now have 1 less file descriptor per Asterisk channel. The API is not ideal (passing int arrays), but this is the cleanest approach I could come up with to maintain API/ABI. I've also removed what I believe to be an erroneous code block that checked the non-blocking flag on the pipe ends for each read. If the file descriptor is 'losing' its non-blocking mode, it is because of a bug somewhere else in our code. In my testing I haven't seen any measurable difference in performance. Change-Id: Iff0fb1573e7f7a187d5211ddc60aa8f3da3edb1d
2017-04-13Merge "modules: change module LOAD_FAILUREs to LOAD_DECLINES"zuul
2017-04-13res_pjsip_sdp_rtp: No rtpmap for static RTP payload IDs in SDP.Alexander Traud
This saves around 100 bytes when G.711, G.722, G.729, and GSM are advertised in SDP. This reduces the chance to hit the MTU bearer of 1300 bytes for SIP over UDP, if many codecs are allowed in Asterisk. This new feature is enabled together with the optional feature compact_headers=yes via the file pjsip.conf. ASTERISK-26932 #close Change-Id: Iaa556ab4c8325cd34c334387ab2847fab07b1689
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-11strings.h: Avoid overflows in the string hash functionsTorrey Searle
On 2's compliment machines abs(INT_MIN) behavior is undefined and results in a negative value still being returnd. This results in negative hash codes that can result in crashes. ASTERISK-26528 #close Change-Id: Idff550145ca2133792a61a2e212b4a3e82c6517b
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