summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
AgeCommit message (Collapse)Author
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22Merge "app_voicemail: Fix file copy error handling." into 13Jenkins2
2017-12-20app_voicemail: Fix file copy error handling.Corey Farrell
Fix error where input/output file descriptors would be closed multiple times. Change-Id: Iba5140b60cb7de79e3d5d92be3c256947aa99da9
2017-12-20Fix Common Typo's.Corey Farrell
Fix instances of: * Retreive * Recieve * other then * different then * Repeated words ("the the", "an an", "and and", etc). * othterwise, teh ASTERISK-24198 #close Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-18app_voicemail: Fix memory management issues.Corey Farrell
* mwi_sub_event_cb: mwist leaked on separate_mailbox failure. * add_email_attachment: A reference to sox_gain_tmpdir was used after the storage was out of scope. Change-Id: I6282c542ff7b82fa091177a912d11234a8b00a30
2017-12-04Add new object for VoicemailUserEntrySungtae Kim
Currently, when the app_voicemail sending VoicemailUserEntry AMI event, there's no OldMessageCount info for default. To check the OldMessageCount info, it required IMAP_STORAGE define, but this is not correct. Added OldMessageCount item as a default. ASTERISK-27456 Change-Id: I5c71521c2d1daf8b7b161e31c34d28cca6aea4c7
2017-10-26app_voicemail.c: Fix compiler warning with IMAP build.Richard Mudgett
ASTERISK-27181 Change-Id: Ic4468b49860bd7f67e922baf4c9e96828c184d17
2017-08-25voicemail: Fix various abuses of mkstempSean Bright
mkstemp() returns a unique filename, but appending an extension to that filename does not guarantee uniqueness. Instead, use mkdtemp() and we can put whatever extension we want on the files that we create inside the directory. In the case of app_minivm, we also now properly clean up any temporary files that we create. ASTERISK-20858 #close Reported by: Walter Doekes Change-Id: I30ad04f0e115f0b11693ff678ba5184d8b938e43
2017-08-24app_voicemail: Honor escape digits in "greeting only" modeSean Bright
ASTERISK-21241 #close Reported by: Eelco Brolman Patches: Patch uploaded by Eelco Brolman (License 6442) Change-Id: Icbe39b5c82a49b46cf1d168dc17766f3d84f54fe
2017-08-01Fix compiler warnings on Fedora 26 / GCC 7.Corey Farrell
GCC 7 has added capability to produce warnings, this fixes most of those warnings. The specific warnings are disabled in a few places: * app_voicemail.c: truncation of paths more than 4096 chars in many places. * chan_mgcp.c: callid truncated to 80 chars. * cdr.c: two userfields are combined to cdr copy, fix would break ABI. * tcptls.c: ignore use of deprecated method SSLv3_client_method(). ASTERISK-27156 #close Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
2017-07-21app_voicemail.c: Allow mailbox entry on authentication retry prompt.Richard Mudgett
The following testsuite voicemail tests were failing to re-enter the mailbox after the first login attempt. tests/apps/voicemail/authenticate_invalid_mailbox tests/apps/voicemail/authenticate_invalid_password The tests were noting the start of the vm-incorrect-mailbox prompt and immediately sending the mailbox for the next login attempt. Since the invalid message playback had to complete before the digits were recognized, the test passed for the wrong reason and added approximately 20 seconds to the test times. * Allow the vm-incorrect-mailbox prompt to get interrupted by the mailbox digits like the initial vm-login prompt so the tests are able to enter the intended mailbox. Change-Id: I1dc53fe917bfe03a4587b2c4cd24c94696a69df8
2017-07-01app_voicemail: Cleanup ODBC connection handlingSean Bright
The primary focus of this patch is adding a missing call to ast_odbc_release_obj(), but is also a general cleanup of the ODBC related code in app_voicemail. ASTERISK-27093 #close Change-Id: I8e285142eaeb3146b4287a928276b70db76c902b
2017-06-19app_voicemail: IMAP connection controlAlexei Gradinari
A new global option "imap_poll_logout" was added to specify whether need to disconnect from the IMAP server after polling of mailboxes. ASTERISK-27068 #close Closing IMAP connection after loading mailbox from voicemail.conf ASTERISK-24052 #close Change-Id: Ib7558ba04516240a32b65f42e9be64372a0ae12a
2017-06-15app_voicemail: IMAP logout on reload/unloadAlexei Gradinari
Closing IMAP connection on module reload or unload. ASTERISK-24052 #close Change-Id: I2a40182aa9ef249fa6865d33570430e9ada68525
2017-06-15Merge "app_voicemail: IMAP logout on MWI unsubscribe" into 13Jenkins2
2017-06-14app_voicemail.c: Fix compile error when IMAP enabled.Richard Mudgett
Change-Id: I2703f15b4099b4210c68eccf293105d1975c1fc1
2017-06-12app_voicemail: IMAP logout on MWI unsubscribeAlexei Gradinari
Closing IMAP connection on MWI unsubscribe. ASTERISK-24052 #close Change-Id: I4ff964026002b2817b48c20fb4239f0a880228fd
2017-04-25cleanup: Fix fread() and fwrite() error handlingSean Bright
Cleaned up some of the incorrect uses of fread() and fwrite(), mostly in the format modules. Neither of these functions will ever return a value less than 0, which we were checking for in some cases. I've introduced a fair amount of duplication in the format modules, but I plan to change how format modules work internally in a subsequent patch set, so this is simply a stop-gap. Change-Id: I8ca1cd47c20b2c0b72088bd13b9046f6977aa872
2017-04-12modules: change module LOAD_FAILUREs to LOAD_DECLINESGeorge Joseph
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-03-08app_voicemail: Cannot set fromstring on a per-mailbox basisDaniel Journo
* apps/app_voicemail.c fromstring field added to mailbox which will override the global fromstring if set. ASTERISK-24562 #close Change-Id: I5e90e3a1ec2b2d5340b49a0db825e4bbb158b2fe
2017-02-20app_voicemail: vm_authenticate accesses uninitialized memorySean Bright
vm_authenticate doesn't always set the passed ast_vm_user argument, so we initialize to 0 before passing it in. ASTERISK-25893 #close Reported by: Filip Jenicek Change-Id: Ia3cc0128f93d352ed9add8d5c2f0f7232c2cbe4a
2017-02-14Merge "app_voicemail: Allow 'Comedian Mail' branding to be overriden" into 13zuul
2017-02-14Merge "app_voicemail: VoiceMailPlayMsg did not play database stored ↵zuul
messages" into 13
2017-02-14app_voicemail: Allow 'Comedian Mail' branding to be overridenSean Bright
Original patch by John Covert, slight modifications by me. ASTERISK-17428 #close Reported by: John Covert Patches: app_voicemail.c.patch (license #5512) patch uploaded by John Covert Change-Id: Ic3361b0782e5a5397a19ab18eb8550923a9bd6a6
2017-02-14app_voicemail: VoiceMailPlayMsg did not play database stored messagesrrittgarn
When attempting to use VoiceMailPlayMsg with a realtime data backend the message is located, but never retrieved. This patch adds the required RETRIEVE and DISPOSE calls that will fetch the message from the database (and IMAP storage as well for that matter). Also, removed extraneous make_file call. ASTERISK-26723 #close Change-Id: I1e122dd53c0f3d7faa10f3c2b7e7e76a47d51b8c
2017-02-13cli: Fix various CLI documentation and completion issuesSean Bright
* app_minivm: Use built-in completion facilities to complete optional arguments. * app_voicemail: Use built-in completion facilities to complete optional arguments. * app_confbridge: Add missing colons after 'Usage' text. * chan_alsa: Use built-in completion facilities to complete optional arguments. * chan_sip: Use built-in completion facilities to complete optional arguments. Add completions for 'load' for 'sip show user', 'sip show peer', and 'sip qualify peer.' * chan_skinny: Correct and extend completions for 'skinny reset' and 'skinny show line.' * func_odbc: Correct completions for 'odbc read' and 'odbc write' * main/asterisk: Correct and extend completions for 'core show file version.' * main/astmm: Use built-in completion facilities to complete arguments for 'memory' commands. * main/bridge: Correct completions for 'bridge kick.' * main/ccss: Use built-in completion facilities to complete arguments for 'cc cancel' command. * main/cli: Add 'all' completion for 'channel request hangup.' Correct completions for 'core set debug channel.' Correct completions for 'core show calls.' * main/pbx_app: Remove redundant completions for 'core show applications.' * main/pbx_hangup_handler: Remove unused completions for 'core show hanguphandlers all.' * res_sorcery_memory_cache: Add completion for 'reload' argument of 'sorcery memory cache stale' and properly implement. Change-Id: Iee58c7392f6fec34ad9d596109117af87697bbca
2017-01-24tests: use datadir for sound filesTzafrir Cohen
Some (voicemail-related) tests API symlinks beep.gsm and other files from ast_config_AST_VAR_DIR. It should use ast_config_AST_DATA_DIR. ASTERISK-26740 #close Change-Id: Id49c56fb9e16df64b1a2b829693ca7601252df89
2016-10-26app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS.Joshua Colp
When executing the MailboxExists dialplan application and MAILBOX_EXISTS dialplan function the passed in temporary voice mailbox was not cleared, causing it to try to free garbage. ASTERISK-26503 #close Change-Id: Ie21ccfa1b80b9c59318e596f6b8e17da2b5a7cb3
2016-08-03app_voicemail: Add taskprocessor alert level options.Alexei Gradinari
On heavy loaded system with IMAP or DB storage, 'app_voicemail' taskprocessor queue could reach 500 scheduled tasks. It could happen when the IMAP or DB server dies or is unreachable. It could happen on startup when there are many (thousands) realtime endpoints configured with unsolicited mwi. If the taskprocessor queue reaches the high water level then the alert is triggered and pjsip stops processing new requests until the queue reaches the low water level to clear the alert. This patch adds 2 new 'general' configuration options to tune taskprocessor alert levels: 'tps_queue_high' - Taskprocessor high water alert trigger level. 'tps_queue_low' - Taskprocessor low water clear alert level ASTERISK-26229 #close Change-Id: I766294fbffedf64053c0d9ac0bedd3109f043ee8
2016-07-18Unit tests: Use AST_TEST_DEFINE in conditional code only.Corey Farrell
If AST_TEST_DEFINE is not conditional to TEST_FRAMEWORK it produces dead code. This places all existing unit tests into a conditional block if they weren't already. ASTERISK-26211 #close Change-Id: I8ef83ee11cbc991b07b7a37ecb41433e8c734686
2016-06-20app_voicemail.c: Fix IMAP compile error.Richard Mudgett
Fix compile error introduced by the patch for ASTERISK-26045 Change-Id: I5b02876266f2824f4cec2b54d6ff4db5de5778d3
2016-05-26app_voicemail: fix bugs, imap mm_status log change to debugAlexei Gradinari
Fixed some bugs: - create dirpath when save downloading message from IMAP storage. - create IMAP folder if not exists when saving to IMAP storage - check if file successfully opened before write to it - some IMAP checks - remove non-standard flag 'Unseen' etc Change to debug IMAP mm_status log instead of verbose. Remove unused X-Asterisk-VM-Caller-channel message header for security reason. The clients should not know name of peer/endpoint. ASTERISK-26045 #close Change-Id: I7f83d88b69b36934e2539c114b9fb612deed971b
2016-05-03app_voicemail: always copy dynamic struct to avoid race conditionAndrew Nagy
Voicemail email addresses can be corrupt or voicemail emails can end up being sent to the wrong email address if asterisk is reading voicemail.conf during a reload and processing an email at the same time. This patch always copies the struct that would otherwise only be copied once. ASTERISK-24463 #close Reported by: John Campbell Tested by: Etienne Lessard Tested by: Andrew Nagy Change-Id: I3a0643813116da84e2617291903d0d489b7425fb
2016-04-15Merge "app_voicemail/IMAP: function 'save_to_folder' creates wrong folder" ↵Joshua Colp
into 13
2016-04-12app_voicemail: Fix test_voicemail_notify_endl test.Joshua Colp
The test_voicemail_notify_endl test checks the end-of-line characters of an email message to confirm that they are consistent. The test wrongfully assumed that reading from the email message into a buffer will always result in more than 1 character being read. This is incorrect. If only 1 character was read the test would go outside of the buffer and access other memory causing a crash. The test now checks to ensure that 2 or more characters are read in ensuring the test stays within the buffer. ASTERISK-25874 #close Change-Id: Ic2c89cea6e90f2c0bc2d8138306ebbffd4f8b710
2016-04-11app_voicemail/IMAP: function 'save_to_folder' creates wrong folderAlexei Gradinari
If try to move message to Cust1 (number 5) the function 'save_to_folder' tries to create Greeting folder instead of Cust1. This patch fixed it by setting GREETINGS_FOLDER = -1 ASTERISK-24927 #close Change-Id: I03d1a761894bcc2d130ec9b003bbcddc28e25c51
2016-04-07app_voicemail/IMAP: IMAP access FATAL error: Out of memoryAlexei Gradinari
Sometimes uw-imap function 'mail_fetchbody' returns huge len which then pass to uw-imap function 'rfc822_base64'. uw-imap tries to allocate huge memory and abort() on fail. This patch check the len. If the len more than max size (128 Mbytes) log error. This patch also set variables len, newlen to avoid uninizialezed len. This patch also check pointer returned by rfc822_base64. ASTERISK-25899 #close Change-Id: I4a0e7d655f11abef6a5224e2169df6d5c1f1caca
2016-01-04voicemail: Move app_voicemail / res_mwi_external conflict to runtimeGeorge Joseph
The menuselect conflict between app_voicemail and res_mwi_external makes it hard to package 1 version of Asterisk. There no actual build dependencies between the 2 so moving this check to runtime seems like a better solution. The ast_vm_register and ast_vm_greeter_register functions in app.c were modified to return AST_MODULE_LOAD_DECLINE instead of -1 if there is already a voicemail module registered. The modules' load_module functions were then modified to return DECLINE instead of -1 to the loader. Since -1 is interpreted by the loader as AST_MODULE_LOAD_FAILURE, the modules were incorrectly causing Asterisk to stop so this needed to be cleaned up anyway. Now you can build both and use modules.conf to decide which voicemail implementation to load. The default menuselect options still build app_voicemail and not res_mwi_external but if both ARE built, res_mwi_external will load first and become the voicemail provider unless modules.conf rules prevent it. This is noted in CHANGES. Change-Id: I7d98d4e8a3b87b8df9e51c2608f0da6ddfb89247
2015-05-13app_voicemail: fix moving when old messages fullJonathan Rose
When completing voicemail playback of a message in the 'INBOX', the message gets moved to the 'Old' messages folder. Without this patch, if the 'Old' folder is already at its set limit, then the 'INBOX' message will simply be deleted. With this patch, the flag to delete the message will be removed if the save_to_folder function indicates that the message could not be moved due to a full folder. ASTERISK-25082 #close Reported by: Jonathan Rose Review: https://gerrit.asterisk.org/#/c/448/ Change-Id: I2be440a09f42e2d06d50975c40d1ad7f836ecb3f
2015-03-28clang compiler warnings: Fix -Wparantheses-equality warningsMatthew Jordan
Clang will treat ((a == b)) as a warning, as it reasonably expects that the developer may have intended to write (a == b) or ((a = b)). This patch cleans up all instances where equality, not assignment, was intended between two parantheses. Review: https://reviewboard.asterisk.org/r/4531/ ASTERISK-24917 Repoted by: dkdegroot patches: rb4531.patch submitted by dkdegroot (License 6600) ........ Merged revisions 433687 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-10app_voicemail: Fix crash with IMAP backends when greetings aren't presentMatthew Jordan
When an IMAP backend is in use and greetings are set to be used, but aren't present for a user in their IMAP folder, Asterisk will crash. This occurs due to the mailstream being set to the 'greetings' folder and being left in that particular state, regardless of the success/failure of the attempt to access the folder the mailstream points to. Later access of the mailstream assumes that it points to the 'INBOX' (or some other folder), resulting in either a crash (if the greetings folder didn't exist and the mailstream is invalid) or an inability to read messages from the 'INBOX' folder. This patch restores the mailstream to its correct state after accessing the greetings. This fixes the crash, and sets the mailstream to the state that VoiceMailMain expects. Note that while ASTERISK-23390 also contained a patch for this issue, the patch on ASTERISK-24786 is the one being merged here. Review: https://reviewboard.asterisk.org/r/4459/ ASTERISK-23390 #close Reported by: Ben Smithurst ASTERISK-24786 #close Reported by: Graham Barnett Tested by: Graham Barnett patches: app_voicemail.c.patch.SIGSEGV3rev2 uploaded by Graham Barnett (License 6685) ........ Merged revisions 432695 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-05app_voicemail: Fix compile breaking in app_voicemail with IMAP_STORAGE.George Joseph
There is a leftover "assert" in app_voicemail/__messagecount that references variables that don't exist. This causes the compile to fail when --enable-dev-mode and IMAP_STORAGE are selected. This patch removes the assert. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4461/ ........ Merged revisions 432484 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-21apps/app_voicemail: Demote an ERROR message to a WARNING messageMatthew Jordan
When using IMAP voicemail with FreePBX, you will often get ERROR messages complaining about not being able to find a mailbox. This is due to how FreePBX handles voicemail mailboxes. Unfortunately, app_voicemail has to consider this a configuration error, as in any other system it would be indicative of someone misconfiguring their system. Regardless, a misconfiguration is a WARNING, and not an ERROR. This patch demotes the message so that system administrators can hopefully reduce some of the noise in their log files. Note that in the original patch this was made into a NOTICE, but that's a too forgiving. ASTERISK-24790 #close Reported by: Graham Barnett patches: app_voicemail.c.patch_noise uploaded by Graham Barnett (License 6685) ........ Merged revisions 432098 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-20apps/app_voicemail: Fix IMAP header compatibility issue with Microsoft ExchangeMatthew Jordan
When interfacing with Microsoft Exchange, custom headers will be returned as all lower case. Currently, the IMAP header code will fail to parse the returned custom headers, as it will be performing a case sensitive comparison. This can cause playback of messages to fail, as needed information - such as origtime - will not be present. This patch updates app_voicemail's header parsing code to perform a case insensitive lookup for the requested custom headers. Since the headers are specific to Asterisk, e.g., 'x-asterisk-vm-orig-time', and headers should be unique in an IMAP message, this should cause no issues with other systems. ASTERISK-24787 #close Reported by: Graham Barnett patches: app_voicemail.c.patch_MSExchange uploaded by Graham Barnett (License 6685) ........ Merged revisions 432012 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-23Fix typo's (retrieve, specified, address).Walter Doekes
........ Merged revisions 430996 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-22apps/app_voicemail: Trigger MWI notification with MixMonitor m() optionMatthew Jordan
The MixMonitor m() option allows a recording to be pushed to a specific voicemail mailbox. If the message is delivered to the mailbox's INBOX, however, no MWI notification is currently raised. This patch corrects the issue by properly calling notify_new_state from the msg_create_from_file function. This will cause MWI to be triggered if the message was placed in the mailbox's INBOX. ASTERISK-24709 #close Reported by: Gareth Palmer patches: app_voicemail-430919.patch uploaded by Gareth Palmer (License 5169) ........ Merged revisions 430920 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-20app_voicemail: Temp message left after review/hangup with ODBC/IMAP backendMatthew Jordan
When using ODBC or IMAP storage, temporary files created on the file system must be disposed of using the DISPOSE macro. The DELETE macro will map to a deletion function for the backend storage, but does not clean up any local files created as a result of the operation. When using voicemail with the operator and review options enabled, pressing 0 to enter the menu, followed by 1 to save the message, followed by any other DTMF press to delete the message, will result in the temporary file lingering on the file system. This patch properly calls DISPOSE after the DELETE. This causes the local file to be disposed of. ASTERISK-24288 #close Reported by: LEI FU patches: voicemail_odbc_review_fix.diff uploaded by LEI FU (License 6640) ........ Merged revisions 430795 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09AMI: Make AMI actions that generate event lists consistent.Richard Mudgett
* Made the following AMI actions use list API calls for consistency: Agents BridgeInfo BridgeList BridgeTechnologyList ConfbridgeLIst ConfbridgeLIstRooms CoreShowChannels DAHDIShowChannels DBGet DeviceStateList ExtensionStateList FAXSessions Hangup IAXpeerlist IAXpeers IAXregistry MeetmeList MeetmeListRooms MWIGet ParkedCalls Parkinglots PJSIPShowEndpoint PJSIPShowEndpoints PJSIPShowRegistrationsInbound PJSIPShowRegistrationsOutbound PJSIPShowResourceLists PJSIPShowSubscriptionsInbound PJSIPShowSubscriptionsOutbound PresenceStateList PRIShowSpans QueueStatus QueueSummary ShowDialPlan SIPpeers SIPpeerstatus SIPshowregistry SKINNYdevices SKINNYlines Status VoicemailUsersList * Incremented the AMI version to 2.7.0. * Changed astman_send_listack() to not use the listflag parameter and always set the value to "Start" so the start capitalization is consistent. i.e., The FAXSessions used "Start" while the rest of the system used "start". The corresponding complete event always used "Complete". * Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the AMI ActionID for all of its list events. * Fixed off-nominal AMI protocol error in manager_bridge_info(), manager_parking_status_single_lot(), and manager_parking_status_all_lots(). Use of astman_send_error() after responding to the original AMI action request violates the action response pattern by sending two responses. * Fixed minor protocol error in action_getconfig() when no requested categories are found. Each line needs to be formatted as "Header: text". * Fixed off-nominal memory leak in manager_build_parked_call_string(). * Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail(). ASTERISK-24049 #close Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/4315/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-03apps/app_voicemail: Fix crash with IMAP when streams are opened simultaneouslyMatthew Jordan
The UW IMAP library is instrinsically not thread-safe, and relies upon higher level applications to guarantee thread safety. For the most part, this is provided by the vms object, which provides locking for individual streams. Unfortunately, this is not sufficient for calls to mail_open which create the IMAP stream. mail_open can, on some systems, call into a UW IMAP specific function for determining the address of a system based on a hostname, ip_nametoaddr. In the ip6_unix implementation of this function, static variables are used to hold parsing buffers. This can cause a crash if multiple threads attempt to convert a hostname to an address at the same time. Locking on a single mail stream is not sufficient to prevent simultaneous access to these static variables. In the IMAP library, this function can be called from the mail_open and imap_status functions. As the imap_status function is not used by app_voicemail, locking on access to mail_open is sufficient to prevent any mangling of the buffers. Review: https://reviewboard.asterisk.org/r/4188/ ASTERISK-24516 #close Reported by: David Duncan Ross Palmer Tested by: David Duncan Ross Palmer patches: ASTERISK-24516.diff uploaded by David Duncan Ross Palmer (License 6660) ........ Merged revisions 428863 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428864 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09app_voicemail: Fix enhancement that allowed multiple recipients in To: headerMatthew Jordan
An issue existed in r420577, which added multiple recipients to voicemail emails. The patch, when looking at the intended recipients, looked ahead for the '|' character inside a while loop which already had pulled out the appropriate field parsing on the '|' character. This would cause it to skip the recipients. This patch fixes it such that it relies completely on the while loop to parse through the e-mail fields. Note that the original author of the patch looked at this fix and approved it. ASTERISK-24250 #close Reported by: abelbeck patches: voicemail-420577-to-comma-fix.diff uploaded by abelbeck (License 5903) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427585 65c4cc65-6c06-0410-ace0-fbb531ad65f3