summaryrefslogtreecommitdiff
path: root/main/message.c
AgeCommit message (Collapse)Author
2013-04-18Fix lock errors on startup.David M. Lee
In messages.c, there are several places in the code where we create a tmp_tech_holder and pass that into an ao2_find call. Unfortunately, we weren't initializing the rwlock on the tmp_tech_holder, which the hash function was locking. It's apparently harmless, but still not the best code. This patch extracts all that copy/pasted code into two functions, msg_find_by_tech and msg_find_by_tech_name, which properly initialize and destroy the rwlock on the tmp_tech_holder. Review: https://reviewboard.asterisk.org/r/2454/ ........ Merged revisions 386006 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-06Update documentation for MessageSend application/command's From field for XMPPMatthew Jordan
When using the channel technology agnostic application/AMI command MessageSend, the "From" field is technically optional for the SIP channel driver. However, if being sent by the XMPP resource module (either res_xmpp or res_jabber), the "From" field is necessary, and must correspond to a defined account. This patch updates the documentation for this application/AMI command to reflect this. (closes issue ASTERISK-20405) Reported by: Leif Madsen ........ Merged revisions 374611 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02Fix findings from check-in on r374177Matthew Jordan
Richard pointed out two problems with the check-in from r374177: * The ast_msg_shutdown function declaration doesn't match the prototype in main/message.c. * The ref/alloc function usage in astobj2 (in trunk) can use the ao2_t_* variants of the functions to allow the REF_DEBUG flag to enable/disable their debug counterparts. ........ Merged revisions 374210 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374211 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02Fix a variety of ref counting issuesMatthew Jordan
This patch resolves a number of ref leaks that occur primarily on Asterisk shutdown. It adds a variety of shutdown routines to core portions of Asterisk such that they can reclaim resources allocate duringd initialization. Review: https://reviewboard.asterisk.org/r/2137 ........ Merged revisions 374177 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374196 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28Reset hangup flags on channels created through messages and cleanup globalsBrent Eagles
in res_xmpp on unload. This patch fixes an issue where hangup flags were not being reset on a channel, affecting subsequent use of that channel. The patch also adds some additional cleanup to res_xmpp to fix an issue with reloading the module. (closes ASTERISK-20360) Reported by: Noah Engelberth Tested by: beagles Review: https://reviewboard.asterisk.org/r/2134/ ........ Merged revisions 374019 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-11Fix inability to shutdown gracefully due to an unending channel reference.Mark Michelson
message.c makes use of a special message queue channel that exists in thread storage. This channel never goes away due to the fact that the taskprocessor used by message.c does not get shut down, meaning that it never ends the thread that stores the channel. This patch fixes the problem by shutting down the taskprocessor when Asterisk is shut down. In addition, the thread storage has a destructor that will release the channel reference when the taskprocessor is destroyed. (closes issue AST-937) Reported by Jason Parker Patches: AST-937.patch uploaded by Mark Michelson (License #5049) Tested by Jason Parker ........ Merged revisions 372885 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372888 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-19Add the ability to specify technology specific documentationMatthew Jordan
A number of applications/AMI commands in Asterisk have specific behavioral differences depending on the resource or channel technology those applications are executed on. For example, the MessageSend application/ command is technology agnostic, but how the channel drivers that support that functionality behave is dependant on the protocols and channel driver implementation. Prior to this patch, those details were either documented in the application/command documentation itself, or were left undocumented. This patch adds a new element to the documentation schema, <info/>. An info node is essentially a piece of technology specific reference information that can be included by any top level XML documentation node. For example, the MessageSend application can now include XMPP/SIP specific information, where that technology specific information can be defined in chan_motif/res_xmpp/ chan_sip. Likewise, that information can also be included in the MessageSend AMI command. Review: https://reviewboard.asterisk.org/r/2049 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15Multiple revisions 369001-369002Kevin P. Fleming
........ r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines Add support-level indications to many more source files. Since we now have tools that scan through the source tree looking for files with specific support levels, we need to ensure that every file that is a component of a 'core' or 'extended' module (or the main Asterisk binary) is explicitly marked with its support level. This patch adds support-level indications to many more source files in tree, but avoids adding them to third-party libraries that are included in the tree and to source files that don't end up involved in Asterisk itself. ........ r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines Add a script to enable finding source files without support-levels defined. ........ Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04Merge changes dealing with support for Digium phones.Mark Michelson
Presence support has been added. This is accomplished by allowing for presence hints in addition to device state hints. A dialplan function called PRESENCE_STATE has been added to allow for setting and reading presence. Presence can be transmitted to Digium phones using custom XML elements in a PIDF presence document. Voicemail has new APIs that allow for moving, removing, forwarding, and playing messages. Messages have had a new unique message ID added to them so that the APIs will work reliably. The state of a voicemail mailbox can be obtained using an API that allows one to get a snapshot of the mailbox. A voicemail Dialplan App called VoiceMailPlayMsg has been added to be able to play back a specific message. Configuration hooks have been added. Configuration hooks allow for a piece of code to be executed when a specific configuration file is loaded by a specific module. This is useful for modules that are dependent on the configuration of other modules. chan_sip now has a public method that allows for a custom SIP INFO request to be sent mid-dialog. Digium phones use this in order to display progress bars when files are played. Messaging support has been expanded a bit. The main visible difference is the addition of an AMI action MessageSend. Finally, a ParkingLots manager action has been added in order to get a list of parking lots. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06Don't add an empty MESSAGE_DATA(key) header if it doesn't already exist.Richard Mudgett
Doing Set(MESSAGE_DATA(key)=) would add an empty key header if the key header did not already exist. If it already existed it would delete it. * Made msg_set_var_full() exit early if the named variable did not already exist and the value to set is empty. ........ Merged revisions 361522 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29Opaquify ast_channel structs and listsTerry Wilson
Review: https://reviewboard.asterisk.org/r/1773/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25Fixes for sending SIP MESSAGE outside of calls.Richard Mudgett
* Fix authenticate MESSAGE losing custom headers added by the MESSAGE_DATA function in the authorization attempt. * Pass up better From header contents for SIP to use. Now is in the "display-name" <URI> format expected by MessageSend. (Note that this is a behavior change that could concievably affect some people.) * Block user from adding standard headers that are added automatically. (To, From,...) * Allow the user to override the Content-Type header contents sent by MessageSend. * Decrement Max-Forwards header if the user transferred it from an incoming message. * Expand SIP short header names so the dialplan and other code only has to deal with the full names. * Documents what SIP expects in the MessageSend(from) parameter. (closes issue ASTERISK-18992) Reported by: Yuri (closes issue ASTERISK-18917) Reported by: Shaun Clark Review: https://reviewboard.asterisk.org/r/1683/ ........ Merged revisions 352520 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-19Update documentation for MESSAGE_SEND_STATUS variable.Leif Madsen
(Closes issue ASTERISK-19056) Reported by: Yuri Patches: 348360.diff uploaded by Yuri (license #5242) ........ Merged revisions 348605 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29Merged revisions 346349 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/10 ........ r346349 | dvossel | 2011-11-28 18:00:11 -0600 (Mon, 28 Nov 2011) | 10 lines Fixes memory leak in message API. The ast_msg_get_var function did not properly decrement the ref count of the var it retrieves. The way this is implemented is a bit tricky, as we must decrement the var and then return the var's value. As long as the documentation for the function is followed, this will not result in a dangling pointer as the ast_msg structure owns its own reference to the var while it exists in the var container. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346350 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