3 years agoMerge "translate: generic plc not filled in after translation"
Jenkins2 [Mon, 30 Apr 2018 13:33:09 +0000 (08:33 -0500)]
Merge "translate: generic plc not filled in after translation"

3 years agoMerge "app_sendtext: Enhance SendText to support Enhanced Messaging"
George Joseph [Mon, 30 Apr 2018 12:34:32 +0000 (07:34 -0500)]
Merge "app_sendtext:  Enhance SendText to support Enhanced Messaging"

3 years agoMerge "bridge_softmix: Forward TEXT frames"
Jenkins2 [Fri, 27 Apr 2018 15:06:30 +0000 (10:06 -0500)]
Merge "bridge_softmix:  Forward TEXT frames"

3 years agoMerge "BuildSystem: Enable IMAP storage on FreeBSD and DragonFly BSD."
Joshua Colp [Fri, 27 Apr 2018 00:09:16 +0000 (19:09 -0500)]
Merge "BuildSystem: Enable IMAP storage on FreeBSD and DragonFly BSD."

3 years agoMerge "chan_ooh323: introduce localras config parameter"
Jenkins2 [Thu, 26 Apr 2018 16:42:06 +0000 (11:42 -0500)]
Merge "chan_ooh323: introduce localras config parameter"

3 years agoMerge "core: Remove unused/incomplete SDP modules."
Jenkins2 [Wed, 25 Apr 2018 20:49:25 +0000 (15:49 -0500)]
Merge "core: Remove unused/incomplete SDP modules."

3 years agoMerge "install_prereq: Add DragonFly BSD."
Jenkins2 [Wed, 25 Apr 2018 19:01:43 +0000 (14:01 -0500)]
Merge "install_prereq: Add DragonFly BSD."

3 years agocore: Remove unused/incomplete SDP modules.
Richard Mudgett [Fri, 22 Dec 2017 19:11:53 +0000 (13:11 -0600)]
core: Remove unused/incomplete SDP modules.

Change-Id: Icc28fbdc46f58e54a21554e6fe8b078f841b1f86

3 years agoMerge "streams: Add string metadata capability"
Joshua Colp [Wed, 25 Apr 2018 18:45:26 +0000 (13:45 -0500)]
Merge "streams: Add string metadata capability"

3 years agoMerge "menuselect: Add DragonFly BSD."
Jenkins2 [Wed, 25 Apr 2018 18:31:44 +0000 (13:31 -0500)]
Merge "menuselect: Add DragonFly BSD."

3 years agoMerge "chan_ooh323: fix ooManualProgress/ooManualRingback on ooh323 debuggin on"
Richard Mudgett [Wed, 25 Apr 2018 15:46:05 +0000 (10:46 -0500)]
Merge "chan_ooh323: fix ooManualProgress/ooManualRingback on ooh323 debuggin on"

3 years agoMerge "Build System: Add missing ASTMM_LIBC to flex output."
Jenkins2 [Wed, 25 Apr 2018 15:02:13 +0000 (10:02 -0500)]
Merge "Build System: Add missing ASTMM_LIBC to flex output."

3 years agoMerge "format_pcm: Correct behavior of fseek and ftell for G.722"
Jenkins2 [Wed, 25 Apr 2018 14:44:43 +0000 (09:44 -0500)]
Merge "format_pcm: Correct behavior of fseek and ftell for G.722"

3 years agoMerge "bridge_softmix: Fix some REMB bugs."
Joshua Colp [Wed, 25 Apr 2018 09:29:42 +0000 (04:29 -0500)]
Merge "bridge_softmix: Fix some REMB bugs."

3 years agoMerge "chan_ooh323: Fix cppcheck warnings"
Joshua Colp [Tue, 24 Apr 2018 23:54:36 +0000 (18:54 -0500)]
Merge "chan_ooh323: Fix cppcheck warnings"

3 years agotranslate: generic plc not filled in after translation
Kevin Harwell [Wed, 18 Apr 2018 20:59:38 +0000 (15:59 -0500)]
translate: generic plc not filled in after translation

If during translation a codec could not handle a given frame the translation
core would return NULL, thus not passing along the "missing" frame. Due to this
there was no frame to apply generic plc to, thus rendering it useless.

This patch makes it so the translation core produces an interpolated slin frame
in the cases where an attempt was made to translate to slin, but failed. This
interpolated frame is then passed along and can be used by the generic plc
algorithms to fill in the frame.

ASTERISK-27814 #close

Change-Id: I133d084da87adef913bf2ecc9c9240e3eaf4f40a

3 years agochan_ooh323: fix ooManualProgress/ooManualRingback on ooh323 debuggin on
Alexander Anikin [Fri, 20 Apr 2018 19:07:21 +0000 (22:07 +0300)]
chan_ooh323: fix ooManualProgress/ooManualRingback on ooh323 debuggin on

Call ooManualProgress/Ringback outside of ast_debug function
when ooh323 debugging is on

ASTERISK-27812 #close
ASTERISK-26893 #close
Reported by: Dimos, Marco Giordani

Change-Id: I5873762e4f05824e7b6e94a19dd4eb56adbbbb79

3 years agobridge_softmix: Fix some REMB bugs.
Joshua Colp [Thu, 19 Apr 2018 18:44:03 +0000 (18:44 +0000)]
bridge_softmix: Fix some REMB bugs.

This change fixes a bug where a REMB collector may be
freed twice, and also tweaks REMB combining such that if
there is no bitrate from anyone (or there are no sources)
we report 0 instead of using an old bitrate.


Change-Id: Ia9dc9c150043890ee7ff85e9cdec007f1a77fcfd

3 years agoBuildSystem: Enable IMAP storage on FreeBSD and DragonFly BSD.
Alexander Traud [Fri, 20 Apr 2018 12:13:12 +0000 (14:13 +0200)]
BuildSystem: Enable IMAP storage on FreeBSD and DragonFly BSD.


Change-Id: I1347f3f2f3737010d0a80a5c30b5aaf71cf3ccb0

3 years agomenuselect: Add DragonFly BSD.
Alexander Traud [Fri, 20 Apr 2018 10:40:21 +0000 (12:40 +0200)]
menuselect: Add DragonFly BSD.

In DragonFly BSD, added libraries from ports are placed into /usr/local.
Therefore, this directory must be added for the preprocessor, compiler, and

Beside that, the script ./configure was updated:
* OSARCH list was outdated and not used, removed.
* AC_CANONICAL_BUILD was not used.
* _REENTRANT, this feature test macro is obsolete.


Change-Id: I186d88d99cfa4de6569888e12ac97bd2f441c422

3 years agoinstall_prereq: Add DragonFly BSD.
Alexander Traud [Fri, 20 Apr 2018 10:18:06 +0000 (12:18 +0200)]
install_prereq: Add DragonFly BSD.


Change-Id: I718ddb000fe5184b1bdc7759da67a370a7520144

3 years agoMerge ""confbridge show profile bridge" does not output "sfu" when video_mode is...
Jenkins2 [Thu, 19 Apr 2018 21:14:37 +0000 (16:14 -0500)]
Merge ""confbridge show profile bridge" does not output "sfu" when video_mode is sfu"

3 years agoMerge "chan_vpb: Avoid GNU old-style field designator extension."
Jenkins2 [Thu, 19 Apr 2018 19:40:53 +0000 (14:40 -0500)]
Merge "chan_vpb: Avoid GNU old-style field designator extension."

3 years agoMerge "Build System: Enable python3 compatibility."
Jenkins2 [Thu, 19 Apr 2018 08:40:02 +0000 (03:40 -0500)]
Merge "Build System: Enable python3 compatibility."

3 years agoMerge "stringfields: Collect extended stringfields into the stringfield section."
Jenkins2 [Wed, 18 Apr 2018 22:43:02 +0000 (17:43 -0500)]
Merge "stringfields: Collect extended stringfields into the stringfield section."

3 years agoMerge "res_pjsip: Fix deadlock on reliable transport shutdown."
Joshua Colp [Wed, 18 Apr 2018 22:32:33 +0000 (17:32 -0500)]
Merge "res_pjsip: Fix deadlock on reliable transport shutdown."

3 years ago"confbridge show profile bridge" does not output "sfu" when video_mode is sfu
Chris-Savinovich [Wed, 18 Apr 2018 16:41:50 +0000 (12:41 -0400)]
"confbridge show profile bridge" does not output "sfu" when video_mode is sfu

Fixes a bug on the "confbridge show profile bridge" cli command
that showed "video_mode=no video" when video_mode was set
to "sfu"

ASTERISK-27418  #close

Change-Id: I481e3172c7f872664c7ac7809879d541c9f031e9

3 years agoBuild System: Add missing ASTMM_LIBC to flex output.
Corey Farrell [Wed, 18 Apr 2018 20:40:56 +0000 (16:40 -0400)]
Build System: Add missing ASTMM_LIBC to flex output.

Redirect libc allocation functions to use Asterisk functions for
main/ast_expr2f.c and res/ael/ael_lex.c.  This will resolve errors
produced by astmm.h when these files are regenerated, though other
issues still remain.


Change-Id: I7263e9e4217a17bde4ffaa2087a8f8aeb2a8588c

3 years agoMerge "bridge_softmix / app_confbridge: Add support for REMB combining."
George Joseph [Wed, 18 Apr 2018 20:37:45 +0000 (15:37 -0500)]
Merge "bridge_softmix / app_confbridge: Add support for REMB combining."

3 years agoMerge "utils/pval: Add -lBlocksRuntime for compiler clang conditionally."
Jenkins2 [Wed, 18 Apr 2018 20:24:24 +0000 (15:24 -0500)]
Merge "utils/pval: Add -lBlocksRuntime for compiler clang conditionally."

3 years agoMerge "utils: Add ast_assert_return"
Jenkins2 [Wed, 18 Apr 2018 19:43:56 +0000 (14:43 -0500)]
Merge "utils: Add ast_assert_return"

3 years agoformat_pcm: Correct behavior of fseek and ftell for G.722
Sean Bright [Wed, 18 Apr 2018 18:40:49 +0000 (14:40 -0400)]
format_pcm: Correct behavior of fseek and ftell for G.722

There are twice as many samples in the same number of bytes, so redefine
some of the G.722 format functions in terms of their PCM counterparts.

Change-Id: I6a8c7352624b930a5f2d9e4857f75283fa5dd9f9

3 years agochan_ooh323: introduce localras config parameter
Alexander Anikin [Tue, 17 Apr 2018 10:33:36 +0000 (13:33 +0300)]
chan_ooh323: introduce localras config parameter

Introduce localras parameter that specify source IP
for connecting to Gatekeeper. Useful for multihome configurations.

ASTERISK-25129 #close
Reported by: Dmitry Melekhov
Tested by: Dmitry Melekhov

Change-Id: I0b604b01793f3e02a776502659e07cd3fc7e3097

3 years agochan_ooh323: Fix cppcheck warnings
Alexander Anikin [Wed, 18 Apr 2018 10:32:34 +0000 (13:32 +0300)]
chan_ooh323: Fix cppcheck warnings

Fix cppcheck warnings about redundant conditions and possible
null pointer usage

ASTERISK-27793 #close
Reported by: Ilya Shipitsin
Tested by: Ilya Shipitsin

Change-Id: I0b31933b062a23331dbac9a82b8bcfe345f406f6

3 years agobridge_softmix / app_confbridge: Add support for REMB combining.
Joshua Colp [Wed, 4 Apr 2018 18:12:50 +0000 (15:12 -0300)]
bridge_softmix / app_confbridge: Add support for REMB combining.

This change adds the ability for multiple REMB reports in
bridge_softmix to be combined according to a configured
behavior into a single report. This single report is sent
back to the sender of video, which adjusts the encoding bitrate
to be at or below the bitrate of the report. The available
behaviors are: lowest, highest, and average. Lowest uses the
lowest received bitrate. Highest uses the highest received
bitrate. Average goes through the received bitrates adding
them to the previous average and creates a new average.

Other behaviors can be added in the future and the existing
average one may be adjusted, but this provides the foundation
to do so.

Support for configuring which behavior to use has been
added to app_confbridge.


Change-Id: I9eafe4e7c1f72d67074a8d6acb26bfcf19322b66

3 years agoMerge "res_musiconhold: Don't restart MOH from beginning after announcement."
Jenkins2 [Tue, 17 Apr 2018 17:21:37 +0000 (12:21 -0500)]
Merge "res_musiconhold: Don't restart MOH from beginning after announcement."

3 years agostreams: Add string metadata capability
George Joseph [Fri, 13 Apr 2018 20:14:47 +0000 (14:14 -0600)]
streams: Add string metadata capability

Replaces the never used opaque data array.

Updated stream tests to include get/set metadata and
stream clone with metadata.

Added stream metadata dump to "core show channel"

Change-Id: Id7473aa4b374d7ab53046c20e321037ba9a56863

3 years agoutils: Add ast_assert_return
George Joseph [Fri, 13 Apr 2018 20:17:36 +0000 (14:17 -0600)]
utils: Add ast_assert_return

Similar to pjproject's PJ_ASSERT_RETURN macro, this one will do the

If the assert passes... NoOp

If the assert fails and AST_DEVMODE is defined, execute ast_assert()
then, if DO_CRASH isn't set, return from the calling function with
the supplied value.

If the assert fails and AST_DEVMODE is not defined, return from the
calling function with the supplied value.

The macro will execute a return without a value if one isn't suppled.

Change-Id: I0003844affeab550d5ff5bca7aa7cf8a559b873e

3 years agoapp_sendtext: Enhance SendText to support Enhanced Messaging
George Joseph [Tue, 10 Apr 2018 21:09:49 +0000 (15:09 -0600)]
app_sendtext:  Enhance SendText to support Enhanced Messaging

SendText now accepts new channel variables that can be used
to override the To and From display names and set the Content-Type
of a message.  Since you can now set Content-Type, other text/*
content types are now valid.

Change-Id: I648b4574478119f95de09d9f08e9595831b02830

3 years agobridge_softmix: Forward TEXT frames
George Joseph [Wed, 27 Sep 2017 16:44:53 +0000 (10:44 -0600)]
bridge_softmix:  Forward TEXT frames

Core bridging and, more specifically, bridge_softmix have been
enhanced to relay received frames of type TEXT or TEXT_DATA to all
participants in a softmix bridge.  res_pjsip_messaging and
chan_pjsip have been enhanced to take advantage of this so when
res_pjsip_messaging receives an in-dialog MESSAGE message from a
user in a conference call, it's relayed to all other participants
in the call.

res_pjsip_messaging already queues TEXT frames to the channel when
it receives an in-dialog MESSAGE from an endpoint and chan_pjsip
will send an MESSAGE when it gets a TEXT frame.  On a normal
point-to-point call, the frames are forwarded between the two
correctly.  bridge_softmix was not though so messages weren't
getting forwarded to conference bridge participants.  Even if they
were, the bridging code had no way to tell the participants who
sent the message so it would look like it came from the bridge

* The TEXT frame type doesn't allow storage of any meta data, such
as sender, on the frame so a new TEXT_DATA frame type was added that
uses the new ast_msg_data structure as its payload.  A channel
driver can queue a frame of that type when it receives a message
from outside.  A channel driver can use it for sending messages
by implementing the new send_text_data channel tech callback and
setting the new AST_CHAN_TP_SEND_TEXT_DATA flag in its tech
properties.  If set, the bridging/channel core will use it instead
of the original send_text callback and it will get the ast_msg_data
structure. Channel drivers aren't required to implement this.  Even
if a TEXT_DATA enabled driver uses it for incoming messages, an
outgoing channel driver that doesn't will still have it's send_text
callback called with only the message text just as before.

* res_pjsip_messaging now creates a TEXT_DATA frame for incoming
in-dialog messages and sets the "from" to the display name in the
"From" header, or if that's empty, the caller id name from the
channel.  This allows the chat client user to set a friendly name
for the chat.

* bridge_softmix now forwards TEXT and TEXT_DATA frames to all
participants (except the sender).

* A new function "ast_sendtext_data" was added to channel which
takes an ast_msg_data structure and calls a channel's
send_text_data callback, or if that's not defined, the original
send_text callback.

* bridge_channel now calls ast_sendtext_data for TEXT_DATA frame
types and ast_sendtext for TEXT frame types.

* chan_pjsip now uses the "from" name in the ast_msg_data structure
(if it exists) to set the "From" header display name on outgoing text

Change-Id: Idacf5900bfd5f22ab8cd235aa56dfad090d18489

3 years agoutils/pval: Add -lBlocksRuntime for compiler clang conditionally.
Alexander Traud [Tue, 17 Apr 2018 12:06:55 +0000 (14:06 +0200)]
utils/pval: Add -lBlocksRuntime for compiler clang conditionally.


Change-Id: I930b364a33d54cc08dedfcd5bb45f7e83242f134

3 years agochan_vpb: Avoid GNU old-style field designator extension.
Alexander Traud [Tue, 17 Apr 2018 10:27:47 +0000 (12:27 +0200)]
chan_vpb: Avoid GNU old-style field designator extension.

clang 6.0 warned about this. Beside that, this change removes the used variable


Change-Id: Ia26bdcc0a562c058151814511cfcf70ecafa595b

3 years agores_rtp_asterisk: Add support for receiving and handling NACK requests.
Ben Ford [Mon, 9 Apr 2018 22:09:03 +0000 (17:09 -0500)]
res_rtp_asterisk: Add support for receiving and handling NACK requests.

Adds the ability to receive and handle incoming NACK requests if
retransmissions are enabled. If retransmissions are enabled, a data
buffer is allocated that stores packets being sent. If a NACK request
is received, the packet requested for retransmission is sent if it is
still in the buffer. In the same request, if any of the following 16
packets are marked as not received, those will be sent as well if
available, as outlined in RFC4585.

Also changes RTCP RR and SR to use media source SSRC instead of packet
source SSRC when determining which instance to use for RTCP reports.

For more information, refer to the wiki page:

ASTERISK-27806 #close

Change-Id: I7f7f124af3b9d5d2fd9cffc6ba8cb48a6fff06ec

3 years agostringfields: Collect extended stringfields into the stringfield section.
Richard Mudgett [Mon, 16 Apr 2018 21:38:49 +0000 (16:38 -0500)]
stringfields: Collect extended stringfields into the stringfield section.

Use of extended stringfields is a temporary mechanism to avoid ABI
breakage in released branches without resorting to more inconvienient

* Collect existing extended stringfields into the parent stringfield
section of the struct.

Change-Id: I8d46d037801b4518837c3ea4b6df95ceadc9436b

3 years agoMerge "res_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations."
George Joseph [Mon, 16 Apr 2018 16:12:30 +0000 (11:12 -0500)]
Merge "res_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations."

3 years agoMerge "pjsip_scheduler.c: Add ability to trace scheduled tasks."
Jenkins2 [Mon, 16 Apr 2018 12:11:26 +0000 (07:11 -0500)]
Merge "pjsip_scheduler.c: Add ability to trace scheduled tasks."

3 years agoMerge "pjsip_scheduler.c: Fix some corner cases."
Jenkins2 [Mon, 16 Apr 2018 11:49:14 +0000 (06:49 -0500)]
Merge "pjsip_scheduler.c: Fix some corner cases."

3 years agores_musiconhold: Don't restart MOH from beginning after announcement.
Ben Ford [Fri, 13 Apr 2018 19:32:48 +0000 (14:32 -0500)]
res_musiconhold: Don't restart MOH from beginning after announcement.

This reverts a problem introduced by the fix for ASTERISK_24329.
Now, when an announcement is played while waiting in a queue, music on
hold will not restart from the beginning of the sound file and will
instead pick up where it left off. However, the incorrect behavior in
ASTERISK_24329 is now present again; if an announcement X seconds
long is played when music on hold starts, music on hold will start X
seconds into the file.

ASTERISK-27774 #close
Reported by: lvl

Change-Id: I86b2885ee7063268f9b9747eddb788336ade989b

3 years agopjsip_scheduler.c: Add ability to trace scheduled tasks.
Richard Mudgett [Wed, 28 Mar 2018 20:13:13 +0000 (15:13 -0500)]
pjsip_scheduler.c: Add ability to trace scheduled tasks.

When a scheduled task is created you can pass in the
AST_SIP_SCHED_TASK_TRACK flag.  This new flag causes scheduling events to
be logged.

Change-Id: I91967eb3d5a220915ce86881a28af772f9a7f56b

3 years agores_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations.
Richard Mudgett [Tue, 27 Mar 2018 16:04:42 +0000 (11:04 -0500)]
res_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations.

ast_sip_push_task_synchronous() did not necessarily execute the passed in
task under the specified serializer.  If the current thread is any
registered pjsip thread then it would execute the task immediately instead
of under the specified serializer.  Reentrancy issues could result if the
task does not execute with the right serializer.

The original reason ast_sip_push_task_synchronous() checked to see if the
current thread was a registered pjsip thread was because of a deadlock
with masquerades and the channel technology's fixup callback
(ASTERISK_22936).  A subsequent masquerade deadlock fix (ASTERISK_24356)
involving call pickups avoided the original deadlock situation entirely.
The PJSIP channel technology's fixup callback no longer needed to call

However, there are a few places where this unexpected behavior is still
required to avoid deadlocks.  The pjsip monitor thread executes callbacks
that do calls to ast_sip_push_task_synchronous() that would deadlock if
the task were actually pushed to the specified serializer.  I ran into one
dealing with the pubsub subscriptions where an ao2 destructor called

* Split ast_sip_push_task_synchronous() into
ast_sip_push_task_wait_servant() and ast_sip_push_task_wait_serializer().
ast_sip_push_task_wait_servant() has the old behavior of
ast_sip_push_task_synchronous().  ast_sip_push_task_wait_serializer() has
the new behavior where the task is always executed by the specified
serializer or a picked serializer if one is not passed in.  Both functions
behave the same if the current thread is not a SIP servant.

* Redirected ast_sip_push_task_synchronous() to
ast_sip_push_task_wait_servant() to preserve API for released branches.


Change-Id: Id040fa42c0e5972f4c8deef380921461d213b9f3

3 years agopjsip_scheduler.c: Fix some corner cases.
Richard Mudgett [Thu, 22 Mar 2018 00:43:21 +0000 (19:43 -0500)]
pjsip_scheduler.c: Fix some corner cases.

* Fix the periodic interval wander because it may take significant time
between the sched thread queueing the task in the serializer and the
serializer actually executing the task.  The time it takes to actually
execute the task was already taken into account.

* Pass a schtd ref to the serializer when we queue a scheduled task on
the serializer.  We don't want it going away on us while it is in the
serializer queue.

* Skip the scheduled task if the task was canceled between queueing the
task to the serializer and the serializer actually executing the task.

* Reorder struct ast_sip_sched_task to avoid unnecessary padding.  Removed
task_id and added next_periodic.

* Hold a ref to the passed in serializer so the serializer cannot go away
on the scheduled task.


Change-Id: I6c8046b75f6953792c8c30e55b836a4291143f24

3 years agopjsip_scheduler.c: Sort "pjsip show scheduled_tasks" output.
Richard Mudgett [Fri, 23 Mar 2018 00:09:02 +0000 (19:09 -0500)]
pjsip_scheduler.c: Sort "pjsip show scheduled_tasks" output.

* A side benefit is that the scheduled tasks are not completely blocked
while the CLI command executes.

* Adjusted the "Task Name" column width to have more room for longer

Change-Id: Iec64aa463ee8b10eef90120e00c38b1fb444087e

3 years agoMerge "res_pjsip_notify.c: enable in-dialog NOTIFY"
Jenkins2 [Thu, 12 Apr 2018 20:03:54 +0000 (15:03 -0500)]
Merge "res_pjsip_notify.c: enable in-dialog NOTIFY"

3 years agoMerge "pjsip_scheduler.c: Fix ao2 usage errors."
Jenkins2 [Thu, 12 Apr 2018 15:25:18 +0000 (10:25 -0500)]
Merge "pjsip_scheduler.c: Fix ao2 usage errors."

3 years agoMerge "Build System: Strip '-std=c99' from CFLAGS provided by libraries."
Jenkins2 [Thu, 12 Apr 2018 14:52:02 +0000 (09:52 -0500)]
Merge "Build System: Strip '-std=c99' from CFLAGS provided by libraries."

3 years agocdr_mysql: Compile error because MYSQL_PORT definition is missing
Evandro Cesar Arruda [Mon, 2 Apr 2018 20:59:29 +0000 (17:59 -0300)]
cdr_mysql: Compile error because MYSQL_PORT definition is missing

If it is not defined, it will add MYSQL_PORT definition. After some
research on MySQL/MariaDB development tree, I couldn't find any reference
to MYSQL_PORT definition in include files.

ASTERISK-27782 #close

Change-Id: Ieee56c836fc2e8bd021c456145bba04c6068bb77

3 years agores_pjsip_session: Rewrite o= with external_media_address.
Chris-Savinovich [Tue, 10 Apr 2018 01:00:37 +0000 (21:00 -0400)]
res_pjsip_session: Rewrite o= with external_media_address.

It now appends the external IP address on the
o= line of the SDP packet.  The decision was made to write
the numeric IP address as opposed to the RFC that states
the FQDN should be used if and when available.  We believe
the usage of literal IP address will help avoid
potential problems.

ASTERISK-27614 #close

Change-Id: I84f3360f3606b8c4e8d161edb228799ec0b8a302

3 years agores_pjsip_notify.c: enable in-dialog NOTIFY
Nathan Bruning [Thu, 22 Feb 2018 18:18:48 +0000 (19:18 +0100)]
res_pjsip_notify.c: enable in-dialog NOTIFY

This patch adds support to send in-dialog SIP NOTIFY commands on
chan_pjsip channels, similar to the functionality recently added
for chan_sip (ASTERISK_27461).

This extends res_pjsip_notify to allow for in-dialog messages.


Change-Id: If7f3151a6d633e414d5dc319d5efc1443c43dd29

3 years agoMerge "res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge"
Jenkins2 [Wed, 11 Apr 2018 12:11:16 +0000 (07:11 -0500)]
Merge "res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge"

3 years agoMerge "chan_sip.c: Fix INVITE with replaces channel ref leak."
George Joseph [Tue, 10 Apr 2018 15:10:52 +0000 (10:10 -0500)]
Merge "chan_sip.c: Fix INVITE with replaces channel ref leak."

3 years agopjsip_scheduler.c: Fix ao2 usage errors.
Richard Mudgett [Thu, 22 Mar 2018 18:35:04 +0000 (13:35 -0500)]
pjsip_scheduler.c: Fix ao2 usage errors.

* Removed several invalid uses of OBJ_NOLOCK.  These uses resulted in the
'tasks' container being accessed without a lock in a multi-threaded
environment.  A recipe for crashes.

* Removed needlessly obtaining schtd object references.  If the caller
providing you a pointer to an object doesn't have a valid reference then
you cannot safely get one from it.

* Getting a ref to 'tasks' when you aren't copying the pointer into
another location is useless.  The 'tasks' container pointer is global.

* Removed many unnecessary uses of RAII_VAR.

* Make ast_sip_schedule_task() name parameter const.


Change-Id: I5c62488e651314e2a1dbc01f5b078a15512d73db

3 years agoMerge "pjsip / res_rtp_asterisk: Add support for sending REMB"
Jenkins2 [Mon, 9 Apr 2018 16:14:16 +0000 (11:14 -0500)]
Merge "pjsip / res_rtp_asterisk: Add support for sending REMB"

3 years agoMerge "res_rtp_asterisk: Fix minimum block word length for REMB."
Joshua Colp [Mon, 9 Apr 2018 15:58:00 +0000 (10:58 -0500)]
Merge "res_rtp_asterisk: Fix minimum block word length for REMB."

3 years agoMerge "app_confbridge / bridge_softmix: Add ability to configure REMB interval."
Joshua Colp [Mon, 9 Apr 2018 15:57:40 +0000 (10:57 -0500)]
Merge "app_confbridge / bridge_softmix: Add ability to configure REMB interval."

3 years agoMerge "Build System: Fixes for configure script."
Joshua Colp [Mon, 9 Apr 2018 15:32:49 +0000 (10:32 -0500)]
Merge "Build System: Fixes for configure script."

3 years agoMerge "app_originate: Add async option."
Joshua Colp [Mon, 9 Apr 2018 15:32:38 +0000 (10:32 -0500)]
Merge "app_originate: Add async option."

3 years agoMerge "res_rtp_asterisk: Queue video update on picture loss indication."
Jenkins2 [Mon, 9 Apr 2018 15:27:26 +0000 (10:27 -0500)]
Merge "res_rtp_asterisk: Queue video update on picture loss indication."

3 years agoBuild System: Enable python3 compatibility.
Corey Farrell [Fri, 23 Mar 2018 11:49:59 +0000 (07:49 -0400)]
Build System: Enable python3 compatibility.

* Consistently use spaces in rest-api-templates/
* Exclude third-party from docs/full-en_US.xml.
* Add docs/full-en_US.xml to .gitignore.
* Use list() to convert python3 view.
* Use python3 print function.
* Replace cmp() with equivalent equation.
* Replace reference to out of scope subtype variable with name
* Use unescaping triple bracket notation in mustache templates where
  needed.  This causes behavior of Python2 to be maintained when using
* Fix references to has_websocket / is_websocket in
* Update calculation of has_websocket to use any().
* Use unicode mode for writing output file in
* Replace 'from swagger_model import *' with explicit import of required

I have not tested or, only the
print syntax has been fixed.

Change-Id: If5c5b556a2800d41a3e2cfef080ac2e151178c33

3 years agores_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge
Richard Mudgett [Thu, 5 Apr 2018 23:33:40 +0000 (18:33 -0500)]
res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge

There is a problem when an INVITE-with-Replaces transfer targets a channel
in a ConfBridge.  The transfer will unconditionally swap out the
ConfBridge channel.  Unfortunately, the ConfBridge state will not be aware
of this change.  Unexpected behavior will happen as a result since
ConfBridge channels currently can only be replaced by a masquerade and not
normal bridge channel moves.

* We just need to pretend that the channel isn't in a bridge (like other
transfer methods already do) so the transfer channel will masquerade into
the ConfBridge channel.

Change-Id: I209beb0e748fa4f4b92a576f36afa8f495ba4c82

3 years agopjsip / res_rtp_asterisk: Add support for sending REMB
Joshua Colp [Wed, 28 Mar 2018 12:27:31 +0000 (12:27 +0000)]
pjsip / res_rtp_asterisk: Add support for sending REMB

This change allows chan_pjsip to be given an AST_FRAME_RTCP
containing REMB feedback and pass it to res_rtp_asterisk.
Once res_rtp_asterisk receives the frame a REMB RTCP feedback
packet is constructed with the appropriate contents and sent
to the remote endpoint.


Change-Id: Ic53f821c1560d8924907ad82c4d9c0bc322b38cd

3 years agoMerge "res_pjsip: Update authenticate_qualify documentation."
Jenkins2 [Fri, 6 Apr 2018 11:53:51 +0000 (06:53 -0500)]
Merge "res_pjsip: Update authenticate_qualify documentation."

3 years agores_rtp_asterisk: Fix minimum block word length for REMB.
Joshua Colp [Fri, 6 Apr 2018 01:02:27 +0000 (01:02 +0000)]
res_rtp_asterisk: Fix minimum block word length for REMB.

The minimum block word length is actually 4, not 5.

Change-Id: I878542218225aed72c72bdf1b856fc822cd2d649

3 years agores_rtp_asterisk: Queue video update on picture loss indication.
Joshua Colp [Thu, 5 Apr 2018 23:48:31 +0000 (23:48 +0000)]
res_rtp_asterisk: Queue video update on picture loss indication.

The previous payload specific feedback handling was very single
minded in that it just assumed everything should trigger a video
update. This was changed but the handling of picture loss indication
was not added. The result was that video may not flow. This change
adds it explicitly in.

Change-Id: I1894be02e39ee10a0af841b5a1dca5f0ec7d60b6

3 years agochan_sip.c: Fix INVITE with replaces channel ref leak.
Richard Mudgett [Thu, 5 Apr 2018 22:40:52 +0000 (17:40 -0500)]
chan_sip.c: Fix INVITE with replaces channel ref leak.

Given the below call scenario:
A -> Ast1 -> B
C <- Ast2 <- B

1) A calls B through Ast1
2) B calls C through Ast2
3) B transfers A to C

When party B transfers A to C, B sends a REFER to Ast1 causing Ast1 to
send an INVITE with replaces to Ast2.  Ast2 then leaks a channel ref of
the channel between Ast1 and Ast2.

Channel ref leaks are easily seen in the CLI "core show channels" output.
The leaked channels appear in the output but you can do nothing with them
and they never go away unless you restart Asterisk.

* Properly account for the channel refs when imparting a channel into a
bridge when handling an INVITE with replaces in handle_invite_replaces().
The ast_bridge_impart() function steals a channel ref but the code didn't
account for how many refs were held by the code at the time and which ref
was stolen.

* Eliminated RAII_VAR in handle_invite_replaces().


Change-Id: I7edbed774314b55acf0067b2762bfe984ecaa9a4

3 years agores_pjsip: Update authenticate_qualify documentation.
Richard Mudgett [Thu, 22 Mar 2018 00:40:46 +0000 (19:40 -0500)]
res_pjsip: Update authenticate_qualify documentation.

Change-Id: I3811de0014b1ffe96d4a3b49cddd5d4ca02ee5d4

3 years agoapp_agent_pool.c: Fix off nominal ref leak.
Richard Mudgett [Mon, 2 Apr 2018 21:49:38 +0000 (16:49 -0500)]
app_agent_pool.c: Fix off nominal ref leak.

Change-Id: Ib427ffc2c802620eaafb08b1c2a17dddd8fb8eb6

3 years agoBuild System: Strip '-std=c99' from CFLAGS provided by libraries.
Corey Farrell [Wed, 4 Apr 2018 15:02:06 +0000 (11:02 -0400)]
Build System: Strip '-std=c99' from CFLAGS provided by libraries.

Asterisk requires GNU C extensions.  On some systems certain libraries
may incorrectly push -std=c99 into CFLAGS, thus breaking the build.
This change causes that flag to be stripped so the Asterisk build is not
broken by those libraries.  This change is made for both pkgconfig and
tool based libraries.

ASTERISK-27629 #close

Change-Id: I13389613b194abbac77becf90cd950dc168704db

3 years agoBuild System: Fixes for configure script.
Corey Farrell [Tue, 3 Apr 2018 19:39:39 +0000 (15:39 -0400)]
Build System: Fixes for configure script.

* Replace all 'else if' statements with 'elif'.
* Use loop to detect versioned lua headers and libraries.

The loop for detecting lua fixes a bug where LUA_INCLUDE would be
appended with the directory of every lua version after the first one is

Change-Id: I3276f9aee955014108345be6092f51c932b43a0f

3 years agoapp_confbridge / bridge_softmix: Add ability to configure REMB interval.
Joshua Colp [Mon, 2 Apr 2018 13:53:17 +0000 (10:53 -0300)]
app_confbridge / bridge_softmix: Add ability to configure REMB interval.

This change adds a configuration option to app_confbridge which can be
used to set the interval at which we will send a combined REMB (remote
estimated maximum bitrate) frame to sources of video. The bridging API
has also been extended slightly to allow setting this so bridge_softmix
can use it.


Change-Id: I0e49eae60f369c86434414f3cb8278709c793c82

3 years agoMerge "install_prereq: Add Gentoo Linux."
Joshua Colp [Tue, 3 Apr 2018 12:32:23 +0000 (07:32 -0500)]
Merge "install_prereq: Add Gentoo Linux."

3 years agoMerge "install_prereq: Add Slackware (somehow)."
Jenkins2 [Tue, 3 Apr 2018 11:18:26 +0000 (06:18 -0500)]
Merge "install_prereq: Add Slackware (somehow)."

3 years agoMerge "res_pjsip: Correct usages of pjproject's timer heap"
Jenkins2 [Mon, 2 Apr 2018 18:06:44 +0000 (13:06 -0500)]
Merge "res_pjsip:  Correct usages of pjproject's timer heap"

3 years agoMerge "pjroject_bundled: Add already-destroyed check to tsx_timer_callback"
Jenkins2 [Mon, 2 Apr 2018 15:42:52 +0000 (10:42 -0500)]
Merge "pjroject_bundled:  Add already-destroyed check to tsx_timer_callback"

3 years agores_pjsip: Correct usages of pjproject's timer heap
George Joseph [Tue, 2 Jan 2018 13:54:54 +0000 (06:54 -0700)]
res_pjsip:  Correct usages of pjproject's timer heap

Fix some timer heap initializations and cancels to try and prevent
crashes and timer heap issues.

Change-Id: I64885d190fa22097d1b55987091375541e57a7ee

3 years agoMerge "main: Update copyright notice with year 2018"
George Joseph [Mon, 2 Apr 2018 15:14:15 +0000 (10:14 -0500)]
Merge "main: Update copyright notice with year 2018"

3 years agopjroject_bundled: Add already-destroyed check to tsx_timer_callback
George Joseph [Sun, 25 Mar 2018 18:35:12 +0000 (12:35 -0600)]
pjroject_bundled:  Add already-destroyed check to tsx_timer_callback

There have been cases that when the transaction timer callback is called
the tsx is already destroyed.  This causes a crash.  We now check the
tsx state and return if the tsx is already destroyed.

Change-Id: If93acd5e48d9ca5bb553f2405d5afc836842fe1c

3 years agopjproject_bundled: timer: Clean up usage of timer heap
George Joseph [Sun, 25 Mar 2018 18:25:30 +0000 (12:25 -0600)]
pjproject_bundled: timer: Clean up usage of timer heap

Added a new pj_timer_entry_reset function that resets a timer_entry
for re-use.

Changed direct settings of timer_entry fields to use
pj_timer_entry_init and pj_timer_entry_reset.

Fixed issues where timers were being rescheduled incorrectly.

Change-Id: I5b624bfbc5c1429117484b9b24567293002148e6

3 years agoMerge "BuildSystem: With external editline, do not require libs for internal editline."
Jenkins2 [Mon, 2 Apr 2018 13:36:01 +0000 (08:36 -0500)]
Merge "BuildSystem: With external editline, do not require libs for internal editline."

3 years agoMerge "core: Create main/options.c."
Jenkins2 [Mon, 2 Apr 2018 13:31:08 +0000 (08:31 -0500)]
Merge "core: Create main/options.c."

3 years agoMerge "pjproject_bundled: Add patch for pj_atomic crashes"
George Joseph [Mon, 2 Apr 2018 13:19:05 +0000 (08:19 -0500)]
Merge "pjproject_bundled:  Add patch for pj_atomic crashes"

3 years agores_pjsip: Fix deadlock on reliable transport shutdown.
Richard Mudgett [Thu, 29 Mar 2018 22:07:56 +0000 (17:07 -0500)]
res_pjsip: Fix deadlock on reliable transport shutdown.

A deadlock can happen when the PJSIP monitor thread is shutting down a
connection oriented transport (TCP/TLS) used by a subscription at the same
time as another thread tries to send something for that subscription.  The
deadlock is between the pjsip monitor thread attempting to get the dialog
lock and another thread sending something for that dialog when it tries to
get the transport manager lock.

* res_pjsip_pubsub.c: Avoid the deadlock by pushing the subscription
removal to the subscription serializer.

* res_pjsip_registrar.c: Pushed off incoming registration contact removals
to a default serializer as a precaution.  Removing the contacts involves
sorcery access which in this case will involve database access.  Depending
upon the setup, the database may not be on the same machine and could take
awhile.  We don't want to hold up the pjsip monitor thread with
potentially long access times.


Change-Id: I56b647aea565f24dba33e9e5ebeed4cd3f31f8c4

3 years agoMerge "res_rtp_asterisk: Add support for raising additional RTCP messages."
Kevin Harwell [Thu, 29 Mar 2018 20:19:17 +0000 (15:19 -0500)]
Merge "res_rtp_asterisk: Add support for raising additional RTCP messages."

3 years agoMerge "main/indications: Use ast_cli_completion_add for all completions."
Kevin Harwell [Thu, 29 Mar 2018 20:06:45 +0000 (15:06 -0500)]
Merge "main/indications: Use ast_cli_completion_add for all completions."

3 years agoMerge "BuildSystem: pjsip_evsub_set_uas_timeout was not used (part 2)."
Jenkins2 [Thu, 29 Mar 2018 20:02:19 +0000 (15:02 -0500)]
Merge "BuildSystem: pjsip_evsub_set_uas_timeout was not used (part 2)."

3 years agoMerge "pjsip_transport_events.c: Fix crash using stale transport pointer."
Jenkins2 [Thu, 29 Mar 2018 19:39:26 +0000 (14:39 -0500)]
Merge "pjsip_transport_events.c: Fix crash using stale transport pointer."

3 years agoMerge "test_data_buffer.c: Add unit tests for data buffer API."
Jenkins2 [Thu, 29 Mar 2018 18:41:37 +0000 (13:41 -0500)]
Merge "test_data_buffer.c: Add unit tests for data buffer API."

3 years agoMerge "Add data buffer API to store packets."
Jenkins2 [Thu, 29 Mar 2018 18:38:02 +0000 (13:38 -0500)]
Merge "Add data buffer API to store packets."

3 years agoMerge "core: fix getopt(3) usage"
Jenkins2 [Thu, 29 Mar 2018 15:52:25 +0000 (10:52 -0500)]
Merge "core: fix getopt(3) usage"

3 years agopjsip_transport_events.c: Fix crash using stale transport pointer.
Ross Beer [Wed, 7 Mar 2018 12:15:05 +0000 (12:15 +0000)]
pjsip_transport_events.c: Fix crash using stale transport pointer.

Apparently it is possible for the transport to be destroyed without
triggering the transport callback logic.  As a result the transport gets
destroyed and we have a stale pointer in the active_transports container.

* Invoke the transport monitor callback checks when the transport is
destroyed in addition to when it is disconnected and shutdown.


Change-Id: Ia9b5469fea8f2b3f2d8476fae6b748a4d23e7261

3 years agotest_data_buffer.c: Add unit tests for data buffer API.
Ben Ford [Mon, 19 Mar 2018 14:36:44 +0000 (09:36 -0500)]
test_data_buffer.c: Add unit tests for data buffer API.

Added unit tests for the data buffer API. These tests include creating a
data buffer, putting payloads into the buffer, resizing the buffer, and
the nominal case for data buffer usage, which consists of adding
the max number of payloads to the buffer, checking to see if the correct
payloads are present, then adding more payloads and checking again to
see if the previous payloads were replaced or not.

For more information, refer to the wiki page:

Change-Id: Id5b599aa15a5e61d0ec080f97cd0c57bd07e6f8f