Commit Graph

31890 Commits

Author SHA1 Message Date
Kevin Harwell 67d5c469fb Merge "res_config_odbc: Avoid deadlock when max_connections = 1" 2019-03-01 16:20:45 -06:00
Friendly Automation 3fbbd57338 Merge "menuselect: Add license header to menuselect_gtk.c" 2019-03-01 15:01:00 -06:00
Joshua Colp a7e8a782a6 Merge "Revert "pjsip_message_filter: Only do interface lookup for wildcard addresses."" 2019-03-01 08:02:21 -06:00
Sean Bright 8dc5f86095 menuselect: Add license header to menuselect_gtk.c
This file was added to the Subversion repository on 2007-03-15 by
Russell Bryant, a Digium employee at the time.

ASTERISK-24173 #close

Change-Id: Ie866fa9d31d550467613d362b35b03c031ee594d
2019-02-28 15:38:55 -06:00
Sean Bright 719a4643ab res_config_odbc: Avoid deadlock when max_connections = 1
Rather than calling ast_odbc_find_table() in the prepare callback, call
it beforehand and pass it in to the callback to avoid the need for a
second connection.

ASTERISK-28166 #close

Change-Id: I6f8a0b9990d636fd6bc1a92ed70f7050d2436202
2019-02-28 14:46:16 -06:00
George Joseph 8f9ffe5905 res_pjsip_sdp_rtp: Fix return code from apply_negotiated_sdp_stream
apply_negotiated_sdp_stream was returning a "1" when no joint
capabilities were found on an outgoing call instead of a "-1".
This indicated to res_pjsip_session that the handler DID handle
the sdp when in fact it didn't.  Without the appropriate setup,
a subsequent media frame coming in would have an invalid stream_num
and cause a seg fault when the stream was attempted to be retrieved.

apply_negotiated_sdp_stream now returns the correct "-1" and any
media is now discarded before it reaches the core stream processing.

ASTERISK-28260
Reported by: Sotiris Ganouris

Change-Id: Ia095cb16b4862f2f6ad6d2d2a77453fa2542371f
2019-02-28 11:35:53 -06:00
Joshua Colp 47745fa1c9 Merge "res_pjsip_config_wizard: Don't crash if misconfigured" 2019-02-28 07:47:51 -06:00
Sean Bright 101272d0dc Revert "pjsip_message_filter: Only do interface lookup for wildcard addresses."
This reverts commit d524ad523d.

Reason for revert: This causes Contact and Via headers to have the wrong
transport address.

ASTERISK-28309 #close

Change-Id: Ibba4d6176f68e39279fcd9a545f81d56e747bed8
2019-02-28 06:57:58 -06:00
Friendly Automation 9d6161ee6a Merge "res/res_rtp_asterisk: smoother can cause wrong timestamps if dtmf happen" 2019-02-28 05:44:47 -06:00
Sean Bright 82a43394ed res_pjsip_config_wizard: Don't crash if misconfigured
If both send_registrations and send_auth are both set to yes,
outbound_auth/username must be set or we crash.

ASTERISK-27992 #close

Change-Id: I6418d56de1ae53f80393b314c2584048fbf7f11d
2019-02-27 19:54:32 -06:00
Friendly Automation b408bfdd06 Merge "res_mwi_devstate.c: New module to allow presence subs to VM boxes" 2019-02-27 17:40:32 -06:00
George Joseph e0fc663295 CI: Update jenkinsfiles with new Gerrit URLs
The recent upgrade of Gerrit to 2.16 elimiated referencing a
repository in a way the jenkinsfiles were relying on so
the URL references were changed to a more consistent and supported
format.

Change-Id: I2e8e3f213b9a96bb1b27665eca4a9a24bc49820e
(cherry picked from commit 5ce084579f)
2019-02-27 10:56:33 -06:00
Joshua C. Colp f48a9c2520 Merge "rest-api-templates/asterisk_processor - replace http line breaks with line feed" 2019-02-26 09:14:02 -06:00
George Joseph 9ee76cf070 res_mwi_devstate.c: New module to allow presence subs to VM boxes
This module allows presence subscriptions to voicemail boxes.  This
allows common BLF keys to act as voicemail waiting indicators.

ASTERISK-28301

Change-Id: I62a246c24f3d7d432e33e22d7a4a57c15c292fdd
2019-02-26 08:32:01 -06:00
Torrey Searle 360f543677 res/res_rtp_asterisk: smoother can cause wrong timestamps if dtmf happen
Delivery timeval in the smoother object will fall behind while a DTMF is
being generated.  This can eventually lead to invalid rtp timestamps.
To prevent this from happening the smoother needs to be reset after every
DTMF to keep the timing up to date.

ASTERISK-28303 #close

Change-Id: Iaba3f7b428ebd72a4caa90e13b829ab4f088310f
2019-02-26 08:13:38 -06:00
Friendly Automation 12c359ba5d Merge "http.c: Support separated HTTP request" 2019-02-26 07:17:53 -06:00
Joshua C. Colp 18f92cb6f3 Merge "taskprocessor: Enable subsystems and overload by subsystem" 2019-02-26 07:04:15 -06:00
Friendly Automation b37283e694 Merge "app_queue: Enable set the wrapuptime from AddQueueMember application" 2019-02-26 06:52:06 -06:00
Joshua C. Colp 5d08b4c463 Merge "res_ari_applications: Fix incorrect call to ao2_lock." 2019-02-26 06:26:16 -06:00
Joshua C. Colp 5f29d3b581 Merge "Core: Increase AST_PBX_MAX_STACK to 512 if not LOW_MEMORY" 2019-02-26 06:08:45 -06:00
Kevin Harwell 574128dec6 rest-api-templates/asterisk_processor - replace http line breaks with line feed
Including line breaks (<br>, <br/>, <br />) in certain parts of the rest-api
json definition (e.g. summary, notes) displays them correctly in swagger.
However, when the field gets converted to the wiki format those breaks get
escaped and show up in the text as the actual string literal "<br>" etc...

This patch makes it so when converting to the wiki format it replaces all line
break values (<br>, etc...) with line feeds ('\n').

Change-Id: Ie1c9faa0d1c5d622804cc0a21ce769095b08aa3d
2019-02-25 17:31:57 -06:00
Joshua C. Colp e687cf214d res_ari_applications: Fix incorrect call to ao2_lock.
When listing the applications the apps lock was incorrectly
locked twice instead of being locked and then unlocked.

ASTERISK-28302

Change-Id: If7d064592a9e88c0f1049214c50e02be6dabf79e
2019-02-25 06:12:14 -06:00
Joshua Colp e6b67b2a5d res_pjsip_sdp_rtp: Allow only single ssrc attribute.
When processing SSRC attributes we were iterating through
all of them, even though we only need to know the remote
SSRC once. This was problematic because some browsers group
SSRCs together on a stream, and due to our negotiation only
end up using the first one. Since we set the second one as
the remote SSRC we would drop the received media from them
instead of allowing it through.

In the future this may be extended to allow SSRC groups
and to use information from the attributes.

Change-Id: I4dc87087dbe56a83aa65f0f897bbd4ca75ec1270
2019-02-21 12:08:34 -06:00
Joshua C. Colp 88f77b3983 Merge "stasis: Store subscriber uniqueids with topic statistics." 2019-02-21 10:17:28 -06:00
Joshua C. Colp cf1b64aaf0 Merge "res_pjsip_session Added rtcp stats result vector into the session" 2019-02-21 06:30:52 -06:00
Sungtae Kim b4ccaad671 http.c: Support separated HTTP request
Currently, the Asterisk does not support seperated HTTP request.
This patch make the Asterisk enables to wait lest part of HTTP request.
Also increases acceptable HTTP body length to 40k to support more
larger request.

ASTERISK-28236

Change-Id: I48a401aa64a21c3b37bf3cb4e0486d64b7dd8aa1
2019-02-20 22:23:53 +01:00
George Joseph bc8dead610 Core: Increase AST_PBX_MAX_STACK to 512 if not LOW_MEMORY
The current settings AST_PBX_MAX_STACK is 128 entries which is
too low for some FreePBX installations with complex parking
arrangements.  Increased to 512 if LOW_MEMORY is not defined.

ASTERISK-28300

Change-Id: I7c4b540bc92e6642df0f3da639b003f7da8b1299
2019-02-20 12:52:53 -06:00
Joshua C. Colp a286f546f1 stasis: Store subscriber uniqueids with topic statistics.
This change provides an easier mechanism to determine which
subscribers are subscribed to a topic. Using this you can
inspect the specific subscribers for further details.

Change-Id: I8deea21703cd5c5357b85593b46c3eaf24e18c0c
2019-02-20 12:24:11 -06:00
George Joseph c2adeb9dc2 taskprocessor: Enable subsystems and overload by subsystem
To prevent one subsystem's taskprocessors from causing others
to stall, new capabilities have been added to taskprocessors.

* Any taskprocessor name that has a '/' will have the part
  before the '/' saved as its "subsystem".
  Examples:
  "sorcery/acl-0000006a" and "sorcery/aor-00000019"
  will be grouped to subsystem "sorcery".
  "pjsip/distributor-00000025" and "pjsip/distributor-00000026"
  will bn grouped to subsystem "pjsip".
  Taskprocessors with no '/' have an empty subsystem.

* When a taskprocessor enters high-water alert status and it
  has a non-empty subsystem, the subsystem alert count will
  be incremented.

* When a taskprocessor leaves high-water alert status and it
  has a non-empty subsystem, the subsystem alert count will be
  decremented.

* A new api ast_taskprocessor_get_subsystem_alert() has been
  added that returns the number of taskprocessors in alert for
  the subsystem.

* A new CLI command "core show taskprocessor alerted subsystems"
  has been added.

* A new unit test was addded.

REMINDER: The taskprocessor code itself doesn't take any action
based on high-water alerts or overloading.  It's up to taskprocessor
users to check and take action themselves.  Currently only the pjsip
distributor does this.

* A new pjsip/global option "taskprocessor_overload_trigger"
  has been added that allows the user to select the trigger
  mechanism the distributor uses to pause accepting new requests.
  "none": Don't pause on any overload condition.
  "global": Pause on ANY taskprocessor overload (the default and
  current behavior)
  "pjsip_only": Pause only on pjsip taskprocessor overloads.

* The core pjsip pool was renamed from "SIP" to "pjsip" so it can
  be properly grouped into the "pjsip" subsystem.

* stasis taskprocessor names were changed to "stasis" as the
  subsystem.

* Sorcery core taskprocessor names were changed to "sorcery" to
  match the object taskprocessors.

Change-Id: I8c19068bb2fc26610a9f0b8624bdf577a04fcd56
2019-02-20 11:51:08 -06:00
Kevin Harwell 8681fc9db7 ARI event type filtering
Event type filtering is now enabled, and configurable per application. An app is
now able to specify which events are sent to the application by configuring an
allowed and/or disallowed list(s). This can be done by issuing the following:

PUT /applications/{applicationName}/eventFilter

And then enumerating the allowed/disallowed event types as a body parameter.

ASTERISK-28106

Change-Id: I9671ba1fcdb3b6c830b553d4c5365aed5d588d5b
2019-02-20 09:56:22 -06:00
George Joseph 0eb27e1970 Merge "json.c/strings.c - Add a couple of utility functions" 2019-02-20 09:53:33 -06:00
Friendly Automation de64949f6a Merge "chan_pjsip: Changed to continued after invalid media for pjsip show channelstats" 2019-02-20 09:00:08 -06:00
George Joseph e20ddfde46 Merge "CI: Use tmpfs option to Docker instead of mount." 2019-02-20 08:31:33 -06:00
Joshua Colp f4c9a351d8 CI: Use tmpfs option to Docker instead of mount.
Some tests require Asterisk to execute scripts which
are stored in /tmp. When mount is used for tmpfs there
is no ability to allow scripts to be executed from
that location.

This change switches to using tmpfs which can be told
to allow executables to be run from /tmp.

Change-Id: I0e598ca2b76af1f7f2d29f0da7b1731a214a291a
2019-02-19 10:23:10 -06:00
Kevin Harwell 8f1b3edde8 json.c/strings.c - Add a couple of utility functions
Added 'ast_json_object_string_get' to the JSON wrapper in order to make it a
little easier to retrieve a string field from the JSON object.

Also added an 'ast_strings_equal' function that safely checks (checks for NULLs)
for equality between two strings.

Change-Id: I26f0a16d61537505eb41b4b05ef2e6d67fc2541b
2019-02-19 09:44:58 -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
Torrey Searle 8ea9608efb res/res_rtp_asterisk: clear smoother when local bridging
p2p_write updates txformat but doesn't require a smoother.  If a smoother
was created by another bridge type the smoother could fall out of date causing
one way audio issues.  To prevent this the smoother is now destroyed on the
start of native bridge.

ASTERISK-28284 #close

Change-Id: I84e67f144963787fff9b4d79ac500514fb40cdc6
2019-02-19 01:37:57 -06:00
sungtae kim fb651756c7 chan_pjsip: Changed to continued after invalid media for pjsip show channelstats
Currently, the pjsip show channelstats cli does not show channel's
stats after hits the invalid channel info. This makes hard to use
this cli. Changed to keep iterate after hits the invalid channel
info.

ASTERISK-28292

Change-Id: I3efdff1c9e1b1efd3c971fb82ae77aa133a6f43c
2019-02-15 00:12:23 +01:00
Sungtae Kim 7e1d881d89 res_pjsip_session Added rtcp stats result vector into the session
Currently, the Asterisk's pjsip_session module does not keeping the
rtcp's stats info after it was removed. But by adding the results
vector and keeping it until session is destroying, it can give more
useful information for other modules.

ASTERISK-28253

Change-Id: Ib25c2d3fc4da084aecfde2a82c1b1d733bd64fa5
2019-02-13 23:04:08 +01:00
George Joseph 16084df36f Merge "ci: Rerun unit tests when non-code changes occur." 2019-02-11 09:27:59 -06:00
Friendly Automation d4a78063eb Merge "res_odbc: Add basic query logging." 2019-02-11 08:35:02 -06:00
Joshua Colp c2ea9c90a2 ci: Rerun unit tests when non-code changes occur.
This change makes it so that even if non-code changes
occur (such as commit message changing) unit tests
will still be run and result in a verification.

ASTERISK-28251

Change-Id: I6491fff7c93e5d5cd8e41054486968bf66c4f608
2019-02-08 07:10:30 -06:00
Kevin Harwell 61a8f79a29 res_pjsip_registrar: lock transport monitor when setting 'removing' flag
A previous patch attempt to mitigate blocked threads on transport shutdown for
a given contact. It was thought that a second lock could be avoided by checking
the 'removing' flag on the transport monitor twice (once before and once after
the normal named aor locking). However as with usual threading issues if the
timing was right the original problem still occured.

This patch adds locking around the first 'removing' flag check and set, thus
nullifying the secondary check, so it was removed.

ASTERISK-28213

Change-Id: Iaa8e36e5311789549b76d8de42dfcea96013b2ed
2019-02-07 14:28:41 -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 68bb6ef6cb Merge "sounds: Sort 'core show sounds' output" 2019-02-06 07:13:07 -06:00
Sungtae Kim 5a2a7d65b5 main/cdr: Fixed cdr start overwriting
The CDR was overwriting the start time when the call continued the
dialplan from the ARI stasis or a Local channel was originated.

This change fixes this by no longer reinitializing the CDR when
transitioning out of the dialed pending state to the single state.

ASTERISK-28181

Change-Id: I921bc04064b6cff1deb2eea56a94d86489561cdc
2019-02-05 21:32:13 +01:00
Giuseppe Sucameli e2bbab17b3 Fix deadlock handling subscribe req during res_parking reload
Split destroy_hint method to separate hint removal and extension hint
state changed callback, the latter now called via stasis.
This avoids deadlock between res_parking reload that is removing the
parking lot and the related hint and subscribe requests coming for the
same parking lot.

ASTERISK-28173

Change-Id: I5b03c3455b3b12b6f83cea4cc34f4b4b20444f7e
2019-02-05 10:14:47 -06:00
Friendly Automation 99186c4b15 Merge "pjsip/config_global: regcontext context not created" 2019-02-05 08:48:28 -06:00
George Joseph 00d7b6df49 Merge "res_stasis: Auto-create context and extens on Stasis app launch." 2019-02-05 08:26:46 -06:00
George Joseph 4787b47da0 Merge "Added ARI resource /ari/asterisk/ping" 2019-02-05 08:15:52 -06:00