Commit Graph

28327 Commits

Author SHA1 Message Date
Matt Jordan
0422667d6c manager: Add <see-also> tags to relate UserEvent actions/apps/events
Change-Id: I80f8a981f62f50e74609c69c49edcaca6c95efa4
2016-08-13 20:26:50 -05:00
Matt Jordan
f9e734974b res_agi: Improve documentation
* Groups of AGI commands that have similar functionality now reference
  each other, and all reference the AGI application for ease of wiki
  reference.

* The documentation for the AGI application has been improved, in
  particular noting the various AGI types and how they are invoked.

* A warning message has been added to DeadAGI, noting that it is
  deprecated.

Change-Id: I479ccdee8a7393f01b18692c3d4ab7e6bdd1875d
2016-08-13 20:26:50 -05:00
Matt Jordan
781bb410d0 manager: Add <see-also> links between related events
This patch adds some see-also references between related AMI events. It
focuses primarily on those events that are guaranteed to come in pairs,
such as DTMFBegin/DTMFEnd, as well as those that occur during the life
cycle of an Asterisk channel, such as Newchannel/Hangup.

Change-Id: Iaab600477052018d0f8c03d0c624c0856e9ff1f3
2016-08-13 20:26:38 -05:00
zuul
2dc23297a9 Merge "res_pjsip: Fail global load if debug or default_from_user are empty" into 13 2016-08-12 18:49:54 -05:00
zuul
8633259301 Merge "res_pjsip_caller_id: Copy header name to short header name" into 13 2016-08-12 15:55:20 -05:00
zuul
03b7d04298 Merge "Run mandatory cleanup when startup fails." into 13 2016-08-12 13:59:46 -05:00
zuul
3ea349e2bd Merge "location.c: Misc fixes and cleanups." into 13 2016-08-12 13:10:47 -05:00
Matt Jordan
cfd6852d39 func_channel: Reorganize documentation
* Following the example of the PJSIP channel driver, the channel
  technology specific documentation has been moved to the respective
  channel drivers that provide that functionality. This has the benefit
  of locating the documentation of items with those modules that provide
  it.

* Examples of using the CHANNEL function for both standard items as well
  as for PJSIP have been added.

* The 'max_forwards' standard item has been documented.

Change-Id: Ifaa79a232c8ac99cf8da6ef6cc7815d398b1b79b
2016-08-12 11:15:38 -05:00
zuul
b3586baeea Merge "app_queue: Prevent crash when a call is forwarded to an invalid location" into 13 2016-08-12 08:52:10 -05:00
zuul
ce7357237c Merge "res_pjsip res_pjsip_mwi: Misc fixes and cleanups." into 13 2016-08-12 05:35:57 -05:00
zuul
0383500afb Merge "pjsip_distributor.c: Add missing allocation failure check." into 13 2016-08-12 03:03:51 -05:00
zuul
ee150b697f Merge "alembic: add auth_username to endpoint's identify_by enum" into 13 2016-08-12 01:27:31 -05:00
zuul
4a05856f40 Merge "res_pjsip: Make aor named lock a mutex." into 13 2016-08-11 23:14:38 -05:00
Corey Farrell
cb043249b6 Run mandatory cleanup when startup fails.
Errors during startup result in an exit.  These error branches should be
calling ast_run_atexit(0) to ensure mandatory cleanup is run.

ASTERISK-26267 #close

Change-Id: If226f2326ae2df7add20040696132214cf2bb680
2016-08-11 23:11:33 -04:00
George Joseph
4d5e96ab53 res_pjsip_caller_id: Copy header name to short header name
When compact_headers was set, we were sending a zero-length header name
for PAI and RPID because we always forced the short header name length
to 0.  We did this because we cloned the header from "From" and wanted
to clear "f" from the sname.  By cloning however, we bypass pjproject's
automatic logic that sets sname to name if there's no compact form of
the header, which there isn't for PAI and RPID.  So now we force sname
to be the same as name right after we set name.

res_pjsip_diversion needed the same treatment for the Diversion header.

ASTERISK-26241 #close

Change-Id: I633ec139630cd83809aae00336cee4a10077e467
2016-08-11 13:16:41 -06:00
George Joseph
143df33110 res_pjsip: Fail global load if debug or default_from_user are empty
If debug was specified in the global configuration but left blank,
the logger would treat it as a wildcard and log all hosts.  If
default_from_user was empty, a crash would result.

The global apply handler now checks for empty strings.

ASTERISK-26239 #close
ASTERISK-26238 #close

Change-Id: Ie75727f5cd5808845d92cc81f5713842fb203336
2016-08-11 11:32:43 -06:00
Richard Mudgett
1fc5c90014 res_pjsip res_pjsip_mwi: Misc fixes and cleanups.
* Eliminated RAII_VAR() usage in
ast_sip_persistent_endpoint_update_state().

* Added a missing allocation failure check to
persistent_endpoint_find_or_create().

* Made persistent_endpoint_find_or_create() create the new object without
a lock as it isn't needed.

* Cleaned up some ao2 container allocation idioms.

* Reordered res_pjsip_mwi.c load_module() and unload_module()

Change-Id: If8ce88fbd82a0c72a37a2388f74f77237a6a36a8
2016-08-11 12:14:53 -05:00
Richard Mudgett
73052e5732 location.c: Misc fixes and cleanups.
* Eliminated most RAII_VAR() usage.

* Added several missing allocation failure checks.

* Made ast_sip_for_each_contact() allocate the wrapper ao2 object without
a lock as it is not needed.

Change-Id: Ie20913365156c95dd79e5d471cfd25e99ae880bc
2016-08-11 12:12:48 -05:00
Richard Mudgett
9d4bd3d763 taskprocessor.c: Tweak high water checks.
* The high water check in ast_taskprocessor_alert_set_levels() would
trigger immediately if the new high water level is zero and the queue was
empty.

* The high water check in taskprocessor_push() was off by one.

Change-Id: I687729fb4efa6a0ba38ec9c1c133c4d407bc3d5d
2016-08-11 11:59:08 -05:00
Richard Mudgett
e1248c3075 res_pjsip: Make aor named lock a mutex.
The named aor lock was always being locked for writes so a rwlock adds no
benefit and may be slower because rwlocks are biased toward read locking.

Change-Id: I8c5c2c780eb30ce5441832257beeb3506fd12b28
2016-08-11 11:57:51 -05:00
Richard Mudgett
6e40334d89 pjsip_distributor.c: Add missing allocation failure check.
Change-Id: I932ab2cea845e534d9ff318035b6de39972d3b28
2016-08-11 11:56:24 -05:00
Matt Jordan
a3c5488ff4 app_queue: Prevent crash when a call is forwarded to an invalid location
When a call forward attempt is made from a Queue member, the current
code will hang up the forwarding channel in an off-nominal condition
prior to raising the Stasis events informing the rest of Asterisk that
the call was forwarded. This will result in a slew of dreaded FRACKs,
most likely leading to a crash.

This patch modifies the code such that we don't hang up the forwarding
channel even in an off-nominal condition until we've safely raised the
Stasis messages.

ASTERISK-25797 #close

Change-Id: Ife5abed351691fd79105321636eaa8ea8dcdba38
2016-08-11 11:16:48 -05:00
zuul
1a3cc84371 Merge "channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH" into 13 2016-08-11 11:15:00 -05:00
Kevin Harwell
5913929d31 alembic: add auth_username to endpoint's identify_by enum
A new identify_by option was added recently, auth_username. However, this
setting was not added as an allowable choice in the database enumeration
value.

This patch updates the current enumeration, adding in the new setting.

ASTERISK-26268 #close

Change-Id: Ib4788e8485e4cd40172ec0abbf5810a147ab8bf8
2016-08-11 10:59:15 -05:00
zuul
134db75e67 Merge "alembic/sqlalchemy: auto increment only allowed on a single column" into 13 2016-08-10 21:15:15 -05:00
zuul
dbc78c9fab Merge "pjsip: Fix deadlock with suspend taskprocessor on masquerade" into 13 2016-08-10 19:19:08 -05:00
Alexei Gradinari
1589452fdc pjsip: Fix deadlock with suspend taskprocessor on masquerade
If both channels which should be masqueraded
are in the same serializer:
1st channel will be locked waiting condition 'complete'
2nd channel will be locked waiting condition 'suspended'

On heavy load system a chance that both channels will be in
the same serializer 'pjsip/distibutor' is very high.

To reproduce compile res_pjsip/pjsip_distributor.c with
DISTRIBUTOR_POOL_SIZE=1

Steps to reproduce:
1. Party A calls Party B (bridged call 'AB')
2. Party B places Party A on hold
3. Party B calls Voicemail app (non-bridged call 'BV')
4. Party B attended transfers Party A to voicemail using REFER.
5. When asterisk masquerades calls 'AB' and 'BV',
   a deadlock is happened.

This patch adds a suspension indicator to the taskprocessor.
When a session suspends/unsuspends the serializer
it sets the indicator to the appropriate state.
The session checks the suspension indicator before
suspend the serializer.

ASTERISK-26145 #close

Change-Id: Iaaebee60013a58c942ba47b1b4930a63e686663b
2016-08-10 16:01:23 -04:00
Joshua Colp
c864ebab52 Merge "res_rtp_asterisk: Cache local RTCP address." into 13 2016-08-10 14:00:38 -05:00
Kevin Harwell
f6ec94cca6 alembic/sqlalchemy: auto increment only allowed on a single column
The extensions table defined two columns (id and priority) as primary key
autoincrement columns. However only one is allowed when defining the primary
key.

This patch removes the autoincrement attribute from the priority column since
it does not need to be as such and really should not have been on there in the
first place.

This patch also removes 'context', 'exten', and 'priority' from the primary key
index and creates a new combined unique contraint index on them.

ASTERISK-26183 #close

Change-Id: Ib9c712c612a4d7ec1edb0dcb77f1bae0905a470b
2016-08-10 13:50:13 -05:00
Matt Jordan
5f815f9dba channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH
This patch adds a new PJSIP specific dialplan function,
PJSIP_SEND_SESSION_REFRESH. When invoked on a PJSIP channel, the media
session will be refreshed via either an UPDATE or re-INVITE request.
When used in conjunction with the PJSIP_MEDIA_OFFER dialplan function,
the formats in use on a PJSIP channel can be re-negotiated and changed
dynamically after call setup.

ASTERISK-26277 #close

Change-Id: Ib98fe09ba889aafe26d58d32f0fd1323f8fd9b1b
2016-08-10 11:20:11 -05:00
Mark Michelson
a119bab6a6 res_rtp_asterisk: Cache local RTCP address.
When an RTCP packet is sent or received, res_rtp_asterisk generates a
Stasis event that contains the RTCP report as well as the local and
remote addresses that the report pertains to.

The addresses are determined using ast_find_ourip(). For the local
address, this will typically result in a lookup of the hostname of the
server, and then a DNS lookup of that hostname. If you do not have the
host in /etc/hosts, then this results in a full DNS lookup, which can
potentially block for some time.

This is especially problematic when performing RTCP reads, since those
are done on the same thread responsible for reading and writing media.

This patch addresses the issue by performing a lookup of the local
address when RTCP is allocated. We then use this cached local address
for the Stasis events when necessary.

ASTERISK-26280 #close
Reported by Mark Michelson

Change-Id: I3dd61882c2e57036f09f0c390cf38f7c87e9b556
2016-08-09 16:19:34 -05:00
zuul
5a5b949333 Merge "res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack" into 13 2016-08-09 16:19:13 -05:00
Joshua Colp
926c1c72bd Merge "res_pjsip_outbound_publish: Use a serializer shutdown group for unload." into 13 2016-08-09 14:44:24 -05:00
Alexei Gradinari
a06a1af0eb res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack
The PJSIP taskprocessors could be overflowed on startup
if there are many (thousands) realtime endpoints
configured with unsolicited mwi.
The PJSIP stack could be totally unresponsive for a few minutes
after boot completed.

This patch creates a separate PJSIP serializers pool for mwi
and makes unsolicited mwi use serializers from this pool.
This patch also adds 2 new global options to tune taskprocessor
alert levels: 'mwi_tps_queue_high' and 'mwi_tps_queue_low'.

This patch also adds new global option 'mwi_disable_initial_unsolicited'
to disable sending unsolicited mwi to all endpoints on startup.
If disabled then unsolicited mwi will start processing
on next endpoint's contact update.

ASTERISK-26230 #close

Change-Id: I4c8ecb82c249eb887930980a800c9f87f28f861a
2016-08-08 13:53:32 -04:00
Joshua Colp
bf21359292 Merge "app_voicemail: Add taskprocessor alert level options." into 13 2016-08-08 12:32:52 -05:00
Joshua Colp
485fd27f7c res_pjsip_outbound_publish: Use a serializer shutdown group for unload.
This change replaces the custom unload process for the outbound
publish module with the common serializer shutdown group.

ASTERISK-25217 #close

Change-Id: I280a0384d860c486202d87d2d674394cca77ffb6
2016-08-04 15:16:33 +00:00
Corey Farrell
805f105f88 Add missing checks during startup.
This ensures startup is canceled due to allocation failures from the
following initializations.
* channel.c: ast_channels_init
* config_options.c: aco_init

ASTERISK-26265 #close

Change-Id: I911ed08fa2a3be35de55903e0225957bcdbe9611
2016-08-03 16:39:46 -04:00
Alexei Gradinari
ea71bd6e3e app_voicemail: Add taskprocessor alert level options.
On heavy loaded system with IMAP or DB storage,
'app_voicemail' taskprocessor queue could reach 500 scheduled tasks.
It could happen when the IMAP or DB server dies or is unreachable.
It could happen on startup when there are many (thousands)
realtime endpoints configured with unsolicited mwi.
If the taskprocessor queue reaches the high water level
then the alert is triggered and pjsip stops processing new requests
until the queue reaches the low water level to clear the alert.

This patch adds 2 new 'general' configuration options
to tune taskprocessor alert levels:
'tps_queue_high' - Taskprocessor high water alert trigger level.
'tps_queue_low' - Taskprocessor low water clear alert level

ASTERISK-26229 #close

Change-Id: I766294fbffedf64053c0d9ac0bedd3109f043ee8
2016-08-03 14:56:45 -05:00
Joshua Colp
9dc8cfabd5 astconfigparser: Really handle case where line is simply a comment.
The regular expression would match causing the code that handled
the line if it was merely a comment to never get executed.

Change-Id: I3e4022481037ebcba9905587fe8c764b4ce21819
2016-08-03 14:47:04 +00:00
zuul
9db6cdba1a Merge "asterisk.c: Add auto generation and persistence of UUID" into 13 2016-08-02 19:05:42 -05:00
zuul
bc43220fc6 Merge "Remove SILK payload mappings from Asterisk core." into 13 2016-08-02 18:32:11 -05:00
Joshua Colp
2a0f42c494 Merge "res_pjsip: SIP/SDP origin (o=) contained square brackets on IP6 transports." into 13 2016-08-02 15:59:51 -05:00
George Joseph
ad3e65433c asterisk.c: Add auto generation and persistence of UUID
Upcoming features will require the generation and persistence
of a UUID.

Change-Id: I3ec0062427e133217db6ef496a4216f427c3b92d
2016-08-02 14:20:10 -06:00
Joshua Colp
85f9642420 Merge "menuselect: Add an opaque "member_data" string to the acceptable xml" into 13 2016-08-02 14:17:22 -05:00
Joshua Colp
f1b0286aa4 Merge "rest-api: Code out of sync with the model" into 13 2016-08-02 13:36:18 -05:00
Kevin Harwell
efc4034d72 rest-api: Code out of sync with the model
Change-Id: Idccaa26fd4a423d47d013ee592b8fa6a0349c006
2016-08-02 13:02:24 -05:00
Joshua Colp
9d59de79c9 Merge "sorcery: Use more compatible regex for local expressions." into 13 2016-08-02 12:21:12 -05:00
Mark Michelson
f6821fbaec Remove SILK payload mappings from Asterisk core.
SILK is a bit of a hog when it comes to using up our limited number of
dynamic payload types in the RTP engine. By freeing up four slots, it
allows for other codecs to potentially take the place.

Now, codec_silk.so will dynamically use the payload slots in the RTP
engine when it loads.

A better fix would be make RTP dynamic payload types actually
dynamic. However, at this stage of Asterisk 14 development, this is a
risky move that would be imprudent.

Change-Id: I5774e09408f9a203db189529eabdc0d3f4c1e612
(cherry picked from commit d50895c7b0)
2016-08-02 10:50:34 -05:00
Joshua Colp
829b4ba8b3 Merge "pjproject: fixed a few bugs" into 13 2016-08-02 09:34:39 -05:00
Joshua Colp
102d28c11a sorcery: Use more compatible regex for local expressions.
This changes the use of an empty regex for both res_sorcery_config
and res_sorcery_memory to "." instead. This is a more compatible
regular expression which also works on FreeBSD.

ASTERISK-26206 #close

Change-Id: Ia9166dd176f1597555ba22b6931180d0626c1388
2016-08-02 10:25:16 +00:00