Commit Graph

5223 Commits

Author SHA1 Message Date
Alexei Gradinari 745cbab501 app_blind_transfer: new application BlindTransfer
BlindTransfer redirects all channels currently bridged to the
caller channel to the specified destination.

This application can be useful with Custom Dynamic Features.
For example to make blind transfer to a predefined number.

features.conf
;;;
[applicationmap]
my_blindxfer => *6,self,GoSub,"my_blindxfer,s,1",default
;;;

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=my_blindxfer

[my_blindxfer]
exten => s,1,BlindTransfer(1234567890,default)
   same => n,Return()
;;;

This application also can be used to completly redefine Blind transfer
feature using dialplan. For example:

features.conf
;;;
[featuremap]
blindxfer =>

[applicationmap]
custom_blindxfer => ##,self,GoSub,"custom_blindxfer,s,1",default
;;;

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=custom_blindxfer

[custom_blindxfer]
exten => s,1,
   same => n,Playback(pbx-transfer)
   same => n,Read(dest,dial,10,i,3,3)
   same => n,BlindTransfer(${dest},default)
   same => n,Return()
;;;

Change-Id: I9d55e7f69ccfd4472dec00d62771d6de8803215a
2019-06-07 08:26:37 -06:00
Alexei Gradinari 408210bd4c app_readexten: new option 'p' to stop reading on '#' key
This patch adds the 'p' option.
The extension entered will be considered complete when a # is entered.

Change-Id: If77c40c9c8b525885730821e768f5dea71cf04c1
2019-05-23 08:37:08 -06:00
George Joseph c5c953c1f1 Fixes for GCC 9
Various fixes for issues caught by gcc 9.  Mostly snprintf
trying to copy to a buffer potentially too small.

ASTERISK-28412

Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e
2019-05-10 10:22:55 -06:00
Joshua Colp 80dba268ea app_confbridge: Add "all" variants of REMB behavior.
When producing a combined REMB value the normal behavior
is to have a REMB value which is unique for each sender
based on all of their receivers. This can result in one
sender having low bitrate while all the rest are high.

This change adds "all" variants which produces a bridge
level REMB value instead. All REMB reports are combined
together into a single REMB value that is the same for
each sender.

ASTERISK-28401

Change-Id: I883e6cc26003b497c8180b346111c79a131ba88c
2019-05-02 07:29:08 -06:00
Friendly Automation 45a9ff8286 Merge "app_queue: Set correct value by default for shared_lastcall" 2019-04-30 16:45:48 -05:00
Friendly Automation c2326155aa Merge "mwi core: Move core MWI functionality into its own files" 2019-04-30 10:41:10 -05:00
agupta 7ce6d960d4 app_amd: Fix infinite loop on silent calls
The total time logic will now be executed on calls which
do not pass any media.

ASTERISK-28143

Change-Id: I24726bd29d7e467fc721ca265363417234b22855
2019-04-30 04:15:46 -06:00
Rodrigo Ramírez Norambuena ed615afb7e app_queue: Set correct value by default for shared_lastcall
There a long history here:

In commit dd1e62c095 has introduce by default shared_lastcall = true by
default but this now only happen is there not [general] directive in
queues.conf

After that, the commit 4b50e3f1ee fix the
sample file.

We'll need to keep the same setting if there a general or not section in
configuration file since the shared_lastcall is by a long time in
sample files as default value to 'no'.

Change-Id: Id44faec370136df8d57902b453ad4059ed21b94c
2019-04-29 12:13:07 -04:00
Antoni Goldstein 8e21c25ce5 app_dial.c: RINGTIME, PROGRESSTIME and ms resolution dial timings
Added RINGTIME, RINGTIME_MS, PROGRESSTIME, PROGRESSTIME_MS variables filled
at the earliest received PROGRESS or RINGING.
Added millisecond versions of DIALEDTIME and ANSWEREDTIME.

Added millisecond versions of ast_channel_get_up_time and
ast_channel_get_duration in channel.c.

ASTERISK-28363

Change-Id: If95f1a7d8c4acbac740037de0c6e3109ff6620b1
2019-04-24 06:27:41 -06:00
Kevin Harwell ff0d0ac23a mwi core: Move core MWI functionality into its own files
There is enough MWI functionality to warrant it having its own 'c' and header
files. This patch moves all current core MWI data structures, and functions
into the following files:

main/mwi.h
main/mwi.c

Note, code was simply moved, and not modified. However, this patch is also in
preparation for core MWI changes, and additions to come.

Change-Id: I9dde8bfae1e7ec254fa63166e090f77e4d3097e0
2019-04-23 17:40:15 -05:00
Sean Bright d58d7d4500 app_voicemail: Don't split mailbox options on comma
Because the per-mailbox options are the last thing on a line, don't look
for or stomp on any subsequent commas.

ASTERISK-27935 #close
Reported by: Sébastien Duthil

Change-Id: I07b2eb4a33c303d0c7114d5b906f8c067c60a153
2019-04-13 12:39:39 -06:00
Sean Bright 63f86cac09 app_voicemail: Cleanup stale lock files on module load
If Asterisk crashes while a VM directory is locked, lock files in the VM
spool directory will not get properly cleaned up. We now clear them on
module load.

ASTERISK-20207 #close
Reported by: Steven Wheeler

Change-Id: If40ccd508e2f6e5ade94dde2f0bcef99056d0aaf
2019-04-12 07:14:04 -06:00
Sean Bright e8cf3693f6 app_queue: Fix a few member pause bugs
* Always set member->lastpause when setting member->paused

* Fixed typo (using member->lastcall instead of member->lastpause) in
  'queue show' output.

* Use a constant 'now' in 'queue show' output for a better point-in-time
  view of time based stats.

ASTERISK-27541 #close
Reported by: César Benjamín García Martínez

Change-Id: Ib41ced90cfdb66f9bb1e7b263d0f6fc1ac6e18fa
2019-03-29 07:16:57 -06:00
Sean Bright 834d022da5 app_queue: Fix documentation for QUEUE_MEMBER function.
It was a copy/paste of the QUEUE_MEMBER_COUNT function's synopsis.

ASTERISK-20986 #close
Reported by: Olivier Krief

Change-Id: If51ec481feb35824a4e78ab5600b197b819b10be
2019-03-26 15:57:11 -06:00
Joshua C. Colp a145f83d30 Merge "stasis: Improve topic/subscription names and statistics." 2019-03-14 09:22:14 -05:00
Dömsödi Gergely 48e407e506 app_queue: fix ring_entry to access nativeformats with a channel lock
Fixes an intermittent segmentation fault which occured when accessing
nativeformats of a channel which entered into a queue.

ASTERISK-27964
Reported by: Francisco Seratti

Change-Id: Ic87fa7a363f3b487c24ce07032f4b2201c22db9e
2019-03-13 04:49:21 -06:00
Joshua Colp 0231dd6ae7 stasis: Improve topic/subscription names and statistics.
Topic names now follow: <subsystem>:<functionality>[/<object>]

This ensures that they are all unique, and also provides better
insight in to what each topic is for.

Subscriber ids now also use the main topic name they are
subscribed to and an incrementing integer as their identifier to
make it easier to understand what the subscription is primarily
responsible for.

Both the CLI commands for listing topic and subscription statistics
now sort to make it a bit easier to see what is going on.

Subscriptions will now show all topics that they are receiving messages
from, not just the main topic they were subscribed to.

ASTERISK-28335

Change-Id: I484e971a38c3640f2bd156282e532eed84bf220d
2019-03-11 11:39:35 -03:00
Sean Bright 57850c7861 app_meetme: Don't mute joining admins if conference is muted
ASTERISK-28328 #close

Change-Id: I4f6069fb34923b7521520c2a205a1e56227e592b
2019-03-08 10:44:00 -06:00
Sean Bright f6b5b7208c app_queue: Handle empty 'interface' in queue member config
While the 'interface' column is a NOT NULL, the empty string is still
allowed. res_config_odbc treats the empty string as a NULL and we crash
when trying to dereference.

Also cleaned up an adjacent error message for consistency.

ASTERISK-28168 #close

Change-Id: I55e012b540fbcda99bb40bede3099b7ae5db8202
2019-03-04 16:07:46 -06:00
Rodrigo Ramírez Norambuena ce0523a57e app_queue: Enable set the wrapuptime from AddQueueMember application
This change add ability to set the wrapuptime per-member using the
AddQueueMember application.

The feature to set wrapuptime per member was include in the issue
ASTERISK-27483 for static member by configuration file and was not
added to set from AddQueueMember.

ASTERISK-28055 #close

Change-Id: I7c7ee4a6f804922cd7c42cb02eea26eb3806c6cf
2019-02-19 08:37:10 -06:00
Joshua Colp 54a912b26d res_odbc: Add basic query logging.
When Asterisk is connected and used with a database the response
time of the database can cause problems in Asterisk if it is long.
Normally the only way to see this problem would be to retrieve a
backtrace from Asterisk and examine where things are blocked, or
examine the database to see if there is any indication of a
problem.

This change adds some basic query logging to make it easier to
investigate such a problem. When logging is enabled res_odbc will
now keep track of the number of queries executed, as well as the
query that has taken the longest time to execute. There is also
an option which will cause a WARNING message to be output if a
query takes longer than a configurable amount of time to execute.

This makes it easier and clearer for users that their database may
be experiencing a problem that could impact Asterisk.

ASTERISK-28277

Change-Id: I173cf4928b10754478a6a8c27dfa96ede0f058a6
2019-02-07 08:23:14 -06:00
George Joseph c6980e32ae app_voicemail: Add Mailbox Aliases
You can now define an "aliases" context in voicemail.conf
whose entries point to actual mailboxes.  These can be used anywhere
the mailbox is specified.

Example:
[general]
aliasescontext = myaliases

[default]
1234 = yadayada

[myaliases]
4321@devices = 1234@default

Now you can use 4321@devices to refer to the 1234@default mailbox.

This can be useful to provide channel drivers with constant
mailbox specifications such as <extension>@devices leaving
app_voicemail to control exactly which mailbox the alias points to.
Now, only voicemail has to be reloaded to make changes instead of
individual channel drivers which are usually more expensive to
reload.

Change-Id: I395b9205c91523a334fe971be0d1de4522067b04
2019-01-22 13:32:04 -06:00
Joshua C. Colp b4523ef334 Merge "app_voicemail: Fix Channel variable VM_MESSAGEFILE for "urgent" voicemail" 2019-01-14 06:19:45 -06:00
Bryan Boatright 2c48b5d9bf app_voicemail: Fix Channel variable VM_MESSAGEFILE for "urgent" voicemail
If a voicemail is marked "urgent" then the VM_MESSAGEFILE channel variable is
not updated correctly since urgent messages are in a different directory. The
fix is to update the channel variable when the path to the urgent message is
created.

ASTERISK-28225

Change-Id: I8efbace06e6122ea0793f7bdb073d4378e8274ca
2019-01-02 13:16:58 -05:00
Joshua Colp b7b080a0aa app_queue: Fix crash when using 'b' option on non-ringall queue.
When using the 'b' option to Queue with a queue that was not configured
for ring all a crash would occur as the wrong pointer would be used.

ASTERISK-28218

Change-Id: If1390f64e321047dff24fd2410c95dde74904980
2019-01-02 12:35:27 -05:00
George Joseph c23c8d92d5 app_voicemail: Don't delete mailbox state unless mailbox is deleted
The free_user function was automatically deleting the stasis mailbox
state but this only makes sense when the mailbox is actually
deleted, not just the structure freed.  This was causing issues
where leave_voicemail would publish the mwi message to stasis and
delete the state before the message could be processed by
res_pjsip_mwi.

* Removed the delete of state from free_user().

* Created a new free_user_final() function that both frees the data
  structure and deletes the state.  This function is only called
  during module load/unload where it's appropriate to delete the
  state.

ASTERISK-28215

Change-Id: I305e8b3c930e9ac41d901e5dc8a58fd7904d98dd
2018-12-18 11:40:22 -05:00
Alexei Gradinari cb1a08bdcb confbridge: announce to the marked users when they join an empty conference
Currently the file sound_only_person is not played when a marked
user (with announce_only_user=yes) joins an empty conference.

This patch fixes it.

ASTERISK-28201 #close

Change-Id: I85b67687e6b220939c3af8091d83a70a7b174cf4
2018-12-12 12:15:49 -05:00
lvl 140702ba2d app_queue: Revert broken queue channel reference patch
Revert commit 6409e7b11a, and add
NULL checks for all app_queue event handling code.

Related issues: ASTERISK~25185, ASTERISK~27006, ASTERISK~25844

ASTERISK-28125

Change-Id: I37334ea184ebb56e54471496b82937d4927815a0
2018-12-03 11:12:20 +01:00
George Joseph efeab21b52 Merge "Revert "app_voicemail: Remove need to subscribe to stasis"" 2018-11-30 07:30:35 -06:00
George Joseph 4f0bf0270e Revert "app_voicemail: Remove need to subscribe to stasis"
This reverts commit 29115e2384.

That commit closed a long standing hole which allowed subscriptions
to mailboxes that weren't configured in voicemail.conf.  This
caused an issue with FreePBX which depdended on that behavior.
The commit is being reverted until FreePBX can handle the new
behavior.

ASTERISK-28151
Reported by: Ronald Raikes

Change-Id: I57b7b85e75d7dd97c742b5c69d718a0f61260c15
2018-11-29 12:29:34 -07:00
George Joseph 3667c5e1d2 bridges: Remove reliance on stasis caching
* The bridging core no longer uses the stasis cache for bridge
  snapshots.  The latest bridge snapshot is now stored on the
  ast_bridge structure itself.

* The following APIs are no longer available since the stasis cache
  is no longer used:
    ast_bridge_topic_cached()
    ast_bridge_topic_all_cached()

* A topic pool is now used for individual bridge topics.

* The ast_bridge_cache() function was removed since there's no
  longer a separate container of snapshots.

* A new function "ast_bridges()" was created to retrieve the
  container of all bridges.  Users formerly calling
  ast_bridge_cache() can use the new function to iterate over
  bridges and retrieve the latest snapshot directly from the
  bridge.

* The ast_bridge_snapshot_get_latest() function was renamed to
  ast_bridge_get_snapshot_by_uniqueid().

* A new function "ast_bridge_get_snapshot()" was created to retrieve
  the bridge snapshot directly from the bridge structure.

* The ast_bridge_topic_all() function now returns a normal topic
  not a cached one so you can't use stasis cache functions on it
  either.

* The ast_bridge_snapshot_type() stasis message now has the
  ast_bridge_snapshot_update structure as it's data.  It contains
  the last snapshot and the new one.

* cdr, cel, manager and ari have been updated to use the new
  arrangement.

Change-Id: I7049b80efa88676ce5c4666f818fa18ad1985369
2018-11-26 14:30:02 -07:00
Joshua Colp 50ac85cb40 stasis: Segment channel snapshot to reduce creation cost.
When a channel snapshot was created it used to be done
from scratch, copying all data (many strings). This incurs
a cost when doing so.

This change segments the channel snapshot into different
components which can be reused if unchanged from the
previous snapshot creation, reducing the cost. In normal
cases this results in some pointers being copied with
reference count being bumped, some integers being set,
and a string or two copied. The other benefit is that it
is now possible to determine if a channel snapshot update
is redundant and thus stop it before a message is published
to stasis.

The specific segments in the channel snapshot were split up
based on whether they are changed together, how often they
are changed, and their general grouping. In practice only
1 (or 0) of the segments actually get changed in normal
operation.

Invalidation is done by setting a flag on the channel when
the segment source is changed, forcing creation of a new
segment when the channel snapshot is created.

ASTERISK-28119

Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423
2018-11-26 12:56:24 -06:00
Joshua Colp d0ccbb3377 stasis: Use an implementation specific channel snapshot cache.
Channels no longer use the Stasis cache for channel snapshots. Instead
they are stored in a hash table in stasis_channels which reduces the
number of Stasis messages created and allows better storage.

As a result the following APIs are no longer available since the stasis
cache is no longer used:
ast_channel_topic_cached()
ast_channel_topic_all_cached()

The ast_channel_cache_all() and ast_channel_cache_by_name() functions
now return an ao2_container of ast_channel_snapshots rather than
a container of stasis_messages therefore you can't (and don't need
to) call stasis_cache functions on it.

The ast_channel_topic_all() function now returns a normal topic not
a cached one so you can't use stasis cache functions on it either.

The ast_channel_snapshot_type() stasis message now has the
ast_channel_snapshot_update structure as it's data. It contains the
last snapshot and the new one.

ast_channel_snapshot_get_latest() still returns the latest snapshot.

The latest snapshot is now stored on the channel itself to eliminate
cache hits when Stasis messages that have the snapshot as a payload
are created.

ASTERISK-28102

Change-Id: I9334febff60a82d7c39703e49059fa3a68825786
2018-11-26 18:43:53 +00:00
Corey Farrell 021ce938ca
astobj2: Remove legacy ao2_container_alloc routine.
Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
ao2_container_alloc_list.  Remove ao2_container_alloc macro.

Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
2018-11-21 09:56:16 -05:00
Joshua Colp 9b0808e2d0 Merge "app_queue: Cleanup queue_ref / queue_unref routines." 2018-11-20 05:05:32 -06:00
Corey Farrell 64e21c9ea9 app_queue: Cleanup queue_ref / queue_unref routines.
This replaces the inline functions with macros.  This removes the need
to directly use __ao2_ref, opts instead for standard ao2_bump and
ao2_cleanup macros.

Change-Id: If4e04e9bab2e3c883188437cb9f487b3e498a21b
2018-11-19 08:04:01 -05:00
Joshua Colp 3077ad0c24 stasis: Add internal filtering of messages.
This change adds the ability for subscriptions to indicate
which message types they are interested in accepting. By
doing so the filtering is done before being dispatched
to the subscriber, reducing the amount of work that has
to be done.

This is optional and if a subscriber does not add
message types they wish to accept and set the subscription
to selective filtering the previous behavior is preserved
and they receive all messages.

There is also the ability to explicitly force the reception
of all messages for cases such as AMI or ARI where a large
number of messages are expected that are then generically
converted into a different format.

ASTERISK-28103

Change-Id: I99bee23895baa0a117985d51683f7963b77aa190
2018-11-18 15:08:16 -05:00
Joshua Colp e80f2012e6 Merge "app_dial/queue/followme: 'I' options to block initial updates in both directions" 2018-10-25 07:46:38 -05:00
Alexei Gradinari 4a567cee3a app_dial/queue/followme: 'I' options to block initial updates in both directions
The 'I' option currently blocks initial CONNECTEDLINE or REDIRECTING updates
from the called parties to the caller.

This patch also blocks updates in the other direction before call is
answered.

ASTERISK-27980

Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
2018-10-24 14:15:27 -05:00
George Joseph 8d1c6bb6e6 bridge_softmix: Add SDP "label" attribute to streams
Adding the "label" attribute used for participant info correlation
was previously done in app_confbridge but it wasn't working
correctly because it didn't have knowledge about which video
streams belonged to which channel.  Only bridge_softmix has that
data so now it's set when the bridge topology is changed.

ASTERISK-28107

Change-Id: Ieddeca5799d710cad083af3fcc3e677fa2a2a499
2018-10-24 08:41:23 -05:00
George Joseph eb1b48d514 Merge "app_dial/app_queue: Update application option documentation" 2018-10-24 07:47:19 -05:00
Richard Mudgett 9838a5e57a app_dial/app_queue: Update application option documentation
* Update the post-answer documentation and example.  The Dial example was
incorrect and misleading for the post-answer subroutine useage.

* Fix note and warning paragraphs in option descriptions.  They don't show
up in the wiki.

Change-Id: I81019a1fd75d5b9151f76b52c38e2a90da682d14
2018-10-18 17:23:01 -05:00
Corey Farrell 5ab94d2a3e
taskprocessor: Warn on unused result from pushing task.
Add attribute_warn_unused_result to ast_taskprocessor_push,
ast_taskprocessor_push_local and ast_threadpool_push.  This will help
ensure we perform the necessary cleanup upon failure.

Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d
2018-10-17 09:14:05 -04:00
Joshua Colp 0944059d35 Merge "app_queue.c: Fix json ref leak" 2018-10-02 07:58:26 -05:00
Corey Farrell 52b530503f
app_page: Add dependency against app_confbridge.
Change-Id: I1946509f518961d23fb21229d91676ee3e441921
2018-10-01 13:11:41 -04:00
Richard Mudgett b68b3012ea app_queue.c: Fix json ref leak
Declining the queue_member_status_type stasis message in stasis.conf
causes these messages to leak json objects.

* Add missing ast_json_unref() if the type is NULL in
queue_publish_member_blob().

ASTERISK-28084

Change-Id: I691ecf49bd1f7d9c29182e1eee8c4bb7103be9fc
2018-10-01 11:46:40 -05:00
Joshua Colp 71ef8eaa6d Merge "app_confbridge: Use bridge join hook to send join and leave events" 2018-10-01 06:24:21 -05:00
George Joseph f10c7b6eeb app_confbridge: Use bridge join hook to send join and leave events
The first attempt at publishing confbridge events to participants
involved publishing them at the same time stasis events were
created.  This caused issues with bridge and channel locks.  The
second attempt involved publishing them when the stasis events
were received by the code that published the confbridge AMI events.
This caused timing issues because, depending on resources available,
the event could be received before channels actually joined the
bridge and would therefore fail to send messages to the participant.

This attempt reverts to the original mechanism with one exception.
The join and leave events are published via bridge join and leave
hooks.  This guarantees the states of the channels and bridge and
provides deterministic timing for event publishing.

Change-Id: I2660074f8a30a5224cb953d5e047ee84484a9036
2018-09-28 07:33:16 -05:00
Cao Minh Hiep f23a12244d app_queue: Fix Attended transfer hangup with removing pending member.
This issue related to setting of holdtime, announcements, member delays.
It works well if we set the member delays to "0" and no announcements
and no holdtime.This issue will happen if we set member delays to "1",
"2"... or announcements or holdtime and hangs up the call during
processing it.

And here is the reason:
(At the step of answering a phone.)
It takes care any holdtime, announcements, member delays,
or other options after a call has been answered if it exists.

Normally, After the call has been aswered,
and we wait for the processing one of the cases of the member delays
or hold time or announcements finished, "if (ast_check_hangup(peer))"
will be not executed, then queue will be updated at update_queue().
Here, pending member will be removed.

However, after the call has been aswered,
if we hangs up the call during one of the cases of the member delays
or hold time or announcements, "if (ast_check_hangup(peer))"
will be executed.
outgoing = NULL and at hangupcalls, pending members will not be removed.

* This fixed patch will remove the pending member from container
before hanging up the call with outgoing is NULL.

ASTERISK-27920

Reported by: Cao Minh Hiep
Tested by: Cao Minh Hiep

Change-Id: Ib780fbf48ace9d2d8eaa1270b9d530a4fc14c855
2018-09-26 20:04:45 -05:00
George Joseph 6e1cf9de6b Merge "app_voicemail: Fix stack overrun in append_mailbox" 2018-09-24 13:50:36 -05:00
George Joseph 06c0676da0 app_voicemail: Cleanup mailbox topic and cache
app_voicemail wasn't properly cleaning up the stasis cache or the
mwi topic pool when the module was unloaded or when a user was
deleted as a result of a reload.  This resulted in leaks in both
areas.

* app_voicemail now calls ast_delete_mwi_state_full when it frees
  a user structure and ast_delete_mwi_state_full in turn now calls
  the new stasis_topic_pool_delete_topic function to clear the topic
  from the pool.

Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8
2018-09-24 10:10:48 -05:00
George Joseph 22cf065ec9 app_voicemail: Fix stack overrun in append_mailbox
The append_mailbox function wasn't calculating the correct length
to pass to ast_alloca and it wasn't handling the case where context
might be empty.

Found by the Address Sanitizer.

Change-Id: I7eb51c7bd18a7a8dbdba261462a95cc69e84f161
2018-09-21 16:07:39 -05:00
George Joseph cdece3b637 app_voicemail: Remove need to subscribe to stasis
app_voicemail was using the stasis cache to build and maintain a
list of mailboxes that had subscribers.  It then used this list
to determine if a mailbox should be polled for new messages if
polling was enabled.  For this to work, stasis had to cache every
subscription and unsubscription to the mailbox which caused a lot of
overhead, both cpu and memory related.

Since polling is only required when changes are being made to
mailboxes outside of app_voicemail and since the number of mailboxes
that don't have any subscribers is likely to be very low, all
mailboxes are now polled instead of just the ones with subscribers.

This paves the way for disabling the caching of stasis subscription
change messages.

Also fixed cleanup in some of the unit tests that not only left
test users in the users list but also caused segfaults if the tests
were run more than once.

ASTERISK-27121

Change-Id: I5cceb737246949f9782955c64425b8bd25a9e9ee
2018-09-18 08:47:07 -05:00
lvl 1174759f0c app_queue: Update realtime queuemembers after wait_a_bit(), not before
This ensures the most up-to-date information is used for the next
call attempt.

ASTERISK-28032

Change-Id: I02fc17c6ffb50bb60ea97c2d2e6023e8061815ce
2018-09-06 16:13:59 -05:00
Rodrigo Ramírez Norambuena 1a3115d1c5 app_dial: set the comment for OPT_ARG_ANNOUNCE to really what is done
Change-Id: I08f88adb09f7e5813f37e70fecd787468cdb32c8
2018-09-03 11:27:07 -03:00
Sean Bright 14c6f8be9d app_queue: Silence GCC 8 compiler warning
I'm only seeing an error in 14+, so I assume it is due to different
compiler options:

app_queue.c: In function ‘handle_queue_add_member’:
app_queue.c:10234:19: error: ‘%d’ directive writing between 1 and 11
    bytes into a region of size 3 [-Werror=format-overflow=]
     sprintf(num, "%d", state);
                   ^~
app_queue.c:10234:18: note: directive argument in the range
    [-2147483648, 99]
     sprintf(num, "%d", state);
                  ^~~~

Compiler: gcc version 8.0.1 20180414 (experimental)
    [trunk revision 259383] (Ubuntu 8-20180414-1ubuntu2) 

Change-Id: I18577590da46829c1ea7d8b82e41d69f105baa10
2018-08-22 08:53:06 -05:00
Ivan Poddubny 2ce061091e app_queue: set QUEUESTATUS to LEAVEEMPTY instead of CONTINUE
When a call leaves a queue on leaveempty condition, QUEUESTATUS
must be set to LEAVEEMPTY, no matter whether Queue was executed with or
without the "c" (continue) option.

The regression was introduced in the fix for ASTERISK_25665.
The following fix (ASTERISK_27065) was incomplete, as QUEUESTATUS was
overwritten in case when "c" is set, regardless of what was the cause
for leaving the queue.

ASTERISK-27973 #close
Reported-by: Valentin Safonov

Change-Id: Iec013fe6a26a4e825ca572a1dda4f3cee5f6f80c
2018-08-13 12:45:16 -05:00
Joshua Colp 134e2f0ddc module: Remove deprecated modules and update support levels.
I have removed the STATIC_BUILD option immediately as it has not
been maintained in many years and is non-functional.

ASTERISK-27965

Change-Id: I64783d017b86dba9ee3c7bcfb97e59889a3f76d7
2018-07-18 18:15:53 +00:00
George Joseph 34f3fe9552 app_confbridge: Use the SDP 'label' attribute to correlate users
Previously, the msid "label" attribute was used to correlate
participant info but because streams could be reused, the msid
wasn't being updated correctly when someone left the bridge and
another joined.

Now, instead of looking for the msid attribute on a channel's streams,
app_confbridge sets an "SDP:LABEL" attribute on the stream which
res_pjsip_sdp_rtp looks for.  If it finds it, it adds a "label"
attribute to the current sdp.

Change-Id: I6cbaa87fb59a2e0688d956e72d2d09e4ac20d5a5
2018-07-13 11:33:30 -05:00
Robert Mordec 9d3f3a4b0a app_confbridge: Bridge and announcers not removed if conference ends quickly
If a conference is ended very quickly after it was created (i.e., the
first user immediately hangs up) then the conference bridge and announcer
channels are not removed.

When a conference is created, the push_announcer() function is added to
the playback queue task processor and the conference object reference is
bumped.  If a conference is ended while the push_announcer() function is
still going then the ao2_cleanup(conference) at the end of
push_announcer() will call the destructor function -
destroy_conference_bridge().

The destroy_conference_bridge() function will then add the
hangup_playback() task to the playback queue and will wait for it to end.
Since it is already a current task of the playback queue it will wait
forever.

This patch makes the conference thread call push_announcer() directly.
This way the conference object reference bump is not needed.  Since the
playback queue task processor is only used by the conference thread
itself, there is no danger of trying to play announcements before the
announcer is pushed to the bridge.

ASTERISK-27870 #close

Change-Id: I947a50fb121422d90fd1816d643a54d75185a477
2018-06-29 10:07:06 -06:00
Joshua Colp 5f517bacd0 Merge "app_confbridge: Move participant info code to confbridge_manager." 2018-06-28 13:04:12 -05:00
George Joseph 5f12e2bd07 app_confbridge: Move participant info code to confbridge_manager.
With the participant info code in app_confbridge, we were still
in the process of adding the channel to the bridge when trying to send
an in-dialog MESSAGE.  This caused 2 threads to grab the channel
blocking flag at the same time.  To mitigate this, the participant
info code was moved to confbridge_manager so it runs after all
channel/bridge actions have finished.

Change-Id: I228806ac153074f45e0b35d5236166e92e132abd
2018-06-26 15:18:35 -06:00
Kristian F. Høgh 184b375b41 app_queue: Add option for predial handlers on caller and callee channels
Add predial handler support to app_queue.  app_dial (ASTERISK_19548) and
app_originate (ASTERISK_26587) have the ability to execute predial
handlers on caller and callee channels.  This patch adds predial handlers
to app_queue and uses the same options as Dial and Originate (b and B).
The caller routine gets executed when the caller first enters the queue.
The callee routine gets executed for each queue member when they are about
to be called.

ASTERISK-27912

Change-Id: I5acf5c32587ee008658d12e8a8049eb8fa4d0f24
2018-06-21 17:39:33 -05:00
Richard Mudgett 7d874c1af7 AMI PlayDTMF Action: Make not compete with channel's media thread.
There can be one and only one thread handling a channel's media at a time.
Otherwise, we don't know which thread is going to handle the media frames.

ASTERISK-27625

Change-Id: Ia341f1a6f4d54f2022261abec9021fe5b2eb4905
2018-06-19 15:02:52 -05:00
Jenkins2 986cffa18e Merge "app_confbridge: Enable sending events to participants" 2018-06-18 09:24:45 -05:00
Sam Wierema 4c7ab73468 app_mp3: remove 10 seconds of silence after mp3 playback
This patch changes the way asterisk polls output from mpg123, instead
of waiting for 10 seconds(when playing an http url) it now uses a
timeout of one second and iterates 10 times using this same timeout.

The main difference is that for every timeout asterisk receives it now
checks if mpg123 is still running before poll again.

ASTERISK-27752

Change-Id: Ib7df8462e3e380cb328011890ad9270d9e9b4620
2018-06-15 06:24:37 -06:00
George Joseph e7a7506f9c app_confbridge: Enable sending events to participants
ConfBridge can now send events to participants via in-dialog MESSAGEs.
All current Confbridge events are supported, such as ConfbridgeJoin,
ConfbridgeLeave, etc.  In addition to those events, a new event
ConfbridgeWelcome has been added that will send a list of all
current participants to a new participant.

For all but the ConfbridgeWelcome event, the JSON message contains
information about the bridge, such as its id and name, and information
about the channel that triggered the event such as channel name,
callerid info, mute status, and the MSID labels for their audio and
video tracks. You can use the labels to correlate callerid and mute
status to specific video elements in a webrtc client.

To control this behavior, the following options have been added to
confbridge.conf:

bridge_profile/enable_events:  This must be enabled on any bridge where
events are desired.

user_profile/send_events:  This must be set for a user profile to send
events.  Different user profiles connected to the same bridge can have
different settings.  This allows admins to get events but not normal
users for instance.

user_profile/echo_events:  In some cases, you might not want the user
triggering the event to get the event sent back to them.  To prevent it,
set this to false.

A change was also made to res_pjsip_sdp_rtp to save the generated msid
to the stream so it can be re-used.  This allows participant A's video
stream to appear as the same label to all other participants.

Change-Id: I26420aa9f101f0b2387dc9e2fd10733197f1318e
2018-06-13 09:12:18 -06:00
George Joseph 49196c3a7b Merge "app_confbridge: Add talking indicator for ConfBridgeList AMI response" 2018-06-06 09:47:19 -05:00
Joshua Colp 8b08a8437e Merge "app_meetme: Fix manager event documentation for several events." 2018-06-05 06:54:00 -05:00
George Joseph 437ab41881 app_sendtext: Allow content types other than text/plain
There was no real reason to limit the conteny type to text/plain other
than that's what it was limited to before.  Now any text/* content
type will be allowed for channel drivers that don't support enhanced
messaging and any type will be allowed for channel drivers that do
support enhanced messaging.

Change-Id: I94a90cfee98b4bc8e22aa5c0b6afb7b862f979d9
2018-06-04 13:20:34 -06:00
William McCall a7f4121238 app_confbridge: Add talking indicator for ConfBridgeList AMI response
When an AMI client connects, it cannot determine if a user was talking
prior to a transition in the user speaking state (which would generate
a ConfbridgeTalking event). This patch causes app_confbridge to track the
talking state and make this state available via ConfBridgeList.

ASTERISK-27877 #close

Change-Id: I19b5284f34966c3fda94f5b99a7e40e6b89767c6
2018-06-01 07:46:30 -06:00
Richard Mudgett 6bbede84fb app_meetme: Fix manager event documentation for several events.
The MeetmeJoin, MeetmeLeave, MeetmeEnd, MeetmeMute, MeetmeTalking, and
MeetmeTalkRequest AMI events were documented with sending out a Usernum
header when the User header was actually output.

* Change the online documentation to match reality.

ASTERISK-27873
ASTERISK-25261

Change-Id: I437bc70618d07c183c9624b7069c2fcae7f17a39
2018-05-29 11:39:12 -06:00
Joshua Colp f5c1e74524 Merge "app_queue: Update year Copyright and fix missing tabs in documentation" 2018-05-24 05:49:41 -05:00
Rodrigo Ramírez Norambuena d402594f74 app_queue: Update year Copyright and fix missing tabs in documentation
Change-Id: Ieb8faf37dc765463ee5dbca1d1343242c756b1c7
2018-05-22 13:10:59 -04:00
Joshua Colp 21dd609e77 Merge "app_voicemail: Fix data-type mismatch between app_voicemail and database" 2018-05-21 09:05:19 -05:00
Nic Colledge 2ca3b6d9cc app_voicemail: Fix data-type mismatch between app_voicemail and database
Fix data-type mismatch between app_voicemail and database columns
exposed by new version of MariaDB

ASTERISK-27760

Change-Id: I8543ad480a08c98be78bde1ee870e6e6c84b2c5b
2018-05-17 16:18:04 -06:00
Nic Colledge 97f20fe5ed app_voicemail: Fix incorrect msg leaving/retrieving an ODBC voicemail
Correct the log warning message shown when ODBC voicemail
retrieve_file is called and there is a null value in the category
column.
A more meaningfull message is now written at debug level.

ASTERISK-27853

Change-Id: Ic36e97d5eb070a23a12ba45972f6b53e2182a3f4
2018-05-17 16:15:00 -06:00
Corey Farrell b5914d90ac Fix GCC 8 build issues.
This fixes build warnings found by GCC 8.  In some cases format
truncation is intentional so the warning is just suppressed.

ASTERISK-27824 #close

Change-Id: I724f146cbddba8b86619d4c4a9931ee877995c84
2018-05-11 09:48:58 -04:00
Corey Farrell d855658f23 app_macro: Prevent infinite loop in find_matching_priority.
Use AST_PBX_MAX_STACK to escape if we recurse 128 times.  This will
prevent crash if dialplan contains an include loop.  Log an error when
this occurs, at most one message per call to Macro() so we avoid logger
spam.

ASTERISK-26570 #close

Change-Id: I6c71b76998c31434391b150de055ae9a531e31da
2018-05-07 07:58:12 -06:00
George Joseph 5dd6fe478c Merge "app_sendtext: Enhance SendText to support Enhanced Messaging" 2018-04-30 07:34:32 -05:00
Chris-Savinovich b437656c2e "confbridge show profile bridge" does not output "sfu" when video_mode is sfu
Fixes a bug on the "confbridge show profile bridge" cli command
that showed "video_mode=no video" when video_mode was set
to "sfu"

ASTERISK-27418  #close

Change-Id: I481e3172c7f872664c7ac7809879d541c9f031e9
2018-04-18 16:10:54 -06:00
Joshua Colp 8de3fa2b56 bridge_softmix / app_confbridge: Add support for REMB combining.
This change adds the ability for multiple REMB reports in
bridge_softmix to be combined according to a configured
behavior into a single report. This single report is sent
back to the sender of video, which adjusts the encoding bitrate
to be at or below the bitrate of the report. The available
behaviors are: lowest, highest, and average. Lowest uses the
lowest received bitrate. Highest uses the highest received
bitrate. Average goes through the received bitrates adding
them to the previous average and creates a new average.

Other behaviors can be added in the future and the existing
average one may be adjusted, but this provides the foundation
to do so.

Support for configuring which behavior to use has been
added to app_confbridge.

ASTERISK-27804

Change-Id: I9eafe4e7c1f72d67074a8d6acb26bfcf19322b66
2018-04-17 11:25:17 -06:00
George Joseph 8135558bab app_sendtext: Enhance SendText to support Enhanced Messaging
SendText now accepts new channel variables that can be used
to override the To and From display names and set the Content-Type
of a message.  Since you can now set Content-Type, other text/*
content types are now valid.

Change-Id: I648b4574478119f95de09d9f08e9595831b02830
2018-04-17 10:30:44 -06:00
Joshua Colp d6e1acd25e Merge "app_confbridge / bridge_softmix: Add ability to configure REMB interval." 2018-04-09 10:57:40 -05:00
Joshua Colp df3db2f146 Merge "app_originate: Add async option." 2018-04-09 10:32:38 -05:00
Richard Mudgett 6774913e82 app_agent_pool.c: Fix off nominal ref leak.
Change-Id: Ib427ffc2c802620eaafb08b1c2a17dddd8fb8eb6
2018-04-04 17:02:58 -06:00
Joshua Colp 0f6431e8e4 app_confbridge / bridge_softmix: Add ability to configure REMB interval.
This change adds a configuration option to app_confbridge which can be
used to set the interval at which we will send a combined REMB (remote
estimated maximum bitrate) frame to sources of video. The bridging API
has also been extended slightly to allow setting this so bridge_softmix
can use it.

ASTERISK-27786

Change-Id: I0e49eae60f369c86434414f3cb8278709c793c82
2018-04-03 08:13:11 -06:00
Russell Bryant 75715b95b4 app_originate: Add async option.
Add an option to make app_originate not wait for the created channel
to answer.

Change-Id: I7fc2facd77079abc6321f44e8bcd4e39298de2ae
Requested-by: Frederic Steinfels <fst@highdefinition.ch>
Signed-off-by: Russell Bryant <russell@russellbryant.net>
2018-03-22 13:22:23 +00:00
Joshua Colp 0bfc83ee4f Merge "BuildSystem: Remove unused dependency on libltdl." 2018-03-20 06:37:09 -05:00
Jenkins2 5843a19797 Merge "loader: Convert reload_classes to built-in modules." 2018-03-19 12:53:12 -05:00
George Joseph c29b5389c5 Merge "app_voicemail: Fix json blob errors" 2018-03-19 09:50:00 -05:00
George Joseph d6a49afb56 Merge "app_dial: Enable early-media video" 2018-03-19 09:34:16 -05:00
Alexander Traud 10a978829e BuildSystem: Remove unused dependency on libltdl.
Asterisk does not need the development package of libltdl, because it does not
use any symbol of -lltdl directly. Instead, it uses the runtime package via the
shared library -lodbc. On the supported platforms, that shared library declares
its dependency on -lltdl correctly, otherwise AST_EXT_LIB_CHECK would have
failed.

ASTERISK-27745

Change-Id: Icd315809b8e7978203431f3afb66240dd3a040ba
2018-03-17 11:00:06 +01:00
Florian Floimair ecc846b26b app_dial: Enable early-media video
Certain applications (e.g. door-phone) require that also video is transmitted
before a call is accepted.

Change-Id: I9842e1dc2f6e1c2c49dc33fe615255007d2f821e
2018-03-16 17:53:20 +01:00
George Joseph 4d1e3fef6b app_voicemail: Fix json blob errors
When app_voicemail calls ast_test_suite_notify with the results of
a user keypress, it formats the keypress as '%c'.  If the user hung up
or some other error occurrs, the result of the keypress is a non
printable character.  This ultimately causes json_vpack_ex to think
it's being passed a non utf-8 string and return an error.

* Keypress results passed to ast_test_suite_notify are now checked with
  isprint() and a '?' is substituted if the check fails.

Change-Id: I78ee188916bbac840f3d03f40201b692347ea865
2018-03-16 08:09:19 -06:00
Corey Farrell 572a508ef2 loader: Convert reload_classes to built-in modules.
* acl (named_acl.c)
* cdr
* cel
* ccss
* dnsmgr
* dsp
* enum
* extconfig (config.c)
* features
* http
* indications
* logger
* manager
* plc
* sounds
* udptl

These modules are now loaded at appropriate time by the module loader.
Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
the module loader will abort startup on failure of these modules.

Some of these modules are still initialized or shutdown from outside the
module loader.  logger.c is initialized very early and shutdown very
late, manager.c is initialized by the module loader but is shutdown by
the Asterisk core (too much uses it without holding references).

Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
2018-03-14 05:20:12 -04:00
Jenkins2 1485719531 Merge "Replace direct checks of option_debug with DEBUG_ATLEAST macro." 2018-03-12 10:44:46 -05:00
Jenkins2 ffdd4b1c39 Merge "Complete deprecating legacy modules." 2018-03-12 07:50:01 -05:00
Jenkins2 4ef5b58230 Merge "app_osplookup: Move header defines into the app." 2018-03-11 17:24:29 -05:00
Kevin Harwell 257be6847c Merge "voicemail: Fixed wrong voicemail message count" 2018-03-08 15:26:37 -06:00
Richard Mudgett e6738b79b3 Complete deprecating legacy modules.
The menuselect comment was updated to deprecate these modules but the
AST_MODULE_INFO block at the end of file was missed.

ASTERISK-27671

Change-Id: I63070b5c4d4f08af010c6034acd4793c1bcef839
2018-03-08 13:53:09 -06:00
Corey Farrell c8a521b6c8 Replace direct checks of option_debug with DEBUG_ATLEAST macro.
Checking option_debug directly is incorrect as it ignores file/module
specific debug settings.  This system-wide change replaces nearly all
direct checks for option_debug with the DEBUG_ATLEAST macro.

Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0
2018-03-07 16:03:01 -06:00
Sungtae Kim 961dd9fe52 voicemail: Fixed wrong voicemail message count
Fixed wrong voicemail mailbox reference for Action: VoicemailUsersList.

ASTERISK-27703

Change-Id: Ie6578ad80bba2bfaf34b84f0be978f59045ce6cd
2018-03-07 09:47:10 -06:00
Corey Farrell add03e207c app_osplookup: Move header defines into the app.
astosp.h is leftover from when logic was split between app_osplookup and
res_osp.  All logic was moved into app_osplookup by 109737eb1c in 2006,
but astosp.h remained.  This moves the remaining defines into
app_osplookup and deletes astosp.h.

Change-Id: I0a6c4debd7c9543b608520b1765abfa4fab7b2fd
2018-03-07 02:45:24 -05:00
Michael Cargile 7b01236028 apps/app_amd.c: Fixed total time and silence calculations
Between Asterisk 11 and Asterisk 13 there was a significant increase
in the number of AST_FRAME_NULL frames being processed by app_amd.c's
main loop. Each AST_FRAME_NULL frame was being counted as 100ms
towards the total time and silence. This may have been accurate
when app_amd.c was orginally added, but it is not in Asterisk 13.
As such the total analysis time and silence calculations were way
off effectively breaking app_amd.c

* Additional debug messages were added
* AST_FRAME_NULL are now ignored

ASTERISK-27610

Change-Id: I18aca01af98f87c1e168e6ae0d85c136d1df5ea9
2018-02-25 11:57:34 -06:00
Corey Farrell 9f74afbdcf Deprecate legacy modules.
* app_fax (replaced by res_fax).
* res_config_sqlite (replaced by res_config_sqlite3).
* res_monitor (replaced by app_mixmonitor).

This is related to ASTERISK~23657 but does not resolve that ticket.
Resolving that ticket would require complete removal of res_monitor.

ASTERISK-27671 #close

Change-Id: I16a3edd61fc1abd4a7b2e9357693ed663f62dd49
2018-02-13 13:56:03 -05:00
Richard Mudgett 67cd90f10d app_confbridge: ConfbridgeList event has standard channel shapshot headers.
* Made the AMI ConfbridgeList action's ConfbridgeList events output all
the standard channel snapshot headers instead of a few hand-coded channel
snapshot headers.  The benefit is that the CallerIDName gets disruptive
characters like CR, LF, Tab, and a few others escaped.  However, an empty
CallerIDName is now output as "<unknown>" instead of "<no name>".

ASTERISK-27651

Change-Id: Iaf7d54a9d40194c2db060bc9b4979fab6720d977
2018-02-05 13:47:30 -06:00
Richard Mudgett f4b161440b app_confbridge: Add the Muted header to ConfbridgeJoin AMI event.
ASTERISK-27651

Change-Id: Idef2ca54d242d1b894efd3fc7b360bc6fd5bdc34
2018-02-05 13:47:30 -06:00
Jenkins2 f041bc7863 Merge "app_confbridge: Update dsp_silence_threshold and dsp_talking_threshold docs." 2018-02-01 11:36:00 -06:00
Jenkins2 9083901068 Merge "app_voicemail: Avoid always true when using pointer address." 2018-01-31 15:43:03 -06:00
Richard Mudgett b9024197ab app_confbridge: Update dsp_silence_threshold and dsp_talking_threshold docs.
The dsp_talking_threshold does not represent time in milliseconds.  It
represents the average magnitude per sample in the audio packets.  This is
what the DSP uses to determine if a packet is silence or talking/noise.

Change-Id: If6f939c100eb92a5ac6c21236559018eeaf58443
2018-01-31 13:13:27 -06:00
Jenkins2 a231e1d155 Merge "Remove redundant module checks and references." 2018-01-29 12:39:34 -06:00
Alexander Traud 156b12340e app_voicemail: Avoid always true when using pointer address.
clang 4.0 warned about this.

ASTERISK-27635

Change-Id: I213f230607d7fbe97c0f5f2d60da9cbf5a2d8231
2018-01-29 17:00:52 +01:00
Corey Farrell 527cf5a570 Remove redundant module checks and references.
This removes references that are no longer needed due to automatic
references created by module dependencies.

In addition this removes most calls to ast_module_check as they were
checking modules which are listed as dependencies.

Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
2018-01-24 13:37:29 -05:00
Corey Farrell 679fa5fb34 Add missing OPTIONAL_API and ARI dependences.
I've audited all modules that include any header which includes
asterisk/optional_api.h.  All modules which use OPTIONAL_API now declare
those dependencies in AST_MODULE_INFO using requires or optional_modules
as appropriate.

In addition ARI dependency declarations have been reworked.  Instead of
declaring additional required modules in res/ari/resource_*.c we now add
them to an optional array "requiresModules" in api-docs for each module.
This allows the AST_MODULE_INFO dependencies to include those missing
modules.

Change-Id: Ia0c70571f5566784f63605e78e1ceccb4f79c606
2018-01-22 12:16:58 -05:00
ghjm 86b484dec7 app_followme: Add a prompt to be read when a call is connected
This patch adds the ability to configure a prompt which will be read
to the "winner" who pressed 1 (or the configured value) and received
the call.

ASTERISK-24372 #close

Change-Id: I6ec1c6c883347f7d1e1f597189544993c8d65272
2018-01-17 12:08:59 -06:00
Corey Farrell 9cfdb81e91 loader: Add dependency fields to module structures.
* Declare 'requires' and 'enhances' text fields on module info structure.
* Rename 'nonoptreq' to 'optional_modules'.
* Update doxygen comments.

Still need to investigate dependencies among modules I cannot compile.

Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
2018-01-15 13:25:51 -05:00
Alexander Traud 685bab254c app_osplookup.c: Avoid two format truncations.
GCC 7 warned about this.

ASTERISK-27578

Change-Id: I4a00458dbe9b575ef04338b6a7852272745e1552
2018-01-12 11:27:23 +01:00
Corey Farrell 5380fb9978 app_confbridge: Fix NULL check in action_kick_last.
The check for last_user == NULL needs to happen before we dereference
the variable, previously it was possible for us to check flags of a NULL
last_user.

Change-Id: I274f737aa8af9d2d53e4a78cdd7ad57561003945
2018-01-08 19:47:38 -05:00
Alexander Traud f84fcc1fc1 General: Avoid implicit conversion to char when changes value to negative.
clang 5.0 warned about this.

ASTERISK-27557

Change-Id: I7cceaa88e147cbdf81a3a7beec5c1c20210fa41e
2018-01-06 22:12:40 +01:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Jenkins2 667296c907 Merge "app_voicemail: Fix file copy error handling." 2017-12-22 07:32:58 -06:00
Jenkins2 0100c9267e Merge "Fix Common Typo's." 2017-12-21 08:40:22 -06:00
Corey Farrell f2f51ff4ea app_voicemail: Fix file copy error handling.
Fix error where input/output file descriptors would be closed multiple
times.

Change-Id: Iba5140b60cb7de79e3d5d92be3c256947aa99da9
2017-12-20 22:19:29 -05:00
Corey Farrell 1b80ffa495 Fix Common Typo's.
Fix instances of:
* Retreive
* Recieve
* other then
* different then
* Repeated words ("the the", "an an", "and and", etc).
* othterwise, teh

ASTERISK-24198 #close

Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-20 12:40:01 -05:00
Corey Farrell fff7782cf5 app_festival: Fix fd leak on connection failure.
Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f
2017-12-20 01:53:17 -05:00
George Joseph 5554bc6b53 Merge "app_queue: Add feature to set wrapuptime on the queue member" 2017-12-19 14:15:48 -06:00
Corey Farrell dc04d1ec93 app_voicemail: Fix memory management issues.
* mwi_sub_event_cb: mwist leaked on separate_mailbox failure.
* add_email_attachment: A reference to sox_gain_tmpdir was used
  after the storage was out of scope.

Change-Id: I6282c542ff7b82fa091177a912d11234a8b00a30
2017-12-18 19:04:56 -05:00
Rodrigo Ramírez Norambuena 5335ad117d app_queue: Add feature to set wrapuptime on the queue member
This patch adds the ability to set the wrapuptime on the queue member
config.

When the option is set the wrapuptime on the queue member is used instead
of the queue's wrapuptime.

ASTERISK-27483 #close

Change-Id: I11c85809537f974eb44dc5bbf82bcedd8a458902
2017-12-18 17:29:21 -06:00
Joshua Colp 5224fd3ab4 Merge changes from topic 'faster-aco'
* changes:
  aco: Minimize use of regex.
  aco: Create ways to minimize use of regex.
2017-12-18 14:41:41 -06:00
Joshua Colp b40c00c97b app_transfer: Remove LOCAL from documentation.
The Local channel has never supported app_transfer
from what I can see so remove it from the documentation.

ASTERISK-25649

Change-Id: Icbcfe297f6f866285a26b3e9fd5c6d00fa22e0e9
2017-12-18 06:37:03 -06:00
Joshua Colp b0f054cb2d Merge "app_queue: Fix extension state subscriptions removed on dialplan reload" 2017-12-15 09:55:12 -06:00
Corey Farrell bf2d35931d aco: Minimize use of regex.
Remove nearly all use of regex from ACO users.  Still remaining:
* app_confbridge has a legitamate use of option name regex.
* ast_sorcery_object_fields_register is implemented with regex, all
  callers use simple prefix based regex.  I haven't decided the best
  way to fix this in both 13/15 and master.

Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b
2017-12-15 10:14:31 -05:00
Joshua Colp 7a837ece97 Merge "Add new AMI action for app_voicemail" 2017-12-14 06:14:32 -06:00
pchero daa3a3009a Add new AMI action for app_voicemail
Currently, to figure out specified voicemail's status, there's only one
way to do it, which is use a VoicemailUserEntry AMI message.
But it consumed it too much resource(it check everything).
So, added new AMI action.

ASTERISK-27470

Change-Id: Ie4eba1424a142e5fbd1d9fb1821a3fc1a1e238b7
2017-12-13 10:31:24 -06:00
Ivan Poddubny c7f94e570e app_queue: Fix extension state subscriptions removed on dialplan reload
The approach with having a single global subscription to all extension
state changes has one issue: dynamically created hints don't have any
watchers and are therefore garbage collected on the first dialplan
reload.

This change creates a state subscription for every queue member with a
hint as state_interface, thus increasing the count of watches for
hints, so they are not destroyed prematurely anymore.

There are 2 side effects:
1. The state change callback in app_queue is not executed when
   there are no members referring to the extension.
2. The callback is called multiple times for the same hint if it's
   associated with more than one queue member.

Reported by: Steven T. Wheeler

ASTERISK-18411 #close

Change-Id: I4956af2136ea2a7f110ac9272eae5f6e676d8f89
2017-12-12 23:00:51 +01:00
Sean Bright 2ffe52a116 utils: Add convenience function for setting fd flags
There are many places in the code base where we ignore the return value
of fcntl() when getting/setting file descriptior flags. This patch
introduces a convenience function that allows setting or clearing file
descriptor flags and will also log an error on failure for later
analysis.

Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7
2017-12-08 13:28:04 -06:00
Sungtae Kim 0611fe581c Add new object for VoicemailUserEntry
Currently, when the app_voicemail sending VoicemailUserEntry AMI event, there's
no OldMessageCount info for default.
To check the OldMessageCount info, it required IMAP_STORAGE define, but this is
not correct.
Added OldMessageCount item as a default.

ASTERISK-27456

Change-Id: I5c71521c2d1daf8b7b161e31c34d28cca6aea4c7
2017-12-04 10:51:49 +01:00
Corey Farrell 58fa3885cc Loader: Remove unneeded load_pri declarations.
Instead of specifying AST_MODFLAG_LOAD_ORDER with load_pri
AST_MODPRI_DEFAULT just use AST_MODFLAG_DEFAULT.

Change-Id: I0123258eafce324249433a69df15a85cc16e509f
2017-11-20 13:17:55 -06:00
Corey Farrell 2fab3aacd6 app_minivm: Fix possible uninitialized return value.
Declare 'res' initialized to -1 to deal with earlier error paths that
could cause 'res' to be returned uninitialized.

Change-Id: I8ac2a5755bf4174d89ef893e924c940f702b104e
2017-11-18 20:29:16 -05:00
George Joseph f512707362 app_record: Don't set RECORD_STATUS chan var until file is closed
We've been calling pbx_builtin_setvar_helper to set the
RECORD_STATUS variable before actually closing the recorded file.
If a client is watching VarSet events and tries to do something with
the file when a RECORD_STATUS event is seen, they might attempt to
do so while the file it's still open.

We now delay calling pbx_builtin_setvar_helper until after we close
the file.

ASTERISK-27423

Change-Id: I7fe9de99953e46b4bafa2b38cf151fe8f6488254
2017-11-15 15:03:21 -05:00
Richard Mudgett ee08f10d06 Fix ast_(v)asprintf() malloc failure usage conditions.
When (v)asprintf() fails, the state of the allocated buffer is undefined.
The library had better not leave an allocated buffer as a result or no one
will know to free it.  The most likely way it can return failure is for an
allocation failure.  If the printf conversion fails then you actually have
a threading problem which is much worse because another thread modified
the parameter values.

* Made __ast_asprintf()/__ast_vasprintf() set the returned buffer to NULL
on failure.  That is much more useful than either an uninitialized pointer
or a pointer that has already been freed.  Many uses won't have to check
for failure to ensure that the buffer won't be double freed or prevent an
attempt to free an uninitialized pointer.

* stasis.c: Fixed memory leak in multi_object_blob_to_ami() allocated by
ast_asprintf().

* ari/resource_bridges.c:ari_bridges_play_helper(): Remove assignment to
the wrong thing which is now not needed even if assigning to the right
thing.

Change-Id: Ib5252fb8850ecf0f78ed0ee2ca0796bda7e91c23
2017-11-06 12:47:30 -05:00
Corey Farrell 606ae3484a Add missing menuselect dependencies.
This adds menuselect dependencies for modules that use symbols of other
modules.

ASTERISK-27390

Change-Id: Ia2d2849f5b87a72af7324a82edc3f283eafb5385
2017-11-02 02:57:52 -04:00
Joshua Colp 92b3ed4d32 Merge "Modules: Fix issues with CLI completion." 2017-10-30 17:18:59 -05:00
Corey Farrell e82b921c35 Modules: Fix issues with CLI completion.
* Stop using ast_module_helper to check if a module is loaded, use
  ast_module_check instead (app_confbridge and app_meetme).
* Stop ast_module_helper from listing reload classes when needsreload
  was not requested.

ASTERISK-27378

Change-Id: Iaed8c1e4fcbeb242921dbac7929a0fe75ff4b239
2017-10-30 01:39:20 -04:00
Igor Goncharovskiy 9bad4c74cc app_agent_spool: Fix typo in dtmf features usage desctiption
Fix typo, that specify usage wrong option 'dtmf-features' for CHANNEL() function
instead of correct 'dtmf_features'

ASTERISK-27377 #close

Change-Id: I15ecc829c1035b359584673e12cdb5c9291ac930
2017-10-28 19:24:17 -05:00
Richard Mudgett 26607e4e3b app_voicemail.c: Fix compiler warning with IMAP build.
ASTERISK-27181

Change-Id: Ic4468b49860bd7f67e922baf4c9e96828c184d17
2017-10-26 12:24:51 -05:00
Richard Mudgett 488f98310f app_agent_pool.c: Fix online documentation typo.
Change-Id: Ib0bc95fd0ec288c78c313823254d7a84ebfc4429
2017-10-23 07:54:34 -05:00
Corey Farrell 955a891a84 app_macro deprecation.
* Mark the module deprecated.
* Disable the module by default.
* Produce a warning the first time a macro is used.
* Note deprecation related options in app_dial and app_queue.

ASTERISK-27350

Change-Id: I560ea043bacdbc5534a17d97854273d52c2f1bdc
2017-10-18 09:54:58 -05:00
Joshua Colp 0bedd436dc Merge "app_originate: Set ORIGINATE_STATUS correctly on failure" 2017-10-11 16:03:21 -05:00
Nathan Bruning be7da57546 app_queue.c: clear moh field in init_queue
ASTERISK-27301 #close

Change-Id: Ic31361f34e2de3b6470e68fc37205a7711082eba
2017-10-11 05:34:45 -05:00
Sean Bright 3ad7d2f36c app_originate: Set ORIGINATE_STATUS correctly on failure
We were ignoring the return value from ast_pbx_outgoing_exten() and
ast_pbx_outgoing_app() which could fail before setting the reason code.
This resulted in failures being reported as success.

ASTERISK-25266 #close
Reported by: Allen Ford

Change-Id: Idf16237b7e41b527d2c69c865829128686beeb3b
2017-10-10 12:32:25 -05:00
Richard Mudgett b2dbfe23ef app_queue.c: Fix announcements when announce-to-first-user not enabled.
The previous patch for ASTERISK-27216 made it so you wouldn't get any
position or periodic announcements unless you had announce-to-first-user
enabled.  The announce-to-first-user feature was added by ASTERISK_21782
as a result of the patch which introduced the redundant announcements that
ASTERISK-27216 removes.

* By noting that the makeannouncement variable is used to suppresses the
first user announcement, we set its initial value to the
announce-to-first-user enable setting.

ASTERISK-27216

Change-Id: Ieaeb7dbea8ae7073086b775fbafe0625b000b10a
2017-09-28 18:48:21 -05:00
Joshua Colp 2a09b3b76a Merge "app_queue: Only do announcement logic between ringing cycles" 2017-09-26 06:36:47 -05:00
Joshua Colp 0133d29c83 Merge "build: A few gcc 7 error fixes" 2017-09-25 13:04:22 -05:00
George Joseph 4275ca16a1 build: A few gcc 7 error fixes
Change-Id: I7b5300fbf1af7d88d47129db13ad6dbdc9b553ec
2017-09-25 07:32:14 -05:00
StefanEng86 c3c73b3511 app_queue: Only do announcement logic between ringing cycles
This patch reverts the change by patch 2263 from old reviewboard.
Note that reverting that 2263-patch still preserves the behaviour that
the commit log of the 2263-patch claimed to add. The reason for this is:

The function wait_for_answer is only called from try_calling which
in turn is only called from the main for loop in queue_exec, and
earlier in that loop we already check the things that's removed by
this patch. There's no need to check those things twice each loop
iteration, and I think the proper place to check it is before each
ringing cycle. By checking it in wait_for_answer, you allow the issue
explained in the jira - that the head caller hears announcements while
the agents' sip phones are actively ringing.

Reported-by: Stefan Engström
Tested-by: Stefan Engström
ASTERISK-27216 #close

Change-Id: Ic4290dc75256f9743900c6762ee1bb915f672db0
2017-09-25 07:02:37 -05:00
Sean Bright 0fad11f21c app_stream_echo: Don't echo declined streams
Discovered while experimenting with Cyber Mega Phone 2K Ultimate Dynamic
Edition after accepting the audio request but declining the video one.

Change-Id: Iaa86d41fccfbc1b559a30ccf740d78a3b5f8a98c
2017-09-23 12:33:54 -05:00
Joshua Colp 6fd3db51e8 app_confbridge: Only create a channel that records audio.
This change makes it so that the conference recorder channel
that is created only contains audio formats and an audio stream.
This is because the underlying application used by ConfBridge to
record, MixMonitor, only allows recording audio.

Having additional streams (and in particular a video stream) can
result in clients needlessly renegotiating to add a video stream
that will never receive video.

Change-Id: I89d38aedc9205eca7741d5435e73e73bb9de97a0
2017-09-19 07:56:00 -05:00
Sean Bright 2b3f903e6f app_waitforsilence: Cleanup & don't treat missing frames as 'noise'
* WaitForSilence completes successfully if it receives no media in the
  specified timeout, but when acting as WaitForNoise that logic needs
  to be reversed.

* Use standard argument parsing macros and add some error checking for
  invalid values.

* The documentation indicated that the first argument to both
  WaitForSilence and WaitForNoise was required when it was not. Update
  the documentation to reflect that.

* Wrap up some behavior in structs to avoid boolean checks all over the
  place.

ASTERISK-24066 #close
Reported by: M vd S

Change-Id: I01d40adc5b63342bb5018a1bea2081a0aa191ef9
2017-09-06 16:16:19 -05:00
Sean Bright 1bdbefbe76 app_directory: Handle a NULL mailbox without crashing
ASTERISK-27241 #close
Reported by: David Moore

Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6
2017-09-01 10:28:12 -05:00
Corey Farrell 1bf3dfffd7 AST-2017-006: Fix app_minivm application MinivmNotify command injection
An admin can configure app_minivm with an externnotify program to be run
when a voicemail is received.  The app_minivm application MinivmNotify
uses ast_safe_system() for this purpose which is vulnerable to command
injection since the Caller-ID name and number values given to externnotify
can come from an external untrusted source.

* Add ast_safe_execvp() function.  This gives modules the ability to run
external commands with greater safety compared to ast_safe_system().
Specifically when some parameters are filled by untrusted sources the new
function does not allow malicious input to break argument encoding.  This
may be of particular concern where CALLERID(name) or CALLERID(num) may be
used as a parameter to a script run by ast_safe_system() which could
potentially allow arbitrary command execution.

* Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp()
instead of ast_safe_system() to avoid command injection.

* Document code injection potential from untrusted data sources for other
shell commands that are under user control.

ASTERISK-27103

Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
2017-08-30 18:43:38 +00:00
Sean Bright 06cc5ae9ff confbridge: Handle user hangup during name recording
This prevents orphaned CBAnn channels from getting stuck in the bridge.

ASTERISK-26994 #close
Reported by: James Terhune

Change-Id: I5e43e832a9507ec3f2c59752cd900b41dab80457
2017-08-29 09:28:11 -05:00
Jenkins2 f47733cea0 Merge "app_record: Resolve some absolute vs. relative filename bugs" 2017-08-29 05:57:07 -05:00
Sean Bright da13cdb9e7 voicemail: Fix various abuses of mkstemp
mkstemp() returns a unique filename, but appending an extension to that
filename does not guarantee uniqueness. Instead, use mkdtemp() and we
can put whatever extension we want on the files that we create inside
the directory.

In the case of app_minivm, we also now properly clean up any temporary
files that we create.

ASTERISK-20858 #close
Reported by: Walter Doekes

Change-Id: I30ad04f0e115f0b11693ff678ba5184d8b938e43
2017-08-25 16:08:55 -05:00
Sean Bright 43670e471f app_record: Resolve some absolute vs. relative filename bugs
If the Record() application is called with a relative filename that
includes directories, we were not properly creating the intermediate
directories and Record() would fail.

Secondarily, updated the documentation for RECORDED_FILE to mention
that it does not include a filename extension.

Finally, rewrote the '%d' functionality to be a bit more straight
forward and less noisy.

ASTERISK-16777 #close
Reported by: klaus3000

Change-Id: Ibc2640cba3a8c7f17d97b02f76b7608b1e7ffde2
2017-08-25 12:27:12 -05:00
Jenkins2 179524c255 Merge "app_queue: Evaluate realtime queues when running dialplan functions" 2017-08-25 09:32:28 -05:00
Sean Bright 02f95d290f app_queue: Evaluate realtime queues when running dialplan functions
ASTERISK-19103 #close
Reported by: Jim Van Meggelen

Change-Id: I4bd32a9d1fcebb8ac56bff0e084d4f53e31b692b
2017-08-24 09:44:27 -05:00
Sean Bright b1097be134 app_voicemail: Honor escape digits in "greeting only" mode
ASTERISK-21241 #close
Reported by: Eelco Brolman
Patches:
	Patch uploaded by Eelco Brolman (License 6442)

Change-Id: Icbe39b5c82a49b46cf1d168dc17766f3d84f54fe
2017-08-24 09:04:13 -05:00
Joshua Colp c7edd0b493 Merge "app_confbridge: Document sfu video_mode value." 2017-08-23 13:05:35 -05:00
Jenkins2 e8cf4ab833 Merge "confbridge.h: Fix doxygen comments." 2017-08-23 12:05:29 -05:00
Richard Mudgett 5bbf7b2aad app_confbridge: Document sfu video_mode value.
Change-Id: I26e17df2c93f3933b23f78070603adbcc84ba204
2017-08-22 11:23:45 -05:00
Richard Mudgett f96536b1ea confbridge.h: Fix doxygen comments.
Change-Id: I16133166a85fdb557c66ffcbfe8128d0b4725b0e
2017-08-22 11:21:13 -05:00
Sungtae Kim 22af5e3784 app_queue: Fix initial hold time queue statistic
Fixed to use correct initial value and fixed to use the
correct queue info to check the first value.

ASTERISK-27204

Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73
2017-08-22 07:36:25 -05:00
Jenkins2 1fde9dc7a5 Merge "app_privacy: remove unused header asterisk/image.h" 2017-08-07 07:04:13 -05:00
Corey Farrell 4b03eb5c38 Fix compile error for old versions of GCC.
Use -Wno-format-truncation only if supported by compiler.

ASTERISK-27171 #close

Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6
2017-08-02 18:10:57 -04:00
Corey Farrell 148cf2e0f7 app_privacy: remove unused header asterisk/image.h
Change-Id: I56ed530633a642633b18383821069e806c92ae82
2017-08-02 17:08:48 -04:00
Corey Farrell 58d032112b Fix compiler warnings on Fedora 26 / GCC 7.
GCC 7 has added capability to produce warnings, this fixes most of those
warnings.  The specific warnings are disabled in a few places:

* app_voicemail.c: truncation of paths more than 4096 chars in many places.
* chan_mgcp.c: callid truncated to 80 chars.
* cdr.c: two userfields are combined to cdr copy, fix would break ABI.
* tcptls.c: ignore use of deprecated method SSLv3_client_method().

ASTERISK-27156 #close

Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
2017-08-01 15:42:38 -06:00
Sean Bright 3f98488279 app_queue: Add announce-position-only-up option
Setting this option will cause the Queue application to only announce
the caller's position if it has improved since the last time that we
announced it.

Change-Id: I173a124121422209485b043e2bf784f54242fce6
2017-08-01 15:42:37 -06:00
Joshua Colp b610295b62 Merge "bridge_softmix / res_rtp_asterisk: Fix packet loss and renegotiation issues." 2017-07-26 08:31:13 -05:00
Richard Mudgett 922930753c app_voicemail.c: Allow mailbox entry on authentication retry prompt.
The following testsuite voicemail tests were failing to re-enter the
mailbox after the first login attempt.

tests/apps/voicemail/authenticate_invalid_mailbox
tests/apps/voicemail/authenticate_invalid_password

The tests were noting the start of the vm-incorrect-mailbox prompt and
immediately sending the mailbox for the next login attempt.  Since the
invalid message playback had to complete before the digits were
recognized, the test passed for the wrong reason and added approximately
20 seconds to the test times.

* Allow the vm-incorrect-mailbox prompt to get interrupted by the mailbox
digits like the initial vm-login prompt so the tests are able to enter the
intended mailbox.

Change-Id: I1dc53fe917bfe03a4587b2c4cd24c94696a69df8
2017-07-21 16:17:13 -05:00
George Joseph 66b8c454d1 Merge "app_playback.c: Use the timezonename parameter" 2017-07-19 12:11:09 -05:00
Joshua Colp 680c491a62 bridge_softmix / res_rtp_asterisk: Fix packet loss and renegotiation issues.
This change does a few things to improve packet loss and renegotiation:

1. On outgoing RTP streams we will now properly reflect out of order
packets and packet loss in the sequence number. This allows the
remote jitterbuffer to better reorder things.

2. Video updates can now be discarded for a period of time
after one has been sent to prevent flooding of clients.

3. For declined and removed streams we will now release any
media session resources associated with them. This was not
previously done and caused an issue where old state was being
used for a new stream.

4. RTP bundling was not actually removing bundled RTP instances
from the parent. This has been resolved by removing based on
the RTP instance itself and not the SSRC.

5. The code did not properly handle explicitly unbundling an
RTP instance from its parent. This now works as expected.

ASTERISK-27143

Change-Id: Ibd91362f0e4990b6129638e712bc8adf0899fd45
2017-07-19 13:23:26 +00:00
George Joseph 47084ad09e Merge "app_queue: Add change priority of call" 2017-07-18 09:37:36 -05:00
Sergej Kasumovic 26f149ab0a app_confbridge: Make sure name recordings are always removed from the filesystem
This commit fixes two possible scenarios:

* When recording name and if during recording you hangup, file is never
removed. This is due to the fact file location is nulled.
* When recording name and if you hangup during thank-you prompt, file
is never removed.

ASTERISK-27123 #close

Change-Id: I39b7271408b4b54ce880c5111a886aa8f28c2625
2017-07-14 07:50:13 -05:00
Holger Hans Peter Freyther b54eb167b4 app_playback.c: Use the timezonename parameter
In say_date_generic the timezonename parameter is passed but never
used. Fix it by passing it to the ast_localtime function.

ASTERISK-27124

Change-Id: I63106b8db10426d417d7275f22554a616e92fae4
2017-07-12 23:22:56 +02:00
Joshua Colp 27aeca3594 Merge "app_stream_echo: misc bug fixes" 2017-07-12 06:13:34 -05:00
Joshua Colp 767a163fea Merge "manager: Remove AMI "Queues" action." 2017-07-12 04:25:45 -05:00
Benjamin Keith Ford 5d86da61a6 manager: Remove AMI "Queues" action.
When performing the "Queues" action via AMI, it outputs the same
text that the Asterisk CLI outputs when running a "queue show"
command, which does not conform with the AMI spec. "QueueStatus"
already does what the "Queues" action should do, so instead of
correcting the output, the "Queues" action will be removed and
"QueueStatus" should be used instead.

ASTERISK-27073 #close
Reported by: Brian

Change-Id: Id11743859758255b69cc3a557750d7a56c6d16f8
2017-07-11 15:16:32 -05:00
George Joseph 17103ca898 Merge "app_queue: Add priority to AMI QueueStatus" 2017-07-10 09:50:37 -05:00
Joshua Colp 6f35428c87 Merge "app_voicemail: Cleanup ODBC connection handling" 2017-07-07 16:38:21 -05:00
Sean Bright 325eeced6a core: Remove 'Data Retrieval API'
This API was not actively maintained, was not added to new modules
(such as res_pjsip), and there exist better alternatives to acquire the
same information, such as the ARI.

Change-Id: I4b2185a83aeb74798b4ad43ff8f89f971096aa83
2017-07-05 11:25:58 -05:00
Rodrigo Ramírez Norambuena d556c67f9f app_queue: Add change priority of call
This patch include a feature to change the priority a caller in a
queue by CLI and AMI.

Change-Id: I55d520d71cc1cefe9a9b81fefaefc14679e96133
2017-07-04 00:56:35 -04:00
Sean Bright 950b39a4f5 app_voicemail: Cleanup ODBC connection handling
The primary focus of this patch is adding a missing call to
ast_odbc_release_obj(), but is also a general cleanup of the ODBC
related code in app_voicemail.

ASTERISK-27093 #close

Change-Id: I8e285142eaeb3146b4287a928276b70db76c902b
2017-07-01 07:11:58 -05:00
Jenkins2 b62a3f0a67 Merge "app_queue: Fix returning to dialplan when a queue is empty" 2017-06-30 15:52:38 -05:00
Kevin Harwell e7d41050e0 app_stream_echo: misc bug fixes
Fixed the following bugs:

* calls to stream_echo_write had the last two parameters swapped
* ast_read should have been ast_read_stream
* added a null check on the frame's subclass format

This also resets the update_sent flag upon receiving SRRCHANGE control frame.
This will then force a video update.

ASTERISK-26997

Change-Id: I6ad7c8253559b800800433c52339e7f5aa583566
2017-06-30 10:57:34 -05:00
Niklas Larsson ab7d99e62d app_queue: Add priority to AMI QueueStatus
Add priority to callers in AMI QueueStatus response

ASTERISK-27092 #close

Change-Id: I8d1f737a72c7c38f4cfe1a4ee3ecc0a4f85bd199
2017-06-29 03:55:02 -05:00
Ivan Poddubny 7827755570 app_queue: Fix returning to dialplan when a queue is empty
The fix for ASTERISK-25665 introduced a regression.
The return value of queue_exec used to be 0 in case of leavewhenempty
but it was changed to -1 (returned from wait_our_turn and passed
transparently by queue_exec), thus leading to hangup instead of returning
back to dialplan.

This commit resets the value back to 0 in this case, restoring
original behavior.

ASTERISK-27065 #close
Reported by: Marek Cervenka

Change-Id: Id9c83b75aeda463250155e88c5004be52bbca5ac
2017-06-27 11:54:06 +02:00
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