summaryrefslogtreecommitdiff
path: root/apps/app_meetme.c
AgeCommit message (Collapse)Author
2018-01-24Remove redundant module checks and references.Corey Farrell
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
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-10-30Modules: Fix issues with CLI completion.Corey Farrell
* Stop using ast_module_helper to check if a module is loaded, use ast_module_check instead (app_confbridge and app_meetme). * Stop ast_module_helper from listing reload classes when needsreload was not requested. ASTERISK-27378 Change-Id: Iaed8c1e4fcbeb242921dbac7929a0fe75ff4b239
2017-09-25build: A few gcc 7 error fixesGeorge Joseph
Change-Id: I7b5300fbf1af7d88d47129db13ad6dbdc9b553ec
2017-07-05core: Remove 'Data Retrieval API'Sean Bright
This API was not actively maintained, was not added to new modules (such as res_pjsip), and there exist better alternatives to acquire the same information, such as the ARI. Change-Id: I4b2185a83aeb74798b4ad43ff8f89f971096aa83
2017-05-31channel / app_meetme: Fix parentheses.Joshua Colp
ASTERISK-27025 Change-Id: Id736b0aa4ec6b6b0f04663d64fa8d151f81fdbed
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-02-01build_system: Fix some warnings highlighted by clangGeorge Joseph
Fix some warnings found with clang. Change-Id: I5195b6189b148c2ee3ed4a19d015a6d4ef3e77bd
2015-12-09app_meetme: Set default value for audio_buffers.Corey Farrell
The default value was never set for audio_buffers, causing bad audio quality. This ensures the default is always set. ASTERISK-25569 #close Change-Id: I2d2ee3e644120b0f9f6ea6ab9286d7d590942a44
2015-06-08Fix unsafe uses of ast_context pointers.Corey Farrell
Although ast_context_find, ast_context_find_or_create and ast_context_destroy perform locking of the contexts table, any context pointer can become invalid at any time that the contexts table is unlocked. This change adds locking around all complete operations involving these functions. Places where ast_context_find was followed by ast_context_destroy have been replaced with calls ast_context_destroy_by_name. ASTERISK-25094 #close Reported by: Corey Farrell Change-Id: I1866b6787730c9c4f3f836b6133ffe9c820734fa
2015-05-13AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro.Rodrigo Ramírez Norambuena
Change-Id: Icf88f9f861c6b2a16e5f626ff25795218a6f2723
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-01-12Revert -r430452 It needs to be redone for the next major AMI version change ↵Richard Mudgett
instead. ASTERISK-24049 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09AMI: Remove no longer used parameter from astman_send_listack().Richard Mudgett
Follow-up issue to -r430435 from reviewboard review. ASTERISK-24049 Review: https://reviewboard.asterisk.org/r/4315/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09AMI: Make AMI actions that generate event lists consistent.Richard Mudgett
* Made the following AMI actions use list API calls for consistency: Agents BridgeInfo BridgeList BridgeTechnologyList ConfbridgeLIst ConfbridgeLIstRooms CoreShowChannels DAHDIShowChannels DBGet DeviceStateList ExtensionStateList FAXSessions Hangup IAXpeerlist IAXpeers IAXregistry MeetmeList MeetmeListRooms MWIGet ParkedCalls Parkinglots PJSIPShowEndpoint PJSIPShowEndpoints PJSIPShowRegistrationsInbound PJSIPShowRegistrationsOutbound PJSIPShowResourceLists PJSIPShowSubscriptionsInbound PJSIPShowSubscriptionsOutbound PresenceStateList PRIShowSpans QueueStatus QueueSummary ShowDialPlan SIPpeers SIPpeerstatus SIPshowregistry SKINNYdevices SKINNYlines Status VoicemailUsersList * Incremented the AMI version to 2.7.0. * Changed astman_send_listack() to not use the listflag parameter and always set the value to "Start" so the start capitalization is consistent. i.e., The FAXSessions used "Start" while the rest of the system used "start". The corresponding complete event always used "Complete". * Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the AMI ActionID for all of its list events. * Fixed off-nominal AMI protocol error in manager_bridge_info(), manager_parking_status_single_lot(), and manager_parking_status_all_lots(). Use of astman_send_error() after responding to the original AMI action request violates the action response pattern by sending two responses. * Fixed minor protocol error in action_getconfig() when no requested categories are found. Each line needs to be formatted as "Header: text". * Fixed off-nominal memory leak in manager_build_parked_call_string(). * Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail(). ASTERISK-24049 #close Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/4315/ ........ Merged revisions 430434 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-06apps/app_meetme: Apply default values on initial load with no config fileMatthew Jordan
When the app_meetme module is loaded without its configuration file, the module settings aren't initialized. In particular, this impacts the use of logging realtime members. This patch guarantees that we always set the default module settings on initial load. Review: https://reviewboard.asterisk.org/r/4242/ ASTERISK-24572 #close Reported by: Nuno Borges patches: 24572.patch uploaded by Nuno Borges (License 6116) ........ Merged revisions 429027 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 429028 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 429029 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-17apps/app_meetme: Fix crash when publishing MeetMe messages with no channelMatthew Jordan
The same function, meetme_stasis_generate_msg, handles creating and publishing Stasis message both when there are channels in the MeetMe conference and when there are no channels in the conference. When the performance improvement was made to use cached snapshots, this created a situation where Asterisk would crash: obtaining a cached snapshot is not NULL tolerant. This patch restores the previous implementation, which used a NULL safe set of routines to produce a blob containing the channel snapshot (if available) and information about the MeetMe conference. ASTERISK-24234 #close Reported by: Shaun Ruffell Tested by: Shaun Ruffell ........ Merged revisions 421270 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 421273 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25Add module support level to ast_module_info structure. Print it in CLI ↵Mark Michelson
"module show" . ASTERISK-23919 #close Reported by Malcolm Davenport Review: https://reviewboard.asterisk.org/r/3802 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-22Fix more dev-mode build issuesKinsey Moore
........ Merged revisions 419129 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 419162 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 419163 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-20media formats: re-architect handling of media for performance improvementsMatthew Jordan
In the old times media formats were represented using a bit field. This was fast but had a few limitations. 1. Asterisk was limited in how many formats it could handle. 2. Formats, being a bit field, could not include any attribute information. A format was strictly its type, e.g., "this is ulaw". This was changed in Asterisk 10 (see https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal for notes on that work) which led to the creation of the ast_format structure. This structure allowed Asterisk to handle attributes and bundle information with a format. Additionally, ast_format_cap was created to act as a container for multiple formats that, together, formed the capability of some entity. Another mechanism was added to allow logic to be registered which performed format attribute negotiation. Everywhere throughout the codebase Asterisk was changed to use this strategy. Unfortunately, in software, there is no free lunch. These new capabilities came at a cost. Performance analysis and profiling showed that we spend an inordinate amount of time comparing, copying, and generally manipulating formats and their related structures. Basic prototyping has shown that a reasonably large performance improvement could be made in this area. This patch is the result of that project, which overhauled the media format architecture and its usage in Asterisk to improve performance. Generally, the new philosophy for handling formats is as follows: * The ast_format structure is reference counted. This removed a large amount of the memory allocations and copying that was done in prior versions. * In order to prevent race conditions while keeping things performant, the ast_format structure is immutable by convention and lock-free. Violate this tenet at your peril! * Because formats are reference counted, codecs are also reference counted. The Asterisk core generally provides built-in codecs and caches the ast_format structures created to represent them. Generally, to prevent inordinate amounts of module reference bumping, codecs and formats can be added at run-time but cannot be removed. * All compatibility with the bit field representation of codecs/formats has been moved to a compatibility API. The primary user of this representation is chan_iax2, which must continue to maintain its bit-field usage of formats for interoperability concerns. * When a format is negotiated with attributes, or when a format cannot be represented by one of the cached formats, a new format object is created or cloned from an existing format. That format may have the same codec underlying it, but is a different format than a version of the format with different attributes or without attributes. * While formats are reference counted objects, the reference count maintained on the format should be manipulated with care. Formats are generally cached and will persist for the lifetime of Asterisk and do not explicitly need to have their lifetime modified. An exception to this is when the user of a format does not know where the format came from *and* the user may outlive the provider of the format. This occurs, for example, when a format is read from a channel: the channel may have a format with attributes (hence, non-cached) and the user of the format may last longer than the channel (if the reference to the channel is released prior to the format's reference). For more information on this work, see the API design notes: https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite Finally, this work was the culmination of a large number of developer's efforts. Extra thanks goes to Corey Farrell, who took on a large amount of the work in the Asterisk core, chan_sip, and was an invaluable resource in peer reviews throughout this project. There were a substantial number of patches contributed during this work; the following issues/patch names simply reflect some of the work (and will cause the release scripts to give attribution to the individuals who work on them). Reviews: https://reviewboard.asterisk.org/r/3814 https://reviewboard.asterisk.org/r/3808 https://reviewboard.asterisk.org/r/3805 https://reviewboard.asterisk.org/r/3803 https://reviewboard.asterisk.org/r/3801 https://reviewboard.asterisk.org/r/3798 https://reviewboard.asterisk.org/r/3800 https://reviewboard.asterisk.org/r/3794 https://reviewboard.asterisk.org/r/3793 https://reviewboard.asterisk.org/r/3792 https://reviewboard.asterisk.org/r/3791 https://reviewboard.asterisk.org/r/3790 https://reviewboard.asterisk.org/r/3789 https://reviewboard.asterisk.org/r/3788 https://reviewboard.asterisk.org/r/3787 https://reviewboard.asterisk.org/r/3786 https://reviewboard.asterisk.org/r/3784 https://reviewboard.asterisk.org/r/3783 https://reviewboard.asterisk.org/r/3778 https://reviewboard.asterisk.org/r/3774 https://reviewboard.asterisk.org/r/3775 https://reviewboard.asterisk.org/r/3772 https://reviewboard.asterisk.org/r/3761 https://reviewboard.asterisk.org/r/3754 https://reviewboard.asterisk.org/r/3753 https://reviewboard.asterisk.org/r/3751 https://reviewboard.asterisk.org/r/3750 https://reviewboard.asterisk.org/r/3748 https://reviewboard.asterisk.org/r/3747 https://reviewboard.asterisk.org/r/3746 https://reviewboard.asterisk.org/r/3742 https://reviewboard.asterisk.org/r/3740 https://reviewboard.asterisk.org/r/3739 https://reviewboard.asterisk.org/r/3738 https://reviewboard.asterisk.org/r/3737 https://reviewboard.asterisk.org/r/3736 https://reviewboard.asterisk.org/r/3734 https://reviewboard.asterisk.org/r/3722 https://reviewboard.asterisk.org/r/3713 https://reviewboard.asterisk.org/r/3703 https://reviewboard.asterisk.org/r/3689 https://reviewboard.asterisk.org/r/3687 https://reviewboard.asterisk.org/r/3674 https://reviewboard.asterisk.org/r/3671 https://reviewboard.asterisk.org/r/3667 https://reviewboard.asterisk.org/r/3665 https://reviewboard.asterisk.org/r/3625 https://reviewboard.asterisk.org/r/3602 https://reviewboard.asterisk.org/r/3519 https://reviewboard.asterisk.org/r/3518 https://reviewboard.asterisk.org/r/3516 https://reviewboard.asterisk.org/r/3515 https://reviewboard.asterisk.org/r/3512 https://reviewboard.asterisk.org/r/3506 https://reviewboard.asterisk.org/r/3413 https://reviewboard.asterisk.org/r/3410 https://reviewboard.asterisk.org/r/3387 https://reviewboard.asterisk.org/r/3388 https://reviewboard.asterisk.org/r/3389 https://reviewboard.asterisk.org/r/3390 https://reviewboard.asterisk.org/r/3321 https://reviewboard.asterisk.org/r/3320 https://reviewboard.asterisk.org/r/3319 https://reviewboard.asterisk.org/r/3318 https://reviewboard.asterisk.org/r/3266 https://reviewboard.asterisk.org/r/3265 https://reviewboard.asterisk.org/r/3234 https://reviewboard.asterisk.org/r/3178 ASTERISK-23114 #close Reported by: mjordan media_formats_translation_core.diff uploaded by kharwell (License 6464) rb3506.diff uploaded by mjordan (License 6283) media_format_app_file.diff uploaded by kharwell (License 6464) misc-2.diff uploaded by file (License 5000) chan_mild-3.diff uploaded by file (License 5000) chan_obscure.diff uploaded by file (License 5000) jingle.diff uploaded by file (License 5000) funcs.diff uploaded by file (License 5000) formats.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) bridges.diff uploaded by file (License 5000) mf-codecs-2.diff uploaded by file (License 5000) mf-app_fax.diff uploaded by file (License 5000) mf-apps-3.diff uploaded by file (License 5000) media-formats-3.diff uploaded by file (License 5000) ASTERISK-23715 rb3713.patch uploaded by coreyfarrell (License 5909) rb3689.patch uploaded by mjordan (License 6283) ASTERISK-23957 rb3722.patch uploaded by mjordan (License 6283) mf-attributes-3.diff uploaded by file (License 5000) ASTERISK-23958 Tested by: jrose rb3822.patch uploaded by coreyfarrell (License 5909) rb3800.patch uploaded by jrose (License 6182) chan_sip.diff uploaded by mjordan (License 6283) rb3747.patch uploaded by jrose (License 6182) ASTERISK-23959 #close Tested by: sgriepentrog, mjordan, coreyfarrell sip_cleanup.diff uploaded by opticron (License 6273) chan_sip_caps.diff uploaded by mjordan (License 6283) rb3751.patch uploaded by coreyfarrell (License 5909) chan_sip-3.diff uploaded by file (License 5000) ASTERISK-23960 #close Tested by: opticron direct_media.diff uploaded by opticron (License 6273) pjsip-direct-media.diff uploaded by file (License 5000) format_cap_remove.diff uploaded by opticron (License 6273) media_format_fixes.diff uploaded by opticron (License 6273) chan_pjsip-2.diff uploaded by file (License 5000) ASTERISK-23966 #close Tested by: rmudgett rb3803.patch uploaded by rmudgetti (License 5621) chan_dahdi.diff uploaded by file (License 5000) ASTERISK-24064 #close Tested by: coreyfarrell, mjordan, opticron, file, rmudgett, sgriepentrog, jrose rb3814.patch uploaded by rmudgett (License 5621) moh_cleanup.diff uploaded by opticron (License 6273) bridge_leak.diff uploaded by opticron (License 6273) translate.diff uploaded by file (License 5000) rb3795.patch uploaded by rmudgett (License 5621) tls_fix.diff uploaded by mjordan (License 6283) fax-mf-fix-2.diff uploaded by file (License 5000) rtp_transfer_stuff uploaded by mjordan (License 6283) rb3787.patch uploaded by rmudgett (License 5621) media-formats-explicit-translate-format-3.diff uploaded by file (License 5000) format_cache_case_fix.diff uploaded by opticron (License 6273) rb3774.patch uploaded by rmudgett (License 5621) rb3775.patch uploaded by rmudgett (License 5621) rtp_engine_fix.diff uploaded by opticron (License 6273) rtp_crash_fix.diff uploaded by opticron (License 6273) rb3753.patch uploaded by mjordan (License 6283) rb3750.patch uploaded by mjordan (License 6283) rb3748.patch uploaded by rmudgett (License 5621) media_format_fixes.diff uploaded by opticron (License 6273) rb3740.patch uploaded by mjordan (License 6283) rb3739.patch uploaded by mjordan (License 6283) rb3734.patch uploaded by mjordan (License 6283) rb3689.patch uploaded by mjordan (License 6283) rb3674.patch uploaded by coreyfarrell (License 5909) rb3671.patch uploaded by coreyfarrell (License 5909) rb3667.patch uploaded by coreyfarrell (License 5909) rb3665.patch uploaded by mjordan (License 6283) rb3625.patch uploaded by coreyfarrell (License 5909) rb3602.patch uploaded by coreyfarrell (License 5909) format_compatibility-2.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13stasis: Reduce creation of channel snapshots to improve performanceMatthew Jordan
During some performance testing of Asterisk with AGI, ARI, and lots of Local channels, we noticed that there's quite a hit in performance during channel creation and releasing to the dialplan (ARI continue). After investigating the performance spike that occurs during channel creation, we discovered that we create a lot of channel snapshots that are technically unnecessary. This includes creating snapshots during: * AGI execution * Returning objects for ARI commands * During some Local channel operations * During some dialling operations * During variable setting * During some bridging operations And more. This patch does the following: - It removes a number of fields from channel snapshots. These fields were rarely used, were expensive to have on the snapshot, and hurt performance. This included formats, translation paths, Log Call ID, callgroup, pickup group, and all channel variables. As a result, AMI Status, "core show channel", "core show channelvar", and "pjsip show channel" were modified to either hit the live channel or not show certain pieces of data. While this is unfortunate, the performance gain from this patch is worth the loss in behaviour. - It adds a mechanism to publish a cached snapshot + blob. A large number of publications were changed to use this, including: - During Dial begin - During Variable assignment (if no AMI variables are emitted - if AMI variables are set, we have to make snapshots when a variable is changed) - During channel pickup - When a channel is put on hold/unhold - When a DTMF digit is begun/ended - When creating a bridge snapshot - When an AOC event is raised - During Local channel optimization/Local bridging - When endpoint snapshots are generated - All AGI events - All ARI responses that return a channel - Events in the AgentPool, MeetMe, and some in Queue - Additionally, some extraneous channel snapshots were being made that were unnecessary. These were removed. - The result of ast_hashtab_hash_string is now cached in stasis_cache. This reduces a large number of calls to ast_hashtab_hash_string, which reduced the amount of time spent in this function in gprof by around 50%. #ASTERISK-23811 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3568/ ........ Merged revisions 416211 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22app_meetme: Don't interrupt MOH for waitmarked users.Richard Mudgett
Occasionally, when the last marked user leaves the conference, waitmarked users don't get MOH if MOH is supposed to be played while a waitmarked user is waiting for another marked user. * Made not interrupt MOH when the user is a waitmarked user. The waitmarked user doesn't need to hear any leave announcements from the conference as the user would have already heard different leave announcements if they were enabled. Apparently DAHDI occasionally sends unending non-silent streams to these users or a normal user still in the conference has continuous high background noise. These non-silent streams cause MOH to be suspended while the never ending "announcement" is played. Issue caused by ASTERISK-13680. AST-1349 #close Reported by: Tyler Stewart Review: https://reviewboard.asterisk.org/r/3543/ ........ Merged revisions 414401 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414402 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414404 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-15app_meetme: Fix overwrite of DAHDI conference data structure.Richard Mudgett
Starting a conference recording using the admin menu overwrites the DAHDI conference data structure used to modify the admin user's conference mute mode. * Made no longer pass the user's DAHDI conference data structure into the menu functions. The menu now uses its own DAHDI conference data structure to start the recording channel. * Moved the unlock conf->playlock to before playing the conf-full message. No sense keeping the lock while that prompt is playing. The user is never going to get into the conference at that point. ........ Merged revisions 413991 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413992 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413993 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07uniqueid: channel linkedid, ami, ari object creation with id'sScott Griepentrog
Much needed was a way to assign id to objects on creation, and much change was necessary to accomplish it. Channel uniqueids and linkedids are split into separate string and creation time components without breaking linkedid propgation. This allowed the uniqueid to be specified by the user interface - and those values are now carried through to channel creation, adding the assignedids value to every function in the chain including the channel drivers. For local channels, the second channel can be specified or left to default to a ;2 suffix of first. In ARI, bridge, playback, and snoop objects can also be created with a specified uniqueid. Along the way, the args order to allocating channels was fixed in chan_mgcp and chan_gtalk, and linkedid is no longer lost as masquerade occurs. (closes issue ASTERISK-23120) Review: https://reviewboard.asterisk.org/r/3191/ ........ Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21json: Fix off-nominal json ref counting issues.Richard Mudgett
* Fixed off-nominal json ref counting issue with using the following API calls: ast_json_object_set() and ast_json_array_append(). * Fixed off-nominal error reporting in ast_ari_endpoints_list(). * Fixed some miscellaneous off-nominal json ref counting issues in report_receive_fax_status() and dial_to_json(). ........ Merged revisions 408713 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-03app_meetme: compiler warningKevin Harwell
Fixed a compiler warning (errors in 'dev-mode') given by gcc version 4.8.1. The one in app_meetme involved the 'sizeof-pointer-memaccess' (see: http://gcc.gnu.org/gcc-4.8/porting_to.html) warning. Fixed so it would no longer issue a warning and can compile again in 'dev-mode'. Review: https://reviewboard.asterisk.org/r/3098/ ........ Merged revisions 404742 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404773 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 404781 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18channel locking: Add locking for channel snapshot creationKevin Harwell
Original commit message by mmichelson (asterisk 12 r403311): "This adds channel locks around calls to create channel snapshots as well as other functions which operate on a channel and then end up creating a channel snapshot. Functions that expect the channel to be locked prior to being called have had their documentation updated to indicate such." The above was initially committed and then reverted at r403398. The problem was found to be in core_local.c in the publish_local_bridge_message function. The ast_unreal_lock_all function locks and adds a reference to the returned channels and while they were being unlocked they were not being unreffed when no longer needed. Fixed by unreffing the channels. Also in bridge.c a lock was obtained on "other->chan", but then an attempt was made to unlock "other" and not the previously locked channel. Fixed by unlocking "other->chan" (closes issue ASTERISK-22709) Reported by: John Bigelow ........ Merged revisions 404237 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18channels: Return allocated channels locked.Joshua Colp
This change makes ast_channel_alloc return allocated channels locked. By doing so no other thread can acquire, lock, and manipulate the channel before it is completely set up. (closes issue AST-1256) Review: https://reviewboard.asterisk.org/r/3067/ ........ Merged revisions 404204 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-05Reverting r403311. It's causing ARI tests to hang.David M. Lee
........ Merged revisions 403398 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-03Add channel locking for channel snapshot creation.Mark Michelson
This adds channel locks around calls to create channel snapshots as well as other functions which operate on a channel and then end up creating a channel snapshot. Functions that expect the channel to be locked prior to being called have had their documentation updated to indicate such. ........ Merged revisions 403311 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03Cache string values of formats on ast_format_cap() to save processing.Mark Michelson
Channel snapshots have string representations of the channel's native formats. Prior to this change, the format strings were re-created on ever channel snapshot creation. Since channel native formats rarely change, this was very wasteful. Now, string representations of formats may optionally be stored on the ast_format_cap for cases where string representations may be requested frequently. When formats are altered, the string cache is marked as invalid. When strings are requested, the cache validity is checked. If the cache is valid, then the cached strings are copied. If the cache is invalid, then the string cache is rebuilt and copied, and the cache is marked as being valid again. Review: https://reviewboard.asterisk.org/r/2879 ........ Merged revisions 400356 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30Multiple revisions 399887,400138,400178,400180-400181David M. Lee
........ r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line Minor performance bump by not allocate manager variable struct if we don't need it ........ r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines Stasis performance improvements This patch addresses several performance problems that were found in the initial performance testing of Asterisk 12. The Stasis dispatch object was allocated as an AO2 object, even though it has a very confined lifecycle. This was replaced with a straight ast_malloc(). The Stasis message router was spending an inordinate amount of time searching hash tables. In this case, most of our routers had 6 or fewer routes in them to begin with. This was replaced with an array that's searched linearly for the route. We more heavily rely on AO2 objects in Asterisk 12, and the memset() in ao2_ref() actually became noticeable on the profile. This was #ifdef'ed to only run when AO2_DEBUG was enabled. After being misled by an erroneous comment in taskprocessor.c during profiling, the wrong comment was removed. Review: https://reviewboard.asterisk.org/r/2873/ ........ r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines Taskprocessor optimization; switch Stasis to use taskprocessors This patch optimizes taskprocessor to use a semaphore for signaling, which the OS can do a better job at managing contention and waiting that we can with a mutex and condition. The taskprocessor execution was also slightly optimized to reduce the number of locks taken. The only observable difference in the taskprocessor implementation is that when the final reference to the taskprocessor goes away, it will execute all tasks to completion instead of discarding the unexecuted tasks. For systems where unnamed semaphores are not supported, a really simple semaphore implementation is provided. (Which gives identical performance as the original taskprocessor implementation). The way we ended up implementing Stasis caused the threadpool to be a burden instead of a boost to performance. This was switched to just use taskprocessors directly for subscriptions. Review: https://reviewboard.asterisk.org/r/2881/ ........ r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines Optimize how Stasis forwards are dispatched This patch optimizes how forwards are dispatched in Stasis. Originally, forwards were dispatched as subscriptions that are invoked on the publishing thread. This did not account for the vast number of forwards we would end up having in the system, and the amount of work it would take to walk though the forward subscriptions. This patch modifies Stasis so that rather than walking the tree of forwards on every dispatch, when forwards and subscriptions are changed, the subscriber list for every topic in the tree is changed. This has a couple of benefits. First, this reduces the workload of dispatching messages. It also reduces contention when dispatching to different topics that happen to forward to the same aggregation topic (as happens with all of the channel, bridge and endpoint topics). Since forwards are no longer subscriptions, the bulk of this patch is simply changing stasis_subscription objects to stasis_forward objects (which, admittedly, I should have done in the first place.) Since this required me to yet again put in a growing array, I finally abstracted that out into a set of ast_vector macros in asterisk/vector.h. Review: https://reviewboard.asterisk.org/r/2883/ ........ r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines Remove dispatch object allocation from Stasis publishing While looking for areas for performance improvement, I realized that an unused feature in Stasis was negatively impacting performance. When a message is sent to a subscriber, a dispatch object is allocated for the dispatch, containing the topic the message was published to, the subscriber the message is being sent to, and the message itself. The topic is actually unused by any subscriber in Asterisk today. And the subscriber is associated with the taskprocessor the message is being dispatched to. First, this patch removes the unused topic parameter from Stasis subscription callbacks. Second, this patch introduces the concept of taskprocessor local data, data that may be set on a taskprocessor and provided along with the data pointer when a task is pushed using the ast_taskprocessor_push_local() call. This allows the task to have both data specific to that taskprocessor, in addition to data specific to that invocation. With those two changes, the dispatch object can be removed completely, and the message is simply refcounted and sent directly to the taskprocessor. Review: https://reviewboard.asterisk.org/r/2884/ ........ Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13Fix several crashes in MeetMeAdminKinsey Moore
This change ensures that MeetMeAdmin commands requiring a user actually get a user and fixes another issue where an extra dereference could occur for a last-entered user being ejected if a user identifier was also provided. (closes issue ASTERISK-21907) Reported by: Alex Epshteyn Review: https://reviewboard.asterisk.org/r/2844/ ........ Merged revisions 399033 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399034 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399035 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-19Resolve conflicts between CONFFLAG_DONT_DENOISE and CONFFLAG_INTROUSER_VMRECMatthew Jordan
When r382230 added an option to not denoise the MeetMe conference (if a user had a channel whose format's sample rate changed frequently, for example), the value added was the maximum allowed value for the constants that define the options for MeetMe in 1.8. Not so in 11 - unfortunately, the option CONFFLAG_DONT_DENOISE conflicts with CONFFLAG_INTROUESR_VMREC. This patch fixes that, and also tweaks one of the way in which the constants was declared for consistency. Thanks to Tony Mountifield for pointing out the problem and solution. (closes issue ASTERISK-22269) Reported by: Tony Mountifield ........ Merged revisions 396944 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06Fixed app_meetme for cache split changesDavid M. Lee
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01Fix documentation replication issuesKinsey Moore
This prevents XML documentation duplication by expanding channel and bridge snapshot tags into channel and bridge snapshot parameter sets with a given prefix or defaulting to no prefix. This also prevents documentation from becoming fractured and out of date by keeping all variations of the documentation in template form such that it only needs to be updated once and keeps maintenance to a minimum. Review: https://reviewboard.asterisk.org/r/2708/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01Split caching out from the stasis_caching_topic.David M. Lee
In working with res_stasis, I discovered a significant limitation to the current structure of stasis_caching_topics: you cannot subscribe to cache updates for a single channel/bridge/endpoint/etc. To address this, this patch splits the cache away from the stasis_caching_topic, making it a first class object. The stasis_cache object is shared amongst individual stasis_caching_topics that are created per channel/endpoint/etc. These are still forwarded to global whatever_all_cached topics, so their use from most of the code does not change. In making these changes, I noticed that we frequently used a similar pattern for bridges, endpoints and channels: single_topic ----------------> all_topic ^ | single_topic_cached ----+----> all_topic_cached | +----> cache This pattern was extracted as the 'Stasis Caching Pattern', defined in stasis_caching_pattern.h. This avoids a lot of duplicate code between the different domain objects. Since the cache is now disassociated from its upstream caching topics, this also necessitated a change to how the 'guaranteed' flag worked for retrieving from a cache. The code for handling the caching guarantee was extracted into a 'stasis_topic_wait' function, which works for any stasis_topic. (closes issue ASTERISK-22002) Review: https://reviewboard.asterisk.org/r/2672/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-17Change ast_hangup() to return void and be NULL safe.Richard Mudgett
Since ast_hangup() is effectively a channel destructor, it should be a void function. * Make the few silly callers checking the return value no longer do so. Only the CDR and CEL unit tests checked the return value. * Make all callers take advantage of the NULL safe change and remove the NULL check before the call. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-10astobj2-ify the SLA codeRussell Bryant
The SLA code within app_meetme was written before asotbj2 had been merged into Asterisk. Worse, support for reloads did not exist at first and was added later as a bolt-on feature. I knew at the time that reloading was not safe at all while SLA was in use, so the reload would be queued up to execute when the system was idle. Unfortunately, this approach was still prone to errors beyond the fact that this was the only place in Asterisk where configuration was not reloaded instantly when requested. This patch converts various SLA objects to be reference counted objects using astobj2. This allows reloads to be processed while the system is in use. The code ensures that the objects will not disappear while one of the other threads is using them. However, they will be immediately removed from the global trunk and station containers so no new calls will use them if removed from configuration. Review: https://reviewboard.asterisk.org/r/2581/ ........ Merged revisions 393928 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 393929 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01Refactor extraneous channel eventsKinsey Moore
This change removes JitterBufStats, ChannelReload, and ChannelUpdate and refactors the following events to travel over Stasis-Core: * LocalBridge * DAHDIChannel * AlarmClear * SpanAlarmClear * Alarm * SpanAlarm * DNDState * MCID * SIPQualifyPeerDone * SessionTimeout Review: https://reviewboard.asterisk.org/r/2627/ (closes issue ASTERISK-21476) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-07app_meetme: Refactor manager events to use stasisJonathan Rose
(closes issue ASTERISK-21467) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2564/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-06Make SLA reload more paranoid.Russell Bryant
Reload support was originally not included for SLA. It was added later, but in a fairly non-traditional way. It basically sets a flag indicating that a reload is pending, and then waits for a time where it thinks everything SLA related is idle and unused, and *then* executes the reload. It does this because the reload process is destructive. It starts by throwing everything away and starting over. There are a number of problems with this approach. One of them is that the check to see if anything in use was incomplete. This patch makes it more complete and thus less likely for a crash to occur during reload processing. However, this approach still has problems so some much more significant reworking of this code will need to come in as a next step. Patch credit and testing by CoreDial, LLC. ........ Merged revisions 387688 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387689 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-22sla: remove redundant locking.Russell Bryant
sla.lock was already locked in the only place that sla_check_reload() was called. Remove the redundant locking of sla.lock done in this function. Less recursive locking is A Good Thing. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-26Fix multi-station answer race condition.Russell Bryant
When an SLA trunk is ringing (inbound call on the trunk) Asterisk will make outbound calls to the stations that have that trunk. If more than one station answers the call at the same time, all channels other than the first one to answer are left in a bad state. The channel gets leaked, is not connected to anything, and there's no way to get rid of it. We now properly clean up these losing channels by hanging up on them. Since they lost the race, as we process their answer, there is no ringing trunk for them to answer. ........ Merged revisions 383835 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383836 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28Let channels joining a MeetMe conference opt out of the denoiserMatthew Jordan
For some channel drivers, specifically those that have a varying rate in the number of audio samples, the audio quality for a MeetMe conference can be exceedingly poor. This is due to a unilateral application of the DENOISE function in func_speex to channels joining the conference. The denoiser function in the speex library is initialized with the number of audio samples in each sample that will be provided to it. If the number of audio samples changes, the denoiser has to be thrown away and re-initialized. While this could be worked around by removing func_speex, that doesn't help if you actually use the denoiser with other channels on the system. This patches does the following: * Checks for the presence of func_speex as opposed to codec_speex when determining if the DENOISE function is present (which is where the function is actually implemented) * Adds an option to MeetMe 'n' that causes the denoiser to not be applied to a channel when it joins. This keeps the current behavior the default, but let's users disable the denoiser if it causes problems on their system. Review: https://reviewboard.asterisk.org/r/2358 (closes issue AST-1062) Reported by: Thomas Arimont ........ Merged revisions 382227 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382230 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-22app_meetme: Use new prompts for administrator menuJonathan Rose
The old prompts for the administrator menu were inadequate. They didn't mention that the menu had additional options through the 8 key and pressing the 8 key wouldn't reveal what those options were. This patch fixes all of that while also organizing code pertaining to each individual menu type which was previously all stored in one gigantic function along with many of the basic conference functions. (closes issue AST-996) Reported by: John Bigelow Review: http://reviewboard.digium.internal/r/360/ ........ Merged revisions 379885 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 379892 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-22Fix station ringback; trunk hangup issues in SLAMatthew Jordan
This patch fixes two bugs: * If an outbound call is made from a SLA phone using SLAStation, then there is no ringtone audible to the phone that originates the call. The indication of the ringing was not being passed to the SLA station; this patch fixes that by passing through the progress indications. * If an SLA station hangs up before the called party answers, then the channel to the called party continues to ring until a timeout occurs. If the called party manages to answer, Asterisk attempts to connect the called party to a non-existant MeetMe room. This patch corrects the behavior by abandoning the call attempt if it detects that the SLA station is no longer in use while attempting to call the called party. Review: https://reviewboard.asterisk.org/r/2275/ (closes issue ASTERISK-20462) Reported by: dkerr patches: asterisk-11-bugid20440+20462.patch uploaded by dkerr (license 5558) asterisk-11-bugid20462.patch uploaded by dkerr (license 5558) (closes issue ASTERISK-20440) Reported by: dkerr patches: asterisk-11-bugid20440.patch uploaded by dkerr (license 5558) asterisk-11-bugid20440+20462.patch uploaded by dkerr (license 5558) ........ Merged revisions 379825 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 379826 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02Prevent exhaustion of system resources through exploitation of event cacheMatthew Jordan
Asterisk maintains an internal cache for devices in the event subsystem. The device state cache holds the state of each device known to Asterisk, such that consumers of device state information can query for the last known state for a particular device, even if it is not part of an active call. The concept of a device in Asterisk can include entities that do not have a physical representation. One way that this occurred was when anonymous calls are allowed in Asterisk. A device was automatically created and stored in the cache for each anonymous call that occurred; this was possible in the SIP and IAX2 channel drivers and through channel drivers that utilized the res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices are never removed from the system, allowing anonymous calls to potentially exhaust a system's resources. This patch changes the event cache subsystem and device state management to no longer cache devices that are not associated with a physical entity. (issue ASTERISK-20175) Reported by: Russell Bryant, Leif Madsen, Joshua Colp Tested by: kmoore patches: event-cachability-3.diff uploaded by jcolp (license 5000) ........ Merged revisions 378303 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378320 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378321 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-15app_meetme: Fix channels lingering when hung up under certain conditionsJonathan Rose
Channels would get stuck and MeetMe would repeatedly display an Unable to write frame to channel error in the conf_run function if hung up during certain sound prompts such as during user count announcements. This patch fixes that by reintroducing a hangup check in the meetme's main loop (also in conf_run). (closes issue ASTERISK-20486) Reported by: Michael Cargile Review: https://reviewboard.asterisk.org/r/2187/ Patches: meetme_hangup_patch_ASTERISK-20486_v3.diff uploaded by Jonathan Rose (license 6182) ........ Merged revisions 376307 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376308 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376310 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07Multiple revisions 375993-375994Mark Michelson
........ r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines Fix misuses of timeouts throughout the code. Prior to this change, a common method for determining if a timeout was reached was to call a function such as ast_waitfor_n() and inspect the out parameter that told how many milliseconds were left, then use that as the input to ast_waitfor_n() on the next go-around. The problem with this is that in some cases, submillisecond timeouts can occur, resulting in the out parameter not decreasing any. When this happens thousands of times, the result is that the timeout takes much longer than intended to be reached. As an example, I had a situation where a 3 second timeout took multiple days to finally end since most wakeups from ast_waitfor_n() were under a millisecond. This patch seeks to fix this pattern throughout the code. Now we log the time when an operation began and find the difference in wall clock time between now and when the event started. This means that sub-millisecond timeouts now cannot play havoc when trying to determine if something has timed out. Part of this fix also includes changing the function ast_waitfor() so that it is possible for it to return less than zero when a negative timeout is given to it. This makes it actually possible to detect errors in ast_waitfor() when there is no timeout. (closes issue ASTERISK-20414) reported by David M. Lee Review: https://reviewboard.asterisk.org/r/2135/ ........ r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines Remove some debugging that accidentally made it in the last commit. ........ Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375995 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376014 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3