summaryrefslogtreecommitdiff
path: root/res/res_jabber.c
AgeCommit message (Collapse)Author
2014-07-04Remove many deprecated modulesMatthew Jordan
Billing records are fair, To get paid is quite bright, You should really use ODBC; Good-bye cdr_sqlite. Microsoft did once push H.323, Hell, we all remember NetMeeting. But try to compile chan_h323 now And you will take quite a beating. The XMPP and SIP war was fierce, And in the distant fray Was birthed res_jabber/chan_jingle; But neither to stay. For everyone did care and chase what Google professed. "Free Internet Calling" was what devotees cried, But Google did change the specs so often That the developers were happy the day chan_gtalk died. And then there was that odd application Dedicated to the Polish tongue. app_saycountpl was subsumed by Say; One could say its bell was rung. To read and parse a file from the dialplan You could (I guess) use an application. app_readfile did fill that purpose, but I think A function is perhaps better in its creation. Barging is rude, I'm not sure why we do it. Inwardly, the caller will probably sigh. But if you really must do it, Don't use app_dahdibarge, use ChanSpy. We all despise the sound of tinny robots It makes our queues so cold. To control such an abomination It's better to not use Wait/SetMusicOnHold. It's often nice to know properties of a channel It makes our calls right We have a nice function called CHANNEL And so SIPCHANINFO is sent off into the night. And now things get odd; Apparently one could delimit with a colon Properties from the SIPPEER function! Commas are in; all others are done. Finally, a word on pipes and commas. We're sorry. We can't say it enough. But those compatibility options in asterisk.conf; To maintain them forever was just too tough. This patch removes: * cdr_sqlite * chan_gtalk * chan_jingle * chan_h323 * res_jabber * app_saycountpl * app_readfile * app_dahdibarge It removes the following applications/functions: * WaitMusicOnHold * SetMusicOnHold * SIPCHANINFO It removes the colon delimiter from the SIPPEER function. Finally, it also removes all compatibility options that were configurable from asterisk.conf, as these all applied to compatibility with Asterisk 1.4 systems. Review: https://reviewboard.asterisk.org/r/3698/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418019 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-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-03-27Fix dialplan function NULL channel safety issuesCorey Farrell
(closes issue ASTERISK-23391) Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3386/ ........ Merged revisions 411313 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411314 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411315 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19Voicemail: Remove mailbox identifier format (box@context) assumptions in the ↵Richard Mudgett
system. This change is in preparation for external MWI support. Removed code from the system for normal mailbox handling that appends @default to the mailbox identifier if it does not have a context. The only exception is the legacy hasvoicemail users.conf option. The legacy option will only work for app_voicemail mailboxes. The system cannot make any assumptions about the format of the mailbox identifer used by app_voicemail. chan_sip and chan_dahdi/sig_pri had the most changes because they both tried to interpret the mailbox identifier. chan_sip just stored and compared the two components. chan_dahdi actually used the box information. The ISDN MWI support configuration options had to be reworked because chan_dahdi was parsing the box@context format to get the box number. As a result the mwi_vm_boxes chan_dahdi.conf option was added and is documented in the chan_dahdi.conf.sample file. Review: https://reviewboard.asterisk.org/r/3072/ ........ Merged revisions 404348 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-17Reduce log level of a non-pubsub error messageKinsey Moore
Drop an error log message to debug level 1 since distributed device state functions correctly when receiving this message and it spams the logs. (closes issue ASTERISK-22410) Reported by: abelbeck Patches: asterisk-1.8-res_jabber-log-nonpubsub-error-to-debug.patch uploaded by abelbeck (License 5903) asterisk-11-res_xmpp-log-nonpubsub-error-to-debug.patch uploaded by abelbeck (License 5903) ........ Merged revisions 401119 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401120 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 401121 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401122 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-06Multiple revisions 398558,398577Kinsey Moore
........ r398558 | kmoore | 2013-09-06 14:28:16 -0500 (Fri, 06 Sep 2013) | 17 lines Fix Jabber/XMPP distributed MWI The mailbox and context are swapped on the receiving end for all users of Jabber and XMPP distributed MWI in Asterisk 1.8 and all more recent versions. This swaps those values to be correct when publishing to the internal event system from Jabber/XMPP distributed MWI state. (closes issue ASTERISK-22435) Reported by: abelbeck Tested by: Michael Keuter Patches: asterisk-1.8-res_jabber-aji_handle_pubsub_event.patch uploaded by abelbeck asterisk-11-res_xmpp-xmpp_pubsub_handle_event.patch uploaded by abelbeck ........ Merged revisions 398523 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ r398577 | kmoore | 2013-09-06 16:00:56 -0500 (Fri, 06 Sep 2013) | 10 lines Commit the remainder of r398523 This is a missing part of the commit in revision 398523 that corrects the name of a variable. (issue ASTERISK-22435) ........ Merged revisions 398576 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398558,398577 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398580 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17Strip down the old event systemKinsey Moore
This removes unused code, event types, IE pltypes, and event IE types where possible and makes several functions private that were once public. This includes a renumbering of the remaining event and IE types which breaks binary compatibility with previous versions. The last remaining consumers of the old event system (or parts thereof) are main/security_events.c, res/res_security_log.c, tests/test_cel.c, tests/test_event.c, main/cel.c, and the CEL backends. Review: https://reviewboard.asterisk.org/r/2703/ (closes issue ASTERISK-22139) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 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-05-24Migrate a large number of AMI events over to Stasis-CoreMatthew Jordan
This patch moves a number of AMI events over to the Stasis-Core message bus. This includes: * ChanSpyStart/Stop * MonitorStart/Stop * MusicOnHoldStart/Stop * FullyBooted/Reload * All Voicemail/MWI related events In addition, it adds some Stasis-Core and AMI support for generic AMI messages, refactors the message router in AMI to use a single router with topic forwarding for the topics that AMI cares about, and refactors MWI message types and topics to be more name compliant. Review: https://reviewboard.asterisk.org/r/2532 (closes issue ASTERISK-21462) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17Fix shutdown assertions in stasis-coreDavid M. Lee
In r388005, macros were introduced to consistently define message types. This added an assert if a message type was used either before it was initialized or after it had been cleaned up. It turns out that this assertion fires during shutdown. This actually exposed a hidden shutdown ordering problem. Since unsubscribing is asynchronous, it's possible that the message types used by the subscription could be freed before the final message of the subscription was processed. This patch adds stasis_subscription_join(), which blocks until the last message has been processed by the subscription. Since joining was most commonly done right after an unsubscribe, a stasis_unsubscribe_and_join() convenience function was also added. Similar functions were also added to the stasis_caching_topic and stasis_message_router, since they wrap subscriptions and have similar problems. Other code in trunk was refactored to join() where appropriate, or at least verify that the subscription was complete before being destroyed. Review: https://reviewboard.asterisk.org/r/2540 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16res_xmpp and res_jabber need to search 'cachable' in the attrib section of ↵Alec L Davis
the received IE, not data. (issue ASTERISK-20175) (closes issue ASTERISK-21429) (closes issue ASTERISK-21069) (closes issue ASTERISK-21164) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2452/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16Move device state distribution to Stasis-coreKinsey Moore
In the move from Asterisk's event system to Stasis, this makes distributed device state aggregation always-on, removes unnecessary task processors where possible, and collapses aggregate and non-aggregate states into a single cache for ease of retrieval. This also removes an intermediary step in device state aggregation. Review: https://reviewboard.asterisk.org/r/2389/ (closes issue ASTERISK-21101) Patch-by: Kinsey Moore <kmoore@digium.com> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27Convert MWI state message type to the new stasis naming conventionKinsey Moore
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-16Make sure things compile...Kinsey Moore
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-16Transition MWI to Stasis-coreKinsey Moore
Remove MWI's dependency on the event system by moving it to Stasis-core. This also introduces forwarding topic pools in Stasis-core which aggregate many dynamically allocated topics into a single primary topic. Review: https://reviewboard.asterisk.org/r/2368/ (closes issue ASTERISK-21097) Patch-by: Kinsey Moore git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-16Let documentation reference links specify which module they're linking toMatthew Jordan
Again, since res_jabber/res_xmpp have duplicate APIs, their documentation ref links have to specify which reference they're referring to. The various documentation parsers can interpret the module attribute however they want in order to construct the appropriate links. ........ Merged revisions 379228 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-16Multiple revisions 379209-379210Matthew Jordan
........ r379209 | mjordan | 2013-01-16 09:27:44 -0600 (Wed, 16 Jan 2013) | 8 lines Add module tags to documentation for res_jabber/res_xmpp Since res_jabber/res_xmpp provide the same APIs (app/func/manager/etc.), the XML documentation for each needs to call out which module is providing the documentation. The module attribute has been added to the various XML fragments for this purpose. ........ r379210 | mjordan | 2013-01-16 09:30:20 -0600 (Wed, 16 Jan 2013) | 4 lines Update the dtd to actually *support* the module attribute in all elements Mea culpa. ........ Merged revisions 379209-379210 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379211 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
2013-01-02Resolve crashes due to large stack allocations when using TCPMatthew Jordan
Asterisk had several places where messages received over various network transports may be copied in a single stack allocation. In the case of TCP, since multiple packets in a stream may be concatenated together, this can lead to large allocations that overflow the stack. This patch modifies those portions of Asterisk using TCP to either favor heap allocations or use an upper bound to ensure that the stack will not overflow: * For SIP, the allocation now has an upper limit * For HTTP, the allocation is now a heap allocation instead of a stack allocation * For XMPP (in res_jabber), the allocation has been eliminated since it was unnecesary. Note that the HTTP portion of this issue was independently found by Brandon Edwards of Exodus Intelligence. (issue ASTERISK-20658) Reported by: wdoekes, Brandon Edwards Tested by: mmichelson, wdoekes patches: ASTERISK-20658_res_jabber.c.patch uploaded by mmichelson (license 5049) issueA20658_http_postvars_use_malloc2.patch uploaded by wdoekes (license 5674) issueA20658_limit_sip_packet_size3.patch uploaded by wdoekes (license 5674) ........ Merged revisions 378269 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378286 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378287 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking to the resource. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04Check for presence of buddy in info/dinfo handlersMatthew Jordan
The res_jabber resource module uses the ASTOBJ library for managing its ref counted objects. After calling ASTOBJ_CONTAINER_FIND to locate a buddy object, the pointer to the object has to be checked to see if the buddy existed. Prior to this patch, the buddy object was not checked for NULL; with this patch in both aji_client_info_handler and aji_dinfo_handler the pointer is checked before used and, if no buddy object was found, the handlers return an error code. This patch does not take the approach that our JID can be used to log in from another resource. If that approach is desired, an improvement could be made to this patch to create the buddy on the fly. This patch seeks only to prevent Asterisk from crashing. FYI: In Asterisk 11+, you really should be using res_xmpp. It does not have this problem, as it moved to the astobj2 library. Note that multiple people have proposed patches for this issue; the patch being committed here is based on those. (closes issue ASTERISK-19532) Reported by: Karsten Wemheuer Tested by: Byron Clark patches: fix-jabber uploaded by Karsten Wemheuer (license #5930) xmpp_no_crash_with_ejabberd.patch uploaded by Byron Clark (license #6157) (closes issue ASTERISK-19557) Reported by: ulugutz ........ Merged revisions 374335 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374336 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374337 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28res_jabber: Remove CLI command 'jabber test'Jonathan Rose
The opinion of development was that it is both improper to have Matt's personal email address used in the source and that the command wouldn't be useful without it. (closes issue AST-467) Reported by: Malcolm Davenport ........ Merged revisions 374032 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374045 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374059 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21Doxygen Updates - janitor workAndrew Latham
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style. Some missing txt file links are removed but their content or essense will be included in some later updates. A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen. Further updates coming. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10Deprecate chan_gtalk, chan_jingle, and res_jabberKinsey Moore
chan_gtalk, chan_jingle, and res_jabber are now deprecated in favor of using chan_motif and res_xmpp. They are a feature-equivalent replacement and are written to be more easily maintainable. (closes issue ASTERISK-20298) Review: https://reviewboard.asterisk.org/r/2082/ Reported-by: Leif Madsen ........ Merged revisions 372795 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21Fix misuses of asprintf throughout the code.Mark Michelson
This fixes three main issues * Change asprintf() uses to ast_asprintf() so that it pairs properly with ast_free() and no longer causes MALLOC_DEBUG to freak out. * When ast_asprintf() fails, set the pointer NULL if it will be referenced later. * Fix some memory leaks that were spotted while taking care of the first two points. (Closes issue ASTERISK-20135) reported by Richard Mudgett Review: https://reviewboard.asterisk.org/r/2071 ........ Merged revisions 371590 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371591 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371592 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31Clean up and ensure proper usage of alloca()Kinsey Moore
This replaces all calls to alloca() with ast_alloca() which calls gcc's __builtin_alloca() to avoid BSD semantics and removes all NULL checks on memory allocated via ast_alloca() and ast_strdupa(). (closes issue ASTERISK-20125) Review: https://reviewboard.asterisk.org/r/2032/ Patch-by: Walter Doekes (wdoekes) ........ Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-07Add a new unified Jingle, Google Jingle, and Google Talk channel driver ↵Joshua Colp
written from scratch called chan_motif. This channel driver is a replacement for both chan_gtalk and chan_jingle but adds additional features not found in either. These features include full configuration reload, video, full codec support, bidirectional cause code mapping, hold, unhold, and ringing indication. It is also compliant with the current published Jingle and Google Jingle specifications. The original Google Talk protocol is also supported for Google Voice interoperability. You may ask yourself though where the name motif comes from... and I would say to you... music! motif: a perceivable or salient recurring fragment or succession of notes Sorta like a jingle! Review: https://reviewboard.asterisk.org/r/1917/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18Fix a variety of memory leaksMatthew Jordan
This patch addresses a number of memory leaks in a variety of modules that were found by a static analysis tool. A brief summary of the changes: * app_minivm: free ast_str objects on off nominal paths * app_page: free the ast_dial object if the requested channel technology cannot be appended to the dialing structure * app_queue: if a penalty rule failed to match any existing rule list names, the created rule would not be inserted and its memory would be leaked * app_read: dispose of the created silence detector in the presence of off nominal circumstances * app_voicemail: dispose of an allocated unique ID field for MWI event un-subscribe requests in off nominal paths; dispose of configuration objects when using the secret.conf option * chan_dahdi: dispose of the allocated frame produced by ast_dsp_process * chan_iax2: properly unref peer in CLI command "iax2 unregister" * chan_sip: dispose of the allocated frame produced by sip_rtp_read's call of ast_dsp_process; free memory in parse unit tests * func_dialgroup: properly deref ao2 object grhead in nominal path of dialgroup_read * func_odbc: free resultset in off nominal paths of odbc_read * cli: free match_list in off nominal paths of CLI match completion * config: free comment_buffer/list_buffer when configuration file load is unchanged; free the same buffers any time they were created and config files were processed * data: free XML nodes in various places * enum: free context buffer in off nominal paths * features: free ast_call_feature in off nominal paths of applicationmap config processing * netsock2: users of ast_sockaddr_resolve pass in an ast_sockaddr struct that is allocated by the method. Failures in ast_sockaddr_resolve could result in the users of the method not knowing whether or not the buffer was allocated. The method will now not allocate the ast_sockaddr struct if it will return failure. * pbx: cleanup hash table traversals in off nominal paths; free ignore pattern buffer if it already exists for the specified context * xmldoc: cleanup various nodes when we no longer need them * main/editline: various cleanup of pointers not being freed before being assigned to other memory, cleanup along off nominal paths * menuselect/mxml: cleanup of value buffer for an attribute when that attribute did not specify a value * res_calendar*: responses are allocated via the various *_request method returns and should not be allocated in the various write_event methods; ensure attendee buffer is freed if no data exists in the parsed node; ensure that calendar objects are de-ref'd appropriately * res_jabber: free buffer in off nominal path * res_musiconhold: close the DIR* object in off nominal paths * res_rtp_asterisk: if we run out of ports, close the rtp socket object and free the rtp object * res_srtp: if we fail to create the session in libsrtp, destroy the temporary ast_srtp object (issue ASTERISK-19665) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1922 ........ Merged revisions 366880 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366881 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17Avoid cppcheck warnings; removing unused vars and a bit of cleanup.Walter Doekes
Patch by: junky Review: https://reviewboard.asterisk.org/r/1743/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29Allow each logging destination and console to have its own notion of the ↵Tilghman Lesher
verbosity level. Review: https://reviewboard.asterisk.org/r/1599 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23Fix res_jabber resource leaksKinsey Moore
This should fix almost all resource leaks in res_jabber that involve ASTOBJ_CONTAINER_FIND and resolves an ambiguous situation where ast_aji_get_client would sometimes bump an object's refcount and sometimes not. Review: https://reviewboard.asterisk.org/r/1553 ........ Merged revisions 346086 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 346087 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-27Cleanup reference leaks in res_jabberJonathan Rose
res_jabber.c had a number of places where astobjs would be referenced and have their reference counts bumped without having a dereference made before the object lost scope. This patch adds a number of ASTOBJ_UNREFs to resolve that. Review: https://reviewboard.asterisk.org/r/1478/ ........ Merged revisions 342545 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 342546 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-04Merged revisions 339298 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r339298 | jrose | 2011-10-04 09:09:50 -0500 (Tue, 04 Oct 2011) | 19 lines Merged revisions 339297 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r339297 | jrose | 2011-10-04 09:01:05 -0500 (Tue, 04 Oct 2011) | 13 lines Reverting revision 333265 due to component connection problems it introduces. I'm going to attempt some generic res_jabber cleanup and come up with a new fix for this problem, but first it seems prudent to remove this rather broad attempt to fix it and instead approach this problem either from the same angle but looking only at canceling (or possibly rescheduling) the send when we absolutely know it will cause a segfault or, if that can't be easily accomplished, strictly from the devstate side of things. Also, I'm pretty sure a lot of the code in res_jabber isn't thread safe. (issue ASTERISK-18626) (issue ASTERISK-18078) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@339315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-29Merged revisions 333570 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r333570 | jrose | 2011-08-29 10:56:56 -0500 (Mon, 29 Aug 2011) | 11 lines Merged revisions 333569 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r333569 | jrose | 2011-08-29 10:55:34 -0500 (Mon, 29 Aug 2011) | 4 lines Accidental use of variable client->status instead of client->state in from ASTERISK-18078 (issue ASTERISK-18078) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@333571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-26Merged revisions 333410 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r333410 | jrose | 2011-08-26 11:28:03 -0500 (Fri, 26 Aug 2011) | 19 lines Merged revisions 333378 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r333378 | jrose | 2011-08-26 11:19:07 -0500 (Fri, 26 Aug 2011) | 13 lines [patch] Buddies are always auto-registered when processing the roster Reporter said autoregister flag was ignored for registering 'buddies' which had a subscription to us. Verified that this was the case and observed how the patch addressed this and made sure it didn't break anything. (closes issue ASTERISK-14233) Reported by: Simon Arlott Patches: asterisk-0015229.patch (license #5756) patch uploaded by Simon Arlott Tested by: Jonathan Rose ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@333428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-25Merged revisions 333266 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r333266 | jrose | 2011-08-25 14:00:05 -0500 (Thu, 25 Aug 2011) | 20 lines Merged revisions 333265 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r333265 | jrose | 2011-08-25 13:47:42 -0500 (Thu, 25 Aug 2011) | 14 lines Segfault when publishing device states via XMPP and not connected When using publishing device state with res_jabber, Asterisk will attempt to send a device state using the unconnected client using iks_send_raw and crash. This patch checks the validity of the connection before attempting to send the device state. (closes issue ASTERISK-18078) Reported by: Michael L. Young Patches: res_jabber-segfault-pubsub-not-connected2.patch (license #5026) patch uploaded by Michael L. Young Tested by: Jonathan Rose ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@333276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-02Merged revisions 330649 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r330649 | kpfleming | 2011-08-02 15:52:44 -0500 (Tue, 02 Aug 2011) | 9 lines Merged revisions 330648 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r330648 | kpfleming | 2011-08-02 15:51:56 -0500 (Tue, 02 Aug 2011) | 2 lines Convert an error message to actually be helpful. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@330650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-05Merged revisions 326411 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r326411 | tilghman | 2011-07-05 17:08:29 -0500 (Tue, 05 Jul 2011) | 14 lines Add the attribute "type" to each "<use>" for menuselect. This matters only when autoconf fails to detect that weak linking is supported. External optional dependencies will become optional in both cases, as they are removed at compile time when not detected. However, runtime-optional modules are made mandatory when weak linking is not found. This change affects only the external optional dependencies; previously, they were incorrectly required when weak linking support was not detected. Patches: 20110702__issue18062__asterisk_trunk.diff.txt by tilghman (License #5003) Tested by: iasgoscouk ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-07Actually check the "sendtodialplan" option setting for xmpp.Russell Bryant
(closes issue ASTERISK-17978) Reported by: elguero Patches: stop_messages_going_to_dialplan.patch (license #5026) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-01Support routing text messages outside of a call.Russell Bryant
Asterisk now has protocol independent support for processing text messages outside of a call. Messages are routed through the Asterisk dialplan. SIP MESSAGE and XMPP are currently supported. There are options in sip.conf and jabber.conf that enable these features. There is a new application, MessageSend(). There are two new functions, MESSAGE() and MESSAGE_DATA(). Documentation will be available on the project wiki, wiki.asterisk.org. Thanks to Terry Wilson for the assistance with development and to David Vossel for helping with some additional testing. Review: https://reviewboard.asterisk.org/r/1042/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@321546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05Merged revisions 317474 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317474 | russell | 2011-05-05 17:36:33 -0500 (Thu, 05 May 2011) | 2 lines Fix more "set but unused" warnings. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-18Merged revisions 311352 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r311352 | jrose | 2011-03-18 11:19:05 -0500 (Fri, 18 Mar 2011) | 10 lines Changes some print statements/events to use a blank string in place of NULL if the string in question is NULL. This is supposed to improve Solaris compatibility since Solaris goes berserk when trying to output NULL strings. (closes issue #18759) Reported by: bklang Patches: null-strings.patch uploaded by bklang (license 919) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@311373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04Replace ast_log(LOG_DEBUG, ...) with ast_debug()Paul Belanger
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-26Merged revisions 296354 via svnmerge from Brad Watkins
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r296354 | marquis | 2010-11-26 13:31:17 -0500 (Fri, 26 Nov 2010) | 12 lines Fix XMPP PubSub-based distributed device state. Initialize pubsubflags to 0 so res_jabber doesn't think there is already an XMPP connection sending device state. Also clean up CLI commands a bit. (closes issue #18272) Reported by: klaus3000 Patches: res_jabber_fix_pubsubflags_and_CLI-patch.txt uploaded by klaus3000 (license 65) Tested by: klaus3000, Marquis Review: https://reviewboard.asterisk.org/r/1030/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-18Merged revisions 295441 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r295441 | pabelanger | 2010-11-18 13:02:12 -0500 (Thu, 18 Nov 2010) | 11 lines Merged revisions 295440 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r295440 | pabelanger | 2010-11-18 12:51:34 -0500 (Thu, 18 Nov 2010) | 4 lines Fix compiler warnings when using openssl-dev 1.0.0+ Review: https://reviewboard.asterisk.org/r/1016/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@295442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-15Merged revisions 291905 via svnmerge from Terry Wilson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r291905 | twilson | 2010-10-15 09:39:58 -0700 (Fri, 15 Oct 2010) | 14 lines Merged revisions 291904 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r291904 | twilson | 2010-10-15 09:16:57 -0700 (Fri, 15 Oct 2010) | 7 lines Don't crash or deadlock on module unload We can't hold the lock while pthread_join is called since aji_log_hook will attempt to lock from the other therad. We reorder the pthread_join and ast_aji_disconnect so that we don't do an SSL_read() while SSL_shutdown is running, causing a crash. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291906 65c4cc65-6c06-0410-ace0-fbb531ad65f3