Commit Graph

27739 Commits

Author SHA1 Message Date
Joshua Colp
b5c13c1545 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
2016-01-19 19:18:10 -04:00
Richard Mudgett
0ab89182d9 taskprocessor.c: Increase CLI "core ping taskprocessor" timeout.
Change-Id: I4892d6acbb580d6c207d006341eaf5e0f8f2a029
2016-01-19 16:37:12 -06:00
Richard Mudgett
a2a8ea3330 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
2016-01-19 16:30:56 -06:00
Richard Mudgett
d604a9afc8 Fix alembic branches on v13.
Change-Id: I313449b609ede18ad1e1763a655dd23b9210a8e0
2016-01-19 13:44:31 -06:00
Joshua Colp
80e901396e Merge "Remove res/ari/* content during 'make clean'." into 13 2016-01-18 19:27:44 -06:00
Joshua Colp
e7b83fa76e Merge "pjsip/alembic: Fix qualify_timeout column definition" into 13 2016-01-18 19:24:40 -06:00
George Joseph
a0c79f3a4f pjsip_loging_refactor: Rename res_pjsip_log_forwarder to res_pjproject
Change-Id: I5387821f29e5caa0cba0b7d62b0fc0d341e7e20b
2016-01-18 17:45:48 -07:00
Mark Michelson
e50c6f32cc Merge "Update version number in features.conf.sample" into 13 2016-01-18 17:31:35 -06:00
Rusty Newton
018ccf680b 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
2016-01-17 11:49:43 -06:00
Joshua Colp
33af878768 Merge "main/config: Clean config maps on shutdown." into 13 2016-01-17 11:44:28 -06:00
Daniel Journo
5644bca9f9 Update version number in features.conf.sample
Update the version number in the comments from Asterisk 12 to Asterisk 12+

Change-Id: Ie692ac8cda3c993c3bf10f27f51a1cca3317ec7b
2016-01-16 20:06:40 +00:00
Joshua Colp
d690b88a1e Merge "bridge_basic: don't play an attended transfer fail sound after target hangs up" into 13 2016-01-16 08:29:51 -06:00
Joshua Colp
aaa52a2a05 Merge "bridge_basic: don't cache xferfailsound during an attended transfer" into 13 2016-01-16 08:29:23 -06:00
Joshua Colp
0aa47e11e1 Merge "taskprocessor.c: Simplify ast_taskprocessor_get() return code." into 13 2016-01-16 08:28:10 -06:00
Corey Farrell
3f5f30cf82 main/config: Clean config maps on shutdown.
ASTERISK-25700 #close

Change-Id: I096da84f9c62c6095f68bcf98eac4b7c7868e808
2016-01-15 19:59:59 -06:00
Kevin Harwell
660fedecb7 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
2016-01-15 17:45:51 -06:00
Richard Mudgett
9cda1de34d taskprocessor.c: Simplify ast_taskprocessor_get() return code.
Change-Id: Id5bd18ef1f60ef8be453e677e98478298358a9d1
2016-01-15 12:36:34 -06:00
Richard Mudgett
a79af2b312 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
2016-01-14 19:37:36 -06:00
Kevin Harwell
83feb7db3b 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
2016-01-14 16:00:50 -06:00
Mark Michelson
935d641f3b Remove res/ari/* content during 'make clean'.
'make clean' and 'make distclean' can leave behind .o files in the
res/ari/ directory. One observed consequence of this is that running
Asterisk with MALLOC_DEBUG can cause Asterisk to crash immediately on
startup sometimes.

By ensuring that we are making a clean build, we can be sure that stale
files are not being included in the build and causing problems when
build options should have caused files to be re-built.

ASTERISK-25683 #close
Reported by yaron nahum

Change-Id: I1f48baa904d2468eddeefb42ee68a56af7adc7b7
2016-01-14 13:22:46 -06:00
Joshua Colp
236896f391 Merge "pjsip: Add option global/regcontext" into 13 2016-01-14 06:32:04 -06:00
Daniel Journo
46f21df302 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
2016-01-13 21:58:22 +00:00
Mark Michelson
caba57631d Merge "app: Queue hangup if channel is hung up during sub or macro execution." into 13 2016-01-13 15:10:42 -06:00
Joshua Colp
32b29d7b02 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
2016-01-13 12:58:36 -04:00
Mark Michelson
f18ad96b77 Merge "res_pjsip_log_forwarder.c: Add CLI "pjsip show buildopts"." into 13 2016-01-13 09:48:54 -06:00
Sean Bright
e7cfda0b38 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 res_musiconhold.so
  * 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
2016-01-13 07:50:19 -06:00
Richard Mudgett
5586abc957 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
2016-01-12 20:24:15 -06:00
Joshua Colp
092c0db493 Merge "pjsip_sdp_rtp: Add option endpoint/bind_rtp_to_media_address" into 13 2016-01-12 19:45:34 -06:00
Joshua Colp
b91dfcd1fb Merge "res_pjsip: Create human friendly serializer names." into 13 2016-01-12 13:59:42 -06:00
Joshua Colp
b41f69dcbc Merge "res_sorcery_realtime: Remove leading ^ requirement." into 13 2016-01-12 13:59:32 -06:00
Joshua Colp
56d1162dc2 Merge topic 'update_taskprocessor_commands' into 13
* 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.
2016-01-12 13:25:40 -06:00
Joshua Colp
25c0ed2f64 Merge "taskprocessor.c: Fix CLI "core show taskprocessors" output format." into 13 2016-01-12 13:18:51 -06:00
Joshua Colp
3bf8c5140d Merge topic 'update_taskprocessor_commands' into 13
* changes:
  taskprocessor.c: Fix CLI "core show taskprocessors" unref.
  taskprocessor.c: Add CLI "core ping taskprocessor" missing unlock.
2016-01-12 13:18:28 -06:00
Joshua Colp
569595c899 Merge "ccss.c: Replace space in taskprocessor name." into 13 2016-01-12 13:17:47 -06:00
Mark Michelson
4cd58c3b20 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
2016-01-12 13:04:49 -06:00
Joshua Colp
ace79fadad Merge "app_queue: Add member flag "in_call" to prevent reading wrong lastcall time" into 13 2016-01-12 06:05:24 -06:00
George Joseph
219c204a41 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 (0.0.0.0 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.

ASTERISK-25632
ASTERISK-25637
Reported-by: Olivier Krief
Reported-by: Dan Journo

Change-Id: I3dfaa079e54ba7fb7c4fd1f5f7bd9509bbf8bd88
2016-01-11 18:39:55 -06:00
Mark Michelson
f9a275fef4 Merge "Revert "pjsip_location: Delete contact_status object when contact is deleted"" into 13 2016-01-11 17:43:43 -06:00
Joshua Colp
77a46ac84d Merge "pbx: Deadlock between contexts container and context_merge locks" into 13 2016-01-11 17:37:12 -06:00
Joshua Colp
8ec4d20fa9 Merge "pbx_dundi: Run cleanup on failed load." into 13 2016-01-11 16:54:49 -06:00
Daniel Journo
22801a06ee 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
2016-01-11 22:42:57 +00:00
Joshua Colp
ddc9c1f720 Merge "res_crypto: Perform cleanup at shutdown." into 13 2016-01-11 16:35:14 -06:00
Joshua Colp
85fdbcefae Merge "res_calendar: Cleanup scheduler context at unload." into 13 2016-01-11 14:35:40 -06:00
Joshua Colp
672920d0cf Merge "manager: Cleanup manager_channelvars during shutdown." into 13 2016-01-11 14:35:20 -06:00
Joshua Colp
85145be4b8 Merge "devicestate: Cleanup engine thread during graceful shutdown." into 13 2016-01-11 14:35:01 -06:00
Kevin Harwell
1600ebca7d pbx: Deadlock between contexts container and context_merge locks
Recent changes (ASTERISK-25394 commit 2bd27d1222)
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
2016-01-11 13:45:56 -06:00
Corey Farrell
0fc3dad965 devicestate: Cleanup engine thread during graceful shutdown.
ASTERISK-25681 #close

Change-Id: I64337c70f0ebd8c77f70792042684607c950c8f1
2016-01-10 18:10:37 -05:00
Corey Farrell
f34dd10495 manager: Cleanup manager_channelvars during shutdown.
ASTERISK-25680 #close

Change-Id: I3251d781cbc3f48a6a7e1b969ac4983f552b2446
2016-01-10 14:51:00 -05:00
Corey Farrell
1d3a1167fc res_calendar: Cleanup scheduler context at unload.
ASTERISK-25679 #close

Change-Id: I839159bf6882cccc1b23494c7aa2bc2a2624613f
2016-01-10 13:32:48 -06:00
Joshua Colp
3a160cdbf6 res_rtp_asterisk: Revert DTLS negotiation changes.
Due to locking issues within pjnath these changes are being
reverted until pjnath can be changed.

ASTERISK-25645

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

This reverts commit 24ae124e4f.

Change-Id: I2986cfb2c43dc14455c1bcaf92c3804f9da49705

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

This reverts commit 965a0eee46.

Change-Id: Ie68fafde27dad4b03cb7a1e27ce2a8502c3f7bbe
2016-01-09 20:36:42 -04:00