Commit Graph

5269 Commits

Author SHA1 Message Date
Naveen Albert 567ea5abf8 app_voicemail: Configurable voicemail beep
Hitherto, VoiceMail() played a non-customizable beep tone to indicate
the caller could leave a message. In some cases, the beep may not
be desired, or a different tone may be desired.

To increase flexibility, a new option allows customization of the tone.
If the t option is specified, the default beep will be overridden.
Supplying an argument will cause it to use the specified file for the tone,
and omitting it will cause it to skip the beep altogether. If the option
is not used, the default behavior persists.

ASTERISK-29349

Change-Id: I1c439c0011497e28a28067fc1cf1e654c8843280
2021-05-19 08:03:30 -05:00
Sean Bright aac442eecd app_queue.c: Remove dead 'updatecdr' code.
Also removed the sample documentation, and some oddly-placed
documentation about the timeout argument to the Queue() application
itself. There is a large section on the timeout behavior below.

ASTERISK-26614 #close

Change-Id: I8f84e8304b50305b7c4cba2d9787a5d77c3a6217
2021-03-25 08:38:51 -05:00
Sean Bright 8d3d7bdb82 app_queue.c: Don't crash when realtime queue name is empty.
ASTERISK-27542 #close

Change-Id: If0b9719380a25533d2aed1053cff845dc3a4854a
2021-03-22 10:11:44 -05:00
Joshua C. Colp a8a08bcd1e app_queue: Only send QueueMemberStatus if status changes.
If a queue member was updated with the same status multiple
times each time a QueueMemberStatus event would be sent
which would be a duplicate of the previous.

This change makes it so that the QueueMemberStatus event is
only sent if the status actually changes.

ASTERISK-29355

Change-Id: I580c60d992a0a8f2bea8b91c868771b3b490d116
2021-03-22 07:51:38 -05:00
Joshua C. Colp 149e5e5b86 xml: Embed module information into core XML documentation.
This change embeds the MODULEINFO block of modules
into the core XML documentation. This provides a shared
mechanism for use by both menuselect and Asterisk for
information and a definitive source of truth.

ASTERISK-29335

Change-Id: Ifbfd5c700049cf320a3e45351ac65dd89bc99d90
2021-03-16 10:30:43 -05:00
Joshua C. Colp 7438586d8e documentation: Fix non-matching module support levels.
Some modules have a different support level documented in their
MODULEINFO XML and Asterisk module definition. This change
brings the two in sync for the modules which were not matching.

ASTERISK-29336

Change-Id: If2f819103d4a271e2e0624ef4db365e897fa3d35
2021-03-16 10:26:16 -05:00
Sean Bright 8987de270f app_dial.c: Only send DTMF on first progress event.
ASTERISK-29329 #close

Change-Id: Ic58e7a17f1ff3f785a5b21dced88682581149601
2021-03-10 04:23:11 -06:00
Sean Bright 932eae69ab app_page.c: Don't fail to Page if beep sound file is missing
ASTERISK-16799 #close

Change-Id: I40367b0d6dbf66a39721bde060c8b2d734a61cf4
2021-02-26 09:36:25 -06:00
Ivan Poddubnyi 4d8fc97e4a app_queue: Fix conversion of complex extension states into device states
Queue members using dialplan hints as a state interface must handle
INUSE+RINGING hint as RINGINUSE devstate, and INUSE + ONHOLD as INUSE.

ASTERISK-28369

Change-Id: I127e06943d4b4f1afc518f9e396de77449992b9f
2021-02-23 13:38:39 -06:00
Sebastien Duthil 6e695c867f app_mixmonitor: Add AMI events MixMonitorStart, -Stop and -Mute.
ASTERISK-29244

Change-Id: I1862d58264c2c8b5d8983272cb29734b184d67c5
2021-02-23 11:40:56 -06:00
Sean Bright 4a71b08091 app_read: Release tone zone reference on early return.
Change-Id: I350939f2220f9e5d44ddf4c8d9a4c99fde4d169a
2021-02-04 09:57:36 -06:00
Dan Cropp 55891227e8 chan_pjsip, app_transfer: Add TRANSFERSTATUSPROTOCOL variable
When a Transfer/REFER is executed, TRANSFERSTATUSPROTOCOL variable is
0 when no protocl specific error
SIP example of failure, 3xx-6xx for the SIP error code received

This allows applications to perform actions based on the failure
reason.

ASTERISK-29252 #close
Reported-by: Dan Cropp

Change-Id: Ia6a94784b4925628af122409cdd733c9f29abfc4
2021-01-27 11:42:42 -06:00
Kevin Harwell 3bcf483373 app_mixmonitor: cleanup datastore when monitor thread fails to launch
launch_monitor_thread is responsible for creating and initializing
the mixmonitor, and dependent data structures. There was one off
nominal path after the datastore gets created that triggers when
the channel being monitored is hung up prior to monitor starting
itself.

If this happened the monitor thread would not "launch", and the
mixmonitor object and associated objects are freed, including the
underlying datastore data object. However, the datastore itself was
not removed from the channel, so when the channel eventually gets
destroyed it tries to access the previously freed datastore data
and crashes.

This patch removes and frees datastore object itself from the channel
before freeing the mixmonitor object thus ensuring the channel does
not call it when destroyed.

ASTERISK-28947 #close

Change-Id: Id4f9e958956d62473ed5ff06c98ae3436e839ff8
2021-01-06 10:51:49 -06:00
Sean Bright 44d68bd56b app_voicemail: Prevent deadlocks when out of ODBC database connections
ASTERISK-28992 #close

Change-Id: Ia7d608924036139ee2520b840d077762d02668d0
2021-01-06 10:50:30 -06:00
Sean Bright 357510cec3 app_chanspy: Spyee information missing in ChanSpyStop AMI Event
The documentation in the wiki says there should be spyee-channel
information elements in the ChanSpyStop AMI event.

    https://wiki.asterisk.org/wiki/x/Xc5uAg

However, this is not the case in Asterisk <= 16.10.0 Version. We're
using these Spyee* arguments since Asterisk 11.x, so these arguments
vanished in Asterisk 12 or higher.

For maximum compatibility, we still send the ChanSpyStop event even if
we are not able to find any 'Spyee' information.

ASTERISK-28883 #close

Change-Id: I81ce397a3fd614c094d043ffe5b1b1d76188835f
2020-12-17 14:03:38 -06:00
Joshua C. Colp eda3679c1c voicemail: add option 'e' to play greetings as early media
When using this option, answering the channel is deferred until
all prompts/greetings have been played and the caller is about
to leave their message.

ASTERISK-29118 #close

Change-Id: I41b9f0428783c0bd697c8c994f906d1e75ce9ddb
2020-12-01 11:22:49 -06:00
George Joseph 73f458b1e0 app_queue: Fix deadlock between update and show queues
Operations that update queues when shared_lastcall is set lock the
queue in question, then have to lock the queues container to find the
other queues with the same member. On the other hand, __queues_show
(which is called by both the CLI and AMI) does the reverse. It locks
the queues container, then iterates over the queues locking each in
turn to display them.  This creates a deadlock.

* Moved queue print logic from __queues_show to a separate function
  that can be called for a single queue.

* Updated __queues_show so it doesn't need to lock or traverse
  the queues container to show a single queue.

* Updated __queues_show to snap a copy of the queues container and iterate
  over that instead of locking the queues container and iterating over
  it while locked.  This prevents us from having to hold both the
  container lock and the queue locks at the same time.  This also
  allows us to sort the queue entries.

ASTERISK-29155

Change-Id: I78d4dc36728c2d7bc187b97d82673fc77f2bcf41
2020-11-11 10:06:04 -05:00
Alexander Traud 57ee79a563 Compiler fixes for GCC with -Og
ASTERISK-29144

Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62
2020-11-03 17:08:07 -06:00
George Joseph 773f424c7f app_confbridge/bridge_softmix: Add ability to force estimated bitrate
app_confbridge now has the ability to set the estimated bitrate on an
SFU bridge.  To use it, set a bridge profile's remb_behavior to "force"
and set remb_estimated_bitrate to a rate in bits per second.  The
remb_estimated_bitrate parameter is ignored if remb_behavior is something
other than "force".

Change-Id: Idce6464ff014a37ea3b82944452e56cc4d75ab0a
2020-10-02 08:04:31 -05:00
Sean Bright 4b5ed817bd app_voicemail.c: Document VMSayName interruption behavior
ASTERISK-26424 #close

Change-Id: I797ad0ed302d0b3d2c90543eff5b7207ed08ecf0
2020-10-02 08:02:54 -05:00
Kfir Itzhak c3a3ab8628 app_queue: Fix leave-empty not recording a call as abandoned
This fixes a bug introduced mistakenly in ASTERISK-25665:
If leave-empty is enabled, a call may sometimes be removed from
a queue without recording it as abandoned.
This causes Asterisk to not generate an abandon event for that
call, and for the queue abandoned counter to be incorrect.

ASTERISK-29043 #close

Change-Id: I1a71b81df78adff59af587f1d8483cf57df430c7
2020-09-01 10:48:19 -05:00
Sean Bright c925ed0eb9 app_voicemail: Process urgent messages with mailcmd
Rather than putting messages into INBOX and then moving them to Urgent
later, put them directly in to the Urgent folder. This prevents
mailcmd from being skipped.

ASTERISK-27273 #close

Change-Id: I49934e093290d308506ab8d45a40ef705c5ae4f5
2020-08-25 18:16:53 -05:00
Evandro César Arruda b2bd38a4f0 app_queue: Member lastpause time reseting
This fixes the reseting members lastpause problem when realtime members is being used,
the function rt_handle_member_record was forcing the reset members lastpause because it
does not exist in realtime

ASTERISK-29034 #close

Change-Id: Ic9107e4456732a1f78412a32adb2ef87f5da40b5
2020-08-25 17:34:27 -05:00
George Joseph 64ca2d48da scope_trace: Added debug messages and added additional macros
The SCOPE_ENTER and SCOPE_EXIT* macros now print debug messages
at the same level as the scope level.  This allows the same
messages to be printed to the debug log when AST_DEVMODE
isn't enabled.

Also added a few variants of the SCOPE_EXIT macros that will
also call ast_log instead of ast_debug to make it easier to
use scope tracing and still print error messages.

Change-Id: I7fe55f7ec28069919a0fc0b11a82235ce904cc21
2020-08-24 08:41:27 -05:00
George Joseph 647c53c41f ACN: Changes specific to the core
Allow passing a topology from the called channel back to the
calling channel.

 * Added a new function ast_queue_answer() that accepts a stream
   topology and queues an ANSWER CONTROL frame with it as the
   data.  This allows the called channel to indicate its resolved
   topology.

 * Added a new virtual function to the channel tech structure
   answer_with_stream_topology() that allows the calling channel
   to receive the called channel's topology.  Added
   ast_raw_answer_with_stream_topology() that invokes that virtual
   function.

 * Modified app_dial.c and features.c to grab the topology from the
   ANSWER frame queued by the answering channel and send it to
   the calling channel with ast_raw_answer_with_stream_topology().

 * Modified frame.c to automatically cleanup the reference
   to the topology on ANSWER frames.

Added a few debugging messages to stream.c.

Change-Id: I0115d2ed68d6bae0f87e85abcf16c771bdaf992c
2020-08-18 05:16:43 -05:00
Walter Doekes 312c23b0e1 app_queue: (Breaking change) shared_lastcall and autofill default to no
If your queues.conf had _no_ [general] section, they would default to
'yes'. Now, they always default to 'no'.

(Actually, commit ed615afb7e already
partially fixed it for shared_lastcall.)

ASTERISK-28951

Change-Id: Ic39d8a0202906bc454194368bbfbae62990fe5f6
2020-07-09 05:20:36 -05:00
George Joseph 9bd1d686a1 ACN: Add tracing to existing code
Prior to making any modifications to the pjsip infrastructure
for ACN, I've added the tracing functions to the existing code.
This should make the final commit easier to review, but we can also
now run a "before and after" trace.

No functional changes were made with this commit.

Change-Id: Ia83a1a2687ccb96f2bc8a2a3928a5214c4be775c
2020-07-08 09:24:42 -05:00
Joshua C. Colp 00a52b4752 app_stream_echo: Fix state of added streams.
When stream support was added to Asterisk the stream state
was used inconsistently, resulting in odd behavior. This
was then standardized to be the state of a stream from the
perspective of Asterisk.

This change updates the StreamEcho dialplan application
to use the correct state, send only, since we are only
sending to the endpoint and not expecting them to send us
multiple video streams.

ASTERISK-28954

Change-Id: I35bfd533ef1184ffe62586b22bbd253c82872a56
2020-06-19 09:15:44 -05:00
Walter Doekes db012e8cc6 app_queue: Remove stale code in try_calling
Because ring_entry() is not called, outgoing->chan is not touched here
either.

ASTERISK-28950
ASTERISK-28644

Change-Id: I564613715dfaf45af868251eb75a451f512af90f
2020-06-17 09:34:06 -05:00
Walter Doekes 0fb6738314 app_queue: Read latest wrapuptime instead of (possibly stale) copy
Before this changeset, it was possible that a queue member (agent) was
called even though they just got out of a call, and wrapuptime seconds
hadn't passed yet.

This could happen if a member ended a call _between_ a new call attempt
and asterisk trying that particular member for a new call.

In that case, Asterisk would check the hangup time of the
call-before-the-last-call instead of the hangup time of the-last-call.

ASTERISK-28952

Change-Id: Ie0cab8f0e8d639c01cba633d4968ba19873d80b3
2020-06-16 08:18:12 -05:00
George Joseph b9f42a717e app_confbridge: Plug ref leak of bridge channel with send_events
When send_events is enabled for a user, we were leaking a reference
to the bridge channel in confbridge_manager.c:send_message().  This
also caused the bridge snapshot to not be destroyed.

Change-Id: I87a7ae9175e3cd29f6d6a8750e0ec5427bd98e97
2020-06-10 11:03:04 -05:00
Kevin Harwell 3d1bf3c537 Compiler fixes for gcc 10
This patch fixes a few compile warnings/errors that now occur when using gcc
10+.

Also, the Makefile.rules check to turn off partial inlining in gcc versions
greater or equal to 8.2.1 had a bug where it only it only checked against
versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
any version above the specified version is correctly compared.

Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
2020-06-10 09:33:28 -05:00
traud 527e4f6542 app_osplookup: Avoid a format truncation.
Ensure that output buffers for the osp_convert_inout
function have sufficient space for additional data
such as brackets and ports.

ASTERISK-28804

Change-Id: Ie54c8241ff0cc653910539c2db00ff2a4869750b
2020-05-11 05:27:37 -05:00
Nathan Bruning f217fcdc62 app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions
Add a new "masquarade" channel event, and use it in app_queue to track unique id's.

Testcase is submitted as https://gerrit.asterisk.org/c/testsuite/+/14210

ASTERISK-28829 #close
ASTERISK-25844 #close

Change-Id: Ifc5f9f9fd70903f3c6e49738d3bc632b085d2df6
2020-05-06 04:10:26 -05:00
George Joseph 7baf2c4bf1 app_voicemail: Add workaround for a gcc 10 issue with -Wrestrict
The gcc 10 -Wrestrict option was causing "overlap" errors when
snprintf was copying one char[256] structure member to another
char[256] member in the same structure.

Using ast_alloca instead of declaring the structure inline
solves the issue.

Here's a link to the "enhancement":
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-10/msg00570.html

We may follow up with a gcc bug report.

Change-Id: Ie0099adcb0a9727bd9aa99e024dd912a67eaf534
2020-04-30 11:10:23 -05:00
Alexander Traud 26b8c99963 app_fax: SpanDSP headers do not use ast_malloc; ignore that.
Since Asterisk 14, app_fax did not compile at all because Asterisk
requires that not malloc but ast_malloc is used everywhere. However,
the system headers of SpanDSP use malloc. Because we cannot (and do
not need to) change system headers, let us ignore this.

ASTERISK-28848

Change-Id: I31f7a6b92a07032c5cef1c16b8901b107fe35546
2020-04-24 05:18:31 -05:00
Joshua C. Colp 6cfc6ff53c confbridge: Add support for disabling text messaging.
When in a conference bridge it may be necessary to have
text messages disabled for specific participants or for
all. This change adds a configuration option, "text_messaging",
which can be used to enable or disable this on the
user profile. By default existing behavior is preserved
as it defaults to "yes".

ASTERISK-28841

Change-Id: I30b5d9ae6f4803881d1ed9300590d405e392bc13
2020-04-20 12:03:22 -05:00
Alexander Traud 5c2b8fdeca app_getcpeid: Add build-time dependency.
ASTERISK-28838

Change-Id: I68b78e7e4718be82507247433127ce3992a5ba96
2020-04-20 11:03:46 -05:00
Jaco Kroon 4f92dcd66b dahdiras: Only set plugin dahdi.so to pppd if we're running as root.
Users of this should set plugin dahdi.so in their options file.

ASTERISK-16676

Change-Id: I6d01ad0a10e9fea477876d0941c3f38aac357e91
2020-03-25 17:24:30 -05:00
Joshua C. Colp 98d10d0a16 audiohook: Don't allow audiohooks to attach to hung up channels.
Given a scenario where MixMonitor was initiated over AMI it
was possible for the channel and MixMonitor thread to remain
alive past hang up of the channel. This scenario required
the AMI initiated MixMonitor to retrieve the channel, a
hangup to occur on the channel in another thread, and then
for MixMonitor to actually start. If this occurred the
MixMonitor thread would remain alive indefinitely and
the channel reference would remain.

This change ensures that audiohooks are never able to
be attached to channels that have been hung up. An
additional fix has also been done in app_mixmonitor to
properly release the channel reference if this occurs.

ASTERISK-28780

Change-Id: I8044c06daa06f0f16607788c596f55623be26f58
2020-03-13 09:56:40 -05:00
Kevin Harwell 2d9ecd9cd1 Merge "app_queue: Refactor odd placement of if's around say_position" 2020-02-27 14:42:44 -06:00
Kevin Harwell 999fdef335 Merge "app_mixmonitor: Turn on synchronization by default" 2020-02-27 13:17:19 -06:00
Walter Doekes 680e6b9774 app_queue: Refactor odd placement of if's around say_position
Change-Id: Icba97905e331812f129e5966e91a59b104c7a748
2020-02-25 11:00:45 +01:00
Sean Bright 8dcdce42a9 app_mixmonitor: Turn on synchronization by default
The optional synchronization behavior created in
64906c4c9b is now the default for
MixMonitor.

* Add a new flag 'n' that allows for this behavior to be turned off

* Add a notice when the 'S' option is used indicating that it is no
  longer necessary

Change-Id: I158987c475cda4e1ff1256dd0daccdd99df568b4
2020-02-18 09:48:33 -05:00
Sean Bright ddfb60ac2c app_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used
When opening a file for writing, Asterisk silently converts filenames
ending with 'wav49' to 'WAV.' We aren't taking that in to account when
setting the MIXMONITOR_FILENAME variable in MixMonitor.

* If the user wants to write to a wav49 file, make sure that it is
  reflected properly in MIXMONITOR_FILENAME.

* Add a note to the documentation describing this behavior.

* Add a note in main/file.c indicating that app_mixmonitor needs to be
  changed if the logic in build_filename was changed.

ASTERISK-24798 #close
Reported by: xrobau

Change-Id: I384691ce624eb55c80a125b9ca206d2d691c574c
2020-02-17 10:58:40 -06:00
Friendly Automation 95c6fbeae0 Merge "app_voicemail: Remove MessageExists and MESSAGE_EXISTS()" 2020-01-22 15:46:35 -06:00
Joshua Colp 64debbd13f Merge "app_voicemail, say: Fix various leading whitespace problems" 2020-01-20 10:07:13 -06:00
Joshua Colp 058e9f735e Merge "app_voicemail: Prevent crash when saving message with realtime voicemail" 2020-01-20 09:31:42 -06:00
Joshua Colp 2d17e25015 Merge "app_voicemail: Set globals to default values when voicemail.conf missing" 2020-01-17 08:37:34 -06:00
Sean Bright f09cf4da44 app_voicemail: Remove MessageExists and MESSAGE_EXISTS()
* The MailboxExists dialplan application was deprecated on 2006-09-26
  in Asterisk 1.6.0 (commit ec83b11183)

* The MAILBOX_EXISTS dialplan function was deprecated on 2011-12-06 in
  Asterisk 11.0.0 (commit fd64bb66f9)

Change-Id: I71cfc9d7b9217a37b802f4cc6ef2d57900b7398f
2020-01-16 16:39:04 -05:00
Sean Bright 5cbf47714a app_voicemail, say: Fix various leading whitespace problems
In af90afd90c, Japanese language support
was added to app_voicemail and main/say.c, but the leading whitespace
is not consistent with Asterisk coding guidelines. This patch fixes
that.

Whitespace only, no functional change.

ASTERISK~23324
Reported by: Kevin McCoy

Change-Id: I72c725f5930084673749bd7c9cc426a987f08e87
2020-01-16 13:55:32 -06:00
Sean Bright ba8ccb9132 app_voicemail: Prevent crash when saving message with realtime voicemail
ast_store_realtime() is not NULL tolerant, so we need to initialize
the field values we pass to it to the empty string to avoid a crash.

ASTERISK-23739 #close
Reported by: Stas Kobzar

Change-Id: I756c5dd0299c77f4274368f7c99eb0464367466c
2020-01-15 15:52:25 -06:00
Friendly Automation 4255277ffd Merge "feat: AudioSocket channel, application, and ARI support." 2020-01-15 07:22:08 -06:00
Friendly Automation c665878e92 Merge "app_queue: Deprecate the QueueMemberPause.Reason field" 2020-01-15 06:42:24 -06:00
Sean Bright 9be89d9913 app_voicemail: Set globals to default values when voicemail.conf missing
If voicemail.conf exists but is empty, the config parsing process will
default a number of global variables to non-zero values. On the other
hand, if voicemail.conf is missing (arguably semantically equivalent
to an empty file), this process is skipped and the globals are
defaulted to 0.

Set the globals to the same values they would be set to if a
configuration were present. This allows voicemail configuration to be
done completely by Realtime without the need to create an empty
voicemail.conf file.

ASTERISK-27622 #close
Reported by: Jim Van Meggelen

Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409
2020-01-14 16:31:49 -06:00
Seán C McCord 163efbd724 feat: AudioSocket channel, application, and ARI support.
This commit adds support for
[AudioSocket](
https://wiki.asterisk.org/wiki/display/AST/AudioSocket),
a very simple bidirectional audio streaming protocol. There are both
channel and application interfaces.

A description of the protocol can be found on the above referenced
GitHub page.  A short talk about the reasons and implementation can be
found on [YouTube](https://www.youtube.com/watch?v=tjduXbZZEgI), from
CommCon 2019.

ARI support has also been added via the existing "externalMedia" ARI
functionality. The UUID is specified using the arbitrary "data" field.

ASTERISK-28484 #close

Change-Id: Ie866e6c4fa13178ec76f2a6971ad3590a3a588b5
2020-01-14 09:36:44 -06:00
Joshua Colp f6f678fe7d Merge "app_record: Do not hang up if beep audio is missing" 2020-01-14 09:10:30 -06:00
Sean Bright 9522390a69 app_queue: Deprecate the QueueMemberPause.Reason field
The QueueMemberPause AMI event includes two fields that return the
reason a member was paused.

* In release branches, deprecate Reason in favor of PausedReason.
* In master, remove the Reason field entirely.

ASTERISK-28349 #close
Reported by: Niksa Baldun

Change-Id: I01da58f2b0ab927baeee754870f62b51b7b3d296
2020-01-12 11:07:49 -06:00
Corey Farrell 2f8b20b949 app_record: Do not hang up if beep audio is missing
Additionally alter the warning to mention that it was "beep" which could
not be streamed to give admins a better clue about what the warning
means.

ASTERISK-28682

Change-Id: If5aed21226a173117ed17589f44826dd1ba6576e
2020-01-09 05:33:06 -06:00
Kevin Harwell 00a7432156 app_agent_pool: Update XML docs for AgentLogin
This patch fixes some wrongly formatted documentation for the AgentLogin
application. A couple of "see also" links should contain only the function
name, and no parameters.

Change-Id: I3f788b47dce3292e311f8a9856938d59a0bd0661
2020-01-08 14:02:05 -06:00
George Joseph a4fd89536d Merge "app_bridgeaddchan.c: Make BridgeAdd be more like Bridge" 2020-01-07 14:29:27 -06:00
George Joseph 6b7334a311 Merge "app_chanisavail.c: Simplify dialplan using ChanIsAvail." 2020-01-07 14:28:55 -06:00
Friendly Automation 5b815fe1ac Merge "app_dial.c: Simplify dialplan using Dial." 2020-01-07 11:48:57 -06:00
Friendly Automation 5050c45e06 Merge "app_page.c: Simplify dialplan using Page." 2020-01-07 11:40:57 -06:00
Joshua Colp b2664fd3a4 Merge "app_softhangup.c: Reduce unnecessary warning to verbose message." 2020-01-07 11:14:48 -06:00
Richard Mudgett fe3cce816c app_chanisavail.c: Simplify dialplan using ChanIsAvail.
Dialplan has to be careful about passing an empty device list or empty
positions in the list.  As a result, dialplan has to check for these
conditions before using ChanIsAvail.  Simplify dialplan by making
ChanIsAvail handle these conditions gracefully.

* Made tolerate empty positions in the device list.

* Simplified the code and eliminated some unnecessary indention.

ASTERISK-28638

Change-Id: I9e4b67e2cbf26b2417c2d03485b8568e898931d3
2020-01-06 19:11:58 -06:00
Richard Mudgett 19069f7db7 app_bridgeaddchan.c: Make BridgeAdd be more like Bridge
* Made BridgeAdd not hangup the call if there is a problem.
* Reduced message level from warning to verbose for normal exception
cases.
* Added a loop safety check to BridgeAdd.
* Made BridgeAdd set BRIDGERESULT with the status when dialplan is
resumed.

Change-Id: I374d39b8a3edcc794eeb5c6b9f31a01424cdc426
2020-01-05 21:32:01 -06:00
Richard Mudgett abcb4ab321 app_dial.c: Simplify dialplan using Dial.
Dialplan has to be careful about passing an empty destination list or
empty positions in the list.  As a result, dialplan has to check for
these conditions before using Dial.  Simplify dialplan by making Dial
handle these conditions gracefully.

* Made tolerate empty positions in the dialed device list.

* Reduced some message log levels from notice to verbose.

ASTERISK-28638

Change-Id: I6edc731aff451f8bdfaee5498078dd18c3a11ab9
2020-01-05 21:24:27 -06:00
Richard Mudgett d86a6ac5ce app_page.c: Simplify dialplan using Page.
Dialplan has to be careful about passing an empty destination list or
empty positions in the list.  As a result, dialplan has to check for
these conditions before using Page.  Simplify dialplan by making Page
handle these conditions gracefully.

* Made tolerate empty positions in the paged device list.

* Reduced some warnings associated with the 's' option to verbose
messages.  The warning level for those messages really serves no purpose
as that is why the 's' option exists.

ASTERISK-28638

Change-Id: I95b64a6d6800cd1a25279c88889314ae60fc21e3
2020-01-05 21:21:21 -06:00
Richard Mudgett 0d1f3d9bf3 app_chanspy.c: Reduce log message level from notice to verbose.
Change-Id: Ica5f38ccd8cdc077aef14d0c50425e0b29ac7e0a
2020-01-05 21:13:11 -06:00
Richard Mudgett a457947198 app_softhangup.c: Reduce unnecessary warning to verbose message.
Why log a warning for something your dialplan explicitly asked for?

Change-Id: I167b90daf4c7d75dd4b7ef94849f6cef05aa43a7
2020-01-05 21:09:03 -06:00
Joshua C. Colp d21427cadd Merge "app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR." 2019-12-19 18:40:11 -06:00
Frederic LE FOLL a83625b366 app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.
Temporary channel lifespan is very short and CDR deactivation request
through ast_cdr_set_property() may happen when CDR is not available
yet. Use CDR_PROP() dialplan function instead, it will first wait
for pending CDR insertion requests to be processed.

ASTERISK-28636

Change-Id: I1cbe09e8d2169c0962c1195133ff260d291f2074
2019-12-16 15:02:49 -06:00
Joshua C. Colp 89b7144fbd confbridge: Add support for specifying maximum sample rate.
ConfBridge has the ability to move between different sample
rates for mixing the conference bridge. Up until now there has
only been the ability to set the conference bridge to mix at
a specific sample rate, or to let it move between sample rates
as necessary. This change adds the ability to configure a
conference bridge with a maximum sample rate so it can move
between sample rates but only up to the configured maximum.

ASTERISK-28658

Change-Id: Idff80896ccfb8a58a816e4ce9ac4ebde785963ee
2019-12-16 09:54:21 -06:00
Walter Doekes 0e750cdd10
app_queue: Fix old confusing comment about when the members are called
ASTERISK-28644

Change-Id: I2771a931d00a8fc2b9f9a4d1a33ea8f1ad24e06b
2019-12-04 10:33:44 +01:00
George Joseph 6f82430b03 Merge "app_senddtmf: Add receive mode to AMI Action PlayDTMF" 2019-11-21 09:18:54 -06:00
Michael Cargile 5bda460300 app_amd: Fixed timeout issue
ASTERISK_28143 attempted to fix an issue where calls with no audio would never
timeout. It did so by adding AST_FRAME_NULL as a frame type to process in its
calculations. Unfortunately these frames seem to show up at irregular time
intervals. This resulted in app_amd returning prematurely most of the time.

* Removed AST_FRAME_NULL from the calculations
* Added a check to see how much time has actually passed since app_amd began

ASTERISK-28608

Change-Id: I642a21b02d389b17e40ccd5357754b034c3daa42
2019-11-19 10:07:44 -05:00
lvl 772b59034f app_senddtmf: Add receive mode to AMI Action PlayDTMF
ASTERISK-28614

Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664
2019-11-18 18:09:13 -05:00
Kevin Harwell bdd785d31c various files - fix some alerts raised by lgtm code analysis
This patch fixes several issues reported by the lgtm code analysis tool:

https://lgtm.com/projects/g/asterisk/asterisk

Not all reported issues were addressed in this patch. This patch mostly fixes
confirmed reported errors, potential problematic code points, and a few other
"low hanging" warnings or recommendations found in core supported modules.
These include, but are not limited to the following:

* innapropriate stack allocation in loops
* buffer overflows
* variable declaration "hiding" another variable declaration
* comparisons results that are always the same
* ambiguously signed bit-field members
* missing header guards

Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
2019-11-18 08:30:45 -06:00
George Joseph a47cb71bb1 Build: Fix compile issues with seldom used modules
The following modules needed tweaks for API changes.

addons/cdr_mysql.c
addons/chan_ooh323.c
apps/app_meetme.c

ASTERISK-28604

Change-Id: Ib40e513ae55b5114be035cdc929abb6a8ce2d06d
2019-11-07 08:31:53 -05:00
cmaj 2d67dbfef5 app_voicemail.c: Support multiple file formats for forwarded messages.
If you specify multiple formats in voicemail.conf, eg. "format = gsm|wav"
and are using realtime ODBC backend, only the first format gets stored
in the database. So when you forward a message later on, there is a bug
generating the email, related to the stored format (GSM) being different
than the desired email format (WAV) specified for the user. Sox can
handle this, but Asterisk needs to tell sox exactly what to do.

ASTERISK-22192

Change-Id: I7321e7f7e7c58adbf41dd4fd7191c887b9b2eafd
2019-10-14 17:20:01 -05:00
Sean Bright 7362647e2f Revert "app_voicemail: Cleanup stale lock files on module load"
This reverts commit fd2e8d0da7.

Reason for revert: Problematic for users who store their voicemail
on network storage devices, or share voicemail storage between
multiple Asterisk instances.

ASTERISK-28567 #close

Change-Id: I3ff4ca983d8e753fe2971f3439bd154705693c41
2019-10-08 06:35:05 -05:00
Corey Farrell 863fe2225f app_voicemail: Fix module unload leak.
Change-Id: Ib9a06565b9a178822d3bbb67eccf51432e12d84a
2019-09-19 11:16:14 -05:00
Frederic LE FOLL 2d0eee5418 ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf.
ChanIsAvail() creates a temporary channel with ast_request() to test
resource availability. It should not generate a CDR when it hangs up
this temporary channel.

This patch disables CDR generation for the temporary channel with
ast_cdr_set_property().

ASTERISK-28527

Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1
2019-09-10 11:45:37 -05:00
Sean Bright 64906c4c9b audiohook.c: Substitute silence for unavailable audio frames
There are 4 scenarios to consider when capturing audio from a channel
with an audiohook:

 1. There is no rx and no tx audio, so return nothing.
 2. There is rx but no tx audio, so return rx.
 3. There is tx but no rx audio, so return tx.
 4. There is rx and tx audio, so mix them and return.

The file passed as the primary argument to MixMonitor will be written to
in scenarios 2, 3, and 4. However, if you pass the r() and t() options
to MixMonitor, a frame will only be written to the r() file if there was
rx audio and a frame will only be written to the t() file if there was
tx audio.

If you subsequently take the r() and t() files and try to mix them, the
sides of the conversation will 'drift' and be non-representative of the
user experience.

This patch adds a new 'S' option to MixMonitor that injects a frame of
silence on either the r() side or the t() side of the channel so that
when later mixed, there is no such drift.

Change-Id: Ibf5ed73a811087727bd561a89a59f4447b4ee20e
2019-08-20 08:44:00 -05:00
Alexei Gradinari 15624d9a7a app_voicemail/IMAP: check mailstream not NULL in leave_voicemail
The function leave_voicemail checks if expungeonhangup is set,
but does not check if IMAP stream is closed,
so it could call imap function with NULL stream.
This leads to segfault.

ASTERISK-28505 #close

Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c
2019-08-15 09:47:24 -05:00
George Joseph 53c9e7962f Merge "app_voicemail: Remove extra menuselect build options" 2019-08-08 07:25:29 -05:00
Sean Bright 9d07d5a6d6 app_voicemail: Remove extra menuselect build options
You now select voicemail backends like normal dialplan applications, so
there is no longer a need for their own menuselect category.

Reported by snuff-work in #asterisk-dev

Change-Id: Idfa4c9c8349726074318a9e6b68d24c374521005
2019-08-06 07:22:27 -06:00
Kevin Harwell 3656c42cb0 various modules: json integer overflow
There were still a few places in the code that could overflow when "packing"
a json object with a value outside the base type integer's range. For instance:

unsigned int value = INT_MAX + 1
ast_json_pack("{s: i}", value);

would result in a negative number being "packed". In those situations this patch
alters those values to a ast_json_int_t, which widens the value up to a long or
long long.

ASTERISK-28480

Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1
2019-08-01 15:31:48 -06:00
Kevin Harwell c93c579190 app_voicemail: Remove dependency on the stasis cache
app_voicemail utilized the stasis cache when polling mailboxes for MWI. This
caused a memory leak (items were not being appropriately removed from the
cache), and subsequent slowdown in system processing. This patch removes the
stasis cache dependency, thus alleviating the memory leak. It does this by
utilizing the new MWI API that better manages state lifetime.

ASTERISK-28443
ASTERISK-27121

Change-Id: Ie89fedaca81ea1fd03d150d9d3a1ef3d53740e46
2019-07-09 09:36:26 -05:00
Chris-Savinovich 6b1f6ea2c4 app_voicemail.c: Build all three variants for app_voicemail at the same time
Changes made to apps/Makefile to optionally build all three app_voicemail
variations at the same time: 1) file (default), 2) odbc, and 3) imap.
This functionality was requested by users. modules.conf.sample warns the
user to make sure only one voicemail is loaded at a time.

Change-Id: Iba3cd8ffb4b7e8b1c64a11dd383e1eafcd3ed0e7
2019-06-28 07:32:03 -06:00
Kevin Harwell cfdb567425 Merge "app_amd: issue with silence suppression fixed" 2019-06-27 11:33:22 -05:00
Nasir Iqbal 29bc7cf6b3 app_amd: issue with silence suppression fixed
Now AMD algorithm will not ignore AST_FRAME_NULL, As I think using manual
wait time instead of `framelength` is enough to fix timeout / TOOLONG issue.

ASTERISK-28419 #close

Change-Id: I16ea2d6295bc99b975e8c092e5f9fbd9214debdb
2019-06-20 23:45:03 -06:00
George Joseph f3e5419d41 app_confbridge: Attended transfer event fixup
When a channel already in a conference bridge is attended transfered
to another extension, or when an existing call is attended
transferred into a conference bridge, we now generate ConfbridgeJoin
and ConfbridgeLeave events for the entering and departing channels.

Change-Id: Id7709cfbceb26fbcb828b2d0d2a6b2fbeaf028e1
2019-06-13 14:07:16 -06:00
George Joseph 93ccff25c6 Merge "app_attended_transfer: new application AttendedTransfer" 2019-06-12 10:44:06 -05:00
Alexei Gradinari 3eaeb3e6c4 app_attended_transfer: new application AttendedTransfer
AttendedTransfer queues up attended transfer to the given extension.

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

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

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=my_atxfer
TRANSFER_CONTEXT=my_transfer

[my_atxfer]
exten => s,1,AttendedTransfer(1234567890)
   same => n,Return()

[my_transfer]
include => default
;;;

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

features.conf
;;;
[featuremap]
atxfer => *7

[applicationmap]
custom_atxfer => *2,self,GoSub,"custom_atxfer,s,1",default
;;;

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=custom_atxfer
TRANSFER_CONTEXT=my_transfer

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

[my_transfer]
include => default
;;;

Change-Id: Ie5cfa455d0813cffd5c85a6fb117f07d8f0b903b
2019-06-11 08:17:06 -06:00
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