Commit Graph

5025 Commits

Author SHA1 Message Date
Alexei Gradinari 0cef7b9d4e app_voicemail: IMAP connection control
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-22 12:23:27 -05:00
Alexei Gradinari 53b7df82f4 app_voicemail: IMAP logout on reload/unload
Closing IMAP connection on module reload or unload.

ASTERISK-24052 #close

Change-Id: I2a40182aa9ef249fa6865d33570430e9ada68525
2017-06-16 10:45:06 -05:00
George Joseph 15c04db3bd Merge "app_voicemail.c: Fix compile error when IMAP enabled." 2017-06-15 09:06:23 -05:00
Richard Mudgett b8b0b61a24 app_voicemail.c: Fix compile error when IMAP enabled.
Change-Id: I2703f15b4099b4210c68eccf293105d1975c1fc1
2017-06-14 12:35:54 -05:00
Alexei Gradinari 023eede265 app_voicemail: IMAP logout on MWI unsubscribe
Closing IMAP connection on MWI unsubscribe.

ASTERISK-24052 #close

Change-Id: I4ff964026002b2817b48c20fb4239f0a880228fd
2017-06-14 11:30:34 -05:00
Joshua Colp 1a24543124 Merge "Confbridge: Add "sfu" video mode to bridge profile options." 2017-06-06 07:05:13 -05:00
Jenkins2 bb2f6234da Merge "Add primitive SFU support to bridge_softmix." 2017-06-06 06:57:24 -05:00
George Joseph b3590c9602 Merge "app_confbridge: Race between removing and playing name recording while leaving" 2017-06-01 14:43:21 -05:00
Joshua Colp f6eeaaafd5 channel / app_meetme: Fix parentheses.
ASTERISK-27025

Change-Id: Id736b0aa4ec6b6b0f04663d64fa8d151f81fdbed
2017-05-31 09:00:09 -05:00
Mark Michelson 39d14834f8 Confbridge: Add "sfu" video mode to bridge profile options.
A previous commit added plumbing to bridge_softmix to allow for an SFU
experience with Asterisk. This commit adds an option to app_confbridge
that allows for a confbridge to actually make use of the SFU video mode.

SFU mode is implemented in a "set it and forget it" kind of way. That
is, when the bridge is created, if SFU mode is enabled, then the video
mode gets set to SFU and cannot be changed. Future improvements may
allow for a hybrid experience (e.g. forward multiple video streams,
specifically those of the most recent talkers), but for this addition,
no such capability is present.

Change-Id: I87bbcb63dec6dbbb42488f894871b86f112b2020
2017-05-30 10:24:20 -05:00
Mark Michelson 2da869408a Add primitive SFU support to bridge_softmix.
This sets up the "plumbing" in bridge_softmix to
be able to accommodate Asterisk asking as an SFU
(selective forwarding unit) for conferences.

The way this works is that whenever a channel enters or leaves a
conference, all participants in the bridge get sent a stream topology
change request. The topologies consist of the channels' original
topology, along with video destination streams corresponding to each
participants' source video streams. So for instance, if Alice, Bob, and
Carol are in the conference, and each supplies one video stream, then
the topologies for each would look like so:

Alice:
Audio,
Source video(Alice),
Destination Video(Bob),
Destination video (Carol)

Bob:
Audio,
Source video(Bob)
Destination Video(Alice),
Destination video (Carol)

Carol:
Audio,
Source video(Carol)
Destination Video(Alice),
Destination video (Bob)

This way, video that arrives from a source video stream can then be
copied out to the destination video streams on the other participants'
channels.

Once the bridge gets told that a topology on a channel has changed, the
bridge constructs a map in order to get the video frames routed to the
proper destination streams. This is done using the bridge channel's
stream_map.

This change is bare-bones with regards to SFU support. Some key features
are missing at this point:

* Stream limits. This commit makes no effort to limit the number of
  streams on a specific channel. This means that if there were 50 video
  callers in a conference, bridge_softmix will happily send out topology
  change requests to every channel in the bridge, requesting 50+
  streams.

* Configuration. The plumbing has been added to bridge_softmix, but
  there has been nothing added as of yet to app_confbridge to enable SFU
  video mode.

* Testing. Some functions included here have unit tests.
  However, the functionality as a whole has only been verified by
  hand-tracing the code.

* Selectivenss. For a "selective" forwarding unit, this does not
  currently have any means of being selective.

* Features. Presumably, someone might wish to only receive video from
  specific sources. There are no external-facing functions at the moment
  that allow for users to select who they receive video from.

* Efficiency. The current scheme treats all video streams as being
  unidirectional. We could be re-using a source video stream as a
  desetnation, too. But to simplify things on this first round, I did it
  this way.

Change-Id: I7c44a829cc63acf8b596a337b2dc3c13898a6c4d
2017-05-30 10:24:01 -05:00
Jenkins2 56b6a71548 Merge "asterisk: Audit locking of channel when manipulating flags." 2017-05-26 09:25:51 -05:00
Joshua Colp 2e7866ebb7 Merge "app_queue: Add QUEUE_RAISE_PENALTY feature" 2017-05-24 13:04:16 -05:00
Joshua Colp faab058014 app_queue: Fix members showing as being in call when not.
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-23 09:24:22 -05:00
Robert Mordec 36e90952ec app_confbridge: Race between removing and playing name recording while leaving
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-23 07:20:01 -05:00
Steve Davies be4beff3e4 app_queue: Add QUEUE_RAISE_PENALTY feature
Additional variable to work alongside QUEUE_MAX_PENALTY and QUEUE_MIN_PENALTY,
including an extra parameter in queuerules.conf. This value causes lower
Agent penalty values to "raise up" so that they can join higher penalty agents
and be treated equally after a period of time.

ASTERISK-26995 #close

Change-Id: If1c6421a983667a5ac4c359f6dac25b212b4c459
2017-05-22 09:20:02 -03:00
Joshua Colp 95c6b98acf Merge "app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDON" 2017-05-22 05:37:32 -05:00
Kevin Harwell a60d1f3974 app_stream_echo: Added a multi-stream echo application
If the channel does not have multi-stream support then this application acts
just like app_echo. If it does have multi-stream support then each stream is
echoed back to itself (one-to-one).

If a "num" is specified, then a new topology is made that contains clones (from
the channel's topology) of all media types that are not equal to the given
"type". If the media type differs then the first stream matching the "type" is
cloned into the new topology and then up to "num" - 1 of the same stream are
also cloned into it. Any additional streams from the original topology matching
the "type" are subsequently ignored (i.e. not added to the new topology).

For this same case when a frame is read from a stream that frame is still
echoed back like before, but now that frame is also echoed out to the
additional streams that matched on the specified "type".

ASTERISK-26997 #close

Change-Id: I254144486734178e196c7f590a26ffc13543ff2c
2017-05-17 17:41:11 -05:00
Joshua Colp 5a7af00e80 asterisk: Audit locking of channel when manipulating flags.
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-16 14:25:23 +00:00
Ivan Poddubny 045dbcc2d6 app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDON
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-11 08:32:40 +02:00
George Joseph 0001834157 app_confbridge: Fix reference to cfg in menu_template_handler
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-05-04 20:13:55 -05:00
Jenkins2 528e238447 Merge "channel: Add ability to request an outgoing channel with stream topology." 2017-04-27 17:53:53 -05:00
Joshua Colp 2b22c3c84b channel: Add ability to request an outgoing channel with stream topology.
This change extends the ast_request functionality by adding another
function and callback to create an outgoing channel with a requested
stream topology. Fallback is provided by either converting the
requested stream topology into a format capabilities structure if
the channel driver does not support streams or by converting the
requested format capabilities into a stream topology if the channel
driver does support streams.

The Dial application has also been updated to request an outgoing
channel with the stream topology of the calling channel.

ASTERISK-26959

Change-Id: Ifa9037a672ac21d42dd7125aa09816dc879a70e6
2017-04-27 10:39:46 +00:00
Sean Bright f5b67871df cleanup: Fix fread() and fwrite() error handling
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-25 16:24:15 -05:00
George Joseph 747beb1ed1 modules: change module LOAD_FAILUREs to LOAD_DECLINES
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-04-12 15:57:21 -06:00
Troy Bowman fac5115c43 app_queue: Log reason for PAUSEALL/UNPAUSEALL
We needed the reason for our reporting when agents pause/unpause all of
their queues at once.  This is a small, simple patch that adds a reason
for PAUSEALL and UNPAUSEALL.  I have been using it in production for years.

ASTERISK-26920 #close

Change-Id: Ifb3f0d1a0abd5194253d9794023546e1395baf3d
2017-04-05 15:22:00 -05:00
zuul 7c2f4601f2 Merge "channel: Remove old epoll support and fixed max number of file descriptors." 2017-03-29 12:45:47 -05:00
Joshua Colp 5d938045d4 channel: Remove old epoll support and fixed max number of file descriptors.
This change removes the old epoll support which has not been used or
maintained in quite some time.

The fixed number of file descriptors on a channel has also been removed.
File descriptors are now contained in a growable vector. This can be
used like before by specifying a specific position to store a file
descriptor at or using a new API call, ast_channel_fd_add, which adds
a file descriptor to the channel and returns its position.

Tests have been added which cover the growing behavior of the vector
and the new API call.

ASTERISK-26885

Change-Id: I1a754b506c009b83dfdeeb08c2d2815db30ef928
2017-03-27 19:54:44 +00:00
zuul 58b42297fd Merge "Revert "app_queue: Handle the caller being redirected out of a queue bridge"" 2017-03-22 10:54:56 -05:00
zuul 30f011a460 Merge "app_queue: Member stuck as pending after forwarding previous call from queue" 2017-03-22 09:50:22 -05:00
zuul 9f64980e60 Merge "autochan/mixmonitor/chanspy: Fix unsafe channel locking and references." 2017-03-21 21:51:49 -05:00
Sean Bright 1bf839d44b Revert "app_queue: Handle the caller being redirected out of a queue bridge"
This reverts commit 163e9e53dc.

Change-Id: Ief28479c77a298879dfe2c56be7ee92dc465da4b
2017-03-21 09:00:15 -06:00
Joshua Colp b05d2fda0c Merge "app_queue: Fix locking behavior in stasis message handlers" 2017-03-18 06:53:08 -05:00
Robert Mordec 79069f8ccb app_queue: Member stuck as pending after forwarding previous call from queue
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-17 09:59:34 -06:00
Sean Bright c13ea6080e app_queue: Fix locking behavior in stasis message handlers
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
2017-03-17 08:22:53 -06:00
Richard Mudgett 57656e2b5b app_confbridge: Fix ConfbridgeTalking AMI event description.
Thanks to Chris Howard for pointing this out on the wiki.

Change-Id: I18e56de09a70e736b5d04719d45ef29cf0636705
2017-03-16 15:54:10 -06:00
Richard Mudgett c87e7dd9ec autochan/mixmonitor/chanspy: Fix unsafe channel locking and references.
Dereferencing struct ast_autochan.chan without first calling
ast_autochan_channel_lock() is unsafe because the pointer could change at
any time due to a masquerade.  Unfortunately, ast_autochan_channel_lock()
itself uses struct ast_autochan.chan unsafely and can result in a deadlock
if the original channel happens to get destroyed after a masquerade in
addition to the pointer getting changed.

The problem is more likely to happen with v11 and earlier because
masquerades are used to optimize out local channels on those versions.
However, it could still happen on newer versions if the channel is
executing a dialplan application when the channel is transferred or
redirected.  In this situation a masquerade still must be used.

* Added a lock to struct ast_autochan to safely be able to use
ast_autochan.chan while trying to get the channel lock in
ast_autochan_channel_lock().  The locking order is the channel lock then
the autochan lock.  Locking in the other direction requires deadlock
avoidance.

* Fix unsafe ast_autochan.chan usages in app_mixmonitor.c.

* Fix unsafe ast_autochan.chan usages in app_chanspy.c.

* app_chanspy.c: Removed unused autochan parameter from next_channel().

ASTERISK-26867

Change-Id: Id29dd22bc0f369b44e23ca423d2f3657187cc592
2017-03-15 17:18:55 -06:00
Sean Bright 982d6173c5 app_queue: Handle the caller being redirected out of a queue bridge
A caller can leave the Queue() application after being bridged with a
member in a few ways:

  * Caller or member hangup
  * Caller is transferred somewhere else (blind or atx)
  * Caller is externally redirected elsewhere

The first 2 scenarios are currently handled by subscribing to stasis
messages, but the 3rd is not explicitly covered. If a caller is
redirected away from the Queue() application, the member who was last
bridged with that caller will remain in an "In use" state until the
caller hangs up.

This patch adds handling of the caller leaving the queue via
redirection. We monitor the caller-member bridge, and if the caller is
the one that leaves, we treat it the same as we would a caller hangup.

ASTERISK-26400 #close
Reported by: Etienne Lessard

Change-Id: Iba160907770de5a6c9efeffc9df5a13e9ea75334
2017-03-15 09:33:11 -06:00
Daniel Journo 60998371e3 app_voicemail: Cannot set fromstring on a per-mailbox basis
* apps/app_voicemail.c fromstring field added to mailbox which will
override the global fromstring if set.

ASTERISK-24562 #close

Change-Id: I5e90e3a1ec2b2d5340b49a0db825e4bbb158b2fe
2017-03-08 13:25:49 -06:00
frahaase 5b1796f59d Binaural synthesis (confbridge): DTMF conference management.
DTMF configuration options for the binaural softmix bridge:
toggle binaural rendering (per channel).

ASTERISK-26292

Change-Id: Ibfe708b9fe26097c1798fcbfcc4dc461267d8af8
2017-02-24 15:13:56 -06:00
frahaase 094c26aa68 Binaural synthesis (confbridge): Adds binaural synthesis to bridge_softmix.
Adds binaural synthesis to bridge_softmix (via convolution using libfftw3).
Binaural synthesis is conducted at 48kHz.
For a conference, only one spatial representation is rendered.
The default rendering is applied for mono-capable channels.

ASTERISK-26292

Change-Id: Iecdb381b6adc17c961049658678f6219adae1ddf
2017-02-23 10:34:58 -07:00
Sean Bright ab04a018e4 realtime: Fix ast_load_realtime_multientry handling
ast_load_realtime_multientry() returns an ast_config structure whose
ast_categorys are keyed with the empty strings. Several modules were
giving semantic meaning to the category names causing problems at
runtime.

* app_directory: Treated the category name as the mailbox name, and
  would fail to direct calls to the appropriate extension after an
  entry was chosen.

* app_queue: Queues, queue members, and queue rules were all affected
  and needed to be updated.

* pbx_realtime: Pattern matching would never succeed because the
  extension entered by the user was always compared to the empty
  string.

Change-Id: Ie7e44986344b0b76ea8f6ddb5879f5040c6ca8a7
2017-02-21 13:06:29 -06:00
Sean Bright b18f1bfb13 app_voicemail: vm_authenticate accesses uninitialized memory
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-20 15:09:35 -06:00
zuul 0b5a17082b Merge "app_voicemail: Allow 'Comedian Mail' branding to be overriden" 2017-02-14 17:42:07 -06:00
zuul 9498ad8361 Merge "app_voicemail: VoiceMailPlayMsg did not play database stored messages" 2017-02-14 17:18:08 -06:00
Sean Bright 275f469a4d app_voicemail: Allow 'Comedian Mail' branding to be overriden
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-14 16:15:26 -05:00
zuul 4c79dff775 Merge "app_record: Add option to prevent silence from being truncated" 2017-02-14 15:04:40 -06:00
zuul 182c737353 Merge "cli: Fix various CLI documentation and completion issues" 2017-02-14 14:34:03 -06:00
rrittgarn 2b245b12d9 app_voicemail: VoiceMailPlayMsg did not play database stored messages
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-14 12:58:28 -06:00
Sean Bright 662c9e69fa app_record: Add option to prevent silence from being truncated
When using Record() with the silence detection feature, the stream is
written out to the given file. However, if only 'silence' is detected,
this file is then truncated to the first second of the recording.

This patch adds the 'u' option to Record() to override that behavior.

ASTERISK-18286 #close
Reported by: var
Patches:
	app_record-1.8.7.1.diff (license #6184) patch uploaded by var

Change-Id: Ia1cd163483235efe2db05e52f39054288553b957
2017-02-14 09:35:18 -05:00
Joshua Colp 72845bd4b5 Merge "core: Cleanup some channel snapshot staging anomalies." 2017-02-14 07:14:51 -06:00
zuul c68e52d213 Merge "app_queue: reset abandoned in sl for sl2 calculations" 2017-02-13 16:28:38 -06:00
Sebastian Gutierrez 9f394d074a app_queue: reset abandoned in sl for sl2 calculations
ASTERISK-26775 #close

Change-Id: I86de4b1a699d6edc77fea9b70d839440e4088284
2017-02-13 12:59:25 -06:00
Sean Bright 3f94373778 cli: Fix various CLI documentation and completion issues
* 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/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-02-13 11:33:15 -05:00
Sean Bright 0910773077 manager: Restore Originate failure behavior from Asterisk 11
In Asterisk 11, if the 'Originate' AMI command failed to connect the provided
Channel while in extension mode, a 'failed' extension would be looked up and
run. This was, I believe, unintentionally removed in 51b6c49. This patch
restores that behavior.

This also adds an enum for the various 'synchronous' modes in an attempt to
make them meaningful.

ASTERISK-26115 #close
Reported by: Nasir Iqbal

Change-Id: I8afbd06725e99610e02adb529137d4800c05345d
2017-02-10 18:04:41 -05:00
Richard Mudgett 16fdb11bc3 core: Cleanup some channel snapshot staging anomalies.
We shouldn't unlock the channel after starting a snapshot staging because
another thread may interfere and do its own snapshot staging.

* app_dial.c:dial_exec_full() made hold the channel lock while setting up
the outgoing channel staging.  Made hold the channel lock after the called
party answers while updating the caller channel staging.

* chan_sip.c:sip_new() completed the channel staging on off-nominal exit.
Also we need to use ast_hangup() instead of ast_channel_unref() at that
location.

* channel.c:__ast_channel_alloc_ap() added a comment about not needing to
complete the channel snapshot staging on off-nominal exit paths.

* rtp_engine.c:ast_rtp_instance_set_stats_vars() made hold the channel
locks while staging the channels for the stats channel variables.

Change-Id: Iefb6336893163f6447bad65568722ad5d5d8212a
2017-02-10 12:05:56 -06:00
zuul ada0032305 Merge "app_queue: Fix queues randomly disappearing on reload" 2017-01-30 11:39:26 -06:00
zuul 3eabae43c4 Merge "tests: use datadir for sound files" 2017-01-27 12:44:05 -06:00
kkm 8270d2436d app_queue: Fix queues randomly disappearing on reload
With 500+ queues and a reload every minute, a random queue disappears
upon reload. The cause is mususe of the 'dead' flag. Namely, all queues
were marked dead up front, and then "resurrected" by dropping this flag
for those found in the configuration. But a queue marked dead can be
removed also when control leaves the app entry point on a PBX thread.

With this change, the queue is marked only not found, and at the end of
reload only the queues that are still not found are actually marked as
dead, so the dead flag is never reset, and set only on positively dead
queues.

ASTERISK-26755

Change-Id: I3a4537aec9eb8d8aeeaa0193407e3523feb004bf
2017-01-26 20:21:15 -06:00
zuul 1479e049cb Merge "app_queue: add RINGCANCELED log event on caller hang up" 2017-01-25 19:14:12 -06:00
Tzafrir Cohen dbb9c8141d tests: use datadir for sound files
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
2017-01-22 01:52:21 +02:00
Martin Tomec 40b9766a31 app_queue: add RINGCANCELED log event on caller hang up
QueueLog did not log ringnoanswer when the caller abandoned call
before first timeout. It was impossible to get agent membername
and ringing duration for this short calls. After some discusions
it seems that the best way is to add new event RINGCANCELED,
which is generated after caller hangup during ringing.

ASTERISK-26665

Change-Id: Ic70f7b0f32fc95c9378e5bcf63865519014805d3
2017-01-20 13:37:32 +01:00
Joshua Colp fdf481636a Merge "app_queue: Add QueueUpdate application." 2017-01-17 17:26:10 -06:00
Sebastian Gutierrez 8cc1cd5df7 app_queue: Add QueueUpdate application.
Add an application that allows tracking outbound calls
using app_queue.

ASTERISK-19862

Change-Id: Ia0ab64aed934c25b2a25022adcc7c0624224346e
2017-01-17 12:29:34 +00:00
Sebastian Gutierrez 740ca862e4 app_queue: add new Service Level calculation
Adds a new formula for SL2 and documentation

ASTERISK-26559

Change-Id: I0970c620460507cd9d45b0d43600779c8915e770
2017-01-04 14:11:13 -06:00
Martin Tomec f461f65dea app_queue: Ensure member is removed from pending when hanging up.
In some cases member is added to pending_members, and the channel
is hung up before any extension state change. So the member would
stay in pending_members forever. So when we call do_hang, we
should also remove member from pending.

ASTERISK-26621 #close

Change-Id: Iae476b5c06481db18ebe0fa594b3e80fdc9a7d54
2016-12-19 03:45:51 -06:00
David Kerr ddc951060a app_originate: Add option to execute gosub prior to dial
Issue/patch ASTERISK-26587 was inspired by issue ASTERISK-22992
that requested ability to add callerid into app_originate.
Comments in that issue suggested that it was better solved by
adding an option to gosub prior to originating the call.  The
attached patch implements this much like app_dial with two
options one to gosub on the originating channel and one to gosub
on the newly created channel and behaves just like app_dial.
I have tested this patch by adding callerid info to the new
channel and also SIPAddHeader (to e.g. add header to force auto
answer) and confirmed it works.  Have also tested both 'exten'
and 'app' versions of app_originate.

Opened by: dkerr
Patch by: dkerr

Change-Id: I36abc39b58567ffcab4a636ea196ef48be234c57
2016-11-29 19:40:02 -05:00
Joshua Colp d3dba74017 Merge "Implement internal abstraction for iostreams" 2016-11-17 11:07:06 -06:00
Timo Teräs 070a51bf7c Implement internal abstraction for iostreams
fopencookie/funclose is a non-standard API and should not be used
in portable software. Additionally, the way FILE's fd is used in
non-blocking mode is undefined behaviour and cannot be relied on.

This introduces internal abstraction for io streams, that allows
implementing the desired virtualization of read/write operations
with necessary timeout handling.

ASTERISK-24515 #close
ASTERISK-24517 #close

Change-Id: Id916aef418b665ced6a7489aef74908b6e376e85
2016-11-15 22:25:14 +02:00
Matt Jordan cc86329228 apps/app_echo: Only relay a single video source change frame
In 9785e8d0, app_echo was updated to relay video source updates to the
channel for the purposes of displaying video in WebRTC tests.
Unfortunately, this can cause a Kafkaesque nightmare if two or more
Local channels are in a bridge together where their ends are in
app_echo. When this situation occurs, a video update sent into app_echo
will cause the video update to be relayed to the other Local channels,
causing another round of video updates, etc. In not much time at all,
the channel length queues will be overwhelmed, channel alert pipes will
fail, and all hell will break loose as Asterisk merrily continues to
throw more video update requests onto the channels.

This patch updates app_echo to *only* relay a single video update. Once
a video update has been made, all further video updates are dropped.
This meets the intended purpose of the original patch: if we get a video
update and we're in app_echo, go ahead and ask the sender to update
themselves. However, once we've got that video stream sync'd up, don't
keep spamming the world.

Change-Id: I9210780b08d4c17ddb38599d1c64453adfc34f74
2016-11-14 17:03:32 -05:00
Sebastian Gutierrez 4e8ab6cda9 app_queue: new variable set when abandoned
sets the variable ABANDONED to TRUE if the call was not answered.

ASTERISK-26558

Change-Id: I4729af9bff4eba436d8a776afd3374065d0036d3
2016-11-09 13:32:19 -05:00
Joshua Colp 4de5454ef1 app_dial: Fix incorrect device state when channel is picked up.
Given the scenario where multiple channels are dialed using Dial()
but the caller is picked up using PickupChan() all outgoing channels
except the channel specified to PickupChan() would be marked
as ringing until the call had been hung up.

When using the PickupChan application the channel executing the
application is swapped into place of another channel. As part
of this process the channel is answered. The Dial application
has explicit logic which checks if the channel is answered,
cancels all other outgoing channels, and bridges. This logic is
different than the normal logic that is executed when an outgoing
channel is answered. This different logic failed to publish dial
events stating that the other outgoing channels had been canceled.
As a result references to the outgoing channels were held onto by
the dial masquerade process until the call had been ended and
the channels had gone away. This would result in the channels
appearing in the "core show channels" list despite not being present
anymore and would also result in incorrect device state.

This change makes it so that this logic also publishes
dial events stating that the other outgoing channels have been
canceled.

ASTERISK-26549

Change-Id: Iea7168e6e82f7d4609ec0366153804e4f55ea64f
2016-11-02 09:16:41 -05:00
zuul 0ec5abe592 Merge "Remove ASTERISK_REGISTER_FILE." 2016-10-27 22:23:00 -05:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Joshua Colp 95062fe220 app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS.
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-10-26 07:54:25 -05:00
Joshua Colp e29e3a4f11 Merge "Binaural synthesis (confbridge): On/off setting for binaural synthesis." 2016-10-18 11:38:59 -05:00
frahaase dce31f90ba Binaural synthesis (confbridge): On/off setting for binaural synthesis.
Adds setting to confbridge.conf (binaural_active) that determines if binaural
synthesis can be available in bridge_softmix.

ASTERISK-26292

Change-Id: I59dfcb8e55fe1df4ef32045882fea5bb58fc71db
2016-10-17 18:58:14 +00:00
Leandro Dardini 973e57d5ce app_queue: Added initialization for "context" parameter
When using Asterisk Realtime Architecture, empty fields are skipped and the
default values are used. If the "context" parameter in queue was set and then
cleared from the database, the old value remains in memory and it continues
to be used. This change initialize the "context" parameter with an empty value,
allowing clearing the parameter.

ASTERISK-26462 #close

Change-Id: I64be73d5044ce38dd02408bd0e53de965ef65905
2016-10-17 08:15:26 -05:00
zuul 6f49ca5927 Merge "Audit ast_json_pack() calls for needed UTF-8 checks." 2016-10-14 17:17:14 -05:00
zuul 7947ee2894 Merge "app_queue.c: Fix clearing of pause reason string." 2016-10-14 10:08:23 -05:00
Richard Mudgett 9c49b96374 Audit ast_json_pack() calls for needed UTF-8 checks.
Added needed UTF-8 checks before constructing json objects in various
files for strings obtained outside the system.  In this case string values
from a channel driver's peer and not from the user setting channel
variables.

* aoc.c: Fixed type mismatch in s_to_json() for time and granularity json
object construction.

ASTERISK-26466
Reported by: Richard Mudgett

Change-Id: Iac2d867fa598daba5c5dbc619b5464625a7f2096
2016-10-13 18:13:00 -05:00
Richard Mudgett c3bf1632cd app_minivm.c: Fix malformed ast_json_pack() call.
Change-Id: I082b239022fac462666e52a14a44304748908dc0
2016-10-13 15:58:47 -05:00
Richard Mudgett 9c54964dc5 app_queue.c: Fix clearing of pause reason string.
The pause reason is not always cleared when it should be cleared.

* Made set_queue_member_pause() always clear pause reason if not pausing
with a reason string.

Change-Id: I993dad19626ec017478a230e980989438b778c53
2016-10-13 15:56:53 -05:00
George Joseph 86e8716952 app_dial: Add the "Q" option to set the cause on unanswered channels
The "Q" option will set the cause on the unanswered channels when
another channel answers.  It overrides the default of
ANSWERED_ELSEWHERE.

NOTE:  chan_sip does not support setting the cause on a CANCEL to
anything other than ANSWERED_ELSEWHERE.

ASTERISK-26446 #close

Change-Id: I71742e0919aaa16784c30a2b2e73fbeed7672e47
2016-10-11 12:05:56 -05:00
Etienne Lessard 806d08b675 app_queue: Update dynamic members ringinuse on reload.
Previously, when reloading the members of a queue, the members added statically
(i.e. defined in queues.conf) would see their "ringinuse" value updated but not
the members added dynamically.

This change makes dynamic members ringuse value to be updated on reload.

Note that it's impossible to add a dynamic member with a specific ringinuse
value. For both static and dynamic members, the ringinuse value can always be
changed later on with command like "queue set ringinuse" or with the AMI action
"QueueMemberRingInUse". So it's possible this commit could break a user workflow
if he was changing the ringinuse value of dynamic members via such commands and
was also relying on the fact that a queue reload would not update the dynamic
members ringinuse value.

ASTERISK-26330

Change-Id: I3745cc9a06ba7e02c399636f1ee9e58c04081f3f
2016-09-30 07:56:27 -04:00
Richard Mudgett 7d7b23f04f app_queue: Fix CLI "queue show" and AMI Queues action output truncation.
The output of CLI "queue show" and AMI Queues action is truncated and
"failed to extend from 240 to 327" messages are generated if the queue
member and interface names are lengthy.

* Increase the string buffer size from 240 to 512 in order to accommodate
for more information fields added to the output since v1.8.

ASTERISK-26360 #close
Reported by: Richard Mudgett

Change-Id: Id99c03cf5362453b80491a4b3b0434cb67aa966d
2016-09-12 12:27:11 -05:00
zuul be42630f5b Merge "ConfBridge: Make some announcements asynchronous." 2016-09-07 20:37:09 -05:00
zuul cc7e978149 Merge "apps/app_dial: Fix crash on non-connect call paths for Privacy/Screening option" 2016-09-07 17:23:45 -05:00
zuul c6a8710ceb Merge "apps/app_dial: Set the DIALSTATUS to NOANSWER on privacy option 5" 2016-09-07 14:04:24 -05:00
Mark Michelson ac02bbd9a0 ConfBridge: Make some announcements asynchronous.
Confbridge announcements tend to block a channel while they are being
played. In some circumstances, this is warranted since you want that
particular channel not to hear the announcement (Example: "John Doe has
entered the conference"). For others it makes less sense.

This change first introduces methods for playing sounds asynchronously
into the conference. This is very similar to how synchronous sounds are
played, except the channel initiating the playback does not wait for the
sound to complete before moving on.

Asynchronous announcements are used for two circumstances:
* Sounds played for a user after they have left the bridge
* Sounds that play first to a single user and then the rest of the
  conference (if the channel and conference use the same language)

ASTERISK-26289 #close
Reported by Mark Michelson

Change-Id: Ie486bb3de1646d50894489030326a423e594ab0a
2016-09-07 09:12:41 -05:00
Matt Jordan 730cb3b0b7 apps/app_dial: Fix crash on non-connect call paths for Privacy/Screening option
In any scenario in which the callee is not connected to the caller, the
current code in app_dial will crash due to raising a Dial End Stasis
Message after the callee channel has been hung up. This patch corrects
the error by simply moving the explicit hangup of the callee (peer)
channel until after the dial end message.

ASTERISK-25691 #close

Change-Id: I816a414014424d0d8c80e2a3cbef13ef8c63798d
2016-09-03 16:07:36 -05:00
Matt Jordan 6e1a3b924e apps/app_dial: Set the DIALSTATUS to NOANSWER on privacy option 5
If the callee selects option '5' using the Dial application's privacy
(P) option, the DIALSTATUS is erroneously set to ANSWER. This option
reflects the callee sending the caller to VoiceMail one time; the call
is definitely *not* ANSWERed in such a scenario. With this patch, the
DIALSTATUS is instead set to NOANSWER, which is the same DIALSTATUS that
is set when the 'send to VoiceMail every time' option is set.

ASTERISK-25691

Change-Id: Iaf0c9f0fa00545e7366443875e2bb7d9a89a1358
2016-09-03 16:06:56 -05:00
Michael Kuron 48fd4c815c app_mp3: Use correct buffer size and the same sample rate as the channel
Previously, the buffer used for MP3 streamed from HTTP servers had a size of
1 MB. For 8 kHz mono audio at 16 bit resolution, such a buffer covers about 1
minute. Only when the buffer is full does audio start to play.
For MP3 files streamed from a server, that is usually not a big deal as long as
the connection to the server is fast enough to supply that much data within a
second or two. For MP3 live streams however, it takes 1 minute to download 1
minute of audio, so without this change, app_mp3 wasn't really usable for MP3
live streams.
This commit changes the buffer size so that it covers 6 seconds of an MP3 file
streamed from a server and 0.5 seconds of an MP3 live stream. The latter is
identified by the use of a .m3u file extension.

app_mp3 so far only supported 8 kHz audio.
Now it always runs at the sample rate of the channel.

ASTERISK-26085 #close

Change-Id: Id1ee274733cd804a0edecf7450329b72f1235af0
2016-09-01 13:16:40 +02:00
zuul 8bdd5b63df Merge "app_queue: Ensure member is removed from pending when hanging up." 2016-08-29 14:56:27 -05:00
Joshua Colp c21e6764f1 app_queue: Ensure member is removed from pending when hanging up.
When dialing channels it is possible that they may not ever
leave the not in use state (Local channels in particular) by
the time we cancel them. If this occurs but we know they were
dialed we explicitly remove them from the pending members
container so that subsequent call attempts occur.

ASTERISK-26299 #close

Change-Id: I6ad0d17c36480c92cebf840626228ce3f7e4bd65
2016-08-27 05:21:58 -05:00
chrisderock 93b7533d74 app_macro: Consider '~~s~~' as a macro start extension.
As described in issue ASTERISK-26282 the AEL parser creates macros with
extension '~~s~~'.  app_macro searches only for extension 's' so the
created extension cannot be found.  with this patch app_macro searches for
both extensions and performs the right extension.

ASTERISK-26282 #close

Change-Id: I939aa2a694148cc1054dd75ec0c47c47f47c90fb
2016-08-25 16:43:05 -05:00
Mark Michelson ded22c712a ConfBridge: Rework announcer channel methodology
NOTE: This patch was submitted earlier and reverted because of a failing
test. The test has been patched so that it adjusts for the changes here,
so this is being resubmitted for review.

One feature that confbridge has is the ability to play sounds to all
participants in the conference. Prior to this commit, the algorithm for
this was as follows:

* Grab the playback lock
* Push the conference announcer channel into the bridge
* Play back the sound
* Pull the conference announcer channel from the bridge
* Release the playback lock

The issue here is that the act of adding the playback channel to the
bridge and removing it for each announcement is expensive. Amongst the
expenses:

* The announcer channel is imparted into the bridge, meaning a new
  thread is spun up for each playback.
* When the announcer is added or removed from the bridge, it results
  in the BRIDGEPEER channel variable being set on all channels in the
  bridge. This requires keeping the bridge locked and locking each
  individual channel in order to set it.
* There's also just the general overhead of adding the channel and
  removing it from the bridge. The bridge potentially has to reconfigure
  every single time

With this commit, the paradigm for playing back announcements has
shifted.

* The announcer channel is now added to the bridge when the conference
  is allocated, and it is hung up when the conference is destroyed.
* A taskprocessor is used to queue playbacks onto the announcer channel.
  This keeps the behavior from before where playbacks do not overlap.
* The announcer channel is no longer placed into the bridge as
  departable. Since we are not constantly removing the channel from
  the bridge, it is safe to add the channel using an independent thread
  and simply hang the channel up when it is time for the conference to
  be destroyed.

The use of the taskprocessor for playbacks opens up the interesting
possibility of having asynchronous announcements played. In this commit,
however, the behavior is still exactly the same as it previously was.

ASTERISK-26289
Reported by Mark Michelson

Change-Id: Ica9fa4907c2f3728cdd1cf0bc564ef4eb40754a0
2016-08-23 13:03:05 -05:00
Joshua Colp 11ef7f34bf Merge "Revert "ConfBridge: Rework announcer channel methodology"" 2016-08-23 05:54:10 -05:00
Joshua Colp 065d810d3f Revert "ConfBridge: Rework announcer channel methodology"
This reverts commit 5aa8773052.

Change-Id: I9ab45776e54a54ecf1bac9ae62d976dec30ef491
2016-08-23 05:54:02 -05:00
zuul c9df806f24 Merge "ConfBridge: Rework announcer channel methodology" 2016-08-22 22:33:15 -05:00
Mark Michelson 5aa8773052 ConfBridge: Rework announcer channel methodology
One feature that confbridge has is the ability to play sounds to all
participants in the conference. Prior to this commit, the algorithm for
this was as follows:

* Grab the playback lock
* Push the conference announcer channel into the bridge
* Play back the sound
* Pull the conference announcer channel from the bridge
* Release the playback lock

The issue here is that the act of adding the playback channel to the
bridge and removing it for each announcement is expensive. Amongst the
expenses:

* The announcer channel is imparted into the bridge, meaning a new
  thread is spun up for each playback.
* When the announcer is added or removed from the bridge, it results
  in the BRIDGEPEER channel variable being set on all channels in the
  bridge. This requires keeping the bridge locked and locking each
  individual channel in order to set it.
* There's also just the general overhead of adding the channel and
  removing it from the bridge. The bridge potentially has to reconfigure
  every single time

With this commit, the paradigm for playing back announcements has
shifted.

* The announcer channel is now added to the bridge when the conference
  is allocated, and it is hung up when the conference is destroyed.
* A taskprocessor is used to queue playbacks onto the announcer channel.
  This keeps the behavior from before where playbacks do not overlap.
* The announcer channel is no longer placed into the bridge as
  departable. Since we are not constantly removing the channel from
  the bridge, it is safe to add the channel using an independent thread
  and simply hang the channel up when it is time for the conference to
  be destroyed.

The use of the taskprocessor for playbacks opens up the interesting
possibility of having asynchronous announcements played. In this commit,
however, the behavior is still exactly the same as it previously was.

ASTERISK-26289
Reported by Mark Michelson

Change-Id: Ic5cd2c4b98a1eaa1715eb7a5b35d62f1a76d78a5
2016-08-18 09:51:24 -05:00
Tzafrir Cohen 046069011b followme: initialize all config items on reload
Some configuration directives were not initialized on reload, and hence
were not reset to default if they were removed from followme.conf.

ASTERISK-26288 #close

Change-Id: Ief829e16374ad1e0ecfd63e6ee4923b5a1d1c150
2016-08-17 18:51:31 +03:00
zuul 3117d150fa Merge "manager: Add <see-also> tags to relate UserEvent actions/apps/events" 2016-08-15 22:47:32 -05:00
Matt Jordan 9202ca34a8 app_dial: Improve documentation
* Add some helpful <literal> and other embedded paragraph tags

* Document some of the lesser known channel variables set by Dial

* Add examples for some common Dial uses, along with some more
  challenging but useful options

Change-Id: Ib2fb9301e8e044d14fbb2815ec64161f19bbfbc1
2016-08-15 07:42:44 -05:00
Matt Jordan 243f0cf99a manager: Add <see-also> tags to relate UserEvent actions/apps/events
Change-Id: I80f8a981f62f50e74609c69c49edcaca6c95efa4
2016-08-15 07:40:35 -05:00
Matt Jordan 225fd1003f app_queue: Prevent crash when a call is forwarded to an invalid location
When a call forward attempt is made from a Queue member, the current
code will hang up the forwarding channel in an off-nominal condition
prior to raising the Stasis events informing the rest of Asterisk that
the call was forwarded. This will result in a slew of dreaded FRACKs,
most likely leading to a crash.

This patch modifies the code such that we don't hang up the forwarding
channel even in an off-nominal condition until we've safely raised the
Stasis messages.

ASTERISK-25797 #close

Change-Id: Ife5abed351691fd79105321636eaa8ea8dcdba38
2016-08-11 13:56:19 -05:00
Alexei Gradinari 9042ad40f2 app_voicemail: Add taskprocessor alert level options.
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-08-05 16:47:07 -04:00
Corey Farrell cf1188a1be Unit tests: Use AST_TEST_DEFINE in conditional code only.
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-07-18 19:40:22 -04:00
Joshua Colp 943bb48b59 Merge "pbx: Create pbx_include.c for management of 'struct ast_include'." 2016-07-18 07:07:36 -05:00
Corey Farrell be36bd7ca5 pbx: Create pbx_include.c for management of 'struct ast_include'.
This changes context includes from a linked list to a vector, makes
'struct ast_include' opaque to pbx.c.

Although ast_walk_context_includes is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_includes_count (AST_VECTOR_SIZE)
* ast_context_includes_get (AST_VECTOR_GET)

As with ast_walk_context_includes callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the includes, they have been converted to use the new functions.

const have been applied where possible to parameters for ast_include
functions.

Change-Id: Ib5c882e27cf96fb2aec67a39c18b4c71c9c83b60
2016-07-15 05:34:29 -04:00
Joshua Colp 31967dacdf app_queue: Only remove queue member from pending when state changes.
It is possible for a not in use state change to occur multiple
times causing a queue member to be removed from the pending call
container prematurely.

The first not in use state change will remove the queue member
from the container. At this moment the member may be called and
placed in the pending container. After this another not in use
state change can be received which will remove it from the
container. Despite being called at this point the code will
incorrectly see that there are no pending calls to it.

This change only removes it from the pending container if the
state has actually changed.

ASTERISK-26133 #close
patches:
  app_queue.diff submitted by Richard Miller (license 5685)

Change-Id: Ie5a7f17a44f98e9159e9b85009ce3f8393aa78c0
2016-07-14 07:53:17 -05:00
Richard Mudgett 0a30008224 app_voicemail.c: Fix IMAP compile error.
Fix compile error introduced by the patch for
ASTERISK-26045

Change-Id: I5b02876266f2824f4cec2b54d6ff4db5de5778d3
2016-06-20 12:17:25 -05:00
Joshua Colp 5c949d009e Merge "Fixes to include signal.h" 2016-06-09 04:40:24 -05:00
Timo Teräs 39b69ab537 Fixes to include signal.h
POSIX defines signal.h. sys/signal.h should not be used as it is
c-library internal header which may or may not exist. Notably with
musl it generates warning of being incorrect.

Change-Id: Ia56b0aa1d84b5c590114867b1b384a624f39a6fc
2016-06-08 20:37:08 +03:00
Örn Arnarson 60caebc738 apps/app_voicemail.c and main/say.c: Add support for Icelandic language
Icelandic has some weird grammar rules when dealing with dates and
numbers. There are different genders used depending on which number
you're dealing with, and only a handful of numbers do change depending
on the gender. There is also an implied gender in several cases.

This patch was originally written for asterisk 1.6, and has been in use
for several years without crashes. I cleaned it up a bit and rewrote
what was necessary for Asterisk 13.

The functions were copied from other similar languages and modified
where appropriate. If i recall correctly, the German and Danish
functions were used as a base.

ASTERISK-26087
Reported by: Örn Arnarson
Tested by: Örn Arnarson

Change-Id: Ib7d8bd7b0fede5767921ed821315b5b508c0e665
2016-06-07 11:36:48 +00:00
Alexei Gradinari 3e8d523d88 core/dial: New channel variable FORWARDERNAME
Added a new channel variable FORWARDERNAME which indicates which
channel was responsible for a forwarding requests received on dial attempt.

Fixed a bug in the app_queue: FORWARD_CONTEXT is not used.

ASTERISK-26059 #close

Change-Id: I34e93e8c1b5e17776a77b319703c48c8ca48e7b2
2016-06-04 11:07:22 -05:00
Joshua Colp 608e0267e8 Merge "Expand the scope of Dial Events" 2016-05-31 16:36:35 -05:00
Joshua Colp ad31e5bb1c Merge "followme: allow disabling callee prompt" 2016-05-31 13:20:49 -05:00
Mark Michelson 205a31f86c Expand the scope of Dial Events
Dial events up to this point have come in two flavors
* A Dial event with no status to indicate that dialing has begun
* A Dial event with a status to indicate that dialing has ended

With this change, Dial events have been expanded to also give
intermediate events, such as "RINGING", "PROCEEDING", and "PROGRESS".
This is especially useful for ARI dialing, as it gives the application
writer the opportunity to place a channel into an early bridge when
early media is detected.

AMI handles these in-progress dial events by sending a new event called
"DialState" that simply indicates that dial state has changed but has
not ended. ARI never distinguished between DialBegin and DialEnd, so no
change was made to the event itself.

Another change here relates to dial forwards. A forward-related event
was previously only sent when a channel was successfully able to forward
a call to a new channel. With this set of changes, if forwarding is
blocked, we send a Dial event with a forwarding destination but no
forwarding channel, since we were prevented from creating one. This is
again useful for ARI since application writers can now handle call
forward attempts from within their own application.

ASTERISK-25925 #close
Reported by Mark Michelson

Change-Id: I42cbec7730d84640a434d143a0d172a740995543
2016-05-31 11:43:24 -05:00
Alexei Gradinari b3142e99e4 app_voicemail: fix bugs, imap mm_status log change to debug
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-26 16:13:33 -05:00
Tzafrir Cohen 1d60bfcdf1 followme: allow disabling callee prompt
Add the option 'enable_callee_prompt' to followme.conf. Enabled by
default. If disabled, a callee is not prompted to accept or reject
the forwarded call.

ASTERISK-26064 #close

Change-Id: I0a8b19d4cf95c86a07c992813babb9e4a4acfff5
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-26 08:00:09 +03:00
Tzafrir Cohen b5c471b339 followme: delete the right recorded name file
FollowMe with the option a records the name of the caller and plays it
to the callee. However it has failed to clean up that recorded file
as it tried to delete the file name without the '.sln' extension.

ASTERISK-26008 #close

Change-Id: I79d7b1be7d5cde57bf076d9389e2a8a4422776ec
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-10 16:26:11 +03:00
Joshua Colp b4e10e7c90 Merge "app_confbridge: Add a regcontext option for confbridge bridge profiles." 2016-05-10 04:48:35 -05:00
Jaco Kroon 8923c9ac96 app_confbridge: Add a regcontext option for confbridge bridge profiles.
This patch allows for having app_confbridge register the name of the
conference as an extension into a specific context, similar to
regcontext for chan_sip.  This variant is not quite as involved as the
one in chan_sip and doesn't allow for multiple contexts or custom
extensions, you can only specify the context and the conference name
will always be used as the extension to register.

ASTERISK-25989 #close

Change-Id: Icacf94d9f2b5dfd31ef36f6cb702392619a7902f
2016-05-09 08:18:56 -05:00
Joshua Colp 122895f864 Merge "app_chanspy: fix audiohook options in non read-only mode" 2016-05-04 04:49:29 -05:00
Jean Aunis 0c9faaee47 app_chanspy: fix audiohook options in non read-only mode
When option 'o' was not set, ChanSpy created its audiohook with the flag
AST_AUDIOHOOK_MUTE_WRITE, which caused ChanSpy to listen audio from one
direction only.

ASTERISK-25866 #close

Change-Id: I5c745855eea29a3fbc4e4aed0b0c0f53580535e0
2016-05-03 17:17:48 -05:00
Andrew Nagy 080c6216b6 app_voicemail: always copy dynamic struct to avoid race condition
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-05-03 05:25:28 -05:00
Jean Aunis 7281770710 app_chanspy: reduce audio loss on the spying channel.
ChanSpy was creating its audiohook with the flags AST_AUDIOHOOK_TRIGGER_SYNC
and AST_AUDIOHOOK_SMALL_QUEUE, which caused audio frames to be lost when
queues grow too large or when read and write queues go out of sync.
Now these flags are set conditionally:
- AST_AUDIOHOOK_TRIGGER_SYNC is not set if the option "o" is set
- a new option "l" is created: if set, AST_AUDIOHOOK_SMALL_QUEUE will not
be set on the audiohook

ASTERISK-25866

Change-Id: I9c7652f41d9fa72c8691e4e70ec4fd16b047a4dd
2016-04-27 15:39:59 +02:00
Joshua Colp 8ae69cffef app_queue: Fix crash when unloading module.
When unloading the app_queue module the members in each queue are
destroyed and as part of this they are removed from the pending
members container. Unfortunately a crash would occur as the container
was destroyed before the members were removed.

This change tweaks ordering so the container destruction occurs
after the members are destroyed.

ASTERISK-16115

Change-Id: I48c728668c55aee3d05b751a5d450fb57e87f44b
2016-04-26 05:52:54 -05:00
zuul 811e24f595 Merge "Bridge system: Fix memory leaks and double frees on impart failure." 2016-04-25 21:08:16 -05:00
Joshua Colp 456600a641 Merge "app_queue: queue members can receive multiple calls" 2016-04-25 19:34:09 -05:00
DarkS f99ec857c8 Fix case sensitive actions in AMI QueueSummary and QueueStatus
ASTERISK-25954 #close
Reported by: Javier Acosta

Change-Id: I00be83d45cc7e8385de2523012bd196aafeeb256
(cherry picked from commit c0688a6398)
2016-04-25 14:22:11 -05:00
Kevin Harwell 30ab21d5fa app_queue: queue members can receive multiple calls
It was possible for a queue member that is a member of at least 2 or more
queues to receive mulitiple calls at the same time. This happened because
of a race between when a member was being rung and when the device state
notified the other queue(s) member object of the state change.

This patch makes it so when a queue member is being rung it gets added to
a global pool of queue members. If that same member is tried again, e.g.
from another queue, and it is found to already exist in the pending member
container then it will not ring that member.

ASTERISK-16115 #close

Change-Id: I546dd474776d158c2b6be44205353dee5bac7e48
2016-04-25 12:39:56 -05:00
Richard Mudgett a63656b419 Bridge system: Fix memory leaks and double frees on impart failure.
You cannot reference the passed in features struct after calling
ast_bridge_impart().  Even if the call fails.

Change-Id: I902b88ba0d5d39520e670fb635078a367268ea21
2016-04-22 15:45:47 -05:00
Joshua Colp d95512a7dd app_talkdetect: Make the module core supported.
This module is used as part of testsuite tests to confirm
stuff works. I'm accordingly marking it as core as it is
required by those tests.

Change-Id: I558e7af7679b22b8ed641d7dd37ee4ca35b11e88
2016-04-19 13:02:56 -05:00
ibercom dbb47e0a47 app_queue: Frequent segfaults in function can_ring_entry()
ASTERISK-25888 #close

Change-Id: I007a2f2dd99823e04fb5be3ff01f02b0a2956117
2016-04-18 05:06:55 -05:00
Joshua Colp f7a434fa6d Merge "app_voicemail/IMAP: function 'save_to_folder' creates wrong folder" 2016-04-15 14:37:28 -05:00
Joshua Colp 5a0534dc62 app_voicemail: Fix test_voicemail_notify_endl test.
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-12 10:22:06 -05:00
Alexei Gradinari c00c298a0e app_voicemail/IMAP: function 'save_to_folder' creates wrong folder
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-11 22:31:21 -05:00
zuul c3339816f1 Merge "app_voicemail/IMAP: IMAP access FATAL error: Out of memory" 2016-04-11 14:21:21 -05:00
Alexei Gradinari f9dab80816 app_voicemail/IMAP: IMAP access FATAL error: Out of memory
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-04-08 13:04:02 -05:00
Richard Mudgett 6138a75e8e pbx.h: Make ast_state_cb_type take more const.
This eliminates some casts that I made a note saying v10 and above
would no longer need them.

Better late than never :)

Change-Id: I346cdb3032b6478ceb40eb6fe732978b54035572
2016-04-07 17:20:17 -05:00
Jacek Konieczny 9785e8d090 app_echo: forward and generate VIDUPDATE frames
When using app_echo via WebRTC with VP8 video the video would appear
only after a few minutes, because there would be nothing to request
a full reference frame.

This fixes the problem in both ways:
- echos any VIDUPDATE frames received on the channel
- sends one such frame when first video frame is to be forwarded

This makes the echo work with Firefox and Chrome WebRTC implementation.

ASTERISK-25867 #close

Change-Id: I73bda87bf7532ee8bfb28d917045a21034908c1e
2016-03-29 10:39:49 -05:00
Gianluca Merlo 894071ea2c config: fix flags in uint option handler
The configuration unsigned integer option handler sets flags for the
parser as if the option should be a signed integer (PARSE_INT32),
leading to errors on "out of range" values. Fix flags (PARSE_UINT32).

A fix to res_pjsip is also present which stops invalid flags from
being passed when registering sorcery object fields for qualify
status.

ASTERISK-25612 #close

Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e
2016-03-24 11:15:30 -05:00
Andrew Nagy 7964e260d3 app_stasis: Don't hang up if app is not registered
This prevents pbx_core from hanging up the channel if the app isn't
registered.

ASTERISK-25846 #close

Change-Id: I63216a61f30706d5362bc0906b50b6f0544aebce
2016-03-16 11:18:28 -05:00
Walter Doekes dcb25bb057 app_chanspy: Fix occasional deadlock with ChanSpy and Local channels.
Channel masquerading had a conflict with autochannel locking.

When locking autochannel->channel, the channel is fetched from the
autochannel and then locked. During the fetch, the autochannel -- which
has no locks itself -- can be modified by someone who owns the channel
lock. That means that the value of autochan->channel cannot be trusted
until you hold the lock.

In practice, this caused problems with Local channels getting
masqueraded away while the ChanSpy attempted to get info from that
channel. The old channel which was about to get removed got locked, but
the new (replaced) channel got unlocked (no-op). Because the replaced
channel was now locked (and would never get unlocked), it couldn't get
removed from the channel list in a timely manner, and would now cause
deadlocks when iterating over the channel list.

This change checks the autochannel after locking the channel for changes
to the autochannel. If the channel had been changed, the lock is
reobtained on the new channel.

In theory it seems possible that after this fix, the lock attempt on the
old (wrong) channel can be on an already destroyed lock, maybe causing
a crash. But that hasn't been observed in the wild and is harder induce
than the current deadlock.

Thanks go to Filip Frank for suggesting a fix similar to this and
especially to IRC user hexanol for pointing out why this deadlock was
possible and testing this fix. And to Richard for catching my rookie
while loop mistake ;)

ASTERISK-25321 #close

Change-Id: I293ae0014e531cd0e675c3f02d1d118a98683def
2016-03-11 16:05:30 -06:00
Rodrigo Ramírez Norambuena 15aeb78c66 app_queue: fix Calculate talktime when is first call answered
Fix calculate of average time for talktime is wrong when is completed the
first call beacuse the time for talked would be that call.

ASTERISK-25800 #close

Change-Id: I94f79028935913cd9174b090b52bb300b91b9492
2016-02-17 02:42:46 -03:00
Richard Mudgett 1bc54aee80 app_confbridge: Only use b_profile options from the conference.
A user cannot set new bridge options after the conference is created by
the first user.  Attempting to do so is documented as undefined behavior.

This patch ensures that the bridge profile options used are from the
conference and not what a subsequent user may have tried to set.

Change-Id: I1b6383eba654679e5739d5a8de98199cf074a266
2016-02-05 11:57:48 -06:00
Joshua Colp 0aea293450 Merge "app_confbridge.c: Replace inlined code with existing function." 2016-02-05 11:49:43 -06:00
Joshua Colp e541d9cf34 Merge topic 'ASTERISK-20987'
* changes:
  app_confbridge: Add ability to get the muted conference state.
  app_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation.
  app_confbridge: Make non-admin users join a muted conference muted.
2016-02-05 11:49:15 -06:00
Richard Mudgett af6b15976d app_confbridge.c: Replace inlined code with existing function.
Change-Id: Ida5594e9f8d7c1fc18eeb733a11f8fb96326da51
2016-01-27 16:46:20 -06:00
Richard Mudgett 7932336a3d app_confbridge: Add ability to get the muted conference state.
* Added CONFBRIDGE_INFO(muted,) for querying the muted conference state.

* Added Muted header to AMI ConfbridgeListRooms action response list
events to indicate the muted conference state.

* Added Muted column to CLI "confbridge list" output to indicate the muted
conference state and made the locked column a yes/no value instead of a
locked/unlocked value.

ASTERISK-20987
Reported by: hristo

Change-Id: I4076bd8ea1c23a3afd4f5833e9291b49a0c448b1
2016-01-27 16:46:20 -06:00
Richard Mudgett 894045e7cf app_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation.
Change-Id: Ic1f9e22ba1f2ff3b3f5cb017c5ddcd9bd48eccc7
2016-01-27 16:46:20 -06:00
Richard Mudgett 12c93e8f81 app_confbridge: Make non-admin users join a muted conference muted.
ASTERISK-20987 #close
Reported by: hristo

Change-Id: Ic61a2b524ab3a4cfadf227fc6b3506527bc03f38
2016-01-27 16:46:20 -06:00
Rodrigo Ramírez Norambuena f299dc0d76 app_queue: Add Lastpause field of queue member
Add time when started a the last pause for a queue member for
QueueMemberStatus ami event.

Also show accumulate time in seconds when started a pause for a queue
member to CLI command 'queue show'.

ASTERISK-16394 #close

Change-Id: I4b12aa3b2efa8d02939db3e13712510b4879865c
2016-01-25 03:51:41 -03:00
Joshua Colp ef293354dc Merge "app_queue: fix some tab format" 2016-02-03 06:19:48 -06:00
Joshua Colp fe059b3534 Merge "app_queue: Fix preserved reason of pause when Asterisk is restared" 2016-02-03 06:19:19 -06:00
Joshua Colp 527057ae24 Merge "app_queue.c: remove include for core_unreal.h not used in code." 2016-02-03 06:18:58 -06:00
George Joseph 40da6434c1 build_system: Fix some warnings highlighted by clang
Fix some warnings found with clang.

Change-Id: I5195b6189b148c2ee3ed4a19d015a6d4ef3e77bd
2016-02-01 19:22:40 -06:00
Rodrigo Ramírez Norambuena 8c664da0ff app_queue: fix some tab format
Change-Id: I2734392b131f1fb0949515d538f83f30fbc15d8c
2016-01-23 15:34:11 -03:00
Rodrigo Ramírez Norambuena d3969d09ae app_queue.c: remove include for core_unreal.h not used in code.
Change-Id: Idc2ae8a6bd869a66544916906744a5678622262d
2016-01-22 14:18:57 -03:00
Rodrigo Ramírez Norambuena 378fed4900 app_queue: Fix preserved reason of pause when Asterisk is restared
When the Asterisk is restared is not preseved reason paused of members.
This patch fixed this cases, retain data on astdb and set when Asterisk
is started.

ASTERISK-25732 #close

Report by: Rodrigo Ramírez Norambuena

Change-Id: Id3fb744c579e006d27cda4a02334ac0e4bed9eb5
2016-01-19 10:14:17 -03:00
Martin Tomec 90b06d1a3c app_queue: Add member flag "in_call" to prevent reading wrong lastcall time
Member lastcall time is updated later than member status. There was chance to
check wrapuptime for available member with wrong (old) lastcall time.
New boolean flag "in_call" is set to true right before connecting call, and
reset to false after update of lastcall time. Members with "in_call" set to true
are treat as unavailable.

ASTERISK-19820 #close

Change-Id: I1923230cf9859ee51563a8ed420a0628b4d2e500
2016-01-05 17:44:11 +01:00
Joshua Colp 0c62e0a55c Merge "voicemail: Move app_voicemail / res_mwi_external conflict to runtime" 2016-01-05 05:55:56 -06:00
George Joseph 6d18fe151c voicemail: Move app_voicemail / res_mwi_external conflict to runtime
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
2016-01-04 17:31:24 -06:00
Richard Mudgett f88b952093 app_dial: Immediately exit dial if the caller is already hung up.
If a caller hangs up before dial is executed within an AGI then the AGI
has likely eaten all queued frames before executing the dial in DeadAGI
mode.  With the caller hung up and no pending frames from the caller's
read queue, dial would not know that the call has hung up until a called
channel answers.  It is rather annoying to whoever just answered the
non-existent call.

Dial should not continue execution in DeadAGI mode, hangup handlers, or
the h exten.

* Added a check early in dial to abort dialing if the caller has hungup.

ASTERISK-25307 #close
Reported by: David Cunningham

Change-Id: Icd1bc0764726ef8c809f76743ca008d0f102f418
2016-01-04 13:34:13 -06:00
Dade Brandon ca394161cf app_amd: Correct maximum_number_of_words functionality & documentation
- The maximum_number_of_words was previously documented as being
the number of words that when exceeded, would result in the AMD
application returning that the audio represents a machine.

This was inconsistent with its actual functionality - it was
a number of words that when REACHED, would result in determination
as a machine.

This update corrects the functionality to match the previously
documented functionality.  This is a backwards incompatible change
in configuration file, and has been added to UPGRADE.txt as a result.

The sample configuration file and application defaults have been updated
so that the default value is now 2, which reflects the same default
functionality as previous versions.

- Update documentation for silence_threshold, which previously implied
that it was measuring time, rather than noise averages in the sample.

- Update the comments in amd.conf.sample.

ASTERISK-25639 #close
Change-Id: I4b1451e5dc9cb3cb06d59b6ab872f5275ba79093
2015-12-21 16:02:09 -08:00
Carlos Oliva 3e7522533c app_queue: update RT members when the 1st call joins a queue with no agents
If a call enters on a queue and the members on that queue are updated in
realtime (ex: using mysql inserting a new agent) the queue members are
never refreshed and the call will stay in the queue until other event occurs.
This happens only if this is the first call of the queue and there is no
agents servicing.
This patch prevent this issue, ensuring realtime members are updated if
there is one call in the queue and no available agents

ASTERISK-25442 #close

Change-Id: If1e036d013a5c1d8b0bf60d71d48fe98694a8682
2015-12-14 17:21:27 +01:00
Corey Farrell fcaebb0e43 app_meetme: Set default value for audio_buffers.
The default value was never set for audio_buffers, causing bad
audio quality.  This ensures the default is always set.

ASTERISK-25569 #close

Change-Id: I2d2ee3e644120b0f9f6ea6ab9286d7d590942a44
2015-12-09 15:57:48 -06:00
Rodrigo Ramírez Norambuena f2a84b500d app_queue: Show reason of pause on CLI
Add value of pause reason when is paused on CLI command "queue show"

ASTERISK-25581 #close

Report by: Rodrigo Ramírez Norambuena

Change-Id: I887028a40cd97b350da9a3bb2719616b7fec9864
2015-11-28 15:33:41 -03:00
Joshua Colp b52b494004 Merge "StatsD: Add sample rate compatibility" 2015-11-19 10:27:07 -06:00
Matt Jordan 65102d19bc Merge "app_bridgeaddchan: ability to barge into existing call" 2015-11-18 21:30:49 -06:00
Alec Davis 8c14b91651 app_bridgeaddchan: ability to barge into existing call
To be able to barge into a call by dialling a prefix+extension that maps
to the extensions device.

Senario is that DECT headset users may be away from their desks and need
to transfer the call, the goal is that from any phone they dial a prefix
then their extension and are added to the bridge that they are in, from
there they can drop the headset call, as it's also on the handset,
and transfer the caller.

The dialplan would look like, where prefix=73, extension = 8512;
exten => _738512,1,BridgeAdd(SIP/cisco0001)

ASTERISK-25551 #close
Reported By: Alec Davis

Change-Id: I8eb5096a02168dcc8d7aeea416ef36ba4ed10540
2015-11-19 11:37:59 +13:00
tcambron 05addf3d8f StatsD: Add sample rate compatibility
Implemented support for the StatsD sample rate parameter,
which is a parameter for determining when to send computed
statistics to a client.

Valid sample rate values are:
Less than or equal to 0.0 will never be sent.
Between 0.0 and 1.0 will randomly be sent.
Greater than or equal to 1.0 will always be sent.

ASTERISK-25419
Reported By: Ashley Sanders

Change-Id: I11d315d0a5034fffeae1178e650aa8264485ed52
2015-11-18 15:01:37 -06:00
Alec Davis 4013f9d577 app_queue: (try_calling): mutex 'qe->chan' freed more times than we've locked!
commit aae45acbd (Mark Michelson 2015-04-15 10:38:02 -0500 6525)
refer ASTERISK-24958

above commit removed ast_channel_lock(qe->chan);
but failed to remove corresponding ast_channel_unlock(qe->chan);

ASTERISK-25561 #close
Reported Alec Davis

Change-Id: Ie05f4e2d08912606178bf1fded57cc022c7a2e1a
2015-11-18 19:21:54 +13:00
Mark Michelson ed13732188 Confbridge: Add a user timeout option
This option adds the ability to specify a timeout, in seconds, for a
participant in a ConfBridge. When the user's timeout has been reached,
the user is ejected from the conference with the CONFBRIDGE_RESULT
channel variable set to "TIMEOUT".

The rationale for this change is that there have been times where we
have seen channels get "stuck" in ConfBridge because a network issue
results in a SIP BYE not being received by Asterisk. While these
channels can be hung up manually via CLI/AMI/ARI, adding some sort of
automatic cleanup of the channels is a nice feature to have.

ASTERISK-25549 #close
Reported by Mark Michelson

Change-Id: I2996b6c5e16a3dda27595f8352abad0bda9c2d98
2015-11-16 14:13:13 -06:00
Joshua Colp 0be147f713 Merge "ast_format_cap_get_names: To display all formats, the buffer was increased." 2015-11-10 14:58:18 -06:00
Alexander Traud cf79b62778 ast_format_cap_get_names: To display all formats, the buffer was increased.
ASTERISK-25533 #close

Change-Id: Ie1a9d1a6511b3f1a56b93d04475fbf8a4e40010a
2015-11-09 16:58:52 +01:00
Walter Doekes 39daf9f066 docs: Fix a few typo's in app docs (more then, resourse).
Change-Id: Iba57efadf6c0b822e762c7a001bc89611d98afd7
2015-11-06 16:46:31 -05:00
Joshua Colp 29810aa620 Merge "StatsD: Send stuff to the StatsD server and test" 2015-11-02 15:11:10 -06:00
tcambron c5093b21ad StatsD: Send stuff to the StatsD server and test
Added code to allow the StatsD dialplan application to
send data to the server specified in statsd.conf.

ASTERISK-25419

Change-Id: I400db2f37c6ddf61515ff5a019646e36dcd0f922
2015-11-02 09:24:49 -06:00
Matt Jordan 2ddd9ff2d9 Merge "app_queue: Added reason pause of member" 2015-11-02 07:59:18 -06:00
tcambron fdfd0fb488 StatsD: Add user input validation to the application
Added code to accept user input and validate it before
allowing it to be sent to the StatsD server.

ASTERISK-25419
Reported By: Ashley Sanders

Change-Id: I55c7ce44326a68ad6c5c1514b9575ac50f25bbc3
2015-10-28 11:44:29 -05:00
Rodrigo Ramírez Norambuena 92fa8d1e0e app_queue: Added reason pause of member
In app_queue added value Paused Reason on QueueMemberStatus when a member
on queue is paused and the reason was set.

ASTERISK-25480 #close
Reporte by: Rodrigo Ramírez Norambuena

Change-Id: Ia5db503482f50764c15e2020196c785f59d4a68e
2015-10-19 06:35:43 -03:00
Matt Jordan da54d3ddd1 Merge "StatsD: Write skeleton Asterisk application" 2015-10-13 11:59:24 -05:00
tcambron 2fe9f09705 StatsD: Write skeleton Asterisk application
Wrote the skeleton framework for the Asterisk StatsD dialplan
application. This includes a load function, unload function, a
callback for execution, and XML documentation.

ASTERISK-25419
Reported By: Ashley Sanders

Change-Id: I9597730e134c6e82c8a55ef4d5334b62dd473363
2015-10-08 14:14:14 -05:00
Matt Jordan 9db74be3c0 Merge "app_queue.c: Force COLP update if outgoing channel name changed." 2015-09-29 07:27:50 -05:00
Matt Jordan 8bb8f99252 Merge "app_queue.c: Factor out a connected line update routine." 2015-09-29 07:27:13 -05:00
Matt Jordan e0d8b6a65d Merge "app_dial.c: Make 'A' option pass COLP updates." 2015-09-29 07:27:02 -05:00
Matt Jordan 360d076dfc Merge "app_dial.c: Force COLP update if outgoing channel name changed." 2015-09-29 07:26:20 -05:00
Joshua Colp afabf9da7f Merge "app_dial.c: Factor out a connected line update routine." 2015-09-28 14:07:05 -05:00
Richard Mudgett 7c7a7ddd27 app_queue.c: Force COLP update if outgoing channel name changed.
* When a call is answered and the outgoing channel name has changed then
force a connected line update because the channel is no longer the same.
The channel was masqueraded into by another channel.  This is usually
because of a call pickup.

Note: Forwarded calls are handled in a controlled manner so the original
channel name is replaced with the forwarded channel.

ASTERISK-25423 #close
Reported by: John Hardin

Change-Id: Ie275ea9e99c092ad369db23e0feb08c44498c172
2015-09-25 12:40:31 -05:00
Richard Mudgett 145608bd81 app_queue.c: Factor out a connected line update routine.
Replace inlined code with update_connected_line_from_peer().

ASTERISK-25423
Reported by: John Hardin

Change-Id: I33bbd033596fcb0208d41d8970369b4e87b806f3
2015-09-25 12:40:31 -05:00
Richard Mudgett 1d394774b2 app_dial.c: Make 'A' option pass COLP updates.
While the 'A' option is playing the announcement file allow the caller and
peer to exchange COLP update frames.

ASTERISK-25423
Reported by: John Hardin

Change-Id: Iac6cf89b56d26452c6bb88e9363622bbf23895f9
2015-09-25 12:40:31 -05:00
Richard Mudgett 680b76eb25 app_dial.c: Force COLP update if outgoing channel name changed.
* When a call is answered and the outgoing channel name has changed then
force a connected line update because the channel is no longer the same.
The channel was masqueraded into by another channel.  This is usually
because of a call pickup.

Note: Forwarded calls are handled in a controlled manner so the original
channel name is replaced with the forwarded channel.

ASTERISK-25423
Reported by: John Hardin

Change-Id: I2e01f7a698fbbc8c26344a59c2be40c6cd98b00c
2015-09-25 12:40:31 -05:00
Richard Mudgett fdf0bcb04a app_dial.c: Factor out a connected line update routine.
Replace inlined code with update_connected_line_from_peer().

ASTERISK-25423
Reported by: John Hardin

Change-Id: Ia14f18def417645cd7fb453e1bdac682630a5091
2015-09-25 12:40:31 -05:00
Richard Mudgett c285879845 app_dial.c: Remove some no-op code.
Change-Id: Ice1884a94315d3cb7e3bbd47a9fba76a27276c54
2015-09-25 11:31:03 -05:00
Richard Mudgett 06f4f80a63 app_page.c: Fix crash when forwarding with a predial handler.
Page uses the async method of dialing with the dial API.  When a call gets
forwarded there is no calling channel available.  If the predial handler
was set then the calling channel could not be put into auto-service
for the forwarded call because it doesn't exist.  A crash is the result.

* Moved the callee predial parameter string processing to before the
string is passed to the dial API rather than having the dial API do it.
There are a few benefits do doing this.  The first is the predial
parameter string processing doesn't need to be done for each channel
called by the dial API.  The second is in async mode and the forwarded
channel is to have the predial handler executed on it then the
non-existent calling channel does not need to be present to process the
predial parameter string.

* Don't start auto-service on a non-existent calling channel to execute
the predial handler when the dial API is in async mode and forwarding a
call.

ASTERISK-25384 #close
Reported by: Chet Stevens

Change-Id: If53892b286d29f6cf955e2545b03dcffa2610981
2015-09-22 17:32:03 -05:00
Kevin Harwell c74101509d app_record: RECORDED_FILE variable not being populated
The RECORDED_FILE variable is empty unless a '%d' is specified in the filename.
This patch makes it so the variable is always set to the filename.

ASTERISK-25410 #close

Change-Id: I4ec826d8eb582ae2ad184e717be8668b74d37653
2015-09-21 18:10:21 -05:00
Matt Jordan 9a4498a112 Merge "app_queue: AgentComplete event has wrong reason" 2015-09-19 16:26:33 -05:00
Kevin Harwell 729a4325da app_queue: AgentComplete event has wrong reason
When a queued caller transfers an agent to another extension sometimes the
raised AgentComplete event has a reason of "caller" and sometimes "transfer".
Since a transfer has taken place this should always be transfer. This occurs
because sometimes the stasis hangup event arrives before the transfer event
thus writing a different reason out.

With this patch, when a hangup event is received during a transfer it will
check to see if the channel that is hanging up is part of a transfer. If so
it will return and let the subsequently received transfer event handler take
care of the cleanup.

ASTERISK-25399 #close

Change-Id: Ic63c49bd9a5ed463ea7a032fd2ea3d63bc81a50d
2015-09-17 16:58:15 -05:00
Kevin Harwell 63ede41227 app_queue: Crash when transferring
During some transfer scenarios involving queues Asterisk would sometimes
crash when trying to obtain a channel snapshot (could happen on caller or
member channels). This occurred because the underlying channel had already
disappeared when trying to obtain the latest snapshot.

This patch adds a reference to both the member and caller channels that
extends to the lifetime of the queue'd call, thus making sure the channels
will always exist when retrieving the latest snapshots.

ASTERISK-25185 #close
Reported by: Etienne Lessard

Change-Id: Ic397fa68fb4ff35fbc378e745da9246a7b552128
2015-09-17 12:11:38 -05:00
Mark Michelson 26fca72837 Merge "app_queue.c: Extract some functions for simpler code." 2015-08-19 17:03:35 -05:00
Richard Mudgett 9fb4a96e15 app_queue.c: Fix setting QUEUE_MEMBER 'paused' and 'ringinuse'.
Setting the 'paused' and 'ringinuse' options on a queue member using the
dialplan function QUEUE_MEMBER did not behave the same way as the
equivalent dialplan applications or AMI actions.

* Made queue_function_mem_write() call the set_member_paused() and
set_member_value() for the 'paused' and 'ringinuse' options respectively.
A beneficial side effect is that the queue name is now optional and sets
the value in all queues the interface is a member.

* Update QUEUE_MEMBER XML documentation.

* Fix error checking in QUEUE_MEMBER() write.

ASTERISK-25215 #close
Reported by: Lorne Gaetz

Change-Id: I3a016be8dc94d63a9cc155295ff9c9afa5f707cb
2015-08-18 15:27:51 -05:00
Richard Mudgett 87b22969a4 app_queue.c: Extract some functions for simpler code.
* Extract set_queue_member_pause() from set_member_paused() for simpler
and more consistent code.

* Extract set_queue_member_ringinuse() from
set_member_ringinuse_help_members() for simpler code.

Change-Id: Iecc1f4119c63347341d7ea6b65f5fc4963706306
2015-08-17 19:15:42 -05:00
Richard Mudgett 5cf98e2459 app_queue.c: Fix error checking in QUEUE_MEMBER() read.
Change-Id: I7294e13d27875851c2f4ef6818adba507509d224
2015-08-17 19:15:21 -05:00
Matt Jordan eff6a88a88 apps/app_dictate: Fix typo in attribution
Last time I checked, it's "Sangoma", not "Samgoma". Thanks to Brian
(GameGamer43) for pointing that out.

Change-Id: I43d7b196f6d7a2b2517b84915e3a8dfbc2894106
2015-07-15 10:34:25 -05:00
Joshua Colp 3b2b004d69 app_dial: Hold reference to calling channel formats when dialing outbound.
Currently when requesting a channel the native formats of the
calling channel are provided to the core for usage when dialing
the outbound channel. This occurs without holding the channel lock
or keeping a reference to the formats. This is problematic as
the channel driver may end up changing the formats during this time.
In the case of chan_sip this happens when an SDP negotiation
completes.

This change makes it so app_dial keeps a reference to the native
formats of the calling channel which guarantees that they will
remain valid for the period of time needed.

ASTERISK-25172 #close

Change-Id: I2f0a67bd0d5d14c3bdbaae552b4b1613a283f0db
2015-06-24 13:51:02 -05:00
Richard Mudgett a657ab12f9 app_directory: Fix crash when using the alias option 'a'.
The voicemail.conf mailbox key/value pair is defined as:
<mailbox>=[<password>[,<full-name>[,<email>[,<pager>[,<options>]]]]]
Where all fields in the value including the field values are optional.

Since the parsing code for the mailbox key/value pair is sloppy, this
patch tightens the parsing for the directory information.

* Renamed the 'pos' and 'bufptr' variables to 'name' and 'options'
respectively in search_directory_sub().  Those names make more sense.

* Made sure that search_directory_sub() is dealing with the voicemail.conf
mailbox options field if it even exists when looking for the 'hidefromdir'
and 'alias' options.

* Fix crash if a voicemail.conf mailbox is just
<mailbox>=<password>,<name> when the 'a' option is used.  If there were no
fields after the name then the 'options' pointer was not checked for NULL.

* Fix users.conf alias processing if the 'a' option is used.  The wrong
variable was used.

ASTERISK-25087 #close
Reported by: Chet Stevens

Change-Id: I86052ea77307beddddba5279824d39dc0d593374
2015-06-11 14:59:25 -05:00
Corey Farrell 80621ce3c5 Fix unsafe uses of ast_context pointers.
Although ast_context_find, ast_context_find_or_create and
ast_context_destroy perform locking of the contexts table,
any context pointer can become invalid at any time that the
contexts table is unlocked. This change adds locking around
all complete operations involving these functions.

Places where ast_context_find was followed by ast_context_destroy
have been replaced with calls ast_context_destroy_by_name.

ASTERISK-25094 #close
Reported by: Corey Farrell

Change-Id: I1866b6787730c9c4f3f836b6133ffe9c820734fa
2015-06-08 11:09:57 -04:00
George Joseph 31f0d78d7b app_playback: Suppress warnings on playback if channel hung up
If a channel hangs up while an audio file is playing, there's
no need to clutter up the logs with a warning so suppress it
if ast_check_hangup returns true.

Also, change warning to debug/2 in file.c if writing a frame
fails.  Same reasoning.

Change-Id: I2e66191af3c5b6e951c98e8f1c3fe3cf2cf7ed89
Reported-by: George Joseph <george.joseph@fairview5.com>
Tested-by: George Joseph <george.joseph@fairview5.com>
2015-05-20 19:10:49 -05:00
Joshua Colp 35ff01823b Merge "AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro." 2015-05-14 05:03:43 -05:00
Rodrigo Ramírez Norambuena eec010829a AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro.
Change-Id: Icf88f9f861c6b2a16e5f626ff25795218a6f2723
2015-05-13 16:34:23 -05:00
Jonathan Rose 0d97d7cb94 app_voicemail: fix moving when old messages full
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-05-13 15:28:36 -05:00
Ivan Poddubny 90bfc02e84 app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter
This patch fixes EXITWITHTIMEOUT queue_log entry to always come with 3
parameters: position, original position and waiting time.

ASTERISK-25038 #close
Reported by: Etienne Lessard

Change-Id: I0c62045922e26bee2125e93aee1dee17eee79618
2015-05-05 15:38:34 -05:00
Corey Farrell 5c1d07baf0 Astobj2: Allow reference debugging to be enabled/disabled by config.
* The REF_DEBUG compiler flag no longer has any effect on code that uses
  Astobj2.  It is used to determine if reference debugging is enabled by
  default.  Reference debugging can be enabled or disabled in asterisk.conf.
* Caller information is provided in logger errors for ao2 bad magic numbers.
* Optimizes AO2 by merging internal functions with the public counterpart.
  This was possible now that we no longer require a dual ABI.

ASTERISK-24974 #close
Reported by: Corey Farrell

Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
2015-04-27 18:37:26 -04:00
Kevin Harwell 9f65ea482e app_confbridge: Default the template option to a compatible default profile.
Confbridge dynamic profiles did not have a default profile unless you
explicitly used Set(CONFBRIDGE(bridge,template)=default_bridge). If a
template was not set prior to the bridge being created then some
options were left with no default values set. This patch makes it so
the default templates are set to the default bridge and user profiles.

ASTERISK-24749 #close
Reported by: philippebolduc

Change-Id: I1bd6e94b38701ac2112d842db68de63d46f60e0a
2015-04-24 12:20:45 -05:00
Mark Michelson aae45acbda Detect potential forwarding loops based on count.
A potential problem that can arise is the following:

* Bob's phone is programmed to automatically forward to Carol.
* Carol's phone is programmed to automatically forward to Bob.
* Alice calls Bob.

If left unchecked, this results in an endless loops of call forwards
that would eventually result in some sort of fiery crash.

Asterisk's method of solving this issue was to track which interfaces
had been dialed. If a destination were dialed a second time, then
the attempt to call that destination would fail since a loop was
detected.

The problem with this method is that call forwarding has evolved. Some
SIP phones allow for a user to manually forward an incoming call to an
ad-hoc destination. This can mean that:

* There are legitimate use cases where a device may be dialed multiple
times, or
* There can be human error when forwarding calls.

This change removes the old method of detecting forwarding loops in
favor of keeping a count of the number of destinations a channel has
dialed on a particular branch of a call. If the number exceeds the
set number of max forwards, then the call fails. This approach has
the following advantages over the old:

* It is much simpler.
* It can detect loops involving local channels.
* It is user configurable.

The only disadvantage it has is that in the case where there is a
legitimate forwarding loop present, it takes longer to detect it.
However, the forwarding loop is still properly detected and the
call is cleaned up as it should be.

Address review feedback on gerrit.

* Correct "mfgium" to "Digium"
* Decrement max forwards by one in the case where allocation of the
  max forwards datastore is required.
* Remove irrelevant code change from pjsip_global_headers.c

ASTERISK-24958 #close

Change-Id: Ia7e4b7cd3bccfbd34d9a859838356931bba56c23
2015-04-17 15:58:07 -05:00
Corey Farrell 62508d6891 Build System: Create Makefile macro MOD_ADD_SOURCE.
This new macro allows a single line to add all additional
sources to a module.  This helps prevent modules from
missing steps, and makes future changes easier since
they can be made in a single place.

ASTERISK-24960 #close
Reported by: Corey Farrell

Change-Id: I38f12d8b72c5e7bb37a879b2fb51761a2855eb4b
2015-04-14 12:53:03 -04:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Matthew Jordan 2201e27340 apps/app_queue: Prevent possible crash when evaluating queue penalty rules
Although it only occurred once, a crash occurred when a queue attempted to
evaluate a queue penalty rule that appeared to have already been destroyed.
In many locations in app_queue, a test is done to see if qe->pr is NULL;
however, when we dispose of a queue's penalty rules, we don't set the pointer
to NULL after free'ing it. This patch does that to prevent any dangling
pointers from lingering on the queue object.

Review: https://reviewboard.asterisk.org/r/4522

ASTERISK-23319 #close
Reported by: Vadim
patches:
  rb4552.patch submitted by Stefan Engström (License 6691)
........

Merged revisions 434448 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434449 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-09 02:05:26 +00:00
Matthew Jordan b8fa8aa775 clang compiler warnings: Fix pointer-bool-converesion warnings
This patch fixes several warnings pointed out by the clang compiler.
* chan_pjsip: Removed check for data->text, as it will always be non-NULL.
* app_minivm: Fixed evaluation of etemplate->locale, which will always
  evaluate to 'true'. This patch changes the evaluation to use
  ast_strlen_zero.
* app_queue:
  - Fixed evaluation of qe->parent->monfmt, which always evaluates to
    true. Instead, we just check to see if the dereferenced pointer
    evaluates to true.
  - Fixed evaluation of mem->state_interface, wrapping it with a call to
    ast_strlen_zero.
* res_smdi: Wrapped search_msg->mesg_desk_term with calls to ast_strlen_zero.

Review: https://reviewboard.asterisk.org/r/4541

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4541.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434285 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434286 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 11:45:05 +00:00
Ashley Sanders a217d2d1db stasis: set a channel variable on websocket disconnect error
Resolve compile errors caused by r433863 by fixing the
documentation xml to comply with the schema.
........

Merged revisions 433888 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-01 16:30:25 +00:00
Mark Michelson da13d15425 stasis: set a channel variable on websocket disconnect error
Resolve compile errors caused by r433839 by included the missing
header file, pbx.h.
........

Merged revisions 433863 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-01 13:35:10 +00:00
Ashley Sanders 06578ef407 stasis: set a channel variable on websocket disconnect error
When an error occurs while writing to a web socket, the web socket is
disconnected and the event is logged. A side-effect of this, however, is that
any application on the other side waiting for a response from Stasis is left
hanging indefinitely (as there is no mechanism presently available for
notifying interested parties about web socket error states in Stasis).

To remedy this scenario, this patch introduces a new channel variable:
STASISSTATUS.

The possible values for STASISSTATUS are:
SUCCESS         - The channel has exited Stasis without any failures
FAILED          - Something caused Stasis to croak. Some (not all) possible
                  reasons for this:
                    - The app registry is not instantiated;
                    - The app requested is not registered;
                    - The app requested is not active;
                    - Stasis couldn't send a start message

ASTERISK-24802
Reported By: Kevin Harwell
Review: https://reviewboard.asterisk.org/r/4519/
........

Merged revisions 433839 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-31 22:49:45 +00:00
Matthew Jordan 7bc2345fb1 clang compiler warnings: Fix -Wabsolute-value warnings
This patch fixes several warnings caught by clang - in this case, usage of the
abs function on non-integer values. This patch uses labs and fabs, as
appropriate, in the various affected files.

Review: https://reviewboard.asterisk.org/r/4525

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4525.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433749 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433750 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 02:45:29 +00:00
Matthew Jordan d2776d4d45 clang compiler warnings: Fix a variety of "unused" warnings
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-28 12:56:43 +00:00
Matthew Jordan e9520dbe0d clang compiler warnings: Fix -Wparantheses-equality warnings
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-28 12:41:24 +00:00
Kevin Harwell ab674f67b5 app_confbridge: file playback blocks dtmf
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-26 17:13:26 +00:00
Matthew Jordan 60f01520e7 Fix compilations errors on 64-bit OpenBSD systems
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-23 00:05:48 +00:00
Richard Mudgett c41dd32b94 Audit ast_sockaddr_resolve() usage for memory leaks.
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-17 21:52:47 +00:00
Matthew Jordan ac1214d9d4 apps/app_sms: Add an option to prevent SMS content from being logged
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-14 01:53:13 +00:00
Matthew Jordan dc752f515b apps/app_amd: Document maximum_word_length option; fix AMDCAUSE documentation
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-14 00:24:52 +00:00
Corey Farrell c08fd275bf Logger: Convert 'struct ast_callid' to unsigned int.
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-13 01:12:35 +00:00
Matthew Jordan ab6e2c93f3 app_voicemail: Fix crash with IMAP backends when greetings aren't present
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-10 18:13:27 +00:00
George Joseph 5c3e33b3ca app_voicemail: Fix compile breaking in app_voicemail with IMAP_STORAGE.
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-03-05 16:40:27 +00:00
Kevin Harwell d04fbb0f9d app_chanspy, channel: fix frame leaks
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-26 17:12:12 +00:00
Matthew Jordan 8a16c2f0c2 make: Remove 'res_features' from libraries to link against with cygwin/mingw32
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-26 04:58:38 +00:00
Matthew Jordan b3c1ad5d73 apps/app_voicemail: Demote an ERROR message to a WARNING message
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-21 17:36:39 +00:00
Matthew Jordan 4dab71831f apps/app_voicemail: Fix IMAP header compatibility issue with Microsoft Exchange
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-20 15:47:46 +00:00
Matthew Jordan d1bd8b091b apps/app_mixmonitor: Move Test Event for MIXMONITOR_END to after it finishes
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-15 00:33:22 +00:00
Richard Mudgett e2d3215b83 HTTP: Stop accepting requests on final system shutdown.
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-02-11 17:39:13 +00:00
Richard Mudgett 23bb5f6a73 app_agent_pool: Fix initial module load agent device state reporting.
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-30 17:49:45 +00:00
Richard Mudgett 94eebd5ba5 app_confbridge: Repeatedly starting and stopping recording ref leaks the 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-27 17:48:18 +00:00
Matthew Jordan aa8fd7d1b9 app_confbridge: Restore user's menu name to CLI output of 'confbridge list'
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-27 17:16:54 +00:00
Richard Mudgett b69b0d12ee app_confbridge: Shorten CBRec channel names to CBRec/<conf_name>-<seq-num>
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-23 20:17:20 +00:00
Richard Mudgett c780223507 app_confbridge: Make CBRec channel names more unique.
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-23 20:14:26 +00:00
Richard Mudgett b38be992b1 app_confbridge: Whitespace
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-23 19:51:42 +00:00
Walter Doekes 49cbfa7de6 Fix typo's (retrieve, specified, address).
........

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-23 15:13:08 +00:00
Matthew Jordan 7fcc9ce8bc apps/app_voicemail: Trigger MWI notification with MixMonitor m() option
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-22 14:23:41 +00:00