Commit Graph

27175 Commits

Author SHA1 Message Date
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
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
Joshua Colp
236896f391 Merge "pjsip: Add option global/regcontext" into 13 2016-01-14 06:32:04 -06: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
George Joseph
4b10fc9173 Revert "pjsip_location: Delete contact_status object when contact is deleted"
This reverts commit 0a9941de9d.

Matt,

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.

ASTERISK-25675
Reported-by: Daniel Journo

Change-Id: Ib586a6b7f90acb641b0c410f659743ab90e84f1a
2016-01-09 17:08:46 -07:00
Corey Farrell
79b4309881 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
2016-01-09 18:07:08 -06:00
Corey Farrell
a5406b1f9e 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
2016-01-09 13:39:00 -06:00
Joshua Colp
573b37c658 Merge "include/asterisk/time.h: Renamed global declaration:tv" into 13 2016-01-09 11:15:32 -06:00
Richard Mudgett
cf8e7a580b 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
serializer
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
2016-01-08 22:08:35 -06:00
Richard Mudgett
4276f185f0 Sorcery: Create human friendly serializer names.
Sorcery name formats:
sorcery/<type>-<seq> -- Sorcery thread pool serializer

Change-Id: Idc2e5d3dbab15c825b97c38c028319a0d2315c47
2016-01-08 22:03:28 -06:00
Richard Mudgett
f02ac1b7f9 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
2016-01-08 22:03:28 -06:00
Richard Mudgett
ec1f1c6742 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
2016-01-08 22:02:51 -06:00
Richard Mudgett
d8bc3e0c8b 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
names.

Change-Id: I1a5c82ce3e8f765a0627796aba87f8f7be077601
2016-01-08 20:12:35 -06:00
Richard Mudgett
2c4b7502de taskprocessor.c: Fix CLI "core show taskprocessors" unref.
Change-Id: I1d9f4e532caa6dfabe034745dd16d06134efdce5
2016-01-08 20:12:35 -06:00
Richard Mudgett
3b33ac7a46 taskprocessor.c: Sort CLI "core show taskprocessors" output.
Change-Id: I71e7bf57c7b908c8b8c71f1816348ed7c5a5d51e
2016-01-08 20:12:35 -06:00
Richard Mudgett
0fc32c4dd3 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
2016-01-08 20:12:34 -06:00
Richard Mudgett
0e0c24ad78 taskprocessor.c: Add CLI "core ping taskprocessor" missing unlock.
Change-Id: I78247e0faf978bf850b5ba4e9f4933ab3c59d17b
2016-01-08 20:12:34 -06:00
Diederik de Groot
0f79c8839b main: Use ast_strdup instead of strdup
Fix compile error in main/utils.c because strdup was used in dummy_start

Change-Id: Id61a6cf4f3cbf235450441e10e7da101a6335793
2016-01-08 13:57:34 -06:00