Commit Graph

32164 Commits

Author SHA1 Message Date
Alexei Gradinari
de82bdd746 pjsip: replace 180 by 183 if SDP negotiation has completed
The caller endpoint hears dead silence if a callee replies 180 (without SDP)
and the caller already received 183 (with SDP).
It happens because Asterisk sends 180 (WITH SDP) to the caller,
there are not incoming RTP packets from the callee
and Asterisk does not generate inband ringing,
so there are not any outgoing RTP packets to the caller.

This patch replaces 180 by 183 if SDP negotiation has completed,
as if the caller endpoint is configured with "inband_progress=yes".

In this case Asterisk will generate inband ringing untill Asterisk receive
incoming RTP packets from the callee.

ASTERISK-27994 #close

Change-Id: I7450b751083ec30d68d6abffe922215a15ae5a73
2019-05-13 17:09:08 -04:00
Joshua Colp
cf2f8db1b7 Merge "pjsip_options.c: Allow immediate qualifies for new contacts." into 16 2019-05-13 14:14:45 -05:00
George Joseph
e7734476c6 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:17:27 -06:00
Joshua Colp
ece29db9bd res_rtp_asterisk: Fix sequence number cycling and packet loss count.
This change fixes two bugs which both resulted in the packet loss
count exceeding 65,000.

The first issue is that the sequence number check to determine if
cycling had occurred was using the wrong variable resulting in the
check never seeing that cycling has occurred, throwing off the
packet loss calculation. It now uses the correct variable.

The second issue is that the packet loss calculation assumed that
the received number of packets in an interval could never exceed
the expected number. In practice this isn't true due to delayed
or retransmitted packets. The expected will now be updated to
the received number if the received exceeds it.

ASTERISK-28379

Change-Id: If888ebc194ab69ac3194113a808c414b014ce0f6
2019-05-08 15:41:43 +00:00
Ben Ford
941dead08d pjsip_options.c: Allow immediate qualifies for new contacts.
When multiple endpoints try to register close together using the same
AOR with qualify_frequency set, one contact would qualify immediately
while the other contacts would have to wait out the duration of the
timer before being able to qualify. Changing the conditional to check
the contact container count for a non-zero value allows all contacts to
qualify immediately.

Change-Id: I79478118ee7e0d6e76af7c354d66684220db9415
2019-05-07 10:26:10 -06:00
Kevin Harwell
edc3e0df1a conversions.c: Add conversions for largest max sized integer
Added a conversion for umax (largest maximum sized integer allowed). Adjusted
the other current conversion functions (uint and ulong) to be derivatives of
the umax conversion since they are simply subsets of umax.

Also made the negative check move the pointer on spaces since strtoumax does it
anyways.

Change-Id: I56c2ef2629d49b524c8df58af12951c181f81f08
2019-05-06 16:26:46 -05:00
agupta
9a0fa51443 stasis: Hangup channel for Local channel No such extension error
When we use early bridge with create and dial from stasis using Local channel
and the dialplan does not any entry the it is returned from core_local.c with
No such extension .

In such case asterisk locks up till the channel is not hangup with the error
Exceptionally long voice queue length

* Found that in such case app_control_dial fails on ast_call method and
  return -1
* Since it is called from stasis_app_send_command_async and return -1 does
  not cause resources to be freed and since no PBX exist it is not able to
  read from channel causing exceptionally long queue
* After putting this code found that the channel was releasing immediately
  and resources were freed.

ASTERISK-28399
Reported by: Abhay Gupta
Tested by: Abhay Gupta

Change-Id: I0a55c923fc6995559f808d63b9488762b4489318
2019-05-06 07:26:55 -03:00
George Joseph
543d487746 build: Pass --fno-partial-inlining to third-party when appropriate
When the gcc version is >= 8.2.1, we were already setting the
--fno-partial-inlining flag for Asterisk source files to get around
a gcc bug but we weren't passing the flag down to the bundled
builds of pjproject and jansson.

ASTERISK-28392

Change-Id: I99ede9bc35408ecd096f7d5369e8192d3dc75704
2019-05-03 12:36:38 -06:00
Joshua Colp
8357ab7e9a Merge "app_confbridge: Add "all" variants of REMB behavior." into 16 2019-05-03 10:53:21 -05:00
Friendly Automation
27696cbda6 Merge "stasis: Only place stasis created and dialed channels into dial bridge." into 16 2019-05-03 10:47:18 -05:00
Friendly Automation
748f1d64a1 Merge "stasis: Call callbacks when imparting fails" into 16 2019-05-03 10:13:16 -05:00
Friendly Automation
7bddfdbfa6 Merge "rtp: Add support for transport-cc in receiver direction." into 16 2019-05-03 10:08:16 -05:00
George Joseph
5002169d6a res_pjsip: Check return from pjsip_parse_uri calls
Updated ast_sip_create_rdata_with_contact and registrar_find_contact
to check the return from pjsip_parse_uri before attempting to
use the uri returned.

ASTERISK-28402
Reported-by: Ross Beer

Change-Id: I9810b3b163c45ed5a56ec743586e5ce107f13ba7
2019-05-02 12:32:31 -06:00
agupta
39c5188bec stasis: Only place stasis created and dialed channels into dial bridge.
The dial bridge is meant to hold channels which have been created
and dialed in stasis. It handles the frames coming from them and raises
the appropriate events.

It was possible for the code to mistakenly place calls which came
from the dialplan into the dial bridge if they were not in an
answered state. These channels are not outgoing channels and
should not be placed into the dial bridge.

The code now checks to ensure that only stasis created channels are
placed into the dial bridge by checking that a PBX does not exist
on the channel.

ASTERISK-27756

Change-Id: Ideee69ff06c9a0b31f7ed61165f5c055f51d21b6
2019-05-02 15:41:14 +00:00
Holger Hans Peter Freyther
f599ebd29e stasis: Call callbacks when imparting fails
After a bridge has been deleted the stasis control will depart
the channel and might attempt to re-add it to the dial bridge.

The later can fail and this can lead to a situation that the stasis
control is unlinked but the after_bridge_cb_failed cb is executed trying
to access a dangling control object.

Fix it by calling the after_cb's before bridge_channel_impart_signal.

ASTERISK-26718

Change-Id: Ib4e8f70d7a21bd54afe3cb51cc6717ef7c355496
2019-05-02 15:28:21 +00:00
Joshua Colp
d861ebdca8 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 13:29:09 +00:00
Joshua Colp
5023f02b2d rtp: Add support for transport-cc in receiver direction.
The transport-cc draft is a mechanism by which additional information
about packet reception can be provided to the sender of packets so
they can do sender side bandwidth estimation. This is accomplished
by having a transport specific sequence number and an RTCP feedback
message. This change implements this in the receiver direction.

For each received RTP packet where transport-cc is negotiated we store
the time at which the RTP packet was received and its sequence number.
At a 1 second interval we go through all packets in that period of time
and use the stored time of each in comparison to its preceding packet to
calculate its delta. This delta information is placed in the RTCP
feedback message, along with indicators for any packets which were not
received.

The browser then uses this information to better estimate available
bandwidth and adjust accordingly. This may result in it lowering the
available send bandwidth or adjusting how "bursty" it can be.

ASTERISK-28400

Change-Id: I654a2cff5bd5554ab94457a14f70adb71f574afc
2019-04-30 20:27:24 +00:00
Friendly Automation
f2cb892d7c Merge "mwi core: Move core MWI functionality into its own files" into 16 2019-04-30 10:12:23 -05:00
Friendly Automation
a6863e5beb Merge "app_amd: Fix infinite loop on silent calls" into 16 2019-04-30 10:03:59 -05:00
Friendly Automation
60d13c3d56 Merge "stasis: Fix crash at shutdown." into 16 2019-04-30 05:50:18 -05:00
agupta
1d214a3623 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 10:14:36 +00:00
Ben Ford
8d35a30a3f stasis: Fix crash at shutdown.
When compiling in dev mode, stasis statistics are enabled and can cause
a crash at shutdown due to the following:
- Containers are freed
- Topics and subscriptions remain
- When those topics and subscriptions are deallocated, they go to do
  things with the container

This changes the containers to global ao2 objects, and whenever needed
in the code, a reference must be obtained and checked before any
operations can be done.

ASTERISK-28353 #close

Change-Id: Ie7d5e907fcfcb4d65bd36d5e4eb923126fde8d33
2019-04-24 07:47:49 -06:00
Antoni Goldstein
d6b37e2926 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:33 -06:00
Kevin Harwell
e3a758975d 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:39:57 -05:00
Friendly Automation
92712891f9 Merge "ARI: Bump non-breaking version number to 4.0.2" into 16 2019-04-23 16:42:44 -05:00
Friendly Automation
641414faf9 Merge "core/buildsystem: check the actual compiler being version" into 16 2019-04-23 15:26:12 -05:00
George Joseph
e281911667 ARI: Bump non-breaking version number to 4.0.2
main/json.c: Added app_name, app_data to channel type
res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics
res/res_ari: Added timestamp as a requirement for all ARI events

Change-Id: I6363f2a3e757cfd59b2ee5d056388ec47659a0c9
2019-04-22 10:17:54 -06:00
Guido Falsi
4dcfa8d127 core/buildsystem: check the actual compiler being version
Make compiler check use the output of the actual compiler being
used as reported by the CC variable, instead of unconditionally
running the "gcc" binary.  Also only run the check if the compiler
is gcc or a cross-compile gcc.

ASTERISK-28374

Change-Id: Icaacf6d93686ad21076878aa1504a23b4fc9d0f4
2019-04-22 07:05:26 -06:00
Lucas Mendes
daed593cfa res_indications: Fix indications remove command autocomplete
We changed the validation of autocomplete parameter in the "indications
remove" command to avoid continue the execution of the command after
asking for autocomplete out of range parameters.

ASTERISK-28391
Reported by: lmendes86

Change-Id: I92b24131fd02f2e3c7fec966eea6f7a663310d40
2019-04-19 09:33:11 -06:00
Friendly Automation
6ec4b113c1 Merge "loader: support for permanent dlopen()" into 16 2019-04-19 08:32:13 -05:00
Friendly Automation
74d79bdf71 Merge "res_pjsip: Added a norefersub configuration setting" into 16 2019-04-19 08:27:53 -05:00
Friendly Automation
93d36953fb Merge "res_remb_modifier: Propertly initialize bitrate to 0.0" into 16 2019-04-18 11:44:23 -05:00
George Joseph
7487fc88d2 res_remb_modifier: Propertly initialize bitrate to 0.0
...and return the frame unaltered if bitrate can't be determined.

Change-Id: Ib2175ab84f85a3d7060d31625f5a2c7fbcc2ba4c
2019-04-18 11:04:00 -03:00
Friendly Automation
bc45d0497c Merge "res_mwi_devstate: Specify AST_MODFLAG_LOAD_ORDER to enable load priority" into 16 2019-04-18 05:46:02 -05:00
Dan Cropp
eca8c440d2 res_pjsip: Added a norefersub configuration setting
Added a new PJSIP global setting called norefersub.
Default is true to keep support working as before.

res_pjsip_refer:  Configures PJSIP norefersub capability accordingly.

Checks the PJSIP global setting value.
If it is true (default) it adds the norefersub capability to PJSIP.
If it is false (disabled) it does not add the norefersub capability
to PJSIP.

This is useful for Cisco switches that do not follow RFC4488.

ASTERISK-28375 #close
Reported-by: Dan Cropp

Change-Id: I0b1c28ebc905d881f4a16e752715487a688b30e9
2019-04-17 11:09:12 -05:00
Friendly Automation
c9ca88ae7d Merge "pbx.c: Ignore dashes in extensions when using extenpatternmatchnew" into 16 2019-04-16 12:16:28 -05:00
Friendly Automation
ff7b0acc4e Merge "app_voicemail: Don't split mailbox options on comma" into 16 2019-04-16 11:36:27 -05:00
Sean Bright
022e784b7a res_mwi_devstate: Specify AST_MODFLAG_LOAD_ORDER to enable load priority
Suggested by abelbeck on the issue tracker.

ASTERISK~28384
Reported by: abelbeck

Change-Id: Icee0fff2b58dbfaa80f2b68270fe69dfb0463fc0
2019-04-16 10:05:12 -06:00
Benjamin Keith Ford
873280c708 Merge "build: Revise CHANGES and UPGRADE.txt handling." into 16 2019-04-16 10:52:34 -05:00
Joshua Colp
7a6895baf5 Merge "res_ael: Use Gosub in for loop expressions" into 16 2019-04-16 08:11:40 -05:00
Joshua Colp
d734e1bbfa Merge "ARI: Run 'make ari-stubs'" into 16 2019-04-16 07:29:41 -05:00
Joshua Colp
95dac45148 Merge "res_ael: Fix pattern matching against literal '+'" into 16 2019-04-16 07:25:48 -05:00
George Joseph
18fe583d12 CI: Move test group config files to Jenkins
One of the downaides of having things like test configuration
in the git repo is that it can't be changed at runtime.  You have
to create a review for the changes and merge it mefore it will
take effect.

This review moves the data currently held in
tests/CI/periodic-dailyTestGroups.json and
tests/CI/gateTestGroups.json into a Jenkins Config File attached
to the job definitions.  This allows us to alter it from the
Jenkins UI at runtime.  The original files stay in the repo
as documentation.

Change-Id: I14b9702f6285ce1fb2420287ba0e7d3b59109763
2019-04-15 06:51:26 -06:00
Sean Bright
d0a8334e4f 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:30 -06:00
George Joseph
03b6d18e99 Merge "res_ael: Create consistent label names across reloads" into 16 2019-04-12 14:16:27 -05:00
George Joseph
62cf7eae92 Merge "pbx.c: Properly parse labels with leading digits" into 16 2019-04-12 14:16:06 -05:00
George Joseph
a53f54856d Merge "app_voicemail: Cleanup stale lock files on module load" into 16 2019-04-12 11:10:03 -05:00
Sean Bright
9b7a64cbf0 pbx.c: Ignore dashes in extensions when using extenpatternmatchnew
Because hyphens are not matched literally in Asterisk dialplan, we need
to ignore them in our candidate extensions as well.

ASTERISK-17695 #close
Reported by: test011

Change-Id: I227f02301577b1633e8a55b9fe9dc149935c03f0
2019-04-12 09:23:18 -06:00
Friendly Automation
49b751d153 Merge "chan_ooh323: fix h323 log file path" into 16 2019-04-12 09:18:36 -05:00
Sean Bright
34b9b65098 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:13:56 -06:00