summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2016-10-14Merge "Audit ast_json_pack() calls for needed UTF-8 checks." into 13zuul
2016-10-14Merge "json: Check party id name, number, subaddresses for UTF-8." into 13zuul
2016-10-14Merge "json: Add UTF-8 check call." into 13zuul
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-13json: Check party id name, number, subaddresses for UTF-8.Richard Mudgett
* Updated unit test as ast_json_name_number() is now NULL tolerant. ASTERISK-26466 #close Reported by: Richard Mudgett Change-Id: I7d4e14194f8f81f24a1dc34d1b8602c0950265a6
2016-10-13json: Add UTF-8 check call.Richard Mudgett
Since the json library does not make the check function public we recreate/copy the function in our interface module. ASTERISK-26466 Reported by: Richard Mudgett Change-Id: I36d3d750b6f5f1a110bc69ea92b435ecdeeb2a99
2016-10-13aoc.c: Whitespace cleanupRichard Mudgett
* In s_to_json() removed unnecessary ast_json_ref() to ast_json_null() when creating the type json object. The ref is a noop. Change-Id: I2be8b836876fc2e34a27c161f8b1c53b58a3889a
2016-10-11Merge "audiohooks: Remove redundant codec translations when using ↵zuul
audiohooks" into 13
2016-10-07astobj2: Add backtrace to log_bad_ao2.Corey Farrell
* Compile __ast_assert_failed unconditionally. * Use __ast_assert_failed to log messages from log_bad_ao2 * Remove calls to ast_assert(0) that happen after log_bad_ao2 was run. Change-Id: I48f1af44b2718ad74a421ff75cb6397b924a9751
2016-10-05audiohooks: Remove redundant codec translations when using audiohooksMichael Walton
The main frame read and write handlers in main/channel.c don't use the optimum placement in the processing flow for calling audiohooks callbacks, as far as codec translation is concerned. This change places the audiohooks callback code: * After the channel read translation if the frame is not linear before the translation, thereby increasing the chance that the frame is linear as required by audiohooks * Before the channel write translation if the frame is linear at this point This prevents the audiohooks code from instantiating additional translation paths to/from linear where a linear frame format is already available, saving valuable CPU cycles ASTERISK-26419 Change-Id: I6edd5771f0740e758e7eb42558b953f046c01f8f
2016-09-23Merge "chan_sip: Address runaway when realtime peers subscribe to ↵zuul
mailboxes" into 13
2016-09-23chan_sip: Address runaway when realtime peers subscribe to mailboxesGeorge Joseph
Users upgrading from asterisk 13.5 to a later version and who use realtime with peers that have mailboxes were experiencing runaway situations that manifested as a continuous stream of taskprocessor congestion errors, memory leaks and an unresponsive chan_sip. A related issue was that setting rtcachefriends=no NEVER worked in asterisk 13 (since the move to stasis). In 13.5 and earlier, when a peer tried to register, all of the stasis threads would block and chan_sip would again become unresponsive. After 13.5, the runaway would happen. There were a number of causes... * mwi_event_cb was (indirectly) calling build_peer even though calls to mwi_event_cb are often caused by build_peer. * In an effort to prevent chan_sip from being unloaded while messages were still in flight, destroy_mailboxes was calling stasis_unsubscribe_and_join but in some cases waited forever for the final message. * add_peer_mailboxes wasn't properly marking the existing mailboxes on a peer as "keep" so build_peer would always delete them all. * add_peer_mwi_subs was unsubscribing existing mailbox subscriptions then just creating them again. All of this was causing a flood of subscribes and unsubscribes on multiple threads all for the same peer and mailbox. Fixes... * add_peer_mailboxes now marks mailboxes correctly and build_peer only deletes the ones that really are no longer needed by the peer. * add_peer_mwi_subs now only adds subscriptions marked as "new" instead of unsubscribing and resubscribing everything. It also adds the peer object's address to the mailbox instead of its name to the subscription userdata so mwi_event_cb doesn't have to call build_peer. With these changes, with rtcachefriends=yes (the most common setting), there are no leaks, locks, loops or crashes at shutdown. rtcachefriends=no still causes leaks but at least it doesn't lock, loop or crash. Since making rtcachefriends=no work wasnt in scope for this issue, further work will have to be deferred to a separate patch. Side fixes... * The ast_lock_track structure had a member named "thread" which gdb doesn't like since it conflicts with it's "thread" command. That member was renamed to "thread_id". ASTERISK-25468 #close Change-Id: I07519ef7f092629e1e844f855abd279d6475cdd0
2016-09-22Merge "core: Ensure presencestate subtype and message are NULL." into 13zuul
2016-09-21core: Ensure presencestate subtype and message are NULL.Joshua Colp
When retrieving presence state information there is no guarantee that the subtype and message passed in are set to NULL. This change ensures they are. ASTERISK-26397 #close Change-Id: I61f8187972d5d8bbd7d6b7f4daa4f4f7e8237b23
2016-09-21Merge "logger: Fix default console settings." into 13zuul
2016-09-21Merge "core: Fix LOW_MEMORY missing symbol ast_pbx_uuid_get." into 13zuul
2016-09-21Merge "asterisk.c: Non-root users also get the astcanary after core ↵zuul
restart." into 13
2016-09-20core: Fix LOW_MEMORY missing symbol ast_pbx_uuid_get.Corey Farrell
Move the function outside the conditional block that excludes LOW_MEMORY. ASTERISK-26273 #close Change-Id: Ic290fa128222c410c3531107e30efacabc8493b4
2016-09-20logger: Fix default console settings.Corey Farrell
When logger.conf is missing or invalid we should be printing notices, warnings and errors to the console. The logmask was incorrectly calculated. Change-Id: Ibaa9465a8682854bc1a5e9ba07079bea1bfb6bb3
2016-09-20sd_notify (systemd status notifications) supportTzafrir Cohen
sd_notify() is used to notify systemd of changes to the status of the process. This allows the systemd daemon to know when the process finished loading (and thus only start another program after Asterisk has finished loading). To use this, use a systemd unit with 'Type=notify' for Asterisk. This commit also adds the function ast_sd_notify(), a wrapper around sd_notify that does nothing if not built with systemd support. Also adds support for libsystemd detection in the configure script. Change-Id: Ied6a59dafd5ef331c5c7ae8f3ccd2dfc94be7811 (cherry picked from commit 07b95f7c65b7c083724f1af2b26f93cc22cad58c)
2016-09-20asterisk.c: Non-root users also get the astcanary after core restart.Walter Doekes
Without this change, a 'core restart' would kill the astcanary forever if you're not running as root. Both with and without this patch, the scheduling priority was still SCHED_RR after restart. Additionally, the astcanary is now spawned if you start with high priority and Asterisk doesn't get a chance to lower it. For example through: `chrt -r 10 sudo -u asterisk asterisk -c` Also reap killed astcanary processes on core restart. ASTERISK-26352 #close Change-Id: Iacb49f26491a0717084ad46ed96b0bea5f627a55
2016-09-19Merge "asterisk.c: When astcanary dies on linux, reset priority on all ↵zuul
threads." into 13
2016-09-19asterisk.c: When astcanary dies on linux, reset priority on all threads.Walter Doekes
Previously only the canary checking thread itself had its priority set to SCHED_OTHER. Now all threads are traversed and adjusted. ASTERISK-19867 #close Reported by: Xavier Hienne Change-Id: Ie0dd02a3ec42f66a78303e9c1aac28f7ed9aae39
2016-09-16Fix showing of swap details when sysinfo() is availableTimo Teräs
If sysinfo() is available, but not sysctl() or swapctl() the printing code for swap buffer sizes is incorrectly omitted. The above condition happens with musl c-library. Fix #if rule to consider defined(HAVE_SYSINFO). And also remove the redundant || defined(HAVE_SYSCTL) which was incorrectly there to start with. Now swap information is displayed only if an actual libc function to get it is available. This also fixes warnings previously seen with musl libc: [CC] asterisk.c -> asterisk.o asterisk.c: In function 'handle_show_sysinfo': asterisk.c:773:6: warning: variable 'totalswap' set but not used [-Wunused-but-set-variable] int totalswap = 0; ^~~~~~~~~ asterisk.c:770:11: warning: variable 'freeswap' set but not used [-Wunused-but-set-variable] uint64_t freeswap = 0; ^~~~~~~~ Change-Id: I1fb21dad8f27e416c60f138c6f2bff03fb626eca
2016-09-14rtp: Preserve timestamps on video frames.Joshua Colp
Currently when receiving video over RTP we store only a calculated samples on the frame. When starting the video it can take some time for this calculation to actually yield a value as it requires constant changing timestamps. As well if a video frame passes over multiple RTP packets this calculation will fail as the timestamp is the same as the previous RTP packet and the number of samples calculated will be 0. This change preserves the timestamp on the frame and allows it to pass through the core. When sending the video this timestamp is used instead of a new one being calculated. ASTERISK-26367 #close Change-Id: Iba8179fb5c14c9443aee4baf670d2185da3ecfbd
2016-09-02format_cap.c: Fix CLI "core show channeltype Surrogate" crash.Richard Mudgett
* Make ast_format_cap_get_names() NULL tolerant. ASTERISK-26331 #close Reported by: CGI.NET Change-Id: Id67e93936dc8ec2a33a9d33655843d43b59285a3
2016-08-29pbx.c: Prevent infinite recursion in manager_show_dialplan_helper.Etienne Lessard
Previously, if context A was including context B and context B was including context A, i.e. if there was a circular dependency between contexts, then calling manager_show_dialplan_helper could lead to an infinite recursion, resulting in a crash. This commit applies the same solution as the one implemented in the show_dialplan_helper function. The manager_show_dialplan_helper and show_dialplan_helper functions contain lots of code in common, but the former was missing the "infinite recursion avoidance" code. ASTERISK-26226 #close Change-Id: I1aea85133c21787226f4f8442253a93000aa0897
2016-08-26Merge "channel: No hung-up on failing security requirements." into 13zuul
2016-08-26channel: No hung-up on failing security requirements.Alexander Traud
In your Diaplan, if you specify same => n,Set(CHANNEL(secure_bridge_media)=1) same => n,Set(CHANNEL(secure_bridge_signaling)=1) only the SIP channel driver chan_sip supports this. All other channels drivers like res_pjsip fail. In case of failure, the original sRTP source code released the whole channel, even if not hung-up, yet. This change does not release the channel but instead hangs-up the channel. ASTERISK-26306 Change-Id: I0489f0cb660fab6673b0db8af027d116e70a66db
2016-08-25ast_framehook_attach() must be called with the channel locked.Richard Mudgett
The framehook container could become corrupted if the channel lock is not held before calling. Change-Id: I1a6b957a1f7b899eb29a186915f8cccab886a438
2016-08-24Fix checks for allocation debugging.Corey Farrell
MALLOC_DEBUG should not be used to check if debugging is actually enabled, __AST_DEBUG_MALLOC should be used instead. MALLOC_DEBUG only indicates that debugging is requested, __AST_DEBUG_MALLOC indicates it is active. Change-Id: I3ce9cdb6ec91b74ee1302941328462231be1ea53
2016-08-17res_ari: Add http prefix to generated docsTorrey Searle
updated the uri handler to include the url prefix of the http server this enables res_ari to add it to the uris when generating docs Change-Id: I279335a2625261a8492206c37219698f42591c2e
2016-08-16Merge "Refactor usage pattern of xmldoc info tag." into 13zuul
2016-08-16Merge "sorcery.c: Minor optimizations." into 13Joshua Colp
2016-08-16Merge "sorcery.c: Tweak some container declaration formatting." into 13zuul
2016-08-16Merge "core: Entity ID is not set or invalid" into 13zuul
2016-08-16Merge "pbx.c: Additional fixes to ast_context_remove_extension_callerid2." ↵zuul
into 13
2016-08-15Refactor usage pattern of xmldoc info tag.Corey Farrell
This updates func_channel.c and main/message.c to use a generic xpointer include instead of including info from each channel driver. Now the name attribute of info is CHANNEL or CHANNEL_EXAMPLES to be included in documentation for func_channel. Setting the name attribute of info to MessageToInfo or MessageFromInfo causes it to be included in the MessageSend application and AMI action. Change-Id: I89fd8276a3250824241a618009714267d3a8d1ea
2016-08-15Merge "manager: Add <see-also> tags to relate interrelated events/actions ↵Joshua Colp
together" into 13
2016-08-15Merge "manager: Add <see-also> tags to relate Bridge related events,actions, ↵Joshua Colp
and apps" into 13
2016-08-15Merge "manager: Add <see-also> tags to relate AoC events and actions" into 13Joshua Colp
2016-08-15Merge "manager: Add <see-also> tags to relate UserEvent actions/apps/events" ↵Joshua Colp
into 13
2016-08-15Merge "manager: Add <see-also> links between related events" into 13zuul
2016-08-15sorcery.c: Minor optimizations.Richard Mudgett
* Remove some unused parameters from internal functions: sorcery_wizard_create() sorcery_wizard_update() sorcery_wizard_delete() * Created the struct sorcery_observer_invocation ao2 object without a lock since it is not needed in sorcery_observer_invocation_alloc(). * Cleanup generic ao2 container sorcery object id hash, sort, and cmp functions. Change-Id: Iff71d75f52bc1b8cee955456838c149faaa4f92e
2016-08-15sorcery.c: Tweak some container declaration formatting.Richard Mudgett
* Tweak sorcery_object_type_alloc() formatting. * Tweak ast_sorcery_init() formatting. Change-Id: Ib02430023f15268cd7a2ea53f2c331213e4d3944
2016-08-15pbx.c: Additional fixes to ast_context_remove_extension_callerid2.Corey Farrell
Do not check registrar of the first extension head. We should only check the registrar when we match the priority. Additionally fix a couple calls to strcmp which used the input callerid instead of the clean version ex.cidmatch. ASTERISK-26233 Change-Id: I17ea6881a18f40840ae9c1f5394aab1fbb3769f1
2016-08-15core: Entity ID is not set or invalidAlexei Gradinari
The Exchanging Device and Mailbox States could not working if the Entity ID (EID) is not set manually and can't be obtained from ethernet interface. This patch replaces debug message to warning and addes missing description about option 'entityid' to asterisk.conf.sample. With this patch the asterisk also: (1) decline loading the modules which won't work without EID: res_corosync and res_pjsip_publish_asterisk. (2) warn if EID is empty on loading next modules: pbx_dundi, res_xmpp Starting with v197 systemd/udev will automatically assign "predictable" names for all local Ethernet interfaces. This patch also addes some new ethernet prefixes "eno" and "ens". ASTERISK-26164 #close Change-Id: I72d712f1ad5b6f64571bb179c5cb12461e7c58c6
2016-08-13manager: Add <see-also> tags to relate interrelated events/actions togetherMatt Jordan
Change-Id: Idbac539205aa732bf786c4f765577d8e9ff28ba4
2016-08-13manager: Add <see-also> tags to relate Bridge related events,actions, and appsMatt Jordan
Change-Id: I67e6b79fa3102e494b5fe6cc7510472249080e85
2016-08-13manager: Add <see-also> tags to relate AoC events and actionsMatt Jordan
Change-Id: Iea89a36222712148c1775c05ed0ad1049d67a70e