summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2016-11-14Revert "Revert "AGI: Only defer frames when in an interception routine.""George Joseph
This reverts commit 6bce938c2fcb60b7a77a0e997a6518860c0bfa39. Change-Id: Iadbf462bf2a52e8b2fa9ebc75b37b1f688ba51d9
2016-11-14Merge "res_pjsip.c: Rework endpt_send_request() req_wrapper code."Joshua Colp
2016-11-14Merge "res_pjsip: Fix tdata leaks in off nominal paths."Joshua Colp
2016-11-11res_pjsip_sdp_rtp: Reject offer of required SRTP without res_srtp.Joshua Colp
When optimistic SRTP was on it was possible for us to still set up a call without an audio stream if an offer was received with required SRTP. This change makes it so this scenario will now fail with a 488 response. ASTERISK-26575 Change-Id: I7d14187037681f48879bd20319ac79d0877318f3
2016-11-11Merge "res_pjsip: Perform resolution when explicit IPv6 transport is used."Joshua Colp
2016-11-10res_pjsip.c: Rework endpt_send_request() req_wrapper code.Richard Mudgett
* Don't hold the req_wrapper lock too long in endpt_send_request(). We could block the PJSIP monitor thread if the timeout timer expires. sip_get_tpselector_from_endpoint() does a sorcery access that could take awhile accessing a database. pjsip_endpt_send_request() might take awhile if selecting a transport. * Shorten the time that the req_wrapper lock is held in the callback functions. * Simplify endpt_send_request() req_wrapper->timeout code. * Removed some redundant req_wrapper->timeout_timer->id assignments. Change-Id: I3195e3a8e0207bb8e7f49060ad2742cf21a6e4c9
2016-11-10res_pjsip: Fix tdata leaks in off nominal paths.Richard Mudgett
Change-Id: Ie83e06e88c2d60157775263b07e40b61718ac97b
2016-11-10res_pjsip_registrar_expire.c: Remove extra linefeed in debug message.Richard Mudgett
Change-Id: I1f9adb911f23376503396ec8867e8005b755eb94
2016-11-10res_pjsip: Perform resolution when explicit IPv6 transport is used.Joshua Colp
This change fixes the SIP resolver such that if an IPv6 transport is explicitly used it will resolve NAPTR, SRV, and AAAA records. You can explicitly use one by specifying it on an endpoint. ASTERISK-26571 Change-Id: I2ed3ce81b43a6a8a937c0ebc1b8ed2da5ac2ef36
2016-11-10Merge "Revert "AGI: Only defer frames when in an interception routine.""George Joseph
2016-11-10Revert "AGI: Only defer frames when in an interception routine."George Joseph
This reverts commit 28926d1c81540bbeb16802814d3f2e63c2347bd2. Multiple testsuite failures were detected after the fact. Change-Id: I8d4f5ccbb421a351d616254844ae7e5a31053edb
2016-11-09res_pjsip_session: Do not call session supplements when it's too late.Mark Michelson
res_pjsip_sesssion was hooking into transaction and invite state changes. One of the reasons for doing so was due to the PJSIP_EVENT_TX_MSG event. The idea was that we were hooking into the message sending process, and so we should call session supplements to alter the outgoing message. In reality, this event was meant to indicate that the message either a) had already been sent, or b) required a DNS lookup and would be sent when the DNS query completed. In case (a), this meant we were altering an already-sent request/response for no reason. In case (b), this potentially meant we could be trying to alter a request/response at the same time that the DNS resolution completed. In this case, it meant we might be stomping on memory being used by the thread actually sending the message. This caused potential crashes and memory corruption. This patch removes the calls to session supplements from the case where the PJSIP_EVENT_TX_MSG event occurs. In all of these cases, trying to alter the message at this point is too late, and it can cause nothing but harm to try to do it. Because there were no longer any calls to the handle_outgoing() function, it has been removed. Change-Id: Ibcc223fb1c3a237927f38754e0429e80ee301e92
2016-11-08AGI: Only defer frames when in an interception routine.Mark Michelson
AGI recently was modified to defer important frames. This was because when AGI was used in a connected line interception routine, the resulting connected line frame would end up getting discarded by the AGI. However, this caused bad behavior in other cases. Specifically, during a transfer, if someone attempted to manually set the Caller ID on a channel in an AGI, the deferred connected line frame would end up overwriting what had been manually set in the AGI. Since the initial issue was specific to interception routines, this change removes the manual frame deferral from AGI and instead uses the new frame deferral API in interception routines. ASTERISK-26343 #close Reported by Morton Tryfoss Change-Id: Iab7d39436d0ee99bfe32ad55ef91e9bd88db4208
2016-11-08Merge "res_http_websocket: Increase the buffer size for non-LOW_MEMORY systems"Joshua Colp
2016-11-08Merge "res_stasis: Don't unsubscribe from a NULL bridge."Joshua Colp
2016-11-08Merge "stasis_recording/stored: remove calls to deprecated readdir_r function."Joshua Colp
2016-11-07res_stasis: Don't unsubscribe from a NULL bridge.Joshua Colp
A NULL bridge has special meaning in res_stasis for unsubscribing. It means that a subscription to ALL bridges should be removed. This should not be done as part of the normal subscription management in the res_stasis channel loop. ASTERISK-26468 Change-Id: I6d5bea8246dd13a22ef86b736aefbf2a39c15af0
2016-11-04res_http_websocket: Increase the buffer size for non-LOW_MEMORY systemsMatt Jordan
Not surprisingly, using Respoke (and possibly other systems) it is possible to blow past the 16k limit for a WebSocket packet size. This patch bumps it up to 32k, which, at least for Respoke, is sufficient. For now. Because 32k is laughable on a LOW_MEMORY system (as is 16k, for that matter), this patch adds a LOW_MEMORY directive that sets the buffer to 8k for systems who have asked for their reduced memory availability to be considered. Change-Id: Id235902537091b58608196844dc4b045e383cd2e
2016-11-04res_stasis: Set a video source mode on Stasis created bridgesMatt Jordan
When a bridge is created via ARI (through res_stasis), no video source mode is set by default. As a result, any endpoint sending video media won't ever see any video reflected back to it. This patch defaults a bridge to a 'follow the talker' video mode. Further work can be done to add routes that allow for the video mode to be controlled through the /bridges resource. Change-Id: I7e9d530a5d7a97a4524a9ee4e468e1a6b3443866
2016-11-04stasis_recording/stored: remove calls to deprecated readdir_r function.Kevin Harwell
The readdir_r function has been deprecated and should no longer be used. This patch removes the readdir_r dependency (replaced it with readdir) and also moves the directory search code to a more centralized spot (file.c) Also removed a strict dependency on the dirent structure's d_type field as it is not portable. The code now checks to see if the value is available. If so, it tries to use it, but defaults back to using the stats function if necessary. Lastly, for most implementations of readdir it *should* be thread-safe to make concurrent calls to it as long as different directory streams are specified. glibc falls into this category. However, since it is possible that there exist some implementations that are not safe, locking has been added for those other than glibc. ASTERISK-26412 ASTERISK-26509 #close Change-Id: Id8f54689b1e2873e82a09d0d0d2faf41964e80ba
2016-11-02Merge "res_pjsip_sdp_rtp: Limit number of formats to defined maximum."Joshua Colp
2016-11-01Merge "res_pjsip_outbound_publish: Fix crash when publishing device state."Joshua Colp
2016-11-01res_pjsip_sdp_rtp: Limit number of formats to defined maximum.Joshua Colp
The res_pjsip_sdp_rtp module did not restrict the number of formats added to a media stream in the SDP to the defined limit. If allow=all was used with additional loaded codecs this could result in the next media stream being overwritten some. This change restricts the module to limit it to the defined maximum and also increases the maximum in our bundled pjproject. ASTERISK-26541 #close Change-Id: I0dc5f59d3891246cafa2f3df5ec406f088559ee8
2016-11-01res/stasis: Add CLI commands for displaying/debugging ARI appsMatt Jordan
This patch adds three new CLI commands: - ari show apps: list the registered ARI applications - ari show app: show detailed information about an ARI application - ari set debug: dump events being sent to an ARI application Note that while these CLI commands live in the res_stasis module, we use the 'ari' family for these commands. This was done as most users of Asterisk aren't aware of the semantic differences between ARI and res_stasis, and some 'ari' CLI commands already exist. ASTERISK-26488 #close Change-Id: I51ad6ff0cabee0d69db06858c13f18b1c513c9f5
2016-10-28res_pjsip_outbound_publish: Fix crash when publishing device state.mkrokosz
While publishing device state between multiple instances of Asterisk, a crash will sporadically occur under high CPS which looks to be a race condition operating on the publisher queue. ASTERISK-26506 Change-Id: I28da25d346deb358eff1d563485cabc433ce1ed6
2016-10-27Merge "Remove ASTERISK_REGISTER_FILE."zuul
2016-10-27Merge "res_pjsip_sdp_rtp: Fix address family of explicit media_address."zuul
2016-10-27Merge "pjsip: Fix a few media bugs with reinvites and asymmetric payloads."Joshua Colp
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls.Joshua Colp
The res_pjsip_caller_id module wrongly assumed that a saved From header would always exist on sessions. This is true until an inbound call is received and a session timer causes an UPDATE to be sent. In this case there will be no saved From header and a crash will occur. This change makes it fall back to the From header of the outgoing request if no saved From header is present. ASTERISK-26307 #close Change-Id: Iccc3bc8d243b5ede9b81abf960292930c908d4fa
2016-10-26pjsip: Fix a few media bugs with reinvites and asymmetric payloads.Joshua Colp
When channel format changes occurred as a result of an RTP re-negotiation the bridge was not informed this had happened. As a result the bridge technology was not re-evaluated and the channel may have been in a bridge technology that was incompatible with its formats. The bridge is now unbridged and the technology re-evaluated when this occurs. The chan_pjsip module also allowed asymmetric codecs for sending and receiving. This did not work with all devices and caused one way audio problems. The default has been changed to NOT do this but to match the sending codec to the receiving codec. For users who want asymmetric codecs an option has been added, asymmetric_rtp_codec, which will return chan_pjsip to the previous behavior. The codecs returned by the chan_pjsip module when queried by the bridge_native_rtp module were also not reflective of the actual negotiated codecs. The nativeformats are now returned as they reflect the actual negotiated codecs. ASTERISK-26423 #close Change-Id: I6ec88c6e3912f52c334f1a26983ccb8f267020dc
2016-10-26res_pjsip_sdp_rtp: Fix address family of explicit media_address.Joshua Colp
When an explicit media_address is provided the address family in the SDP needs to be set to reflect it. ASTERISK-26309 Change-Id: Ib9350cc91c120eb2f96f0623d3907d12af67eb79
2016-10-25Merge "pjsip: Support dual stack automatically."Joshua Colp
2016-10-23pjsip: Support dual stack automatically.Joshua Colp
This change adds support for dual stack automatically. No configuration is required and the IP address and version in the SIP messages and SDP will be automatically changed based on the transport over which the message is being sent. RTP usage has also been changed to listen on both IPv4 and IPv6 simultaneously to allow media to flow, and to allow ICE support on both simultaneously. This also allows failover between IPv6 and IPv4 to work as expected. ASTERISK-26309 #close Change-Id: I235a421d8f9a326606d861b449fa6fe3a030572d
2016-10-20ARI: Add duplicate channel ID checking for channel creation.Mark Michelson
This is similar to what is done for origination, but for the 14 and up channel creation method. When attempting to create a channel, if a channel ID is specified and a channel already exists with that ID, then a 409 is returned. Change-Id: I77f9253278c6947939c418073b6b31065489187c
2016-10-20ARI: Detect duplicate channel IDsMark Michelson
ARI and AMI allow for an explicit channel ID to be specified when originating channels. Unfortunately, there is nothing in place to prevent someone from using the same ID for multiple channels. Further complicating things, adding ID validation to channel allocation makes it impossible for ARI to discern why channel allocation failed, resulting in a vague error code being returned. The fix for this is to institute a new method for channel errors to be discerned. The method mirrors errno, in that when an error occurs, the caller can consult the channel errno value to determine what the error was. This initial iteration of the feature only introduces "unknown" and "channel ID exists" errors. However, it's possible to add more errors as needed. ARI uses this feature to determine why channel allocation failed and can return a 409 error during origination to show that a channel with the given ID already exists. ASTERISK-26421 Change-Id: Ibba7ae68842dab6df0c2e9c45559208bc89d3d06
2016-10-19res_rtp_asterisk: Add ice_blacklist optionMichael Walton
Introduces ice_blacklist configuration in rtp.conf. Subnets listed in the form ice_blacklist = <subnet spec>, e.g. ice_blacklist = 192.168.1.0/255.255.255.0, are excluded from ICE host, srflx and relay discovery. This is useful for optimizing the ICE process where a system has multiple host address ranges and/or physical interfaces and certain of them are not expected to be used for RTP. Multiple ice_blacklist configuration lines may be used. If left unconfigured, all discovered host addresses are used, as per previous behavior. Documention in rtp.conf.sample. ASTERISK-26418 #close Change-Id: Ibee88f80d7693874fda1cceaef94a03bd86012c9
2016-10-18ari: Update model validator based on addition of asterisk_id.Joshua Colp
ASTERISK-26470 Change-Id: I9c386f7a1c7d969161b28f189eb6298bbc5b7541
2016-10-17res/ari: Add the Asterisk EID field to outgoing eventsMatt Jordan
This patch adds the Asterisk EID field to all outgoing ARI events. Because this field should be added to all events as they are transmitted, it is appended to the JSON message just prior to it being handed off to the application message handler. This makes it somewhat resilient to both new events being added to ARI, as well as other potential event transport mechanisms. ASTERISK-26470 #close Change-Id: Ieff0ecc24464e83f3f44e9c3e7bd9a5d70b87a1d
2016-10-13Audit ast_json_pack() calls for needed UTF-8 checks.Richard Mudgett
Added needed UTF-8 checks before constructing json objects in various files for strings obtained outside the system. In this case string values from a channel driver's peer and not from the user setting channel variables. * aoc.c: Fixed type mismatch in s_to_json() for time and granularity json object construction. ASTERISK-26466 Reported by: Richard Mudgett Change-Id: Iac2d867fa598daba5c5dbc619b5464625a7f2096
2016-10-12res_fax: Fix a tight race condition causing fax to crash in audio fallbackTorrey Searle
When T.38 gets rejected and G711 failback occurs there is a period of time where neither AST_FAX_TECH_T38 nor AST_FAX_TECH_AUDIO is set, leading to a crash. Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
2016-10-11Merge "res_calendar: Add support for fetching calendars when reloading"zuul
2016-10-10res_rtp_asterisk: Fix infinite DTMF issue when switching to P2P bridgeTorrey Searle
If a bridge switched to P2P when a DTMF was in progress it was possible for the DTMF to continue being sent indefinitely. Change-Id: I7e2a3efe0d59d4b214ed50cd0b5d0317e2d92e29
2016-10-10res_pjsip_config_wizard: Memory leak in module_unloadBadalyan Vyacheslav
Fixed a memory leak. It removes only the first element. Added a useful feature in vector.h to remove all items under the CMP through a callback function / macro. ASTERISK-26453 #close Change-Id: I84508353463456d2495678f125738e20052da950
2016-10-10res_calendar: Add support for fetching calendars when reloadingLudovic Gasc (GMLudo)
We use a lot res_calendar, we are very happy with that, especially because you use libical, the almost alone opensource library that supports really ical format with all types of recurrency. Nevertheless, some features are missed for our business use cases. This first patch adds a new option in calendar.conf: fetch_again_at_reload. Be my guest for a better name. If it's true, when you'll launch "module reload res_calendar.so", Asterisk will download again the calendar. The business use case is that we have a WebUI with a scheduler planner, we know when the calendars are modified. For now, we need to define 1 minute of timeout to have a chance that our user doesn't wait too long between the modification and the real test. But it generates a lot of useless HTTP traffic. ASTERISK-26422 #close Change-Id: I384b02ebfa42b142bbbd5b7221458c7f4dee7077
2016-09-27Merge "codec_opus: Replace res_format_attr_opus with the one from codec_opus"George Joseph
2016-09-27codec_opus: Replace res_format_attr_opus with the one from codec_opusGeorge Joseph
Preparation ASTERISK-26409 Change-Id: I9f20e7cce00c32464d9a180e81283d49d199d0a3 (cherry picked from commit 59f7662a93bf9c07204fb50e1020a0f5bfbbd5c9)
2016-09-25build_tools: Add ability to download variants to download_externalsGeorge Joseph
Some external packages have multiple variants that apply to different builds of asterisk. The DPMA for instance has a "bundled" variant that needs to be downloaded if asterisk was configured with --with-pjproject-bundled. There are 2 ways to specify variants: If you need the user to make the decision about which variant to download, simply create multiple menuselect "member" entries like so... <member name="res_digium_phone" displayname="..snipped.."> <support_level>external</support_level> <depend>xmlstarlet</depend> <depend>bash</depend> <defaultenabled>no</defaultenabled> </member> <member name="res_digium_phone-bundled" displayname="..snipped.."> <support_level>external</support_level> <depend>xmlstarlet</depend> <depend>bash</depend> <defaultenabled>no</defaultenabled> </member> Note that the second entry has "-<variant>" appended to the name. You can then use the existing menuselect facilities to restrict which members to enable or disable. Youy probably don't want the user to enable multiple at the same time. If you want to hide the details of the variants, the better way to do it is to create 1 member with "variant" elements. <member name="res_digium_phone" displayname="..snipped.."> <support_level>external</support_level> <depend>xmlstarlet</depend> <depend>bash</depend> <defaultenabled>no</defaultenabled> <member_data> <downloader> <variants> <variant tag="bundled" condition='[[ "$PJPROJECT_BUNDLED" = "yes" ]]'/> </variants> </downloader> </member_data> </member> The condition must be a bash expression suitable for use with an "if" statement. Any environment variable can be used plus those available in makeopts. In this case, if asterisk was configured with --with-pjproject-bundled the bundled variant will be automatically downloaded. Otherwise the normal version will be downloaded. Change-Id: I4de23e06d4492b0a65e105c8369966547d0faa3e
2016-09-21res_odbc: Make pooling option deprecation notice more useful.Joshua Colp
This changes the notice for the deprecation of the old pooling options to point to the new option for doing pooling. This gives a clearer direction as to what to look into. ASTERISK-26389 #close Change-Id: I2ca9cdfdcd75aec170a7db9d5ff69a4cd25b7c10
2016-09-20Merge "res_pjsip_multihomed: Change Contact port to listening port."zuul