summaryrefslogtreecommitdiff
path: root/apps
AgeCommit message (Collapse)Author
2015-03-28clang compiler warnings: Fix a variety of "unused" warningsMatthew Jordan
This patch fixes the -Wunused-value -Wunused-variable -Wunused-const-variable errors caught by clang. Specifically: * apps/app_queue.c: removed unused qpm_cmd_usage[], qum_cmd_usage[], qsmp_cmd_usage[] * cel/cel_sqlite3_custom.c: removed unused name[] = "cel_sqlite3_custom" * channels/chan_pjsip.c: removed unused desc[] = "PJSIP Channel" * codecs/gsm/src/gsm_create.c: removed unused ident[] = "$Header$" * funcs/func_env.c:729: Fixed ast_str_append_substr. * main/editline/np/strlcat.c: removed unused rcsid variable * main/editline/np/strlcpy.c: removed unused rcsid variable * main/security_events.c: removed unused TIMESTAMP_STR_LEN * utils/conf2ael.c: removed unused cfextension_states * utils/extconf.c: removed unused cfextension_states Review: https://reviewboard.asterisk.org/r/4526 ASTERISK-24917 Reported by: dkdegroot patches: rb4526.patch submitted by dkdegroot (License 6600) ........ Merged revisions 433693 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433694 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 ........ Merged revisions 433688 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-26app_confbridge: file playback blocks dtmfKevin Harwell
Attempting to execute DTMF in a confbridge while file playback (prompt, announcement, etc) is occurring is not allowed. You have to wait until the sound file has completed before entering DTMF. This patch fixes it so that app_confbridge now monitors for dtmf key presses during menu driven file playback. If a key is pressed playback stops and it executes the matched menu option. ASTERISK-24864 #close Reported by: Steve Pitts Review: https://reviewboard.asterisk.org/r/4510/ ........ Merged revisions 433445 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433446 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-23Fix compilations errors on 64-bit OpenBSD systemsMatthew Jordan
In versiong 5.5, OpenBSD went to 64-bit time values. This requires a cast to (long) when printing members of certain time structs. Review: https://reviewboard.asterisk.org/r/4507 ASTERISK-24879 #close Reported by: snuffy Tested by: snuffy patches: openbsd-time64.diff uploaded by snuffy (License 5024) ........ Merged revisions 433268 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433269 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-17Audit ast_sockaddr_resolve() usage for memory leaks.Richard Mudgett
Valgrind found some memory leaks associated with ast_sockaddr_resolve(). Most of the leaks had already been fixed by earlier memory leak hunt patches. This patch performs an audit of ast_sockaddr_resolve() and found one more. * Fix ast_sockaddr_resolve() memory leak in apps/app_externalivr.c:app_exec(). * Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs parameter for safety so the pointer will never be uninitialized on return. The same goes for res/res_pjsip_acl.c:extract_contact_addr(). * Made functions that call ast_sockaddr_resolve() with RAII_VAR() controlling the addrs variable use ast_free instead of ast_free_ptr to provide better MALLOC_DEBUG information. Review: https://reviewboard.asterisk.org/r/4509/ ........ Merged revisions 433056 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433057 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-14apps/app_sms: Add an option to prevent SMS content from being loggedMatthew Jordan
In some countries, privacy laws specify that SMS content cannot be saved by a provider. This patch adds a new option to the SMS application, 'n', which prevents the SMS content from being written to the SMS log. ASTERISK-22591 #close Reported by: Jan Juergens patches: DisableSmsContentLoggingByParam.patch uploaded by Jan Juergens (License 6538) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-14apps/app_amd: Document maximum_word_length option; fix AMDCAUSE documentationMatthew Jordan
This patch corrects the documentation for the AMD application. Specifically: * It documents the maximum_word_length option, which limits the maximum allowed length of a single utterance. * It clarifies the AMDCAUSE values MAXWORDS and MAXWORDLENGTH. MAXWORDLENGTH was documented as MAXWORDS, while MAXWORDS was undocumented. Thanks to the issue reporter, Frank DiGennaro, for pointing out the issues. ASTERISK-19470 #close Reported by: Frank DiGennaro ........ Merged revisions 432918 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 432920 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-13Logger: Convert 'struct ast_callid' to unsigned int.Corey Farrell
Switch logger callid's from AO2 objects to simple integers. This helps in two ways. Copying integers is faster than referencing AO2 objects, so this will result in a small reduction in logger overhead. This also erases the possibility of an infinate loop caused by an invalid callid in threadstorage. ASTERISK-24833 #comment Committed callid conversion to trunk. Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4466/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432834 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 ........ Merged revisions 432696 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432697 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 ........ Merged revisions 432485 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-26app_chanspy, channel: fix frame leaksKevin Harwell
Fixed a couple of frame leaks that were found during testing. ASTERISK-24828 #close Reported by: John Hardin Review: https://reviewboard.asterisk.org/r/4445/ ........ Merged revisions 432362 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 432363 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-26make: Remove 'res_features' from libraries to link against with cygwin/mingw32Matthew Jordan
Both the apps and channels Makefiles still listed 'res_features' as modules to link against when compiling for cygwin or mingw32. This module hasn't existed for quite some time. ASTERISK-18105 #close Reported by: feyfre ........ Merged revisions 432341 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 432342 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432343 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 ........ Merged revisions 432099 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432100 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 ........ Merged revisions 432013 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-15apps/app_mixmonitor: Move Test Event for MIXMONITOR_END to after it finishesMatthew Jordan
The Test Event for MIXMONITOR_END - which signals that a MixMonitor has completed - technically fired before the filestream was closed. If a test used this to trigger a condition to verify that the file was written, it could result in a race condition where the file size would not be what the test expected. Luckily, no tests were using this (although they should have been). Since the test event needed to be moved after the point where the MixMonitor autochan has been destroyed, the test event no longer emits the channel name. Luckily, nothing needs it. ........ Merged revisions 431788 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 431789 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-11HTTP: Stop accepting requests on final system shutdown.Richard Mudgett
There are three CLI commands to stop and restart Asterisk each. 1) core stop/restart now - Hangup all calls and stop or restart Asterisk. New channels are prevented while the shutdown request is pending. 2) core stop/restart gracefully - Stop or restart Asterisk when there are no calls remaining in the system. New channels are prevented while the shutdown request is pending. 3) core stop/restart when convenient - Stop or restart Asterisk when there are no calls in the system. New calls are not prevented while the shutdown request is pending. ARI has made stopping/restarting Asterisk more problematic. While a shutdown request is pending it is desirable to continue to process ARI HTTP requests for current calls. To handle the current calls while a shutdown request is pending, a new committed to shutdown phase is needed so ARI applications can deal with the calls until the system is fully committed to shutdown. * Added a new shutdown committed phase so ARI applications can deal with calls until the final committed to shutdown phase is reached. * Made refuse new HTTP requests when the system has reached the final system shutdown phase. Starting anything while the system is actively releasing resources and unloading modules is not a good thing. * Split the bridging framework shutdown to not cleanup the global bridging containers when shutting down in a hurry. This is similar to how other modules prevent crashes on rapid system shutdown. * Moved ast_begin_shutdown(), ast_cancel_shutdown(), and ast_shutting_down(). You should not have to include channel.h just to access these system functions. ASTERISK-24752 #close Reported by: Matthew Jordan Review: https://reviewboard.asterisk.org/r/4399/ ........ Merged revisions 431692 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-30app_agent_pool: Fix initial module load agent device state reporting.Richard Mudgett
When the app_agent_pool module initially loads there is a race condition between the thread loading agents.conf and the device state internal processing thread. If the device state internal processing thread handles the agent creation state updates before the thread that loaded agents.conf registers the device state provider callback then the cached agent state is "Invalid". When a consumer module like app_queue asks for the agent state it gets the cached "Invalid" state instead of the real state from the provider. * Moved loading the agents.conf configuration to the last thing setup by app_agent_pool in load_module(). Now the device state provider callback is registered before the config is loaded so the agent creation state updates are guaranteed to get the initial device state. * Removed some now redundant config cleanup on error in load_config(). * Added lock protection when accessing the device state in agent_pvt_devstate_get() and eliminated the RAII_VAR() usage. ASTERISK-24737 #close Reported by: Steve Pitts Review: https://reviewboard.asterisk.org/r/4390/ ........ Merged revisions 431492 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-27app_confbridge: Repeatedly starting and stopping recording ref leaks the ↵Richard Mudgett
recording channel. Starting and stopping conference recording more than once causes the recording channels to be leaked. For v13 the channels also show up in the CLI "core show channels" output. * Reworked and simplified the recording channel code to use ast_bridge_impart() instead of managing the recording thread in the ConfBridge code. The recording channel's ref handling easily falls into place and other off nominal code paths get handled better as a result. ASTERISK-24719 #close Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/4368/ Review: https://reviewboard.asterisk.org/r/4369/ ........ Merged revisions 431135 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 431160 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-27app_confbridge: Restore user's menu name to CLI output of 'confbridge list'Matthew Jordan
When issuing a 'confbridge list XXXX' CLI command, the resulting output no longer displays the menu associated with a ConfBridge participant. The issue was caused by ASTERISK-22760. When that patch was done, it removed the copying of the menu name associated with the user from the actual user profile. This patch fixes the issue by copying the menu name over to the user profile when the menu hooks are applied to the user. Since that function now does a little bit more than just apply the hooks, the name of the function has been changed to cover the copying of the menu name over as well. In addition, there is a disparity between the menu name length as it is stored on the conf_menu structure and the confbridge_user structure; this patch makes the lengths match so that a strcpy can be used. Review: https://reviewboard.asterisk.org/r/4372/ ASTERISK-24723 #close Reported by: Steve Pitts ........ Merged revisions 431134 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-23app_confbridge: Shorten CBRec channel names to CBRec/<conf_name>-<seq-num>Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-23app_confbridge: Make CBRec channel names more unique.Richard Mudgett
Channel names should be different from other channels in the system while the channel exists. * Use a sequence number for CBRec channels instead of a random number because the same random number could be picked again for the next CBRec channel. ........ Merged revisions 431052 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-23app_confbridge: WhitespaceRichard Mudgett
Because there is sometimes no sence to any whitespace. ........ Merged revisions 431049 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 431050 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431051 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 ........ Merged revisions 430998 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431000 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 ........ Merged revisions 430921 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-21apps/app_dial: Don't publish DialEnd twice on unexpected GoSub/Macro valuesMatthew Jordan
The Dial application has some interesting options with the mid-call Macro (M) and GoSub (U) options. If the MACRO_RESULT/GOSUB_RESULT returns specific values, the Dial application will take some action upon the channels involved in the dial operation (such as hanging up a particular party, etc.) The Dial application ensures that a Stasis message is published in the event that MACRO_RESULT/GOSUB_RESULT returns a value that kills the dial operation, so that there is a corresponding DialEnd event published in AMI/ARI for the DialBegin event that preceeded it. A bug exists where that same DialEnd event will be published on Stasis even if the value returned in MACRO_RESULT/GOSUB_RESULT is not one that the Dial application cares about. This causes two DialEnd events to be published - one with the MACRO_RESULT/GOSUB_RESULT and another with "ANSWERED" - which is all sorts of wrong. This patch fixes the bug by ensuring that we only publish a DialEnd message to Stasis if the Dial application's mid-call Macro/GoSub returns something that Dial cares about. Review: https://reviewboard.asterisk.org/r/4336 ASTERISK-24682 #close Reported by: Matt Jordan ........ Merged revisions 430842 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430844 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 ........ Merged revisions 430796 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-13app_macro: Don't restore the calling location on a channel redirect.Richard Mudgett
v11: If a channel redirect to a macro exten of a macro that is active happens, the redirect location doesn't get executed. Instead the original macro location is restored and gets reexecuted. v13: An additional effect happens if a parked call times out to an extension in the macro that parked the call then the macro is reexecuted instead of the expected park return location. * Made not restore the macro calling location on an AST_SOFTHANGUP_ASYNCGOTO. * Increased the locked channel range when setting up the macro execution environment to cover things that should be done while the channel is locked. * Removed unnecessary NULL tests before calling ast_free() in _macro_exec(). ASTERISK-23850 #close Reported by: Andrew Nagy Review: https://reviewboard.asterisk.org/r/4292/ ........ Merged revisions 430564 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 430565 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12Revert -r430452 It needs to be redone for the next major AMI version change ↵Richard Mudgett
instead. ASTERISK-24049 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09AMI: Remove no longer used parameter from astman_send_listack().Richard Mudgett
Follow-up issue to -r430435 from reviewboard review. ASTERISK-24049 Review: https://reviewboard.asterisk.org/r/4315/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430452 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/ ........ Merged revisions 430434 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22app_confbridge: Fix build error caused by XML validation errorsMatthew Jordan
Summaries can't contain XML nodes, as they are defined to contain only text data. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22app_confbridge: Add the ability to pass options/command to MixMonitorMatthew Jordan
This patch adds the ability to pass options and a command to MixMontor when recording a conference using ConfBridge. New options are - * record_options: Options to MixMontor, eg: m(), W() etc. * record_command: The command to execute when recording is over. * record_file_timestamp: Append the start time to the file name. These options can also be used with the CONFBRIDGE function, e.g., Set(CONFBRIDGE(bridge,record_command)=/path/to/command ^{MIXMONITOR_FILENAME})) Review: https://reviewboard.asterisk.org/r/4023 ASTERISK-24351 #close Reported by: Gareth Palmer patches: record_command-428838.patch uploaded by Gareth Palmer (License 5169) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-17Fix printf problems with high ascii characters after r413586 (1.8).Walter Doekes
In r413586 (1.8) various casts were added to silence gcc 4.10 warnings. Those fixes included things like: -out += sprintf(out, "%%%02X", (unsigned char) *ptr); +out += sprintf(out, "%%%02X", (unsigned) *ptr); That works for low ascii characters, but for the high range that yields e.g. FFFFFFC3 when C3 is expected. This changeset: - fixes those casts to use the 'hh' unsigned char modifier instead - consistently uses %02x instead of %2.2x (or other non-standard usage) - adds a few 'h' modifiers in various places - fixes a 'replcaes' typo - dev/urandon typo (in 13+ patch) Review: https://reviewboard.asterisk.org/r/4263/ ASTERISK-24619 #close Reported by: Stefan27 (on IRC) ........ Merged revisions 429673 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 429674 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 429675 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-06apps/app_meetme: Apply default values on initial load with no config fileMatthew Jordan
When the app_meetme module is loaded without its configuration file, the module settings aren't initialized. In particular, this impacts the use of logging realtime members. This patch guarantees that we always set the default module settings on initial load. Review: https://reviewboard.asterisk.org/r/4242/ ASTERISK-24572 #close Reported by: Nuno Borges patches: 24572.patch uploaded by Nuno Borges (License 6116) ........ Merged revisions 429027 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 429028 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 429029 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429030 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 ........ Merged revisions 428865 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01main/stasis: Allow subscriptions to use a threadpool for message deliveryMatthew Jordan
Prior to this patch, all Stasis subscriptions would receive a dedicated thread for servicing published messages. In contrast, prior to r400178 (see review https://reviewboard.asterisk.org/r/2881/), the subscriptions shared a thread pool. It was discovered during some initial work on Stasis that, for a low subscription count with high message throughput, the threadpool was not as performant as simply having a dedicated thread per subscriber. For situations where a subscriber receives a substantial number of messages and is always present, the model of having a dedicated thread per subscriber makes sense. While we still have plenty of subscriptions that would follow this model, e.g., AMI, CDRs, CEL, etc., there are plenty that also fall into the following two categories: * Large number of subscriptions, specifically those tied to endpoints/peers. * Low number of messages. Some subscriptions exist specifically to coordinate a single message - the subscription is created, a message is published, the delivery is synchronized, and the subscription is destroyed. In both of the latter two cases, creating a dedicated thread is wasteful (and in the case of a large number of peers/endpoints, harmful). In those cases, having shared delivery threads is far more performant. This patch adds the ability of a subscriber to Stasis to choose whether or not their messages are dispatched on a dedicated thread or on a threadpool. The threadpool is configurable through stasis.conf. Review: https://reviewboard.asterisk.org/r/4193 ASTERISK-24533 #close Reported by: xrobau Tested by: xrobau ........ Merged revisions 428681 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428687 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01app_record: Fix bug where using the 'k' option and hanging up would trim 1/4 ↵Joshua Colp
of a second of the recording. The Record dialplan function trims 1/4 of a second from the end of recordings in case they are terminated because of DTMF. When hanging up, however, you don't want this to happen. This change makes it so on hangup this does not occur. ASTERISK-24530 #close Reported by: Ben Smithurst patches: app_record_v2.diff submitted by Ben Smithurst (license 6529) Review: https://reviewboard.asterisk.org/r/4201/ ........ Merged revisions 428653 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428654 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428655 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-20AST-2014-017 - app_confbridge: permission escalation/ class authorization.Kevin Harwell
Confbridge dialplan function permission escalation via AMI and inappropriate class authorization on the ConfbridgeStartRecord action. The CONFBRIDGE dialplan function when executed from an external protocol (for instance AMI), could result in a privilege escalation. Also, the AMI action “ConfbridgeStartRecord” could also be used to execute arbitrary system commands without first checking for system access. The AMI “ConfbridgeStopRecord” has also been updated to only run under a system authorization. Asterisk now inhibits the CONFBRIDGE function from being executed from an external interface if the live_dangerously option is set to no. Also, the “ConfbridgeStartRecord” AMI action is now only allowed to execute under a user with system level access. ASTERISK-24490 Reported by: Gareth Palmer ........ Merged revisions 428332 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428334 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428339 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-17apps/app_confbridge: Ensure 'normal' users hear message when last marked leavesMatthew Jordan
When r428077 was made for ASTERISK-24522, it failed to take into account users who are neither wait_marked nor end_marked. These users are *also* supposed to hear the 'leader has left the conference' message. Granted, this behaviour is a bit odd; however, that is how it used to work... and behaviour changes are not good. This patch ensures that if there are any 'normal' users present when the last marked user leaves the conference, the message will still be played to them. Note that this regression was caught by the Asterisk Test Suite's confbridge_nominal test, which has a quirky combination of users. ........ Merged revisions 428113 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428114 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428115 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-17app_confbridge: Don't play leader leaving prompt if no one will hear itMatthew Jordan
Consider the following: - A marked user in a conference - One or more end_marked only users in the conference When the marked users leaves, we will be in the conf_state_multi_marked state. This currently will traverse the users, kicking out any who have the end_marked flags. When they are kicked, a full ast_bridge_remove is immediately called on the channels. At this time, we also unilaterally set the need_prompt flag. When the need_prompt flag is set, we then playback a sound to the bridge informing everyone that the leader has left; however, no one is left in the bridge. This causes some odd behaviour for the end_marked users - they are stuck waiting for the bridge to be unlocked. This results in them waiting for 5 or 6 seconds of dead air before hearing that they've been kicked. Unfortunately, we do have to keep the bridge locked while we're playing back the 'leader-has-left' prompt. If there are any wait_marked users in the conference, this behaviour can't be easily changed - but we do make the case of the end_marked users better with this patch. Review: https://reviewboard.asterisk.org/r/4184/ ASTERISK-24522 #close Reported by: Matt Jordan ........ Merged revisions 428077 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428078 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428079 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-14Fix race condition that could result in ARI transfer messages not being sent.Mark Michelson
From reviewboard: "During blind transfer testing, it was noticed that tests were failing occasionally because the ARI blind transfer event was not being sent. After investigating, I detected a race condition in the blind transfer code. When blind transferring a single channel, the actual transfer operation (i.e. removing the transferee from the bridge and directing them to the proper dialplan location) is queued onto the transferee bridge channel. After queuing the transfer operation, the blind transfer Stasis message is published. At the time of publication, snapshots of the channels and bridge involved are created. The ARI subscriber to the blind transfer Stasis message then attempts to determine if the bridge or any of the involved channels are subscribed to by ARI applications. If so, then the blind transfer message is sent to the applications. The way that the ARI blind transfer message handler works is to first see if the transferer channel is subscribed to. If not, then iterate over all the channel IDs in the bridge snapshot and determine if any of those are subscribed to. In the test we were running, the lone transferee channel was subscribed to, so an ARI event should have been sent to our application. Occasionally, though, the bridge snapshot did not have any channels IDs on it at all. Why? The problem is that since the blind transfer operation is handled by a separate thread, it is possible that the transfer will have completed and the channels removed from the bridge before we publish the blind transfer Stasis message. Since the blind transfer has completed, the bridge on which the transfer occurred no longer has any channels on it, so the resulting bridge snapshot has no channels on it. Through investigation of the code, I found that attended transfers can have this issue too for the case where a transferee is transferred to an application." The fix employed here is to decouple the creation of snapshots for the transfer messages from the publication of the transfer messages. This way, snapshots can be created to reflect what they are at the time of the transfer operation. Review: https://reviewboard.asterisk.org/r/4135 ........ Merged revisions 427848 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427870 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-14app_confbridge: Play "leader has left" sound even when musiconhold is enabled.Joshua Colp
Currently if the leader of a conference bridge leaves any participant that has musiconhold enabled will not hear the "leader has left" sound. This is because musiconhold is started and THEN the sound is played. This change makes it so that the sound is played and THEN musiconhold is started. This provides a better experience for users as they may not have known previously why they went back to musiconhold. Review: https://reviewboard.asterisk.org/r/4177/ ........ Merged revisions 427844 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 427845 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427846 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427847 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) ........ Merged revisions 427585 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06app_agent_pool: Made agent alert interruptable by DTMF.Richard Mudgett
Made agent able to interrupt the alerting beep playback with DTMF. Any digit can interrupt if the call does not need to be acknowledged. Only the first digit of the acknowledgement can interrupt if the call needs to be acknowledged. The agent interrupting the alerting playback builds on the ASTERISK-24447 patch because it knows what digit interrupted the playback and needs to be able to pass that digit to the DTMF hook digit collection code. ASTERISK-24257 #close Reported by: Steve Pitts Review: https://reviewboard.asterisk.org/r/4123/ ........ Merged revisions 427508 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427512 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03Fix compile error caused by review 4138Corey Farrell
There is no procedure called ast_closeframe, fix code to use ast_closestream. Reported By: Matt Jordan ........ Merged revisions 427087 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 427088 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427089 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-02Fix ast_writestream leaksCorey Farrell
Fix cleanup in __ast_play_and_record where others[x] may be leaked. This was caught where prepend != NULL && outmsg != NULL, once realfile[x] == NULL any further others[x] would be leaked. A cleanup block was also added for prepend != NULL && outmsg == NULL. 11+: Fix leak of ast_writestream recording_fs in app_voicemail:leave_voicemail. ASTERISK-24476 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4138/ ........ Merged revisions 427023 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 427024 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 427025 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427026 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30app_queue: fix a couple leaks to struct call_queue in set_member_valueCorey Farrell
set_member_value has a couple leaks to references in the variable q found through testsuite tests/queues/set_penalty. Also remove the REF_DEBUG_ONLY_QUEUES compiler declaration, this is no longer possible with the updated REF_DEBUG code. ASTERISK-24466 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4125/ ........ Merged revisions 426805 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 426806 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 426807 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30app_voicemail: Fix unchecked bounds of myArray in IMAP_STORAGE.Walter Doekes
In update_messages_by_imapuser(), messages were appended to a finite array which resulted in a crash when an IMAP mailbox contained more than 256 entries. This memory is now dynamically increased as needed. Observe that this patch adds a bunch of XXX's to questionable code. See the review (url below) for more information. ASTERISK-24190 #close Reported by: Nick Adams Tested by: Nick Adams Review: https://reviewboard.asterisk.org/r/4126/ ........ Merged revisions 426691 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 426692 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 426696 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 426702 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28app_queue: Cleanup ao2_iteratorCorey Farrell
Clean ao2_iterator, resolving reference leak to queue members. ASTERISK-24454 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4111/ ........ Merged revisions 426255 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 426260 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 426266 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-13manager/config: Support templates and non-unique category names via AMIGeorge Joseph
This patch provides the capability to manipulate templates and categories with non-unique names via AMI. Summary of changes: GetConfig and GetConfigJSON: Added "Filter" parameter: A comma separated list of name_regex=value_regex expressions which will cause only categories whose variables match all expressions to be considered. The special variable name TEMPLATES can be used to control whether templates are included. Passing 'include' as the value will include templates along with normal categories. Passing 'restrict' as the value will restrict the operation to ONLY templates. Not specifying a TEMPLATES expression results in the current default behavior which is to not include templates. UpdateConfig: NewCat now includes options for allowing duplicate category names, indicating if the category should be created as a template, and specifying templates the category should inherit from. The rest of the actions now accept a filter string as defined above. If there are non-unique category names, you can now update specific ones based on variable values. To facilitate the new capabilities in manager, corresponding changes had to be made to config, most notably the addition of filter criteria to many of the APIs. In some cases it was easy to change the references to use the new prototype but others would have required touching too many files for this patch so a wrapper with the original prototype was created. Macros couldn't be used in this case because it would break binary compatibility with modules such as res_digium_phone that are linked to real symbols. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4033/ ........ Merged revisions 425383 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 425384 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425385 65c4cc65-6c06-0410-ace0-fbb531ad65f3