summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-06-26res_http_websocket: Close websocket correctly and use careful fwriteMatthew Jordan
When a client takes a long time to process information received from Asterisk, a write operation using fwrite may fail to write all information. This causes the underlying file stream to be in an unknown state, such that the socket must be disconnected. Unfortunately, there are two problems with this in Asterisk's existing websocket code: 1. Periodically, during the read loop, Asterisk must write to the connected websocket to respond to pings. As such, Asterisk maintains a reference to the session during the loop. When ast_http_websocket_write fails, it may cause the session to decrement its ref count, but this in and of itself does not break the read loop. The read loop's write, on the other hand, does not break the loop if it fails. This causes the socket to get in a 'stuck' state, preventing the client from reconnecting to the server. 2. More importantly, however, is that the fwrite in ast_http_websocket_write fails with a large volume of data when the client takes awhile to process the information. When it does fail, it fails writing only a portion of the bytes. With some debugging, it was shown that this was failing in a similar fashion to ASTERISK-12767. Switching this over to ast_careful_fwrite with a long enough timeout solved the problem. Note that this version of the patch, unlike r417310 in Asterisk 11, exposes configuration options beyond just chan_sip's sip.conf. Configuration options to configure the write timeout have also been added to pjsip.conf and ari.conf. #ASTERISK-23917 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3624/ ........ Merged revisions 417310 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 417311 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26chan_sip: Fix handling of "From" headers longer than 256 charactersCorey Farrell
From headers were processed using a 256 character buffer on the stack. This change replaces that with a heap allocation by ast_strdup. ASTERISK-23790 #close Reported by: uniken1 Tested by: uniken1 Review: https://reviewboard.asterisk.org/r/3669/ Patches: chan_sip-large-from-header-1.8-r3.patch uploaded by wdoekes (license 5674) ........ Merged revisions 417248 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 417249 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 417250 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-25Abstract PJSIP-specific elements from the pubsub API.Mark Michelson
This helps to pave the way for RLS work that is to come. Since this is a self-contained change and subscription tests still pass, this work is being committed directly to trunk instead of a working branch. ASTERISK-23865 #close Review: https://reviewboard.asterisk.org/r/3628 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-25ao2_container node object ignores REF_DEBUG in all places except oneCorey Farrell
Almost every reference operation against container node's uses __ao2_alloc or __ao2_ref, thereby preventing ref logging for the nodes. One node reference is released with ao2_t_ref, causing refcounter.py to falsely report skews and leaks for many nodes. ASTERISK-23922 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3670/ ........ Merged revisions 417212 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-25Skinny: cleanup some log messages around sessions.Damien Wedhorn
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-24Move eid functions to utils.c, mark netsock.h deprecatedCorey Farrell
Move eid functions from netsock.c to utils.c. These functions were already published by utils.h. Flag netsock.h as deprecated and switch res_pjsip_session.h to use netsock2.h. The only code that still uses netsock.h is chan_iax2. ASTERISK-23920 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3661/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23res_rtp_asterisk: Return the length of data written when sending via ICE ↵Joshua Colp
instead of 0. ASTERISK-23834 #close Reported by: Richard Kenner ........ Merged revisions 417141 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 417142 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23core_unreal: Fix off by one buffer overwrite error.Richard Mudgett
Appending the ;2 to the user supplied ;1 uniqueid to create the ;2 version if the user did not also supply an extra uniqueid for the ;2 channel resulted in allocating a buffer that was one byte too small. * Fix off by one error in ast_unreal_new_channels() when generating the ;2 uniqueid from the user suppled ;1 version. * Pulled some long assignment lines from if tests to improve line break readability in ast_unreal_new_channels(). ........ Merged revisions 417119 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23suspended destructions of pri spans on eventsTzafrir Cohen
If a DAHDI span disappears, we wish for its representation in Asterisk to be destroyed as well. The information about the span's removal may come from several paths: 1. DAHDI sends DAHDI_EVENT_REMOVE on every channel. 2. An extra DAHDI_EVENT_REMOVED is sent on every subsequent call to DAHDI_GET_EVENT. 3. Every read (including the internal one by libpri on the D-channel) returns -ENODEV. Asterisk responsds to DAHDI_EVENT_REMOVE on a channel by destroying it. Destroying a channel requires holding the channel list lock (iflock). Destroying a channel that is part of a span requires holding the span's lock. Destroying a channel from a context that holds the span lock, while at the same time another channel is destroyed directly, leads to a deadlock. Solution: don't destroy span while holding the channels list lock. Thus changes in this patch: * Deferring removal of PRI spans in response to events: doomed spans are collected on a list. * Doomed spans are removed periodically by the monitor thread. * ENODEV reads from the D-channel will warant the same deferred removal. Review: https://reviewboard.asterisk.org/r/3548/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-22astobj2: Add an ao2_replace macro to astobj2.hGeorge Joseph
This macro replaces one object reference with another cleaning up the original. param dst Pointer to the object that will be cleaned up. param src Pointer to the object replacing it. src's ref count is bumped if it's non-NULL. dst's ref count is decremented if it's non-NULL. src is assigned to dst, This patch was reviewed on IRC by coreyfarrell and mjordan. Tested by: George Joseph ........ Merged revisions 416995 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20build: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.George Joseph
ast_ext_tool_check.m4 isn't handling cases where a path to a package is provided (E.G. --with-mysqlclient=/some/sysroot) and the package has a config tool (E.G. mysql_config) and the package has its own subdirectories in include or lib. For example, mysql's libraries are in ${MYSQLCLIENT_DIR}/usr/lib/mysql but ast_ext_tool_check sets MYSQLCLIENT_LIB to ${MYSQLCLIENT_DIR}/usr/lib. libxml2 has the same problem with its includes. They're in ${LIBXML2_DIR}/usr/include/libxml2 not directly in ${LIBXML2_DIR}/usr/include. Both cause configure to fail and there are others in the same boat. The problem is caused by logic in ast_ext_tool_check that overrides the result of the config tool's --cflags and --libs options if package_DIR is set. This patch prepends package_DIR (if specified) to the -L and -I results from the package's config tool instead of overriding them. A regenerated ./configure and include/asterisk/autoconfig.h.in are included but can be regenerated by running ./bootstrap.sh at any time. Tested by: George Joseph Tested by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3550/ ........ Merged revisions 416929 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416930 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416931 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20build: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.George Joseph
ast_ext_tool_check.m4 isn't handling cases where a path to a package is provided (E.G. --with-mysqlclient=/some/sysroot) and the package has a config tool (E.G. mysql_config) and the package has its own subdirectories in include or lib. For example, mysql's libraries are in ${MYSQLCLIENT_DIR}/usr/lib/mysql but ast_ext_tool_check sets MYSQLCLIENT_LIB to ${MYSQLCLIENT_DIR}/usr/lib. libxml2 has the same problem with its includes. They're in ${LIBXML2_DIR}/usr/include/libxml2 not directly in ${LIBXML2_DIR}/usr/include. Both cause configure to fail and there are others in the same boat. The problem is caused by logic in ast_ext_tool_check that overrides the result of the config tool's --cflags and --libs options if package_DIR is set. This patch prepends package_DIR (if specified) to the -L and -I results from the package's config tool instead of overriding them. Tested by: George Joseph Tested by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3550/ ........ Merged revisions 416870 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416871 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20res_parking: Make manager commands register with module informationJonathan Rose
Previously module information was not included due to an oversight. Review: https://reviewboard.asterisk.org/r/3626/ ........ Merged revisions 416849 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20Logger: Add manager command 'LoggerRotate' to rotate loggerJonathan Rose
Part of a series of AMI command equivalents to existing CLI commands Review: https://reviewboard.asterisk.org/r/3651/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20voicemail API callbacks: Extract the sayname API call to its own registerd ↵Richard Mudgett
callback. * Extract the sayname API call to its own registerd callback. This allows the app_directory and app_chanspy applications to say a mailbox owner's name using an alternate provider when app_voicemail is not available because you are using res_mwi_external. app_directory still uses the voicemail.conf file. AFS-64 #close Reported by: Mark Michelson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20astobj2: Additional refactoring to push impl specific code down into the impls.George Joseph
Move some implementation specific code from astobj2_container.c into astobj2_hash.c and astobj2_rbtree.c. This completely removes the need for astobj2_container to switch on RTTI and it no longer has any knowledge of the implementation details. Also adds AO2_DEBUG as a new compile option in menuselect which controls astobj2 debugging independently of AST_DEVMODE and REF_DEBUG. Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3593/ ........ Merged revisions 416806 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19pjsip cli: Change Identify to show CIDR notation instead of netmasks.George Joseph
* Added ast_sockaddr_cidr_bits() to count the 1 bits in an ast_sockaddr. * Added ast_ha_join_cidr() which uses ast_sockaddr_cidr_bits() for the netmask instead of ast_sockaddr_stringify_addr. * Changed res_pjsip_endpoint_identifier_ip to call ast_ha_join_cidr() instead of ast_ha_join() for the CLI output. This is a CLI change only. AMI was not affected. Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3652/ ........ Merged revisions 416737 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19Fix build warnings with TEST_FRAMEWORK enabledKinsey Moore
........ Merged revisions 416732 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416733 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416734 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19Remove the problematic and unneeded AST_MODFLAG_GLOBAL_SYMBOLS from pbx_lua.cGeorge Joseph
AST_MODFLAG_GLOBAL_SYMBOLS was causing the module to be incorrectly loaded before pbx_config. pbx_config was therefore blowing away contexts that were created by pbx_lua. With AST_MODFLAG_DEFAULT the load order is now correct and contexs are being properly merged. AST_MODFLAG_GLOBAL_SYMBOLS was not needed anyway since no other modules needed its global symbols that early. ASTERISK-23818 #close Reported by: Dennis Guse Tested by: Dennis Guse Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3629/ ........ Merged revisions 416668 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416669 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-18Update extensions.lua.sample with naming conflict guidance.George Joseph
The sample extensions.lua was causing pbx_lua to fail to load when parsing 'app.goto("default", "s", 1)' because in Lua 5.2, 'goto' is now a reserved word. This patch adds guidance to extensions.lua.sample and changed 'app.goto("default", "s", 1)' to 'app.['goto']("default", "s", 1)'. ASTERISK-23844 #close Reported by: rnewton Tested by: gtjoseph Review: https://reviewboard.asterisk.org/r/3627/ ........ Merged revisions 416581 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416582 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-18stasis_channels: Update the stasis cache if manager variables are neededMatthew Jordan
In r416211, the publishing of variable changes was modified such that a cached channel snapshot was used if manager variables were not requested with each AMI event. This was done to reduce the amount of channel snapshots created. However, an assumption was made that generating a channel snapshot and publishing the snapshot to the channel topic was sufficient to ensure that the cache would be updated; this is not the case. The channel snapshot type must be used to force a snapshot update. This patch updates the publication of channel variables such that the cache is updated prior to publication of the channel variable message if manager variables are in use. This ensures that all AMI events receive the variable update when they are supposed to. Note that this issue was caught by the Asterisk Test Suite (go go testing) ........ Merged revisions 416557 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-17Allow the PUSH and UNSHIFT functions to set inheritable channel variables.Mark Michelson
........ Merged revisions 416500 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416501 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416502 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-17Fix string growth algorithm for XML presence bodies.Mark Michelson
pjpidf_print() does not return < 0 if there is not enough room for the document to be printed. Rather, it returns 39, the length of the XML prolog. The algorithm also had a bug in that it would return if it attempted to grow the string larger. ........ Merged revisions 416442 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-17MoH: Don't restart stream on repeated start callsKinsey Moore
Currently, music on hold will stop and then start again from the beginning if ast_moh_start() is called multiple times. This can happen if a call is put on hold repeatedly (the channel receives multiple HOLD control frames) and can be triggered from ARI by starting MoH on a channel multiple times. This is fairly jarring/annoying to users. This change prevents MoH from being restarted if the requested music class is the same as the one currently playing. This includes an extra check to prevent the errors previously experienced in the testsuite and has 100+ test runs behind it. Review: https://reviewboard.asterisk.org/r/3615/ ........ Merged revisions 416439 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416440 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416441 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16chan_dahdi: Adds support for major update to libss7.Richard Mudgett
* SS7 support now requires libss7 v2.0 or later. The new libss7 is not backwards compatible. * Added SS7 support for connected line and redirecting. * Most SS7 CLI commands are reworked as well as new SS7 commands added. See online CLI help. * Added several SS7 config option parameters described in chan_dahdi.conf.sample. * ISUP timer support reworked and now requires explicit configuration. See ss7.timers.sample. Special thanks to Kaloyan Kovachev for his support and persistence in getting the original patch by adomjan updated and ready for release. SS7-27 #close Reported by: adomjan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16res_http_websocket: read/write string fixupKevin Harwell
There was a problem when reading a string from the websocket. It assumed the received data had a null terminator and tried to write the data to an ast_str. This of course could/would read past the end of the given buffer while writing the data to the internal buffer of ast_str. Modified the the code to correctly place a null terminator on the result string. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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-16channels/chan_sip: Forbid remote bridging if T.38 is negotiatedMatthew Jordan
When a framehook is removed - such as the fax gateway framehook - the bridge framework will re-evaluate the bridge mixing technologies to see if it can improve the bridging. When this occurs, get_rtp_info will be called to determine if local or remote bridging can be used. Using remote bridging will cause a fax to fail, as direct media negotiation will cause some small number of packets to not arrive at the remote endpoint. This patch forces local native bridging if T.38 negotiation is in progress or has been established. ........ Merged revisions 416318 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416319 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-15test_stasis_endpoints: Remove expected channel snapshotMatthew Jordan
We no longer publish a channel snapshot when it is associated with an endpoint; after all, the channel itself hasn't changed - the endpoint state has changed. This updates the channel_messages unit test accordingly. ........ Merged revisions 416298 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-15MoH: Undo commit r416150 (1.8)Matthew Jordan
This patch reverts r416150. When the comparison between mohclass->name and state->class->name is made, you are not guaranteed that (a) state->class is non-NULL or that state or state->class are in a safe state. Crashes caught by the bridges/transfer_capabilities test. ........ Merged revisions 416251 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416252 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416255 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-14res_manager_devicestate and res_manager_presencestate missing support levelCorey Farrell
Add MODULEINFO comment block to define support level core for these new modules. Review: https://reviewboard.asterisk.org/r/3620/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416237 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-13MoH: Don't restart stream on repeated start callsKinsey Moore
Currently, music on hold will stop and then start again from the beginning if ast_moh_start() is called multiple times. This can happen if a call is put on hold repeatedly (the channel receives multiple HOLD control frames) and can be triggered from ARI by starting MoH on a channel multiple times. This is fairly jarring/annoying to users. This change prevents MoH from being restarted if the requested music class is the same as the one currently playing. Review: https://reviewboard.asterisk.org/r/3615/ ........ Merged revisions 416150 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416151 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 416152 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416153 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-12Fix build in devmode for GCC 4.10Kinsey Moore
........ Merged revisions 415980 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415982 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-12Blocked revisions 415838Jonathan Rose
........ Correct UPGRADE.txt notes in r415825 The change was marked against the wrong version of Asterisk. My apologies. ........ Merged revisions 415837 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12app_queue: delayed state can cause early leavewhenempty ringingScott Griepentrog
In app_queue, device state changes arrive in event messages and update the queue member status value. That value is checked in get_member_status() to decide that the caller should leave when there are no available members. Although event messages can be delayed by other activity, there is no adverse affect by lagged status except in one specific case: there is only one available member, it was just rung, and leavewhenempty is enabled set for ringing members. This change adds a direct check of the device state only under this condition where the caller may be dropped incorrectly, resolving this issue without affecting performance of app_queue normally. AST-1248 #close Review: https://reviewboard.asterisk.org/r/3595/ Reported by: Thomas Arimont ........ Merged revisions 415833 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 415835 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415836 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12MixMontior: Add class authorization requirements to MixMonitor AMI commandsJonathan Rose
MixMonitor AMI commands StartMixMonitor and StopMixMonitor lacked class authorization. StopMixMonitor now requires that the manager user either have the call or system class authorization. StartMixMonitor is a slightly larger issue since it can execute shell commands if the right arguments are passed into it, and we consider this a permission escalation. A security release will be issued for problem this shortly. ASTERISK-23609 #close Reported by: Corey Farrell ........ Merged revisions 415825 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 415832 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12res_pjsip_pubsub: unauthenticated remote crash in PJSIP pub/sub frameworkKevin Harwell
A remotely exploitable crash vulnerability exists in the PJSIP channel driver's pub/sub framework. If an attempt is made to unsubscribe when not currently subscribed and the endpoint's "sub_min_expiry" is set to zero, Asterisk tries to create an expiration timer with zero seconds, which is not allowed, so an assertion raised. The fix was to reject a subscription that is attempting to unsubscribe when not being already subscribed. Asterisk now checks for this situation appropriately and responds with a 400 instead of crashing. AST-2014-005 ASTERISK-23489 #close ........ Merged revisions 415812 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12Fix potential deadlock situation in res_pjsip.Mark Michelson
SIP transaction timeouts are handled in the PJSIP monitor thread. When this happens on a subscription, and the subscription is destroyed, the subscription destruction is dispatched synchronously to the threadpool. The issue is that the PJSIP dialog is locked by the monitor thread, and then the dispatched task attempts to lock the dialog. This leads to a deadlock that causes SIP traffic to no longer be accepted on the Asterisk server. The fix here is to treat the monitor thread as if it were a threadpool thread when it attempts to dispatch synchronous tasks. This way, the dispatched task turns into a simple function call within the same thread, and the locking issue is averted. AST-2014-008 ASTERISK-23802 #close ........ Merged revisions 415794 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12res_pjsip_pubsub: Persist subscriptions in sorcery so they are recreated on ↵Joshua Colp
startup. This change makes res_pjsip_pubsub persist inbound subscriptions in sorcery. By default this uses the local astdb but it can also be configured to store within an outside database. When Asterisk is started these subscriptions are recreated if they have not expired. Notifications are sent to the devices which have subscribed and they are none the wiser that the system has restarted. Review: https://reviewboard.asterisk.org/r/3598/ ........ Merged revisions 415766 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12safe_asterisk: Overwrite old safe_asterisk on make install.Walter Doekes
From now on, make install will overwrite safe_asterisk with the latest version. You need to move any local modifications to files inside /etc/asterisk/startup.d, if you have any. See also commits r394939 and r397938. ASTERISK-21965 #close Patches: safe_asterisk.patch uploaded by jkister (License 6232, modified by me) ........ Merged revisions 415748 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415749 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