summaryrefslogtreecommitdiff
path: root/apps
AgeCommit message (Collapse)Author
2017-10-10app_originate: Set ORIGINATE_STATUS correctly on failureSean Bright
We were ignoring the return value from ast_pbx_outgoing_exten() and ast_pbx_outgoing_app() which could fail before setting the reason code. This resulted in failures being reported as success. ASTERISK-25266 #close Reported by: Allen Ford Change-Id: Idf16237b7e41b527d2c69c865829128686beeb3b
2017-09-28app_queue.c: Fix announcements when announce-to-first-user not enabled.Richard Mudgett
The previous patch for ASTERISK-27216 made it so you wouldn't get any position or periodic announcements unless you had announce-to-first-user enabled. The announce-to-first-user feature was added by ASTERISK_21782 as a result of the patch which introduced the redundant announcements that ASTERISK-27216 removes. * By noting that the makeannouncement variable is used to suppresses the first user announcement, we set its initial value to the announce-to-first-user enable setting. ASTERISK-27216 Change-Id: Ieaeb7dbea8ae7073086b775fbafe0625b000b10a
2017-09-26Merge "app_queue: Only do announcement logic between ringing cycles" into 14Jenkins2
2017-09-25build: A few gcc 7 error fixesGeorge Joseph
Change-Id: I7b5300fbf1af7d88d47129db13ad6dbdc9b553ec
2017-09-25app_queue: Only do announcement logic between ringing cyclesStefanEng86
This patch reverts the change by patch 2263 from old reviewboard. Note that reverting that 2263-patch still preserves the behaviour that the commit log of the 2263-patch claimed to add. The reason for this is: The function wait_for_answer is only called from try_calling which in turn is only called from the main for loop in queue_exec, and earlier in that loop we already check the things that's removed by this patch. There's no need to check those things twice each loop iteration, and I think the proper place to check it is before each ringing cycle. By checking it in wait_for_answer, you allow the issue explained in the jira - that the head caller hears announcements while the agents' sip phones are actively ringing. Reported-by: Stefan Engström Tested-by: Stefan Engström ASTERISK-27216 #close Change-Id: Ic4290dc75256f9743900c6762ee1bb915f672db0
2017-09-06app_waitforsilence: Cleanup & don't treat missing frames as 'noise'Sean Bright
* WaitForSilence completes successfully if it receives no media in the specified timeout, but when acting as WaitForNoise that logic needs to be reversed. * Use standard argument parsing macros and add some error checking for invalid values. * The documentation indicated that the first argument to both WaitForSilence and WaitForNoise was required when it was not. Update the documentation to reflect that. * Wrap up some behavior in structs to avoid boolean checks all over the place. ASTERISK-24066 #close Reported by: M vd S Change-Id: I01d40adc5b63342bb5018a1bea2081a0aa191ef9
2017-09-01app_directory: Handle a NULL mailbox without crashingSean Bright
ASTERISK-27241 #close Reported by: David Moore Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6
2017-08-31Merge "AST-2017-006: Fix app_minivm application MinivmNotify command ↵Jenkins2
injection" into 14
2017-08-30AST-2017-006: Fix app_minivm application MinivmNotify command injectionCorey Farrell
An admin can configure app_minivm with an externnotify program to be run when a voicemail is received. The app_minivm application MinivmNotify uses ast_safe_system() for this purpose which is vulnerable to command injection since the Caller-ID name and number values given to externnotify can come from an external untrusted source. * Add ast_safe_execvp() function. This gives modules the ability to run external commands with greater safety compared to ast_safe_system(). Specifically when some parameters are filled by untrusted sources the new function does not allow malicious input to break argument encoding. This may be of particular concern where CALLERID(name) or CALLERID(num) may be used as a parameter to a script run by ast_safe_system() which could potentially allow arbitrary command execution. * Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp() instead of ast_safe_system() to avoid command injection. * Document code injection potential from untrusted data sources for other shell commands that are under user control. ASTERISK-27103 Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
2017-08-29confbridge: Handle user hangup during name recordingSean Bright
This prevents orphaned CBAnn channels from getting stuck in the bridge. ASTERISK-26994 #close Reported by: James Terhune Change-Id: I5e43e832a9507ec3f2c59752cd900b41dab80457
2017-08-29Merge "app_record: Resolve some absolute vs. relative filename bugs" into 14Joshua Colp
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-25app_record: Resolve some absolute vs. relative filename bugsSean Bright
If the Record() application is called with a relative filename that includes directories, we were not properly creating the intermediate directories and Record() would fail. Secondarily, updated the documentation for RECORDED_FILE to mention that it does not include a filename extension. Finally, rewrote the '%d' functionality to be a bit more straight forward and less noisy. ASTERISK-16777 #close Reported by: klaus3000 Change-Id: Ibc2640cba3a8c7f17d97b02f76b7608b1e7ffde2
2017-08-25Merge "app_queue: Evaluate realtime queues when running dialplan functions" ↵Joshua Colp
into 14
2017-08-24app_queue: Evaluate realtime queues when running dialplan functionsSean Bright
ASTERISK-19103 #close Reported by: Jim Van Meggelen Change-Id: I4bd32a9d1fcebb8ac56bff0e084d4f53e31b692b
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-22app_queue: Fix initial hold time queue statisticSungtae Kim
Fixed to use correct initial value and fixed to use the correct queue info to check the first value. ASTERISK-27204 Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73
2017-08-04app_privacy: remove unused header asterisk/image.hCorey Farrell
Change-Id: I56ed530633a642633b18383821069e806c92ae82
2017-08-03Fix compile error for old versions of GCC.Corey Farrell
Use -Wno-format-truncation only if supported by compiler. ASTERISK-27171 #close Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6
2017-08-01app_queue: Add priority to AMI QueueStatusNiklas Larsson
Add priority to callers in AMI QueueStatus response ASTERISK-27092 #close Change-Id: I8d1f737a72c7c38f4cfe1a4ee3ecc0a4f85bd199
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-19Merge "app_playback.c: Use the timezonename parameter" into 14Jenkins2
2017-07-14app_confbridge: Make sure name recordings are always removed from the filesystemSergej Kasumovic
This commit fixes two possible scenarios: * When recording name and if during recording you hangup, file is never removed. This is due to the fact file location is nulled. * When recording name and if you hangup during thank-you prompt, file is never removed. ASTERISK-27123 #close Change-Id: I39b7271408b4b54ce880c5111a886aa8f28c2625
2017-07-12app_playback.c: Use the timezonename parameterHolger Hans Peter Freyther
In say_date_generic the timezonename parameter is passed but never used. Fix it by passing it to the ast_localtime function. ASTERISK-27124 Change-Id: I6afa98f9163190043244b9f3ba91eb1874d1b586
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-29app_queue: Fix returning to dialplan when a queue is emptyIvan Poddubny
The fix for ASTERISK-25665 introduced a regression. The return value of queue_exec used to be 0 in case of leavewhenempty but it was changed to -1 (returned from wait_our_turn and passed transparently by queue_exec), thus leading to hangup instead of returning back to dialplan. This commit resets the value back to 0 in this case, restoring original behavior. ASTERISK-27065 #close Reported by: Marek Cervenka Change-Id: Id9c83b75aeda463250155e88c5004be52bbca5ac
2017-06-22app_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-16app_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.c: Fix compile error when IMAP enabled." into 14Jenkins2
2017-06-14app_voicemail.c: Fix compile error when IMAP enabled.Richard Mudgett
Change-Id: I2703f15b4099b4210c68eccf293105d1975c1fc1
2017-06-14app_voicemail: IMAP logout on MWI unsubscribeAlexei Gradinari
Closing IMAP connection on MWI unsubscribe. ASTERISK-24052 #close Change-Id: I4ff964026002b2817b48c20fb4239f0a880228fd
2017-06-01Merge "app_confbridge: Race between removing and playing name recording ↵Joshua Colp
while leaving" into 14
2017-05-31channel / app_meetme: Fix parentheses.Joshua Colp
ASTERISK-27025 Change-Id: Id736b0aa4ec6b6b0f04663d64fa8d151f81fdbed
2017-05-26Merge "asterisk: Audit locking of channel when manipulating flags." into 14Jenkins2
2017-05-24Merge "app_queue: Fix members showing as being in call when not." into 14Jenkins2
2017-05-23app_queue: Fix members showing as being in call when not.Joshua Colp
A change was done which added an 'in_call' flag to queue members that was set to true while talking to an agent. Unfortunately in practice this does not accurately reflect whether they are talking to an agent or not. If a Local channel is involved and a transfer is performed then the app_queue application would incorrectly think the agent was still in a call with the caller. This was done to fix a race condition between an agent becoming available by device state and the checking of the last call information for the wrapup time. There was a small window where the last call information would be the previous value instead of the new one. This change goes about fixing the original issue in a different way by considering the call completed if device state is received which would make the agent available and if they are currently in a call. If this occurs the last call information is updated before the agent becomes available ensuring that old information is not present when checking if the member should be called. This also improves the transfer situation by actually updating and enforcing the wrapup time. ASTERISK-26399 ASTERISK-26400 ASTERISK-26715 ASTERISK-26975 Change-Id: Ife1cb686e3173b3a6d368601adef9aff69d4beea
2017-05-23app_confbridge: Race between removing and playing name recording while leavingRobert Mordec
When user leaves a conference, its channel calls async_play_sound_file() in order to play the name announcement and then unlinks the sound file. The async_play_sound_file() function adds a task to conference playback queue, which then runs playback_common() function in a different thread. It leads to a race condition when, in some cases, channel thread may unlink the sound file before playback_common() had a chance to open it. This patch creates a file deletion task, that is queued after playback. ASTERISK-27012 #close Change-Id: I412f7922d412004b80917d4e892546c15bd70dd3
2017-05-17app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDONIvan Poddubny
There are 2 places in app_queue.c that log EXITEMPTY event: one in wait_our_turn, and another one in queue_exec in the loop trying to call an agent after wait_our_turn. In most cases it leads to logging EXITEMPTY twice. ABANDON is also logged on two places, and in the rare case when an agent and caller hang up simultaneously it's also possible to get duplicates in queue_log. This commit changes wait_our_turn to return -1 ("the caller should exit the queue") instead of 0 ("the caller's turn has arrived") in case of leaving when empty, so queue_exec skips the agent calling loop. Also, leave_queue is now executed only once in this case, because 2nd time is just a noop when the queue entry has already been removed. Also, it sets qe->handled to -1 to indicate that the call was not answered by an agent, but the necessary handling has already been done in order to avoid logging an extra ABANDON entry. ASTERISK-25665 #close Reported by: Ove Aursand Change-Id: I4578dd383bf2ac41589cf167865e8aaebcd4c11e
2017-05-16asterisk: Audit locking of channel when manipulating flags.Joshua Colp
When manipulating flags on a channel the channel has to be locked to guarantee that nothing else is also manipulating the flags. This change introduces locking where necessary to guarantee this. It also adds helper functions that manipulate channel flags and lock to reduce repeated code. ASTERISK-26789 Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
2017-05-04app_confbridge: Fix reference to cfg in menu_template_handlerGeorge Joseph
menu_template_handler wasn't properly accounting for the fact that it might be called both during a load/reload (which isn't really valid but not prevented) and by a dialplan function. In both cases it was attempting to use the "pending" config which wasn't valid in the latter case. aco_process_config is also partly to blame because it wasn't properly cleaning "pending" up when a reload was done and no changes were made. Both of these contributed to a crash if CONFBRIDGE(menu,template) was called in a dialplan after a reload. * aco_process_config now sets info->internal->pending to NULL after it unrefs it although this isn't strictly necessary in the context of this fix. * menu_template_handler now uses the "current" config and silently ignores any attempt to be called as a result of someone uses the "template" parameter in the conf file. Luckily there's no other place in the codebase where aco_pending_config is used outside of aco_process_config. ASTERISK-25506 #close Reported-by: Frederic LE FOLL Change-Id: Ib349a17d3d088f092480b19addd7122fcaac21a7
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-22Merge "Revert "app_queue: Handle the caller being redirected out of a queue ↵zuul
bridge"" into 14
2017-03-22Merge "app_queue: Member stuck as pending after forwarding previous call ↵zuul
from queue" into 14
2017-03-22Merge "autochan/mixmonitor/chanspy: Fix unsafe channel locking and ↵Joshua Colp
references." into 14
2017-03-21Revert "app_queue: Handle the caller being redirected out of a queue bridge"Sean Bright
This reverts commit 163e9e53dc7d84dd42721e733b7706c8147bdd27. Change-Id: Ief28479c77a298879dfe2c56be7ee92dc465da4b
2017-03-18Merge "app_queue: Fix locking behavior in stasis message handlers" into 14Joshua Colp
2017-03-17app_queue: Member stuck as pending after forwarding previous call from queueRobert Mordec
Queue member will get stuck in pending_members if queue calls a device that is different from the one observed for state changes. This patch removes members from pending_members as a result of channel stasis events such as blind or attended transfers and hangup. ASTERISK-26862 #close Change-Id: I8bf6df487b9bb35726c08049ff25cdad5e357727
2017-03-17app_queue: Fix locking behavior in stasis message handlersSean Bright
The queue_stasis_data structure contains various mutable fields that require appropriate locking. Specifically, the 'dying,' 'member_uniqueid,' and 'caller_uniqueid' fields need to be locked when read from or written to. Change-Id: I246b7dbff8447acc957a1299f6ad0ebd0fd39088