Commit Graph

33843 Commits

Author SHA1 Message Date
George Joseph 7c917618f4 .github: Add cherry-pick reminder to new PRs 2023-05-15 09:37:38 -06:00
Jaco Kroon 0e6295128c
configure: fix test code to match gethostbyname_r prototype. (#75)
This enables the test to work with CC=clang.

Without this the test for 6 args would fail with:

utils.c:99:12: error: static declaration of 'gethostbyname_r' follows non-static declaration
static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
           ^
/usr/include/netdb.h:177:12: note: previous declaration is here
extern int gethostbyname_r (const char *__restrict __name,
           ^

Fixing the expected return type to int sorts this out.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2023-05-15 06:50:36 -06:00
Sean Bright ae6b56e357
res_pjsip_pubsub.c: Use pjsip version for pending NOTIFY check. (#47)
The functionality we are interested in is present only in pjsip 2.13
and newer.

Resolves: #45
2023-05-11 14:23:49 -06:00
zhengsh c8ce2c705d
res_sorcery_memory_cache.c: Fix memory leak (#56)
Replace the original call to ast_strdup with a call to ast_strdupa to fix the leak issue.

Resolves: #55
ASTERISK-30429
2023-05-11 14:21:57 -06:00
Sean Bright f414815159
utils.h: Deprecate `ast_gethostbyname()`. (#79)
Deprecate `ast_gethostbyname()` in favor of `ast_sockaddr_resolve()` and
`ast_sockaddr_resolve_first_af()`. `ast_gethostbyname()` has not been
used by any in-tree code since 2021.

This function will be removed entirely in Asterisk 23.

Resolves: #78

UpgradeNote: ast_gethostbyname() has been deprecated and will be removed
in Asterisk 23. New code should use `ast_sockaddr_resolve()` and
`ast_sockaddr_resolve_first_af()`.
2023-05-11 13:05:49 -06:00
Sean Bright d59a8ef59e
xml.c: Process XML Inclusions recursively. (#69)
If processing an XInclude results in new <xi:include> elements, we
need to run XInclude processing again. This continues until no
replacement occurs or an error is encountered.

There is a separate issue with dynamic strings (ast_str) that will be
addressed separately.

Resolves: #65
2023-05-11 13:03:33 -06:00
Joshua C. Colp 172a1a9d0c .github: Tweak improvement issue type language. 2023-05-09 10:47:05 -03:00
Gitea 60ca49d288 .github: Tweak new feature language, and move feature requests elsewhere. 2023-05-09 10:42:45 -03:00
Joshua C. Colp eec85c672c .github: Fix staleness check to only run on certain labels. 2023-05-09 06:17:17 -03:00
George Joseph 857bc88d14 .github: Add AsteriskReleaser 2023-05-08 11:01:07 -06:00
Henning Westerholt 1a7866b172
chan_pjsip: also return all codecs on empty re-INVITE for late offers (#59)
We should also return all codecs on an re-INVITE without SDP for a
call that used late offer (e.g. no SDP in the initial INVITE, SDP
in the ACK). Bugfix for feature introduced in ASTERISK-30193
(https://issues.asterisk.org/jira/browse/ASTERISK-30193)

Migration from previous gerrit change that was not merged.
2023-05-04 08:55:37 -06:00
Mike Bradeen cd48733353
cel: add local optimization begin event (#54)
The current AST_CEL_LOCAL_OPTIMIZE event is and has been
triggered on a local optimization end to serve as a flag
indicating the event occurred.  This change adds a second
AST_CEL_LOCAL_OPTIMIZE_BEGIN event for further detail.

Resolves: #52

UpgradeNote: The existing AST_CEL_LOCAL_OPTIMIZE can continue
to be used as-is and the AST_CEL_LOCAL_OPTIMIZE_BEGIN event
can be ignored if desired.

UserNote: The new AST_CEL_LOCAL_OPTIMIZE_BEGIN can be used
by itself or in conert with the existing
AST_CEL_LOCAL_OPTIMIZE to book-end local channel optimizaion.
2023-05-04 08:51:55 -06:00
Sean Bright 0d6b271831
core: Cleanup gerrit and JIRA references. (#58)
* Remove .gitreview and switch to pulling the main asterisk branch
  version from configure.ac instead.

* Replace references to JIRA with GitHub.

* Other minor cleanup found along the way.

Resolves: #39
2023-05-03 09:37:57 -06:00
George Joseph f5168354cb .github: Fix CherryPickTest to only run when it should
Fixed CherryPickTest so it triggers only on the
"cherry-pick-test" label instead of all labels.
2023-05-03 09:27:57 -06:00
George Joseph 676cfc3d5a .github: Fix reference to CHERRY_PICK_TESTING_IN_PROGRESS 2023-05-02 14:09:47 -06:00
George Joseph 79a383ebc6 .github: Remove separate set labels step from new PR 2023-05-02 12:11:24 -06:00
George Joseph 06c6a8b064 .github: Refactor CP progress and add new PR test progress 2023-05-02 12:04:26 -06:00
Maximilian Fridrich cacd98bb29
res_pjsip: mediasec: Add Security-Client headers after 401 (#49)
When using mediasec, requests sent after a 401 must still contain the
Security-Client header according to
draft-dawes-sipcore-mediasec-parameter.

Resolves: #48
2023-05-02 09:18:42 -06:00
George Joseph 65fa8d6009 .github: Add cherry-pick test progress labels 2023-05-02 08:56:59 -06:00
Joshua C. Colp 7526d1d6c1
LICENSE: Update link to trademark policy. (#44)
Resolves: #43
2023-05-02 08:17:00 -06:00
InterLinked1 ffb90c4549
say.c: Fix French time playback. (#42)
ast_waitstream was not called after ast_streamfile,
resulting in "o'clock" being skipped in French.

Additionally, the minute announcements should be
feminine.

Reported-by: Danny Lloyd

Resolves: #41
ASTERISK-30488
2023-05-02 08:09:42 -06:00
Naveen Albert 9a999242b2 chan_dahdi: Add dialmode option for FXS lines.
Currently, both pulse and tone dialing are always enabled
on all FXS lines, with no way of disabling one or the other.

In some circumstances, it is desirable or necessary to
disable one of these, and this behavior can be problematic.

A new "dialmode" option is added which allows setting the
methods to support on a per channel basis for FXS (FXO
signalled lines). The four options are "both", "pulse",
"dtmf"/"tone", and "none".

Additionally, integration with the CHANNEL function is
added so that this setting can be updated for a channel
during a call.

Resolves: #35
ASTERISK-29992

UserNote: A "dialmode" option has been added which allows
specifying, on a per-channel basis, what methods of
subscriber dialing (pulse and/or tone) are permitted.

Additionally, this can be changed on a channel
at any point during a call using the CHANNEL
function.
2023-05-02 14:06:28 +00:00
George Joseph 1b95f6ee3f .github: Update issue templates 2023-05-01 09:37:29 -06:00
George Joseph 11ce72fc8a .github: Remove unnecessary parameter in CherryPickTest 2023-05-01 06:48:32 -06:00
George Joseph f50cc8852d Initial GitHub PRs 2023-04-28 12:31:03 -06:00
George Joseph eaec5a35dc Initial GitHub Issue Templates 2023-04-28 11:22:53 -06:00
Joshua C. Colp 21c07cf6e1 pbx_dundi: Fix PJSIP endpoint configuration check.
ASTERISK-28233

Change-Id: I0f11c096b307a6178e22ca49d9c756343f0e1fdc
2023-04-13 03:36:57 -06:00
Joshua Colp 4ec4543332 Revert "app_queue: periodic announcement configurable start time."
This reverts commit 71e317f68f.

Reason for revert: Causes segmentation fault.

Change-Id: I3beeda83249bffec2a8f246aa50a6b2f1b59ef59
2023-04-12 04:50:57 -05:00
Naveen Albert 0119f3ad48 res_pjsip_stir_shaken: Fix JSON field ordering and disallowed TN characters.
The current STIR/SHAKEN signing process is inconsistent with the
RFCs in a couple ways that can cause interoperability issues.

RFC8225 specifies that the keys must be ordered lexicographically, but
currently the fields are simply ordered according to the order
in which they were added to the JSON object, which is not
compliant with the RFC and can cause issues with some carriers.

To fix this, we now leverage libjansson's ability to dump a JSON
object sorted by key value, yielding the correct field ordering.

Additionally, telephone numbers must have any leading + prefix removed
and must not contain characters outside of 0-9, *, and # in order
to comply with the RFCs. Numbers are now properly formatted as such.

ASTERISK-30407 #close

Change-Id: Iab76d39447c4b8cf133de85657dba02fda07f9a2
2023-04-10 17:31:07 -05:00
Naveen Albert ecf49ff746 pbx_dundi: Add PJSIP support.
Adds PJSIP as a supported technology to DUNDi.

To facilitate this, we now allow an endpoint to be specified
for outgoing PJSIP calls. We also allow users to force a specific
channel technology for outgoing SIP-protocol calls.

ASTERISK-28109 #close
ASTERISK-28233 #close

Change-Id: I2e28e5a5d007bd49e3df113ad567b011103899bf
2023-04-10 14:38:51 -05:00
Henning Westerholt 58e88dec90 chan_pjsip: fix music on hold continues after INVITE with replaces
In a three party scenario with INVITE with replaces, we need to
unhold the call, otherwise one party continues to get music on
hold, and the call is not properly bridged between them.

ASTERISK-30428

Change-Id: I5675df11e739be5226b328f8828d4b8d81fbefb4
2023-04-10 13:35:55 -05:00
The_Blode 0c50ab0d4f install_prereq: Add Linux Mint support.
ASTERISK-30359 #close

Change-Id: I9c140c7f12ca7dafe65c317f2a26122cf2c72556
2023-04-10 13:05:47 -05:00
Naveen Albert eadf28a476 voicemail.conf: Fix incorrect comment about #include.
A comment at the top of voicemail.conf says that #include
cannot be used in voicemail.conf because this breaks
the ability for app_voicemail to auto-update passwords.
This is factually incorrect, since Asterisk has no problem
updating files that are #include'd in the main configuration
file, and this does work in voicemail.conf as well.

ASTERISK-30479 #close

Change-Id: I3bf7d275849ab83f55f7fb6702a75a3077ee1df3
2023-04-10 12:05:06 -05:00
Naveen Albert fa41458298 app_queue: Fix minor xmldoc duplication and vagueness.
The F option in the xmldocs for the Queue application
was erroneously duplicated, causing it to display
twice on the wiki. The two sections are now merged into one.

Additionally, the description for the d option was quite
vague. Some more details are added to provide context
as to what this actually does.

ASTERISK-30486 #close

Change-Id: I6706cea708b5cc781f59f8652c2cb377e55aed7e
2023-04-10 11:01:47 -05:00
George Joseph 1245e3330b test.c: Fix counting of tests and add 2 new tests
The unit test XML output was counting all registered tests as "run"
even when only a subset were actually requested to be run and
the "failures" attribute was missing.

* The "tests" attribute of the "testsuite" element in the
  output XML now reflects only the tests actually requested
  to be executed instead of all the tests registered.

* The "failures" attribute was added to the "testsuite"
  element.

Also added 2 new unit tests that just pass and fail to be
used for CI testing.

Change-Id: Ia137814b5aeb0e1a44c75034bd3615c26021da69
2023-04-03 07:41:08 -06:00
Mike Bradeen e494a55467 res_pjsip_pubsub: subscription cleanup changes
There are two main parts of the change associated with this
commit. These are driven by the change in call order of
pubsub_on_rx_refresh and pubsub_on_evsub_state by pjproject
when an in-dialog SUBSCRIBE is received.

First, the previous behavior was for pjproject to call
pubsub_on_rx_refresh before calling pubsub_on_evsub_state
when an in-dialog SUBSCRIBE was received that changes the
subscription state.

If that change was a termination due to a re-SUBSCRIBE with
an expires of 0, we used to use the call to pubsub_on_rx_refresh
to set the substate of the evsub to TERMINATE_PENDING before
pjproject could call pubsub_on_evsub_state.

This substate let pubsub_on_evsub_state know that the
subscription TERMINATED event could be ignored as there was
still a subsequent NOTIFY that needed to be generated and
another call to pubsub_on_evsub_state to come with it.

That NOTIFY was sent via serialized_pubsub_on_refresh_timeout
which would see the TERMINATE_PENDING state and transition it
to TERMINATE_IN_PROGRESS before triggering another call to
pubsub_on_evsub_state (which now would clean up the evsub.)

The new pjproject behavior is to call pubsub_on_evsub_state
before pubsub_on_rx_refresh. This means we no longer can set
the state to TERMINATE_PENDING to tell pubsub_on_evsub_state
that it can ignore the first TERMINATED event.

To handle this, we now look directly at the event type,
method type and the expires value to determine whether we
want to ignore the event or use it to trigger the evsub
cleanup.

Second, pjproject now expects the NOTIFY to actually be sent
during pubsub_on_rx_refresh and avoids the protocol violation
inherent in sending a NOTIFY before the SUBSCRIBE is
acknowledged by caching the sent NOTIFY then sending it
after responding to the SUBSCRIBE.

This requires we send the NOTIFY using the non-serialized
pubsub_on_refresh_timeout directly and let pjproject handle
the protocol violation.

ASTERISK-30469

Change-Id: I05c1d91a44fe28244ae93faa4a2268a3332b5fd7
2023-04-03 08:06:13 -05:00
Jaco Kroon 3d86701a86 res_calendar: output busy state as part of show calendar.
Change-Id: I894e4ecc3e93db4ff7783d46266ba3c5e6ccda10
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2023-04-03 08:02:03 -05:00
Sean Bright acd1513111 ael: Regenerate lexers and parsers.
Various changes to ensure that the lexers and parsers can be correctly
generated when REBUILD_PARSERS is enabled.

Some notes:

* Because of the version of flex we are using to generate the lexers
  (2.5.35) some post-processing in the Makefile is still required.

* The generated lexers do not contain the problematic C99 check that
  was being replaced by the call to sed in the respective Makefiles so
  it was removed.

* Since these files are generated, they will include trailing
  whitespace in some places. This does not need to be corrected.

Change-Id: Ibbd343606fcf5c0d285b1599e6e8e59f514f2e4e
2023-04-03 07:58:23 -05:00
Sean Bright 7dc73c8151 loader.c: Minor module key check simplification.
Change-Id: I65aefd4434a783096165c179b5f94f2e4810dffe
2023-04-03 07:11:36 -05:00
Sean Bright 03e7bbbce9 Revert "pbx_ael: Global variables are not expanded."
This reverts commit c448dcd2f0.

Reason for revert: Behavior change that breaks existing dialplan.

ASTERISK-30472 #close

Change-Id: I20e44b4081d6ee0fe54cde44ac71dcf2d146f909
2023-03-24 07:15:12 -05:00
Mike Bradeen edd7f1b060 bridge_builtin_features: add beep via touch variable
Add periodic beep option to one-touch recording by setting
the touch variable TOUCH_MONITOR_BEEP or
TOUCH_MIXMONITOR_BEEP to the desired interval in seconds.

If the interval is less than 5 seconds, a minimum of 5
seconds will be imposed.  If the interval is set to an
invalid value, it will default to 15 seconds.

A new test event PERIODIC_HOOK_ENABLED was added to the
func_periodic_hook hook_on function to indicate when
a hook is started.  This is so we can test that the touch
variable starts the hook as expected.

ASTERISK-30446

Change-Id: I800e494a789ba7a930bbdcd717e89d86040d6661
2023-03-20 10:46:17 -05:00
Mike Bradeen c4a55322bc res_mixmonitor: MixMonitorMute by MixMonitor ID
While it is possible to create multiple mixmonitor instances
on a channel, it was not previously possible to mute individual
instances.

This change includes the ability to specify the MixMonitorID
when calling the manager action: MixMonitorMute.  This will
allow an individual MixMonitor instance to be muted via id.
This id can be stored as a channel variable using the 'i'
MixMonitor option.

As part of this change, if no MixMonitorID is specified in
the manager action MixMonitorMute, Asterisk will set the mute
flag on all MixMonitor spy-type audiohooks on the channel.
This is done via the new audiohook function:
ast_audiohook_set_mute_all.

ASTERISK-30464

Change-Id: Ibba8c7e750577aa1595a24b23316ef445245be98
2023-03-20 09:29:23 -05:00
Mike Bradeen 9504d17ad2 format_sln: add .slin as supported file extension
Adds '.slin' to existing supported file extensions:
.sln and .raw

ASTERISK-30465

Change-Id: Ice848addc03a64c8404b87cb5d3b13399c57e496
2023-03-16 12:47:34 -06:00
Mike Bradeen 76da3c71a7 cli: increase channel column width
For 'core show channels', the Channel name field is increased
to 64 characters and the Location name field is increased to
32 characters.

For 'core show channels verbose', the Channel name field is
increased to 80 characters, the Context is increased to 24
characters and the Extension is increased to 24 characters.

ASTERISK-30455

Change-Id: Ibec3742ce360ffc93bc56e9984c2a21dabc4d5e1
2023-03-16 10:44:13 -05:00
Jaco Kroon 71e317f68f app_queue: periodic announcement configurable start time.
This newly introduced periodic-announce-startdelay makes it possible to
configure the initial start delay of the first periodic announcement
after which periodic-announce-frequency takes over.

ASTERISK-30437 #close
Change-Id: Ia79984b6377ef78f167ad9ea2ac084bec29955d0
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2023-03-16 10:43:38 -05:00
Naveen Albert 907692abb3 app_osplookup: Remove obsolete sample config.
ASTERISK_30302 previously removed app_osplookup,
but its sample config was not removed.
This removes it since nothing else uses it.

ASTERISK-30438 #close

Change-Id: Ife234208f5f197644475db4ab1af95a8551642fd
2023-03-16 10:42:51 -05:00
Naveen Albert ff6c293ec0 func_json: Fix JSON parsing issues.
Fix issue with returning empty instead of dumping
the JSON string when recursing.

Also adds a unit test to capture this fix.

ASTERISK-30441 #close

Change-Id: If0bde9f3fe84f7af485e0838205cc21e0f752a85
2023-03-16 10:42:41 -05:00
Naveen Albert 95a41d231f app_dial: Fix DTMF not relayed to caller on unanswered calls.
DTMF frames are not handled in app_dial when sent towards the
caller. This means that if DTMF is sent to the calling party
and the call has not yet been answered, the DTMF is not audible.
This is now fixed by relaying DTMF frames if only a single
destination is being dialed.

ASTERISK-29516 #close

Change-Id: Iafd7430ac2915126d42dc48f0b73b262452ee027
2023-03-16 10:40:58 -05:00
Fabrice Fontaine faf58ccc70 configure: fix detection of re-entrant resolver functions
uClibc does not provide res_nsearch:
asterisk-16.0.0/main/dns.c:506: undefined reference to `res_nsearch'

Patch coded by Yann E. MORIN:
http://lists.busybox.net/pipermail/buildroot/2018-October/232630.html

ASTERISK-21795 #close

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[Retrieved from:
https: //git.buildroot.net/buildroot/tree/package/asterisk/0005-configure-fix-detection-of-re-entrant-resolver-funct.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Change-Id: I79296f19e28ec764bbd1e991bf11c416d0b10563
2023-03-16 10:20:19 -05:00
Sean Bright 76a2b2703f res_agi: RECORD FILE plays 2 beeps.
Sending the "RECORD FILE" command without the optional
`offset_samples` argument can result in two beeps playing on the
channel.

This bug has been present since Asterisk 0.3.0 (2003-02-06).

ASTERISK-30457 #close

Change-Id: I95e88aa59378784d7f0eb648843f090e6723b787
2023-03-16 09:22:09 -05:00