4 years agoMerge "main/asterisk.c: ast_el_read_char"
Matt Jordan [Thu, 21 Jan 2016 23:25:03 +0000 (17:25 -0600)]
Merge "main/asterisk.c: ast_el_read_char"

4 years agoMerge "chan_sip: option 'notifyringing' change and doc fix"
Mark Michelson [Thu, 21 Jan 2016 21:22:53 +0000 (15:22 -0600)]
Merge "chan_sip: option 'notifyringing' change and doc fix"

4 years agores_pjsip: Add CLI "pjsip dump endpt [details]"
Richard Mudgett [Wed, 13 Jan 2016 22:49:22 +0000 (16:49 -0600)]
res_pjsip: Add CLI "pjsip dump endpt [details]"

Dump the res_pjsip endpt internals.

In non-developer mode we will not document or make easily accessible the
"details" option even though it is still available.  The user has to know
it exists to use it.  Presumably they would also be aware of the potential
crash warning below.

Warning: PJPROJECT documents that the function used by this CLI command
may cause a crash when asking for details because it tries to access all
active memory pools.

Change-Id: If2d98a3641c9873364d1daaad971376311aef3cb

4 years agoMerge "taskprocessor.c: Increase CLI "core ping taskprocessor" timeout."
Mark Michelson [Wed, 20 Jan 2016 20:19:02 +0000 (14:19 -0600)]
Merge "taskprocessor.c: Increase CLI "core ping taskprocessor" timeout."

4 years agoMerge "taskprocessor.c: Fix some taskprocessor unrefs."
Mark Michelson [Wed, 20 Jan 2016 20:18:57 +0000 (14:18 -0600)]
Merge "taskprocessor.c: Fix some taskprocessor unrefs."

4 years agoMerge "res_pjproject: Add module providing pjproject logging and utils"
Joshua Colp [Wed, 20 Jan 2016 17:46:05 +0000 (11:46 -0600)]
Merge "res_pjproject:  Add module providing pjproject logging and utils"

4 years agomain/asterisk.c: ast_el_read_char
Diederik de Groot [Mon, 18 Jan 2016 09:49:48 +0000 (10:49 +0100)]
main/asterisk.c: ast_el_read_char

Make sure buf[res] is not accessed at res=-1 (buffer underrun).
Address Sanitizer will complain about this quite loudly.

ASTERISK-24801 #close

Change-Id: Ifcd7f691310815a31756b76067c56fba299d3ae9

4 years agores_pjproject: Add module providing pjproject logging and utils
George Joseph [Tue, 19 Jan 2016 01:27:57 +0000 (18:27 -0700)]
res_pjproject:  Add module providing pjproject logging and utils

res_pjsip_log_forwarder has been renamed to res_pjproject
and enhanced as follows:

As a follow-on to the recent 'Add CLI "pjsip show buildopts"' patch,
a new ast_pjproject_get_buildopt function has been added.  It
allows the caller to get the value of one of the buildopts.

The initial use case is retrieving the runtime value of
PJ_MAX_HOSTNAME to insure we don't send a hostname greater
than pjproject can handle.  Since it can differ between
the version of pjproject that Asterisk was compiled against
and the version of pjproject that Asterisk is running against,
we can't use the PJ_MAX_HOSTNAME macro directly in Asterisk
source code.

Change-Id: Iab6e82fec3d7cf00c1cf6185c42be3e7569dee1e

4 years agoMerge "funcs/func_cdr: Correctly report high precision values for duration and billsec"
Joshua Colp [Wed, 20 Jan 2016 16:33:27 +0000 (10:33 -0600)]
Merge "funcs/func_cdr: Correctly report high precision values for duration and billsec"

4 years agoMerge "pjsip_loging_refactor: Rename res_pjsip_log_forwarder to res_pjproject"
Joshua Colp [Wed, 20 Jan 2016 16:32:47 +0000 (10:32 -0600)]
Merge "pjsip_loging_refactor: Rename res_pjsip_log_forwarder to res_pjproject"

4 years agofuncs/func_cdr: Correctly report high precision values for duration and billsec
Matt Jordan [Mon, 18 Jan 2016 23:16:24 +0000 (17:16 -0600)]
funcs/func_cdr: Correctly report high precision values for duration and billsec

When CDRs were refactored, func_cdr's ability to report high precision values
for duration and billsec (the 'f' option) was broken. This was due to func_cdr
incorrectly interpreting the duration/billsec values provided by the CDR engine
in milliseconds, as opposed to seconds. Since the CDR engine only provides
duration and billsec in seconds, and does not expose either attribute with
sufficient precision to merely pass back the underlying value, this patch fixes
the bug by re-calculating duration and billsec with microsecond precision based
on the start/answer/end times on the CDR.

ASTERISK-25179 #close

Change-Id: I8bc63822b496537a5bf80baf6102c06206bee841

4 years agotest_threadpool: Wait for each task to complete and fix memory leak.
Joshua Colp [Tue, 19 Jan 2016 23:15:50 +0000 (19:15 -0400)]
test_threadpool: Wait for each task to complete and fix memory leak.

This change makes the thread_timeout_thrash unit test wait for
each task to complete. This fixes the problem where the test would
prematurely end when all threads were gone and a new one had to be
started to handle the last task. It also increases the thrasing as
it is now more likely for each task to encounter the above scenario.

This also fixes a memory leak where the data for each task was not
being freed.

ASTERISK-25611 #close

Change-Id: I5017d621a4dc911f509074c16229b86bff2fb3c6

4 years agoMerge "Refactor init_logger_chain locking."
Mark Michelson [Tue, 19 Jan 2016 23:07:27 +0000 (17:07 -0600)]
Merge "Refactor init_logger_chain locking."

4 years agotaskprocessor.c: Increase CLI "core ping taskprocessor" timeout.
Richard Mudgett [Tue, 19 Jan 2016 01:44:24 +0000 (19:44 -0600)]
taskprocessor.c: Increase CLI "core ping taskprocessor" timeout.

Change-Id: I4892d6acbb580d6c207d006341eaf5e0f8f2a029

4 years agotaskprocessor.c: Fix some taskprocessor unrefs.
Richard Mudgett [Tue, 19 Jan 2016 01:43:41 +0000 (19:43 -0600)]
taskprocessor.c: Fix some taskprocessor unrefs.

You have to call ast_taskprocessor_unref() outside of the taskprocessor
implementation code.  Taskprocessor use since v12 has become more
transient than just the singleton uses in earlier versions.

Change-Id: If7675299924c0cc65f2a43a85254e6f06f2d61bb

4 years agoFix alembic branches on master.
Richard Mudgett [Tue, 19 Jan 2016 20:16:17 +0000 (14:16 -0600)]
Fix alembic branches on master.

Change-Id: I64ed21fec50eb833641ca49d92184f6aaabd86e8

4 years agoRefactor init_logger_chain locking.
Corey Farrell [Tue, 5 Jan 2016 23:12:54 +0000 (18:12 -0500)]
Refactor init_logger_chain locking.

This removes logchannels locking from init_logger_chain, puts the
responsibility on the caller.  Adds locking around the one call that was
missing it.


Change-Id: I6cc42117338bf9575650a67bcb78ab1a33d7bad8

4 years agoMerge "Remove *.gcna / *.gcno files from added module sources."
Joshua Colp [Tue, 19 Jan 2016 01:24:28 +0000 (19:24 -0600)]
Merge "Remove *.gcna / *.gcno files from added module sources."

4 years agopjsip_loging_refactor: Rename res_pjsip_log_forwarder to res_pjproject
George Joseph [Tue, 19 Jan 2016 01:01:36 +0000 (18:01 -0700)]
pjsip_loging_refactor: Rename res_pjsip_log_forwarder to res_pjproject

Change-Id: I5387821f29e5caa0cba0b7d62b0fc0d341e7e20b

4 years agoMerge "Update version number in features.conf.sample"
Mark Michelson [Mon, 18 Jan 2016 23:31:40 +0000 (17:31 -0600)]
Merge "Update version number in features.conf.sample"

4 years agoMerge "pjsip/alembic: Fix qualify_timeout column definition"
Joshua Colp [Mon, 18 Jan 2016 11:49:45 +0000 (05:49 -0600)]
Merge "pjsip/alembic:  Fix qualify_timeout column definition"

4 years agoMerge "func_channel: Add help text for undocumented CHANNEL function arguments"
Joshua Colp [Sun, 17 Jan 2016 19:48:32 +0000 (13:48 -0600)]
Merge "func_channel: Add help text for undocumented CHANNEL function arguments"

4 years agoMerge "main/config: Clean config maps on shutdown."
Joshua Colp [Sun, 17 Jan 2016 17:44:38 +0000 (11:44 -0600)]
Merge "main/config: Clean config maps on shutdown."

4 years agoUpdate version number in features.conf.sample
Daniel Journo [Sat, 16 Jan 2016 19:18:19 +0000 (19:18 +0000)]
Update version number in features.conf.sample

Update the version number in the comments from Asterisk 12 to Asterisk 12+

Change-Id: Ie692ac8cda3c993c3bf10f27f51a1cca3317ec7b

4 years agopjsip/alembic: Fix qualify_timeout column definition
Daniel Journo [Wed, 13 Jan 2016 21:58:22 +0000 (21:58 +0000)]
pjsip/alembic:  Fix qualify_timeout column definition

Corrects the qualify_timeout column type from Integer to Decimal

ASTERISK-25686 #close
Reported-by: Marcelo Terres

Change-Id: I757d0e3c011ee9be6cd5abd48bc92441a405d3c8

4 years agoMerge "bridge_basic: don't play an attended transfer fail sound after target hangs up"
Joshua Colp [Sat, 16 Jan 2016 14:29:58 +0000 (08:29 -0600)]
Merge "bridge_basic: don't play an attended transfer fail sound after target hangs up"

4 years agoMerge "bridge_basic: don't cache xferfailsound during an attended transfer"
Joshua Colp [Sat, 16 Jan 2016 14:29:17 +0000 (08:29 -0600)]
Merge "bridge_basic: don't cache xferfailsound during an attended transfer"

4 years agoMerge "taskprocessor.c: Simplify ast_taskprocessor_get() return code."
Joshua Colp [Sat, 16 Jan 2016 14:28:16 +0000 (08:28 -0600)]
Merge "taskprocessor.c: Simplify ast_taskprocessor_get() return code."

4 years agomain/config: Clean config maps on shutdown.
Corey Farrell [Sat, 16 Jan 2016 01:52:26 +0000 (20:52 -0500)]
main/config: Clean config maps on shutdown.

ASTERISK-25700 #close

Change-Id: I096da84f9c62c6095f68bcf98eac4b7c7868e808

4 years agobridge_basic: don't cache xferfailsound during an attended transfer
Kevin Harwell [Thu, 14 Jan 2016 20:42:57 +0000 (14:42 -0600)]
bridge_basic: don't cache xferfailsound during an attended transfer

The xferfailsound was read from the channel at the beginning of the transfer,
and that value is "cached" for the duration of the transfer. Therefore, changing
the xferfailsound on the channel using the FEATURE() dialplan function does
nothing once the transfer is under way.

This makes it so the transfer code instead gets the xferfailsound configuration
options from the channel when it is actually going to be used.

This patch also fixes a potential memory leak of the props object as well as
making sure the condition variable gets initialized before being destroyed.

ASTERISK-25696 #close

Change-Id: Ic726b0f54ef588bd9c9c67f4b0e4d787934f85e4

4 years agotaskprocessor.c: Simplify ast_taskprocessor_get() return code.
Richard Mudgett [Fri, 10 Jul 2015 15:37:35 +0000 (10:37 -0500)]
taskprocessor.c: Simplify ast_taskprocessor_get() return code.

Change-Id: Id5bd18ef1f60ef8be453e677e98478298358a9d1

4 years agoastmm.c: Add more stats to CLI "memory show" commands.
Richard Mudgett [Thu, 14 Jan 2016 00:20:57 +0000 (18:20 -0600)]
astmm.c: Add more stats to CLI "memory show" commands.

* Add freed regions totals to allocations and summary.

* Add totals for all allocations and not just the selected allocations.

Change-Id: I61d5a5112617b0733097f2545a3006a344b4032a

4 years agobridge_basic: don't play an attended transfer fail sound after target hangs up
Kevin Harwell [Thu, 14 Jan 2016 22:00:50 +0000 (16:00 -0600)]
bridge_basic: don't play an attended transfer fail sound after target hangs up

If the attended transfer destination answers (picks call up or goes to
voicemail) and then hangs up on the transferer then transferer hears the
fail sound.

This patch makes it so the fail sound is not played when the transfer
destination/target hangs up after answering.

ASTERISK-25697 #close

Change-Id: I97f142fe4fc2805d1a24b7c16143069dc03d9ded

4 years agoRemove *.gcna / *.gcno files from added module sources.
Corey Farrell [Thu, 14 Jan 2016 20:36:10 +0000 (15:36 -0500)]
Remove *.gcna / *.gcno files from added module sources.

Asterisk uses a Makefile macro to associate additional sources with a
module.  This macro is responsible for creating clean targets but
previously left behind *.gcna and *.gcno files.

ASTERISK-25683 #close
Reported by yaron nahum

Change-Id: Idc0823fe80a25c42cefae901fde875e9fc38d8ea

4 years agofunc_channel: Add help text for undocumented CHANNEL function arguments
Rusty Newton [Thu, 14 Jan 2016 15:26:15 +0000 (09:26 -0600)]
func_channel: Add help text for undocumented CHANNEL function arguments

Adding help text documentation for:
* hangupsource
* appname
* appdata
* exten
* context
* channame
* uniqueid
* linkedid

ASTERISK-24097 #close
Reported by: Steven T. Wheeler
Tested by: Rusty Newton

Change-Id: Ib94b00568b0433987df87d5b67ea529b5905754d

4 years agoMerge "pjsip: Add option global/regcontext"
Joshua Colp [Thu, 14 Jan 2016 12:32:12 +0000 (06:32 -0600)]
Merge "pjsip:  Add option global/regcontext"

4 years agopjsip: Add option global/regcontext
Daniel Journo [Sun, 10 Jan 2016 22:22:12 +0000 (22:22 +0000)]
pjsip:  Add option global/regcontext

Added new global option (regcontext) to pjsip. When set, Asterisk will
dynamically create and destroy a NoOp priority 1 extension
for a given endpoint who registers or unregisters with us.

ASTERISK-25670 #close
Reported-by: Daniel Journo

Change-Id: Ib1530c5b45340625805c057f8ff1fb240a43ea62

4 years agoapp: Queue hangup if channel is hung up during sub or macro execution.
Joshua Colp [Tue, 12 Jan 2016 17:14:29 +0000 (13:14 -0400)]
app: Queue hangup if channel is hung up during sub or macro execution.

This issue was exposed when executing a connected line subroutine.
When connected or redirected subroutines or macros are executed it is
expected that the underlying applications and logic invoked are fast
and do not consume frames. In practice this constraint is not enforced
and if not adhered to will cause channels to continue when they shouldn't.
This is because each caller of the connected or redirected logic does not
check whether the channel has been hung up on return. As a result the
the hung up channel continues.

This change makes it so when the API to execute a subroutine or
macro is invoked the channel is checked to determine if it has hung up.
If it has then a hangup is queued again so the caller will see it
and stop.

ASTERISK-25690 #close

Change-Id: I1f9a8ceb1487df0389f0d346ce0f6dcbcaf476ea

4 years agoMerge "res_pjsip_log_forwarder.c: Add CLI "pjsip show buildopts"."
Mark Michelson [Wed, 13 Jan 2016 15:48:57 +0000 (09:48 -0600)]
Merge "res_pjsip_log_forwarder.c: Add CLI "pjsip show buildopts"."

4 years agores_musiconhold: Prevent multiple simultaneous reloads.
Sean Bright [Wed, 13 Jan 2016 13:20:24 +0000 (08:20 -0500)]
res_musiconhold: Prevent multiple simultaneous reloads.

There are two ways in which the reload() function in res_musiconhold can be
called from the CLI:

  * module reload
  * moh reload

In the former case, the module loader holds a lock that prevents multiple
concurrent calls, but in the latter there is no such protection.

This patch changes the 'moh reload' CLI command to invoke the module loader
directly, rather than call reload() explicitly.

ASTERISK-25687 #close

Change-Id: I408968b4c8932864411b7f9ad88cfdc7b9ba711c

4 years agores_pjsip_log_forwarder.c: Add CLI "pjsip show buildopts".
Richard Mudgett [Tue, 12 Jan 2016 20:25:09 +0000 (14:25 -0600)]
res_pjsip_log_forwarder.c: Add CLI "pjsip show buildopts".

PJPROJECT has a function available to dump the compile time
options used when building the library.

* Add CLI "pjsip show buildopts" command.

* Update contrib/scripts/autosupport to get pjproject information.

Change-Id: Id93a6a916d765b2a2e5a1aeb54caaf83206be748

4 years agoMerge "pjsip_sdp_rtp: Add option endpoint/bind_rtp_to_media_address"
Joshua Colp [Wed, 13 Jan 2016 01:45:27 +0000 (19:45 -0600)]
Merge "pjsip_sdp_rtp:  Add option endpoint/bind_rtp_to_media_address"

4 years agoMerge "res_pjsip: Create human friendly serializer names."
Joshua Colp [Tue, 12 Jan 2016 19:59:48 +0000 (13:59 -0600)]
Merge "res_pjsip: Create human friendly serializer names."

4 years agoMerge "res_sorcery_realtime: Remove leading ^ requirement."
Joshua Colp [Tue, 12 Jan 2016 19:59:26 +0000 (13:59 -0600)]
Merge "res_sorcery_realtime: Remove leading ^ requirement."

4 years agoMerge topic 'update_taskprocessor_commands'
Joshua Colp [Tue, 12 Jan 2016 19:25:48 +0000 (13:25 -0600)]
Merge topic 'update_taskprocessor_commands'

* changes:
  Sorcery: Create human friendly serializer names.
  Stasis: Create human friendly taskprocessor/serializer names.
  taskprocessor.c: New API for human friendly taskprocessor names.
  taskprocessor.c: Sort CLI "core show taskprocessors" output.

4 years agoMerge "taskprocessor.c: Fix CLI "core show taskprocessors" output format."
Joshua Colp [Tue, 12 Jan 2016 19:18:58 +0000 (13:18 -0600)]
Merge "taskprocessor.c: Fix CLI "core show taskprocessors" output format."

4 years agoMerge topic 'update_taskprocessor_commands'
Joshua Colp [Tue, 12 Jan 2016 19:18:35 +0000 (13:18 -0600)]
Merge topic 'update_taskprocessor_commands'

* changes:
  taskprocessor.c: Fix CLI "core show taskprocessors" unref.
  taskprocessor.c: Add CLI "core ping taskprocessor" missing unlock.

4 years agoMerge "ccss.c: Replace space in taskprocessor name."
Joshua Colp [Tue, 12 Jan 2016 19:17:54 +0000 (13:17 -0600)]
Merge "ccss.c: Replace space in taskprocessor name."

4 years agores_sorcery_realtime: Remove leading ^ requirement.
Mark Michelson [Tue, 12 Jan 2016 16:36:15 +0000 (10:36 -0600)]
res_sorcery_realtime: Remove leading ^ requirement.

res_sorcery_realtime's search-by-regex callback performed a check to
ensure that the passed-in regex began with a caret (^). If it did not,
then no results would be returned.

This callback only started to become used when "like" support was added
to PJSIP CLI commands. The CLI command for listing objects would pass an
empty regex ("") to the sorcery backend if no "like" statement was
present. For most sorcery backends, this resulted in returning all
objects. However, for realtime, this resulted in returning no objects.

This commit seeks to fix the regression by removing the requirement from
res_sorcery_realtime for the passed-in-regex to begin with a caret.

ASTERISK-25689 #close
Reported by Marcelo Terres

Change-Id: I22b4dc5d7f3f11bb29ac2e42ef94682e9bab3b20

4 years agoMerge "app_queue: Add member flag "in_call" to prevent reading wrong lastcall time"
Joshua Colp [Tue, 12 Jan 2016 12:05:30 +0000 (06:05 -0600)]
Merge "app_queue: Add member flag "in_call" to prevent reading wrong lastcall time"

4 years agopjsip_sdp_rtp: Add option endpoint/bind_rtp_to_media_address
George Joseph [Thu, 7 Jan 2016 17:57:01 +0000 (10:57 -0700)]
pjsip_sdp_rtp:  Add option endpoint/bind_rtp_to_media_address

On a system with multiple ip addresses in the same subnet, if a
transport is bound to a specific ip address and endpoint/media_address
 is set, the SIP/SDP will have the correct address in all fields but
the rtp stream MAY still originate from one of the other ip addresses,
most probably the "primary" ip address.  This happens because
 res_pjsip_sdp_rtp/create_rtp always calls ast_instance_new with
the "all" ip address ( or ::).

The new option causes res_pjsip_sdp_rtp/create_rtp to call
ast_rtp_instance_new with the endpoint's media_address (if specified)
instead of the "all" address.  This causes the packets to originate from
the specified address.

Reported-by: Olivier Krief
Reported-by: Dan Journo

Change-Id: I3dfaa079e54ba7fb7c4fd1f5f7bd9509bbf8bd88

4 years agoMerge "Revert "pjsip_location: Delete contact_status object when contact is deleted""
Mark Michelson [Mon, 11 Jan 2016 23:43:39 +0000 (17:43 -0600)]
Merge "Revert "pjsip_location: Delete contact_status object when contact is deleted""

4 years agoMerge "pbx: Deadlock between contexts container and context_merge locks"
Joshua Colp [Mon, 11 Jan 2016 23:37:18 +0000 (17:37 -0600)]
Merge "pbx: Deadlock between contexts container and context_merge locks"

4 years agoMerge "Alembic: Increase column size of PJSIP AOR "contact"."
Joshua Colp [Mon, 11 Jan 2016 22:59:10 +0000 (16:59 -0600)]
Merge "Alembic: Increase column size of PJSIP AOR "contact"."

4 years agoMerge "Alembic: Add PJSIP global keep_alive_interval."
Joshua Colp [Mon, 11 Jan 2016 22:59:04 +0000 (16:59 -0600)]
Merge "Alembic: Add PJSIP global keep_alive_interval."

4 years agoMerge "pbx_dundi: Run cleanup on failed load."
Joshua Colp [Mon, 11 Jan 2016 22:54:56 +0000 (16:54 -0600)]
Merge "pbx_dundi: Run cleanup on failed load."

4 years agoMerge "res_crypto: Perform cleanup at shutdown."
Joshua Colp [Mon, 11 Jan 2016 22:35:03 +0000 (16:35 -0600)]
Merge "res_crypto: Perform cleanup at shutdown."

4 years agoMerge "res_calendar: Cleanup scheduler context at unload."
Joshua Colp [Mon, 11 Jan 2016 20:35:50 +0000 (14:35 -0600)]
Merge "res_calendar: Cleanup scheduler context at unload."

4 years agoMerge "manager: Cleanup manager_channelvars during shutdown."
Joshua Colp [Mon, 11 Jan 2016 20:35:13 +0000 (14:35 -0600)]
Merge "manager: Cleanup manager_channelvars during shutdown."

4 years agoMerge "devicestate: Cleanup engine thread during graceful shutdown."
Joshua Colp [Mon, 11 Jan 2016 20:34:55 +0000 (14:34 -0600)]
Merge "devicestate: Cleanup engine thread during graceful shutdown."

4 years agopbx: Deadlock between contexts container and context_merge locks
Kevin Harwell [Fri, 8 Jan 2016 22:59:44 +0000 (16:59 -0600)]
pbx: Deadlock between contexts container and context_merge locks

Recent changes (ASTERISK-25394 commit 2bd27d12223fe33b58c453965ed5c6ed3af7c4f5)
introduced the possibility of a deadlock. Due to the mentioned modifications
ast_change_hints now needs to keep both merge/delete and state callbacks from
occurring while it executes. Unfortunately, sometimes ast_change_hints can be
called with the contexts container locked. When this happens it's possible for
another thread to grab the context_merge_lock before the thread calling into
ast_change_hints does and then try to obtain the contexts container lock. This
of course causes a deadlock between the two threads. The thread calling into
ast_change_hints waits for the other thread to release context_merge_lock and
the other thread is waiting on that one to release the contexts container lock.

Unfortunately, there is not a great way to fix this problem. When hints change,
the subsequent state callbacks cannot run at the same time as a merge/delete,
nor when the usual state callbacks do. This patch alleviates the problem by
having those particular callbacks (the ones run after a hint change) occur in a
serialized task. By moving the context_merge_lock to a task it can now safely be
attempted or held without a deadlock occurring.

ASTERISK-25640 #close
Reported by: Krzysztof Trempala

Change-Id: If2210ea241afd1585dc2594c16faff84579bf302

4 years agodevicestate: Cleanup engine thread during graceful shutdown.
Corey Farrell [Sun, 10 Jan 2016 23:08:16 +0000 (18:08 -0500)]
devicestate: Cleanup engine thread during graceful shutdown.

ASTERISK-25681 #close

Change-Id: I64337c70f0ebd8c77f70792042684607c950c8f1

4 years agomanager: Cleanup manager_channelvars during shutdown.
Corey Farrell [Sun, 10 Jan 2016 19:51:00 +0000 (14:51 -0500)]
manager: Cleanup manager_channelvars during shutdown.

ASTERISK-25680 #close

Change-Id: I3251d781cbc3f48a6a7e1b969ac4983f552b2446

4 years agores_calendar: Cleanup scheduler context at unload.
Corey Farrell [Sun, 10 Jan 2016 19:27:57 +0000 (14:27 -0500)]
res_calendar: Cleanup scheduler context at unload.

ASTERISK-25679 #close

Change-Id: I839159bf6882cccc1b23494c7aa2bc2a2624613f

4 years agores_rtp_asterisk: Revert DTLS negotiation changes.
Joshua Colp [Fri, 8 Jan 2016 17:49:02 +0000 (13:49 -0400)]
res_rtp_asterisk: Revert DTLS negotiation changes.

Due to locking issues within pjnath these changes are being
reverted until pjnath can be changed.


Revert "res_rtp_asterisk.c: Fix DTLS negotiation delays."

This reverts commit 24ae124e4f7310cfa64c187b944b2ffc060da28d.

Change-Id: I2986cfb2c43dc14455c1bcaf92c3804f9da49705

Revert "res_rtp_asterisk: Resolve further timing issues with DTLS negotiation"

This reverts commit 965a0eee46d24321f74c244e23c5a5f45e67e12b.

Change-Id: Ie68fafde27dad4b03cb7a1e27ce2a8502c3f7bbe

4 years agoRevert "pjsip_location: Delete contact_status object when contact is deleted"
George Joseph [Sat, 9 Jan 2016 23:57:45 +0000 (16:57 -0700)]
Revert "pjsip_location: Delete contact_status object when contact is deleted"

This reverts commit 0a9941de9d24093b5ff44096d1d7406f29d11e45.


This patch causes another problem and should not have been needed.
Before this patch, persistent_endpoint_contact_deleted_observer WAS
deleting the contact_status when ast_sip_location_delete_contact was
called.  By deleting it yourself in ast_sip_location_delete_contact
it was gone before the observer could run and the observer therefore
was throwing an error and not sending stasis/AMI/statsd messages.

So, I don't think this was the cause of your original issue.  I also
had verified the contact AMI and statsd lifecycle and it was working.
I'll double check now though.

Reported-by: Daniel Journo

Change-Id: Ib586a6b7f90acb641b0c410f659743ab90e84f1a

4 years agopbx_dundi: Run cleanup on failed load.
Corey Farrell [Sun, 10 Jan 2016 00:04:34 +0000 (19:04 -0500)]
pbx_dundi: Run cleanup on failed load.

During failed startup of pbx_dundi no cleanup was performed.  Add a call
to unload_module before returning AST_MODULE_LOAD_DECLINE.

ASTERISK-25677 #close

Change-Id: I8ffa226fda4365ee7068ac1f464473f1a4ebbb29

4 years agores_crypto: Perform cleanup at shutdown.
Corey Farrell [Sat, 9 Jan 2016 19:28:31 +0000 (14:28 -0500)]
res_crypto: Perform cleanup at shutdown.

This change causes res_crypto to unregister CLI at shutdown while still
preventing the module from being unloaded.

ASTERISK-25673 #close

Change-Id: Ie5d57338dc2752abfc0dd05d0eec86413f2304fc

4 years agoMerge "include/asterisk/time.h: Renamed global declaration:tv"
Joshua Colp [Sat, 9 Jan 2016 17:15:22 +0000 (11:15 -0600)]
Merge "include/asterisk/time.h: Renamed global declaration:tv"

4 years agores_pjsip: Create human friendly serializer names.
Richard Mudgett [Thu, 7 Jan 2016 01:10:16 +0000 (19:10 -0600)]
res_pjsip: Create human friendly serializer names.

PJSIP name formats:
pjsip/aor/<aor>-<seq> -- registrar thread pool serializer
pjsip/default-<seq> -- default thread pool serializer
pjsip/messaging -- messaging thread pool serializer
pjsip/outreg/<registration>-<seq> -- outbound registration thread pool
pjsip/pubsub/<endpoint>-<seq> -- pubsub thread pool serializer
pjsip/refer/<endpoint>-<seq> -- REFER thread pool serializer
pjsip/session/<endpoint>-<seq> -- session thread pool serializer
pjsip/websocket-<seq> -- websocket thread pool serializer

Change-Id: Iff9df8da3ddae1132cb2ef65f64df0c465c5e084

4 years agoSorcery: Create human friendly serializer names.
Richard Mudgett [Thu, 7 Jan 2016 01:09:43 +0000 (19:09 -0600)]
Sorcery: Create human friendly serializer names.

Sorcery name formats:
sorcery/<type>-<seq> -- Sorcery thread pool serializer

Change-Id: Idc2e5d3dbab15c825b97c38c028319a0d2315c47

4 years agoStasis: Create human friendly taskprocessor/serializer names.
Richard Mudgett [Thu, 7 Jan 2016 01:09:59 +0000 (19:09 -0600)]
Stasis: Create human friendly taskprocessor/serializer names.

Stasis name formats:
subm:<topic>-<seq> -- Stasis subscription mailbox task processor
subp:<topic>-<seq> -- Stasis subscription thread pool serializer

Change-Id: Id19234b306e3594530bb040bc95d977f18ac7bfd

4 years agotaskprocessor.c: New API for human friendly taskprocessor names.
Richard Mudgett [Thu, 7 Jan 2016 22:15:35 +0000 (16:15 -0600)]
taskprocessor.c: New API for human friendly taskprocessor names.

* Add new API call to get a sequence number for use in human friendly
taskprocessor names.

* Add new API call to create a taskprocessor name in a given buffer and
append a sequence number.

Change-Id: Iac458f05b45232315ed64aa31b1df05b875537a9

4 years agotaskprocessor.c: Fix CLI "core show taskprocessors" output format.
Richard Mudgett [Wed, 6 Jan 2016 23:19:19 +0000 (17:19 -0600)]
taskprocessor.c: Fix CLI "core show taskprocessors" output format.

Update the CLI "core show taskprocessors" output format to not be
distorted because UUID names are longer than previously used taskprocessor

Change-Id: I1a5c82ce3e8f765a0627796aba87f8f7be077601

4 years agotaskprocessor.c: Fix CLI "core show taskprocessors" unref.
Richard Mudgett [Fri, 8 Jan 2016 03:07:49 +0000 (21:07 -0600)]
taskprocessor.c: Fix CLI "core show taskprocessors" unref.

Change-Id: I1d9f4e532caa6dfabe034745dd16d06134efdce5

4 years agoccss.c: Replace space in taskprocessor name.
Richard Mudgett [Thu, 7 Jan 2016 01:00:27 +0000 (19:00 -0600)]
ccss.c: Replace space in taskprocessor name.

The CLI "core ping taskprocessor" command does not work very
well with taskprocessor names that have spaces in them.  You
have to put quotes around the name so using tab completion
becomes awkward.

Change-Id: I29e806dd0a8a0256f4e2e0a7ab88c9e19ab0eda0

4 years agotaskprocessor.c: Sort CLI "core show taskprocessors" output.
Richard Mudgett [Fri, 8 Jan 2016 02:44:18 +0000 (20:44 -0600)]
taskprocessor.c: Sort CLI "core show taskprocessors" output.

Change-Id: I71e7bf57c7b908c8b8c71f1816348ed7c5a5d51e

4 years agotaskprocessor.c: Add CLI "core ping taskprocessor" missing unlock.
Richard Mudgett [Tue, 5 Jan 2016 22:54:06 +0000 (16:54 -0600)]
taskprocessor.c: Add CLI "core ping taskprocessor" missing unlock.

Change-Id: I78247e0faf978bf850b5ba4e9f4933ab3c59d17b

4 years agoMerge "main: Use ast_strdup instead of strdup"
Mark Michelson [Fri, 8 Jan 2016 20:46:51 +0000 (14:46 -0600)]
Merge "main: Use ast_strdup instead of strdup"

4 years agoAlembic: Add PJSIP global keep_alive_interval.
Mark Michelson [Wed, 16 Dec 2015 17:25:13 +0000 (11:25 -0600)]
Alembic: Add PJSIP global keep_alive_interval.

The keep_alive_interval option was added about a year ago, but no
alembic revision was created to add the appropriate column to the

This commit fixes the problem and adds the column. This was discovered
by running the testsuite with automatic conversion to realtime enabled.

Change-Id: If3ef92a7c4f4844d08f8aae170d2178aec5c4c1a

4 years agoinclude/asterisk/time.h: Renamed global declaration:tv
Diederik de Groot [Thu, 7 Jan 2016 09:21:03 +0000 (10:21 +0100)]
include/asterisk/time.h: Renamed global declaration:tv

Renamed global declaration:tv to dummy_tv_var_for_types,
which would oltherwise cause 'shadow' warnings when 'tv'
was declared as a local variable elsewhere.

Added comment to note that dummy_tv_var_for_types is never
really exported and only used as a place holder.

ASTERISK-25627 #close

Change-Id: I9a6e17995006584f3627efe8988e3f8aa0f5dc28

4 years agoPJSIP: Prevent deadlock due to dialog/transaction lock inversion.
Mark Michelson [Thu, 7 Jan 2016 21:37:36 +0000 (15:37 -0600)]
PJSIP: Prevent deadlock due to dialog/transaction lock inversion.

A deadlock was observed where the monitor thread was stuck, therefore
resulting in no incoming SIP traffic being processed.

The problem occurred when two 200 OK responses arrived in response to a
terminating NOTIFY request sent from Asterisk. The first 200 OK was
dispatched to a threadpool worker, who locked the corresponding
transaction. The second 200 OK arrived, resulting in the monitor thread
locking the dialog. At this point, the two threads are at odds, because
the monitor thread attempts to lock the transaction, and the threadpool
thread loops attempting to try to lock the dialog.

In this case, the fix is to not have the monitor thread attempt to hold
both the dialog and transaction locks at the same time. Instead, we
release the dialog lock before attempting to lock the transaction.

There have also been some debug messages added to the process in an
attempt to make it more clear what is going on in the process.

ASTERISK-25668 #close
Reported by Mark Michelson

Change-Id: I4db0705f1403737b4360e33a8e6276805d086d4a

4 years agoast_format_cap_append_by_type: Resolve codec reference leak.
Corey Farrell [Thu, 7 Jan 2016 15:39:19 +0000 (10:39 -0500)]
ast_format_cap_append_by_type: Resolve codec reference leak.

This resolves a reference leak caused by ASTERISK-25535.  The pointer
returned by ast_format_get_codec is saved so it can be released.

ASTERISK-25664 #close

Change-Id: If9941b1bf4320b2c59056546d6bce9422726d1ec

4 years agomain: Use ast_strdup instead of strdup
Diederik de Groot [Thu, 7 Jan 2016 09:33:02 +0000 (10:33 +0100)]
main: Use ast_strdup instead of strdup

Fix compile error in main/utils.c because strdup was used in dummy_start

Change-Id: Id61a6cf4f3cbf235450441e10e7da101a6335793

4 years agoMerge "cel/cel_radius: Fix wrong pointer."
Joshua Colp [Wed, 6 Jan 2016 18:02:36 +0000 (12:02 -0600)]
Merge "cel/cel_radius: Fix wrong pointer."

4 years agoMerge "Add sipp-sendfax.xml and to contrib/scripts."
Joshua Colp [Wed, 6 Jan 2016 16:55:06 +0000 (10:55 -0600)]
Merge "Add sipp-sendfax.xml and to contrib/scripts."

4 years agoAdd sipp-sendfax.xml and to contrib/scripts.
Walter Doekes [Wed, 6 Jan 2016 13:12:40 +0000 (14:12 +0100)]
Add sipp-sendfax.xml and to contrib/scripts.

The creates pcap files from fax.log files, generated
through 'fax set debug on' when receiving a fax. An example fax.log is
included as spandspflow2pcap.log.

The sipp-sendfax.xml SIPp scenario can be used to replay that fax with a
recent version of SIPp.

ASTERISK-25660 #close

Change-Id: I4de8f28b084055b482ab8a5b28d28b605b0ed526

4 years agoMerge topic 'pbx-split'
Joshua Colp [Wed, 6 Jan 2016 12:13:29 +0000 (06:13 -0600)]
Merge topic 'pbx-split'

* changes:
  main/pbx: Move hangup handler routines to pbx_hangup_handler.c.
  main/pbx: Move dialplan application management routines to pbx_app.c.
  main/pbx: Move switch routines to pbx_switch.c.

4 years agoMerge "main/pbx: Move timing routines to pbx_timing.c."
Joshua Colp [Wed, 6 Jan 2016 12:09:48 +0000 (06:09 -0600)]
Merge "main/pbx: Move timing routines to pbx_timing.c."

4 years agocel/cel_radius: Fix wrong pointer.
Aaron An [Mon, 4 Jan 2016 10:26:55 +0000 (18:26 +0800)]
cel/cel_radius: Fix wrong pointer.

The macro ADD_VENDOR_CODE defined in the cel_radius.c should use the parameter
y not the address of y.

I capture the radius UDP packet via tcpdump, and the AV pairs are not correct,
then i review the source code and compare it with cdr/cdr_radius.c. Fix it and
 it works.

ASTERISK-25647 #close
Reported by: Aaron An
Tested by: Aaron An

Change-Id: I72889bccd8fde120d47aa659edc0e7e6d4d019f0

4 years agoMerge "main/pbx: Move variable routines to pbx_variables.c."
Matt Jordan [Tue, 5 Jan 2016 19:38:45 +0000 (13:38 -0600)]
Merge "main/pbx: Move variable routines to pbx_variables.c."

4 years agomain/pbx: Move hangup handler routines to pbx_hangup_handler.c.
Corey Farrell [Tue, 5 Jan 2016 02:23:01 +0000 (21:23 -0500)]
main/pbx: Move hangup handler routines to pbx_hangup_handler.c.

This is the sixth patch in a series meant to reduce the bulk of pbx.c.
This moves hangup handler management functions to their own source.

Change-Id: Ib25a75aa57fc7d5c4294479e5cc46775912fb104

4 years agoapp_queue: Add member flag "in_call" to prevent reading wrong lastcall time
Martin Tomec [Mon, 21 Dec 2015 17:07:14 +0000 (18:07 +0100)]
app_queue: Add member flag "in_call" to prevent reading wrong lastcall time

Member lastcall time is updated later than member status. There was chance to
check wrapuptime for available member with wrong (old) lastcall time.
New boolean flag "in_call" is set to true right before connecting call, and
reset to false after update of lastcall time. Members with "in_call" set to true
are treat as unavailable.

ASTERISK-19820 #close

Change-Id: I1923230cf9859ee51563a8ed420a0628b4d2e500

4 years agoMerge "Happy new year 2016."
Matt Jordan [Tue, 5 Jan 2016 15:39:47 +0000 (09:39 -0600)]
Merge "Happy new year 2016."

4 years agoMerge "voicemail: Move app_voicemail / res_mwi_external conflict to runtime"
Joshua Colp [Tue, 5 Jan 2016 11:55:55 +0000 (05:55 -0600)]
Merge "voicemail: Move app_voicemail / res_mwi_external conflict to runtime"

4 years agomain/pbx: Move dialplan application management routines to pbx_app.c.
Corey Farrell [Tue, 5 Jan 2016 01:46:25 +0000 (20:46 -0500)]
main/pbx: Move dialplan application management routines to pbx_app.c.

This is the sixth patch in a series meant to reduce the bulk of pbx.c.
This moves dialplan application management functions to their own source.

Change-Id: I444c10fb90a3cdf9f3047605d6a8aad49c22c44c

4 years agomain/pbx: Move switch routines to pbx_switch.c.
Corey Farrell [Tue, 5 Jan 2016 00:20:35 +0000 (19:20 -0500)]
main/pbx: Move switch routines to pbx_switch.c.

This is the fifth patch in a series meant to reduce the bulk of pbx.c.
This moves ast_switch functions to their own source.

Change-Id: Ic2592a18a5c4d8a3c2dcf9786c9a6f650a8c628e

4 years agomain/pbx: Move timing routines to pbx_timing.c.
Corey Farrell [Tue, 5 Jan 2016 00:00:23 +0000 (19:00 -0500)]
main/pbx: Move timing routines to pbx_timing.c.

This is the fourth patch in a series meant to reduce the bulk of pbx.c.
This moves pbx timing functions to their own source.

Change-Id: I05c45186cb11edfc901e95f6be4e6a8abf129cd6

4 years agovoicemail: Move app_voicemail / res_mwi_external conflict to runtime
George Joseph [Wed, 30 Dec 2015 16:49:03 +0000 (09:49 -0700)]
voicemail: Move app_voicemail / res_mwi_external conflict to runtime

The menuselect conflict between app_voicemail and res_mwi_external
makes it hard to package 1 version of Asterisk.  There no actual
build dependencies between the 2 so moving this check to runtime
seems like a better solution.

The ast_vm_register and ast_vm_greeter_register functions in app.c
were modified to return AST_MODULE_LOAD_DECLINE instead of -1 if there
is already a voicemail module registered. The modules' load_module
functions were then modified to return DECLINE instead of -1 to the
loader.  Since -1 is interpreted by the loader as AST_MODULE_LOAD_FAILURE,
the modules were incorrectly causing Asterisk to stop so this needed
to be cleaned up anyway.

Now you can build both and use modules.conf to decide which voicemail
implementation to load.

The default menuselect options still build app_voicemail and not
res_mwi_external but if both ARE built, res_mwi_external will load
first and become the voicemail provider unless modules.conf rules
prevent it.  This is noted in CHANGES.

Change-Id: I7d98d4e8a3b87b8df9e51c2608f0da6ddfb89247

4 years agomain/pbx: Move variable routines to pbx_variables.c.
Corey Farrell [Mon, 4 Jan 2016 22:15:14 +0000 (17:15 -0500)]
main/pbx: Move variable routines to pbx_variables.c.

This is the third patch in a series meant to reduce the bulk of pbx.c.
This moves channel and global variable routines to their own source.

Change-Id: Ibe8fb4647db11598591d443a99e3f99200a56bc6