Commit Graph

31985 Commits

Author SHA1 Message Date
sungtae kim
5815597a21 stasis.c: Added topic_all container
Added topic_all container for centralizing the topic. This makes more
easier to managing the topics.

Added cli commands.
stasis show topics : It shows all registered topics.
stasis show topic <name> : It shows speicifed topic's detail info.

ASTERISK-28264

Change-Id: Ie86d125d2966f93de74ee00f47ae6fbc8c081c5f
2019-03-27 17:57:30 -06:00
Friendly Automation
eebc98fa44 Merge "manager: Use separate lock for session event notification." into 16 2019-03-27 17:42:56 -05:00
sungtae kim
bbc13b1f1f res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics
Added ARI resource for channel statistics.
GET /ari/channels/{channelId}/rtp_statistics : It returns given
channel's rtp statistics detail.

ASTERISK-28320

Change-Id: I4343eec070438cec13f2a4f22e7fd9e574381376
2019-03-27 15:07:26 -06:00
George Joseph
0bcbf97cb7 Merge "build: Add staging directories for future changes." into 16 2019-03-27 14:25:21 -05:00
Friendly Automation
5592ae465e Merge "app_queue: Fix documentation for QUEUE_MEMBER function." into 16 2019-03-27 13:32:59 -05:00
Ben Ford
636e301f91 build: Add staging directories for future changes.
This is the first step in changing the release process so that changes
made to the CHANGES and UPGRADE.txt files do not result in merge
conflicts every time multiple people modify these files. The changes
made will go in these new directories: doc/CHANGES-staging and
doc/UPGRADE-staging. The README.md files explain how things will work,
but here's a little overview. When you make a change that would go in
either CHANGES or UPGRADE.txt, this should instead be documented in a
new file in the doc/CHANGES-staging or doc/UPGRADE-staging directory,
respectively. The format will look like this:

   Subject: res_pjsip

   A description that explains the changes made and why. The release
   script will handle the bulleting and section separators! The
   'Subject:' header is case-sensitive.

   You can still separate with new lines within your description.

   Subject: res_ari
   Master-Only: true

   You can have more than one subject, and they don't have to be the
   same! Also, the 'Master-Only' header should always be true and is
   also case-sensitive (but the value is not - you can have 'true' or
   'True'). This header will only ever be present in the master branch.

For more information, check out the wiki page:
https://wiki.asterisk.org/wiki/display/AST/CHANGES+and+UPGRADE.txt

This is an initial change for ASTERISK_28111. Functionally, this will
make no difference, but it will prep the directories for when the
changes from CHANGES and UPGRADE.txt are extracted.

Change-Id: I8d852f284f66ac456b26dcb899ee46babf7d15b6
2019-03-27 12:32:48 -06:00
Sean Bright
d4cd2a9706 pjproject: Add timer patch from pjproject r5934
ASTERISK-28161 #close
Reported by: Ross Beer

Change-Id: I65331d554695753005eaa66c1d5d4807fe9009c8
2019-03-27 08:09:50 -06:00
Friendly Automation
e1b0961fce Merge "chan_sip: Ensure 'qualifygap' isn't negative" into 16 2019-03-27 06:02:12 -05:00
Sean Bright
3e5b26ae0a 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:04 -06:00
Friendly Automation
03c5b916ff Merge "res/res_ari: Added timestamp as a requirement for all ARI events" into 16 2019-03-26 08:52:45 -05:00
George Joseph
4ec943fdee Merge "res_config_odbc: set empty extended field as a single whitespace" into 16 2019-03-26 08:48:12 -05:00
Joshua Colp
4d8cd2efbe manager: Use separate lock for session event notification.
When notifying a manager session that new events were available
the same lock was used that was also held when doing things within
the session (such as sending events out). If the manager session
blocked for a period of time this would cause a back up of messages
in Stasis and would also block any other sessions from receiving
events.

This change adds a separate lock to the manager session which is
strictly used for notifying it that new events are available.

ASTERISK-28350

Change-Id: Ifbcac007faca9ad0231640f5e82a6ca9228f261b
2019-03-26 07:37:29 -06:00
Alexei Gradinari
e51bd0726b pjsip: restrict function PJSIP_PARSE_URI to parse only SIP/SIPS URIs
The next usage of PJSIP_PARSE_URI will crash asterisk
${PJSIP_PARSE_URI(tel:+1234567890,host)}
or
${PJSIP_PARSE_URI(192.168.1.1:5060,host)}

The function pjsip_parse_uri successfully parses then, but returns
struct pjsip_other_uri *.

This patch restricts parsing only SIP/SIPS URIs.

Change-Id: I16f255c2b86a80a67e9f9604b94b129a381dd25e
2019-03-25 19:17:02 -04:00
sungtae kim
6d455487d9 res/res_ari: Added timestamp as a requirement for all ARI events
Changed to requirement to having timestamp for all of ARI events.
The below ARI events were changed to having timestamp.
PlaybackStarted, PlaybackContinuing, PlaybackFinished,
RecordingStarted, RecordingFinished, RecordingFailed,
ApplicationReplaced, ApplicationMoveFailed

ASTERISK-28326

Change-Id: I382c2fef58f5fe107e1074869a6d05310accb41f
2019-03-25 14:09:18 -06:00
Sean Bright
d905602a04 chan_sip: Ensure 'qualifygap' isn't negative
Passing negative intervals to the scheduler rips a hole in the
space-time continuum.

ASTERISK-25792 #close
Reported by: Paul Sandys

Change-Id: Ie706f21cee05f76ffb6f7d89e9c867930ee7bcd7
2019-03-25 13:32:38 -06:00
Alexei Gradinari
634314c727 res_config_odbc: set empty extended field as a single whitespace
If Realtime @ variable value is NULL or empty or contains only whitespaces
then when we try to retrieve it using PJSIP_ENDPOINT we get WARNING
pjsip_endpoint_function_read: Unknown property @my_var for PJSIP endpoint.
And the variable is missing in the result of CLI pjsip show endpoint.

This patch keeps empty sorcery extended field.

ASTERISK-28341 #close

Change-Id: I221fccc04cbfa2be17ce971f64ae0e74e465eea0
2019-03-25 12:43:25 -04:00
Matthew Fredrickson
ce5bed44e4 main/taskprocessor: Increase max name length of taskprocessors
Since the new names went in, the maximum taskprocessor name is too
short.  This patch increases the name field to a length to better
handle the new names.

Change-Id: I32f32d6926f25c8ef5a91303fd2988d2c2858877
2019-03-25 07:14:44 -06:00
Friendly Automation
c7d29cdcf2 Merge "sorcery.c: Sorcery enhancements for wizard management" into 16 2019-03-19 09:51:29 -05:00
George Joseph
396dac8888 Merge "res/res_stasis: Fixed wrong StasisEnd timestamp" into 16 2019-03-19 09:27:05 -05:00
George Joseph
7bdde83f2c sorcery.c: Sorcery enhancements for wizard management
Added ability to specifiy a wizard is read-only when applying
it to a specific object type.  This allows you to specify
create, update and delete callbacks for the wizard but limit
which object types can use them.

Added the ability to allow an object type to have multiple
wizards of the same type.  This is indicated when a wizard
is added to a specific object type.

Added 3 new sorcery wizard functions:

* ast_sorcery_object_type_insert_wizard which does the same thing
  as the existing ast_sorcery_insert_wizard_mapping function but
  accepts the new read-only and allot-duplicates flags and also
  returns the ast_sorcery_wizard structure used and it's internal
  data structure. This allows immediate use of the wizard's
  callbacks without having to register a "wizard mapped" observer.

* ast_sorcery_object_type_apply_wizard which does the same
  thing as the existing ast_sorcery_apply_wizard_mapping function
  but has the added capabilities of
  ast_sorcery_object_type_insert_wizard.

* ast_sorcery_object_type_remove_wizard which removes a wizard
  matching both its name and its original argument string.

* The original logic in __ast_sorcery_insert_wizard_mapping was moved
  to __ast_sorcery_object_type_insert_wizard and enhanced for the
  new capabilities, then __ast_sorcery_insert_wizard_mapping was
  refactored to just call __ast_sorcery_insert_wizard_mapping.

* Added a unit test to test_sorcery.c to test the read-only
  capability.

Change-Id: I40f35840252e4313d99e11dbd80e270a3aa10605
2019-03-18 11:39:31 -06:00
Friendly Automation
f151f72870 Merge "vector: Add AST_VECTOR_COMPACT() to reclaim wasted space" into 16 2019-03-18 06:29:10 -05:00
Joshua Colp
67db353598 Merge "Variable ALTCONF ignored when service is used in Debian" into 16 2019-03-18 05:33:17 -05:00
George Joseph
aba1053a12 Merge "app.c: Remove deletion of pool topic on mwi state delete" into 16 2019-03-15 18:30:20 -05:00
sungtae kim
9e36707dca res/res_stasis: Fixed wrong StasisEnd timestamp
Because StasisEnd's timestamp created it's own timestamp, it makes
wrong timestamp, compare to other channel event(ChannelDestroyed).
Fixed to getting a timestamp from the Channel's timestamp.

ASTERISK-28333

Change-Id: I5eb8380fc472f1100535a6bc4983c64767026116
2019-03-15 15:38:17 -06:00
Sean Bright
057c7380be vector: Add AST_VECTOR_COMPACT() to reclaim wasted space
This might be useful in situations where you are loading an undetermined number
of items into a vector and don't want to keep (potentially) 2x the necessary
memory around indefinitely.

Change-Id: I9711daa0fe01783fc6f04c5710eba84f2676d7b9
2019-03-15 14:53:33 -06:00
Richard Mudgett
0426e0fede taskprocessor.c: Fix printf type mismatch
A size_t is not always an unsigned long.

* Use the %zu format specifier in the ast_cli() printf format string since
AST_VECTOR_SIZE() returns a size_t value.

Change-Id: Ib102dd36bbe6c2a7a4ce6870ae9110d978dd7e98
2019-03-14 12:46:16 -06:00
Joshua C. Colp
6f10c9cf4f Merge "AMI/ARI: Bump non-breaking version numbers" into 16 2019-03-14 09:48:38 -05:00
George Joseph
f5f977baec app.c: Remove deletion of pool topic on mwi state delete
As part of an earlier voicemail refactor, ast_delete_mwi_state_full
was modified to remove the pool topic for a mailbox when the state
was deleted.  This was an attempt to prevent stale topics from
accumulating when app_voicemail was reloaded and a mailbox went
away.  Unfortunately because of the fact that when app_voicemail
reloads, ALL mailboxes are deleted then only current ones recreated,
topics were being removed from the pool that still had subscribers
on them, then recreated as new topics of the same name.  So now
modules like res_pjsip_mwi are listening on a topic that will
never receive any messages because app_voicemail is publishing on
a different topic that happens to have the same name.  The solutiuon
to this is not easy and given that accumulating topics for
deleted mailboxes is less evil that not sending NOTIFYs...

* Removed the call to stasis_topic_pool_delete_topic in
  ast_delete_mwi_state_full.

Also:

* Fixed a topic reference leak in res_pjsip_mwi
  mwi_stasis_subscription_alloc.

* Added some debugging to mwi_stasis_subscription_alloc,
  stasis_topic_create, and topic_dtor.

* Fixed a topic reference leak in an error path in
  internal_stasis_subscribe.

ASTERISK-28306
Reported-by: Jared Hull

Change-Id: Id7da0990b3ac4be4b58491536b35f41291247b27
2019-03-14 08:31:22 -06:00
Joshua C. Colp
de3f28ec8a Merge "res_musiconhold: Remove redundant option parsing" into 16 2019-03-14 09:20:19 -05:00
Joshua C. Colp
3e5dcc9dcf Merge "stasis: Improve topic/subscription names and statistics." into 16 2019-03-14 09:19:37 -05:00
cirillor
342550e0ea Variable ALTCONF ignored when service is used in Debian
When variable ALTCONF is defined, the command start prints the message
"Unable to open specified master config file '"/etc/asterisk/asteris..."
and use default configurations.

ASTERISK-28332

Change-Id: I7595e582a0ee2c1051ea35435e247e27906957ef
2019-03-13 10:36:53 -06:00
Joshua C. Colp
d3c971c315 Merge "stasis: Allow empty application arguments to move." into 16 2019-03-13 11:32:09 -05:00
Kevin Harwell
19957fc60e Merge "app_queue: fix ring_entry to access nativeformats with a channel lock" into 16 2019-03-13 11:17:40 -05:00
Kevin Harwell
0e053fe4e3 Merge "chan_dahdi: Add logical group at DAHDIChannel event and CHANNEL function" into 16 2019-03-13 10:55:11 -05:00
Joshua Colp
03c0d19cc8 stasis: Allow empty application arguments to move.
Change-Id: I1e4d37415f3034abe36496dc30209c2303e6af5c
2019-03-13 07:55:48 -06:00
Joshua C. Colp
c8a1f8bfaa Merge "partial-inlining: disable partial-inlining if gcc>=8.2.1" into 16 2019-03-13 06:29:48 -05:00
Kevin Harwell
6a435723f7 AMI/ARI: Bump non-breaking version numbers
Increasing the non-breaking AMI and ARI version numbers due to changes and
additions in those API's. Note, some changes may be forthcoming (will be added
between now and the next release of Asterisk), thus not listed here. As well
a few changes listed below may have been released in a previous release of
Asterisk, but the API version numbers were not increased at that time, so
including here.

AMI:

 * app_queue: set the wrapuptime from AddQueueMember application - e806990
 * res_pjsip: option for ContactStatus event updates - 7f22c9f

ARI:

 * bridging: Add creation timestamps - 0d70120
 * res_stasis: Add ability to switch applications - 50a4b61
 * ARI event type filtering - 1c5def4
 * Added ARI resource /ari/asterisk/ping - 19fc99a

ASTERISK-28314

Change-Id: Iebc813840f8230afa6b20579772e15549064b787
2019-03-12 15:58:01 -05:00
George Joseph
a71ae3dc44 Makefile.moddir_rules: Pass PJPROJECT_BUNDLED to download_externals
The download_externals script wasn't getting the PJPROJECT_BUNDLED
environment variable passed down to it so it wasn't downloading
the appropriate variant of res_digium_phone.  This could cause
crashes in the DPMA.

Change-Id: I5daa9369c7af1fd556d892e89a85f279a2533425
2019-03-12 12:28:01 -06:00
Chris-Savinovich
47c853f8e1 partial-inlining: disable partial-inlining if gcc>=8.2.1
Apply flag -fno-partial-inlining on default optimization if and only if
gcc version >= 8.2.1 (this is the current ver on Fedora and Ubuntu).
This is done to avoid a bug that causes arithmetic calculations to fail
if the following conditions are met:
1. TEST_FRAMEWORK on
2. DONT_OPTIMIZE off
3. Fedora and Ubuntu
4. GCC 8.2.1
5. There must exist a certain combination of multithreading.
6. Optimization level -O2 and -O3
7. Flag -fpartial-inline activated (default when optimization level>=2)
The following link points to a similar gcc bug reported in 2015. This leads me
to believe the bug has regressed. Note I am not able to replicate this bug
in an environment other than Asterisk + Test Framework + Test_cel because the
multithreading combination that causes it seems to be unique. Therefore I
am temporarily abandoning any thoughts of reporting the new occurrence of this
bug to gcc.gnu.org.  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65307

Change-Id: Ibd1afe60e0a38b88e85fdcd9b051004601c2f102
2019-03-11 12:09:54 -05:00
Friendly Automation
b428363cd5 Merge "res/res_rtp_asterisk.c: Fixing possible divide by zero" into 16 2019-03-11 10:06:56 -05:00
George Joseph
9b15e04011 Merge "jansson: json_pack with new format to verify required runtime version." into 16 2019-03-11 09:49:30 -05:00
Joshua Colp
b886fef66e 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 08:39:39 -06:00
Friendly Automation
13cca7bb11 Merge "app_meetme: Don't mute joining admins if conference is muted" into 16 2019-03-11 09:14:48 -05:00
sungtae kim
ca8f254f0f res/res_rtp_asterisk.c: Fixing possible divide by zero
Currently, when the Asterisk calculates rtp statistics, it uses
sample_count as a unsigned integer parameter. This would be fine
for most of cases, but in case of large enough number of sample_count,
this might be causing the divide by zero error.

ASTERISK-28321

Change-Id: If7e0629abaceddd2166eb012456c53033ea26249
2019-03-11 06:09:31 -06:00
cirillor
c9459b1875 chan_dahdi: Add logical group at DAHDIChannel event and CHANNEL function
Add logical group at DAHDIChannel event
and create "dahdi_group" at CHANNEL function.

ASTERISK-28317

Change-Id: Ic1f834cd53982a9707a9748395ee746d6575086a
2019-03-09 08:29:49 -06:00
Sean Bright
8ca74d73f1 res_musiconhold: Remove redundant option parsing
Change-Id: I481fabd8eaf2e4e7ffb5c8285b294742826e7d12
2019-03-08 15:15:01 -05:00
Torrey Searle
4ca41caf38 chan_pjsip: add a flag to ignore 183 responses if no SDP present
chan_sip will always ignore 183 responses that do not contain SDP
however, chan_pjsip will currently always translate it into a
183 with SDP.  This new flag allows chan_pjsip to have the same
behavior as chan_sip.

ASTERISK-28322 #close

Change-Id: If81cfaa17c11b6ac703e3d71696f259d86c6be4a
2019-03-08 13:13:41 -06:00
Corey Farrell
641b6041c7 jansson: json_pack with new format to verify required runtime version.
Add a json_pack at startup that will fail if runtime links against a
library older than jansson-2.11.

Change-Id: I101aebafe0f9407650206f7c552dad3d69377b5a
2019-03-08 13:46:34 -05:00
George Joseph
255e374254 Merge "samples: Fix comment typo in pjsip.conf.sample" into 16 2019-03-08 12:44:37 -06:00
Friendly Automation
70cd169fb1 Merge "Replace calls to strtok() with strtok_r()" into 16 2019-03-08 12:33:23 -06:00