Commit Graph

5115 Commits

Author SHA1 Message Date
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