summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2014-06-16We have faced situation when using CDR and CEL by sqlite3 modules. With ↵Igor Goncharovskiy
system having high load (~100 concurrent calls created by sipp) we found many cdr and cel records missed. There is special finction in sqlite3, that make able to fix this situation - sqlite3_wait_timeout, that also can replace awful code cdr_sqlite3 ad cel_sqlite3 modules. Also this function can be used for aastdb and res_config_sqlite3 to avoid missed writes to sqlite db. #ASTERISK-23766 #close Reported by: Igor Goncharovsky Review: https://reviewboard.asterisk.org/r/3559/ ........ Merged revisions 416336 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416337 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416338 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-15channel_internal_api: Publish a snapshot change when linkedids changeMatthew Jordan
Snapshots are now not published *quite* as much as they used to. One instance where they are not published any longer is during bridge enter and exit - the state of the channel doesn't change, the bridge does. However, channels are changed when a linkedid is propagated; previously, the channel's state would be updated and published during the bridge enter event. Now this must be explicitly done. ........ Merged revisions 416300 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416301 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-06-13CEL: Expose parking retreiver in extra fieldKinsey Moore
This exposes the retreiver of a parked call under the "retreiver" key of the extra field when this information is available. Review: https://reviewboard.asterisk.org/r/3608/ ........ Merged revisions 416148 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13AST-2014-007: Fix of fix to allow AMI and SIP TCP to send messages.Richard Mudgett
ASTERISK-23673 #close Reported by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/3617/ ........ Merged revisions 416066 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416067 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416070 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12main/pbx - documentation - enhance 'core show hints' and 'core show hint' ↵Rusty Newton
help text Adds descriptive help text to 'core show hints' and 'core show hint'. The text describes the various columns for the sake of clarity. It takes into account recent changes to the content displayed by the commands https://reviewboard.asterisk.org/r/3604/ and https://reviewboard.asterisk.org/r/3611/. ASTERISK-23764 Review: https://reviewboard.asterisk.org/r/3610/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12AST-2014-007: Fix DOS by consuming the number of allowed HTTP connections.Richard Mudgett
Simply establishing a TCP connection and never sending anything to the configured HTTP port in http.conf will tie up a HTTP connection. Since there is a maximum number of open HTTP sessions allowed at a time you can block legitimate connections. A similar problem exists if a HTTP request is started but never finished. * Added http.conf session_inactivity timer option to close HTTP connections that aren't doing anything. Defaults to 30000 ms. * Removed the undocumented manager.conf block-sockets option. It interferes with TCP/TLS inactivity timeouts. * AMI and SIP TLS connections now have better authentication timeout protection. Though I didn't remove the bizzare TLS timeout polling code from chan_sip. * chan_sip can now handle SSL certificate renegotiations in the middle of a session. It couldn't do that before because the socket was non-blocking and the SSL calls were not restarted as documented by the OpenSSL documentation. * Fixed an off nominal leak of the ssl struct in handle_tcptls_connection() if the FILE stream failed to open and the SSL certificate negotiations failed. The patch creates a custom FILE stream handler to give the created FILE streams inactivity timeout and timeout after a specific moment in time capability. This approach eliminates the need for code using the FILE stream to be redesigned to deal with the timeouts. This patch indirectly fixes most of ASTERISK-18345 by fixing the usage of the SSL_read/SSL_write operations. ASTERISK-23673 #close Reported by: Richard Mudgett ........ Merged revisions 415841 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415854 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415896 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-11format.c: Fix misuse of hash container function.Richard Mudgett
The supplied hash function to a container must be idempotent given the object's key value to figure out which container bucket the object belongs in. Returning a random number or the current container count is not idempotent. The "computed hash" value doesn't help find the object later in those cases. * Fixed the format_list container to actually be a list since that is how the container is used. Conceptually, if more than 283 formats were added to the format_list then odd things may have happened before the fix. ........ Merged revisions 415728 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415729 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-11CLI: correct presence information on core show hintsScott Griepentrog
Adds presence to core show hint and changes presence string conversion to use the correct function. ASTERISK-23858 #close Review: https://reviewboard.asterisk.org/r/3611/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-10CLI: add presence information to core show hintsScott Griepentrog
Adds presence state value to output of core show hints. Also reformats the output slightly so it doesn't use as much space as it would otherwise. Was: 1000@demo : SIP/1000 State:Unavailable Watchers 0 Now: 1000@demo : SIP/1000 State:Unavailable Presence:Idle Watchers 0 AFS-53 #close Review: https://reviewboard.asterisk.org/r/3604/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-10Fix build in dev mode due to signed/unsigned mismatchKinsey Moore
........ Merged revisions 415678 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-10PJSIP: PJSIPNotify - Strip content-length headers and add documentationJonathan Rose
Documentation for how to add custom headers/content to notifies created with the PJSIPNotify manager action was a little sparse and it also wasn't vetting application of Content-length headers like its chan_sip equivalent was (so two Content-length headers could be applied... and PJSIP determines the content length anyway, so it just opens people up for error). This patch also flips the variable order so that the variables are interpreted in the same order as they are put in the AMI action. Review: https://reviewboard.asterisk.org/r/3587/ ........ Merged revisions 415658 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-09autoservice: stop thread on graceful shutdownCorey Farrell
This change adds thread shutdown to autoservice for graceful shutdowns only. ast_register_cleanup is backported to 1.8 to allow this. The logger callid is also released on shutdown in 11+. ASTERISK-23827 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3594/ ........ Merged revisions 415463 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415464 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415465 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-08bridges/bridge_native_rtp: Reconfigure bridge on removal of framehookMatthew Jordan
This patch is a re-do of r414122. When r414122 was merged, a major problem with it was uncovered. UNBRIDGE soft hangup flags have a catastrophic effect on the pbx core if they leak out from the bridge layer: the channel gets hung up. With the number of threads involved in a blind transfer, and with the initial patch, it was likely that this would occur. This caused a large number of test failures This patch is nearly identical with the one proposed in r414122, save for the following changes: - We explicitly clear the UNBRIDGE flag when setting an after goto on a channel in a bridge - Defensively, if we encounter an UNBRIDGE flag in the pbx core, we handle it https://reviewboard.asterisk.org/r/3585/ ........ Merged revisions 415443 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-06chan_sip: Fix order of variables specified in SIPNotify actionJonathan Rose
Prior to this patch, sequential variables would be ordered in reverse from the order specified in the manager action. Review: https://reviewboard.asterisk.org/r/3588/ ........ Merged revisions 415359 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415390 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415410 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-06core uri: Custom uri parsing error when no query parametersKevin Harwell
If using the custom URI parsing code (not external uriparser lib) and there was no query parameters the resulting pointer would be NULL and then an attempt was made to subtract from it. The pointer is now set to a valid value if there is no query parameter(s). Also, in the 'ast_uri_make_host_with_port' function when setting the terminator on the resulting string it was writing it one past the end of allocated memory. It now writes the string terminator appropriately. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-06Split astobj2.c into more maintainable components.George Joseph
Split astobj2.c into the following files to improve maintainability. astobj2.c - object primitives, object primitive misc and initialization code. astobj2_private.h - internal object declarations needed by the containers. astobj2_container.c - generic conainer and container misc code. astobj2_container_hash.c - hash container specific code. astobj2_container_rbtree.c - rbtree container specific code. astobj2_container_private.h - generic container definitions and rtti prototypes. https://reviewboard.asterisk.org/r/3576/ ........ Merged revisions 415317 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-05config: Fix indentation and missing curlies in config_text_file_load().Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-05config: Fix config files not reloading when only an included file changes.Richard Mudgett
The twisted logic determining if a config file should be reloaded was mostly broken and disabled. The incorrect test that ASTERISK-23383 fixed actually reenabled the broken logic. The incorrect test was causing the timestamp to always be cleared which caused config files with includes to always be reloaded. * Made wildcard includes always cause a reload. Determining if a file was deleted cannot be determined without restructuring the cache to determine if any files are missing from the last files actually loaded. Also without refactoring config_text_file_load(), the glob loop couldn't check more than one file for changes anyway. * Made remove the cache entry if the file no longer exists when trying to get its timestamp or it is no longer a regular file. This fixes the corner case where the file was loaded, then deleted, then the config reloaded, then the file restored with the same timestamp, and then the config reloaded again. * Made remove the cache entry include list when actually loading the file. This gets rid of any stale includes the file had from the last time the file was loaded. ASTERISK-23683 #close Reported by: tootai Review: https://reviewboard.asterisk.org/r/3575/ ........ Merged revisions 415225 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415229 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415230 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-05res_http_websocket: Create a websocket clientKevin Harwell
Added a websocket server client in Asterisk. Asterisk has a websocket server, but not a client. The ability to have Asterisk be able to connect to a websocket server can potentially be useful for future work (for instance this could allow ARI to connect back to some external system, although more work would be needed in order to incorporate that). Also a couple of things to note - proxy connection support has not been implemented and there is limited http response code handling (basically, it is connect or not). Also added an initial new URI handling mechanism to core. Internet type URI's are parsed into a data structure that contains pointers to the various parts of the URI. (closes issue ASTERISK-23742) Reported by: Kevin Harwell Review: https://reviewboard.asterisk.org/r/3541/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-30TALK_DETECT: A channel function that raises events when talking is detectedMatthew Jordan
This patch adds a new channel function TALK_DETECT that, when set on a channel, causes events indicating the start/stop of talking on a channel to be emitted to both AMI and ARI clients. The function allows setting both the silence threshold (the length of silence after which we decide no one is talking) as well as the talking threshold (the amount of energy that counts as talking). Parameters can be updated on a channel after talk detection has been enabled, and talk detection can be removed at any time. The events raised by the function use a nomenclature similar to existing AMI/ARI events. For AMI: ChannelTalkingStart/ChannelTalkingStop For ARI: ChannelTalkingStarted/ChannelTalkingFinished Review: https://reviewboard.asterisk.org/r/3563/ #ASTERISK-23786 #close Reported by: Matt Jordan ........ Merged revisions 414934 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-30main/config.c: AMI action UpdateConfig EmptyCat clears all categoriesMatthew Jordan
When invoking UpdateConfig AMI action with Action set to EmptyCat, Asterisk will make all categories empty in the config but the one requested with a Cat variable. This is due to a bug in ast_category_empty (main/config.c) that makes an incorrect comparison for a category name. This patch corrects the comparison such that only the requested category is cleared. Review: https://reviewboard.asterisk.org/r/3573/ #ASTERISK-23803 #close Reported by: zvision patches: manager.c.diff uploaded by zvision (License 5755) ........ Merged revisions 414880 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414881 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414882 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-29PBX: Prevent incorrect hint parsingKinsey Moore
Dynamic and pattern matching hints should not be checked for their last known state until they are instantiated by subscribers. (closes issue AFS-56) Reported by: John Hardin Patch AFS-56-pbx.diff submitted by Matt Jordan (license 6283) ........ Merged revisions 414813 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414859 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414860 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28Logger/CLI/etc.: Fix some aesthetic issues; reduce chatty verbose messagesMatthew Jordan
This patch addresses some aesthetic issues in Asterisk. These are all just minor tweaks to improve the look of the CLI when used in a variety of settings. Specifically: * A number of chatty verbose messages were removed or demoted to DEBUG messages. Verbose messages with a verbosity level of 5 or higher were - if kept as verbose messages - demoted to level 4. Several messages that were emitted at verbose level 3 were demoted to 4, as announcement of dialplan applications being executed occur at level 3 (and so the effects of those applications should generally be less). * Some verbose messages that only appear when their respective 'debug' options are enabled were bumped up to always be displayed. * Prefix/timestamping of verbose messages were moved to the verboser handlers. This was done to prevent duplication of prefixes when the timestamp option (-T) is used with the CLI. * Verbose magic is removed from messages before being emitted to non-verboser handlers. This prevents the magic in multi-line verbose messages (such as SIP debug traces or the output of DumpChan) from being written to files. * _Slightly_ better support for the "light background" option (-W) was added. This includes using ast_term_quit in the output of XML documentation help, as well as changing the "Asterisk Ready" prompt to bright green on the default background (which stands a better chance of being displayed properly than bright white). Review: https://reviewboard.asterisk.org/r/3547/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-25core_unreal: Prevent double free of core_unreal pvtMatthew Jordan
When a channel is destroyed (such as via ast_channel_release in off nominal paths in core_unreal), it will attempt to free (via ast_free) the channel tech pvt. This is problematic for a few reasons: 1. The channel tech pvt is an ao2 object in core_unreal. Free'ing the pvt directly is no good. 2. The channel tech pvt's reference count is dropped just prior to calling ast_channel_release, resulting in the pvt's destruction. Hence, the channel destructor is free'ing an invalid pointer. This patch keeps the dropping of the reference count, but sets the pvt to NULL on the channel prior to releasing it. This models what would occur if the channel was hung up directly. ........ Merged revisions 414542 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-23Fix signed/unsigned build warningsKinsey Moore
........ Merged revisions 414474 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22ARI: Add ability to raise arbitrary User EventsScott Griepentrog
User events can now be generated from ARI. Events can be signalled with arbitrary json variables, and include one or more of channel, bridge, or endpoint snapshots. An application must be specified which will receive the event message (other applications can subscribe to it). The message will also be delivered via AMI provided a channel is attached. Dialplan generated user event messages are still transmitted via the channel, and will only be received by a stasis application they are attached to or if the channel is subscribed to. This change also introduces the multi object blob mechanism used to send multiple snapshot types in a single message. The dialplan app UserEvent was also changed to use multi object blob, and a new stasis message type created to handle them. ASTERISK-22697 #close Review: https://reviewboard.asterisk.org/r/3494/ ........ Merged revisions 414405 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22res_pjsip_refer: Fix bugs involving Parking/PJSIP/transfersJonathan Rose
PJSIP would never send the final 200 Notify for a blind transfer when transferring to parking. This patch fixes that. In addition, it fixes a reference leak when performing blind transfers to non-bridging extensions. Review: https://reviewboard.asterisk.org/r/3485/ ........ Merged revisions 414400 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22res_corosync: Update module to work with Stasis (and compile)Matthew Jordan
This patch fixes res_corosync such that it works with Asterisk 12. This restores the functionality that was present in previous versions of Asterisk, and ensures compatibility with those versions by restoring the binary message format needed to pass information from/to them. The following changes were made in the core to support this: * The event system has been partially restored. All event definition and event types in this patch were pulled from Asterisk 11. Previously, we had hoped that this information would live in res_corosync; however, the approach in this patch seems to be better for a few reasons: (1) Theoretically, ast_events can be used by any module as a binary representation of a Stasis message. Given the structure of an ast_event object, that information has to live in the core to be used universally. For example, defining the payload of a device state ast_event in res_corosync could result in an incompatible device state representation in another module. (2) Much of this representation already lived in the core, and was not easily extensible. (3) The code already existed. :-) * Stasis message types now have a message formatter that converts their payload to an ast_event object. * Stasis message forwarders now handle forwarding to themselves. Previously this would result in an infinite recursive call. Now, this simply creates a new forwarding object with no forwards set up (as it is the thing it is forwarding to). This is advantageous for res_corosync, as returning NULL would also imply an unrecoverable error. Returning a subscription in this case allows for easier handling of message types that are published directly to an aggregate topic that has forwarders. Review: https://reviewboard.asterisk.org/r/3486/ ASTERISK-22912 #close ASTERISK-22372 #close ........ Merged revisions 414330 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-21core_unreal: Only block media frames when a generator is on both ends of an ↵Richard Mudgett
unreal channel. The fix for ASTERISK-12292 was a bit too aggressive. You could have generators pointed at each other on local channels but need to get other kinds of frames such as DTMF or CONNECTED_LINE frames accross. ........ Merged revisions 414269 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414270 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414272 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-19Undo r414123Matthew Jordan
The Test Suite caught a few problems, undoing until those are resolved git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-18bridge_native_rtp/bridge_channel: Fix direct media issues due to frame hookMatthew Jordan
This patch fixes issues with direct media bridges that occur after a blind transfer. These issues were caught by the (currently failing) pjsip/transfers/blind_transfer/caller_direct_media test. The test currently fails primarily for two reasons: (1) When Bob and Charlie (the transfer target and the transfer destination) enter a bridge together, the framehook remains on the transfer target channel until both channels are in the bridge. As it consumes voice frames, the initial bridge type is a simple bridge. The framehook is removed when both channels are in the bridge; however, this does not currently cause the bridging framework to re-evaluate the bridge. This patch adds a AST_SOFTHANGUP_UNBRIDGE poke to the transfer target channel when a framehook is removed so the bridge can re-evaluate itself. (2) When a channel leaves a native RTP bridge, it may be leaving due to being hung up. Sending a re-INVITE to a channel that is about to be hung up is not nice - in fact, there's a good chance we'll send the BYE request before the channel has had a chance to send back a 200 OK. To be somewhat nicer, this patch adds a function to channel.h that allows the bridging framework to query for exactly why a channel is leaving a bridge via the channel's soft hangup flags. This allows it to only send the re-INVITE if there's a chance the channel will survive the native bridging experience. Review: https://reviewboard.asterisk.org/r/3535/ ........ Merged revisions 414122 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13chan_sip: Add TLS and SRTP status to CLI command 'sip show channel'Jonathan Rose
ASTERISK-23564 #close Reported by: Patrick Laimbock Review: https://reviewboard.asterisk.org/r/3474/ ........ Merged revisions 413876 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413877 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13rtp: Fix case typo in H263+ mime.Walter Doekes
http://tools.ietf.org/html/rfc3555#section-4.2.6 says the canonical mime subtype is "H263-1998", not "h263-1998". Original code was added in r183101 on 2009-03-19 02:26:50 +0100. This fixes issues with Polycom phones. ASTERISK-23665 #close ASTERISK-23665 #comment Patch r3529.patch uploaded by Guillaume Maudoux, backported by me. Review: https://reviewboard.asterisk.org/r/3529/ ........ Merged revisions 413787 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413788 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413789 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-11framehooks: Add callback for determining if a hook is consuming frames of a ↵Joshua Colp
specific type. In the past framehooks have had no capability to determine what frame types a hook is actually interested in consuming. This has meant that code has had to assume they want all frames, thus preventing native bridging. This change adds a callback which allows a framehook to be queried for whether it is consuming a frame of a specific type. The native RTP bridging module has also been updated to take advantange of this, allowing native bridging to occur when previously it would not. ASTERISK-23497 #comment Reported by: Etienne Lessard ASTERISK-23497 #close Review: https://reviewboard.asterisk.org/r/3522/ ........ Merged revisions 413681 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-11Undoing framehook support. Issues were uncovered by Bamboo.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-10framehooks: Add callback for determining if a hook is consuming frames of a ↵Joshua Colp
specific type. In the past framehooks have had no capability to determine what frame types a hook is actually interested in consuming. This has meant that code has had to assume they want all frames, thus preventing native bridging. This change adds a callback which allows a framehook to be queried for whether it is consuming a frame of a specific type. The native RTP bridging module has also been updated to take advantange of this, allowing native bridging to occur when previously it would not. ASTERISK-23497 #comment Reported by: Etienne Lessard ASTERISK-23497 #close Review: https://reviewboard.asterisk.org/r/3522/ ........ Merged revisions 413650 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09http.c: Remove dead code.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-08app_queue: Extend documentation for various Manager actions and events.Joshua Colp
........ Merged revisions 413485 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413486 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413487 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30chan_sip.c: Fixed off-nominal message iterator ref count and alloc fail issues.Richard Mudgett
* Fixed early exit in sip_msg_send() not destroying the message iterator. * Made ast_msg_var_iterator_next() and ast_msg_var_iterator_destroy() tolerant of a NULL iter parameter in case ast_msg_var_iterator_init() fails. * Made ast_msg_var_iterator_destroy() clean up any current message data ref. * Made struct ast_msg_var_iterator, ast_msg_var_iterator_init(), ast_msg_var_iterator_next(), ast_msg_var_unref_current(), and ast_msg_var_iterator_destroy() use iter instead of i. * Eliminated RAII_VAR usage in res_pjsip_messaging.c:vars_to_headers(). ........ Merged revisions 413139 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413142 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-28Bridging: Don't lock NULL bridgesKinsey Moore
When bridge locking was added for bridge snapshot creation, some locations where bridge locking was added were not guaranteed to actually have a bridge and locking NULL AO2 objects tends to cause segfaults. This ensures that NULL bridges aren't locked. ........ Merged revisions 413073 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-28Add DeviceStateChanged and PresenceStateChanged AMI events.Mark Michelson
These events are controlled by two new modules, res_manager_devicestate and res_manager_presencestate. Review: https://reviewboard.asterisk.org/r/3417 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-27tcptls.c : Log errors as ERROR, not warning or something else.Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-23http: Fix spurious ERROR message in responses with no content.Richard Mudgett
Backport -r411687 and fix the fix because content_length is the length of out plus the length of the file controlled by fd. When a response has an out content length of 0, fwrite would be called to write a buffer with no data in it. This resulted in the following classic error message: [Apr 3 11:49:17] ERROR[26421] http.c: fwrite() failed: Success This patch makes it so that we only attempt to write the content of out if the out string is non-zero. ........ Merged revisions 412922 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412923 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412924 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-23Fix error loading res_monitor.Russell Bryant
For some odd reason, loading app_mixmonitor was fine, but res_monitor was not. This patch fixes a set of issues related to func_periodic_hook exporting the beep functions that gets res_monitor working again. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-21HTTP: Add TCP_NODELAY to accepted connectionsKinsey Moore
This adds the TCP_NODELAY option to accepted connections on the HTTP server built into Asterisk. This option disables the Nagle algorithm which controls queueing of outbound data and in some cases can cause delays on receipt of response by the client due to how the Nagle algorithm interacts with TCP delayed ACK. This option is already set on all non-HTTP AMI connections and this change would cover standard HTTP requests, manager HTTP connections, and ARI HTTP requests and websockets in Asterisk 12+ along with any future use of the HTTP server. Review: https://reviewboard.asterisk.org/r/3466/ ........ Merged revisions 412745 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412748 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412749 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-19main/asterisk: Fix startup sequence for realtime featuresMatthew Jordan
When ASTERISK-23265/ASTERISK-23320 was fixed, it inadvertently led to realtime features breaking. This was due to features loading prior to realtime. This patch fixes this by loading features after loading dynamic modules. ASTERISK-23487 #close Reported by: Denis Tested by: Denis ........ Merged revisions 412698 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-18Originated calls: Fix several originate call problems.Richard Mudgett
* Restore the reason value set by pbx_outgoing_attempt() to use AST_CONTROL_xxx values as all the consumers were expecting rather than cause codes. * Fixed the dial routines to set cause codes for more than just ast_request() so pbx_outgoing_attempt() reason codes will function. * Fix inconsistent locked_channel return status in pbx_outgoing_attempt(). The chanel may not have been locked or the channel may have been a stale pointer. * Fixed the OutgoingSpoolFailed channel to run dialplan whenever the dialing fails for an originate exten and 1 < synchronous. * Fix incorrect ast_cond_wait() usage in pbx_outgoing_attempt(). Indroduced by issue ASTERISK-22212 patch. * Made struct pbx_outgoing use the ao2 lock instead of its own lock for the cond wait mutex. No sense in having two locks associated with the same struct when only one is needed. Review: https://reviewboard.asterisk.org/r/3421/ ........ Merged revisions 412581 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-18app_dial and app_queue: Make lock the forwarding channel while taking the ↵Richard Mudgett
channel snapshot. * Fixed ast_channel_publish_dial_forward() not locking the forwarded channel when taking the channel snapshot. * Fixed app_dial.c:do_forward() using the wrong channel to get the original call forwarding string. * Removed unnecessary locking when calling ast_channel_publish_dial() and ast_channel_publish_dial_forward() in app_dial and app_queue. Holding channel locks when calling ast_channel_publish_dial_forward() with a forwarded channel could result in pausing the system while the stasis bus completes processsing a forwarded channel subscription. Review: https://reviewboard.asterisk.org/r/3451/ ........ Merged revisions 412579 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412580 65c4cc65-6c06-0410-ace0-fbb531ad65f3