Commit Graph

32164 Commits

Author SHA1 Message Date
Corey Farrell
05c79fdf06 taskprocessor: Do not use separate allocation for stats or name.
Merge storage for the stats object and name string into the main
allocation for struct ast_taskprocessor.

Change-Id: I74fe9a7f357f0e6d63152f163cf5eef6428218e1
2018-11-12 08:15:48 -05:00
Joshua Colp
38e609656a Merge "res_pjsip.c: Make taskprocessor scheduling algorithm pick the shortest queue" into 16 2018-11-12 05:38:36 -06:00
Corey Farrell
3cde7e30ba core: Ensure that el_end is always run when needed.
* Ignore console=yes configuration option in remote console processes.
* Use new flag to tell consolethread to run el_end and exit when needed.

ASTERISK-28158

Change-Id: I9e23b31d4211417ddc88c6bbfd83ea4c9f3e5438
2018-11-11 08:43:29 -05:00
Corey Farrell
1c008c6de5 jansson-bundled: Patch for off-nominal crash.
pack_string crashed on non-NULL strings returned when s->has_error was
true if the string was the result of 's' format without '#', '%' or '+'.

Change-Id: Ic125df691d81ba2cbc413e37bdae657b304d20d0
2018-11-08 18:02:03 -05:00
Kevin Harwell
b969e7769d Merge "res_pjsip: Send a 503 response when overload state if reliable transport." into 16 2018-11-08 13:05:46 -06:00
Corey Farrell
07a59b783e pbx_config: Only the first [globals] section is seen.
If multiple [globals] sections are used (for example via separate
included files), only the first one is processed.  This can result in
lost global variables when using a modular extensions.conf.

ASTERISK-28146 #close

Change-Id: Iaac810c0a7c4d9b1bf8989fcc041cdb910ef08a0
2018-11-08 06:43:06 -05:00
Chris-Savinovich
9c9bc5acca res_pjsip: Send a 503 response when overload state if reliable transport.
When Asterisk's taskprocessors get overloaded we need to reduce the work
load. res_pjsip currently ignores new SIP requests and relies on SIP
retransmissions in the hope that the overload condition will clear soon
enough to handle the retransmitted SIP request.
This change adds the following code after ast_taskprocessor_alert_get()
has returned TRUE:
1- identifies transport type. If non-udp then send a 503 response
2- if transport type is udp/udp6 then ignore, as before.

Change-Id: I1c230b40d43a254ea0f226b7acf9ee480a5d3836
2018-11-07 06:55:41 -06:00
Joshua Colp
907ea79a92 Merge "stasis: Clarify lifetime of topics." into 16 2018-11-07 06:08:39 -06:00
Kevin Harwell
03efafbd4d res_pjsip: formatting error in documentation
The use of a '|' in the "global/debug" synopsis documentation caused the
generated html table on the wiki to add an extra column that included the
text after the pipe.

This patch replaces the pipe with a comma.

ASTERISK-28150

Change-Id: I3d79a6ca6d733d9cb290e779438114884b98a719
2018-11-06 17:03:38 -06:00
Alexei Gradinari
3e3f3bfb07 res_pjsip.c: Make taskprocessor scheduling algorithm pick the shortest queue
The current round-robin method does not take the current taskprocessor
load into consideration when distributing requests.  Using the least-size
method the request goes to the taskprocessor that is servicing the least
number of active tasks at the current time.

Longer running tasks with the round-robin method can delay processing
tasks.

* Change the algorithm from round-robin to least-size for picking the
PJSIP taskprocessor from the default serializer pool.

Change-Id: I7b8d8cc2c2490494f579374b6af0a4868e3a37cd
2018-11-06 10:26:00 -05:00
George Joseph
5710cf7c94 Merge "chan_sip: Attempt ast_do_pickup in handle_invite_replaces" into 16 2018-11-05 09:32:34 -06:00
Joshua Colp
27897a850d stasis: Clarify lifetime of topics.
As mentioned in the comment I've added in the code there is no
ability to unsubscribe all subscribers from a topic and explicitly
destroy it. This is not currently a problem as we have two types of
topics:

Long lived topics which exist for the lifetime of the system.
Ephemeral topics which feed a long lived topic.

In the case of the ephemeral topics there is no subscriber which does
not have its lifetime managed by the same entity that has created
the topic. This ensures that when the topic is being unreferenced the
subscribers are also unsubscribed and destroyed, allowing the topic
to ultimately be destroyed as well.

Change-Id: Ic5e244da7b16b1895ba1fc5ece481ebba5809c9a
2018-11-05 09:46:45 -05:00
Jasper Hafkenscheid
7f6ac5dc2f chan_sip: Attempt ast_do_pickup in handle_invite_replaces
When a call pickup is performed using and invite with replaces header
the ast_do_pickup method is attempted and a PICKUP stasis message is sent.

ASTERISK-28081 #close
Reported-by: Luit van Drongelen

Change-Id: Ieb1442027a3ce6ae55faca47bc095e53972f947a
2018-11-02 10:21:37 -05:00
Pascal Cadotte Michaud
a6d1723727 contrib/sip_to_pjsip: add a --quiet option to avoid prints
Using the --quiet or -q option in conjonction with /dev/stdout as the output
file allow the output to be used as a valid configuration.

Given a script that generates a valid sip.conf I can pipe the output of that
script into `sip_to_pjsip.py -q /dev/stdin /dev/stdout`. This allow me to use
that piped command in my pjsip.conf using the `exec` command.

ASTERISK-28136

Change-Id: I7b0e2e90e2549f3f8e01dc96701f111b5874c88d
2018-11-01 08:47:26 -04:00
George Joseph
f9708adcc8 Merge "res_pjsip: Add XML documentation for "use_callerid_contact"" into 16 2018-10-31 13:59:15 -05:00
George Joseph
021a425011 Merge "alembic: Fix use_callerid_contact option add script." into 16 2018-10-31 13:58:21 -05:00
George Joseph
66a5d96c51 Merge "pjsip: new endpoint's options to control Connected Line updates" into 16 2018-10-31 13:57:00 -05:00
George Joseph
b5245b6f36 Merge "contrib/sip_to_pjsip: handle setvar in conversion" into 16 2018-10-31 13:55:32 -05:00
Joshua Colp
9c5e75acb0 res_pjsip: Add XML documentation for "use_callerid_contact"
ASTERISK-28087

Change-Id: I69d48813ec514f5ef06c6de994cba52630e0a3b4
2018-10-31 08:22:28 -05:00
Richard Mudgett
719daf3299 alembic: Fix use_callerid_contact option add script.
ASTERISK-28087

Change-Id: I046d018015427d0916fab571b5a4f5367476f729
2018-10-30 10:57:29 -05:00
Alexei Gradinari
5cbe77cc46 pjsip: new endpoint's options to control Connected Line updates
This patch adds new options 'trust_connected_line' and 'send_connected_line'
to the endpoint.

The option 'trust_connected_line' is to control if connected line updates
are accepted from this endpoint.

The option 'send_connected_line' is to control if connected line updates
can be sent to this endpoint.

The default value is 'yes' for both options.

Change-Id: I16af967815efd904597ec2f033337e4333d097cd
2018-10-30 10:40:32 -05:00
George Joseph
e8eb659afa Merge "res_pjsip_notify: improve realtime performance on CLI completion on the endpoint" into 16 2018-10-29 13:22:52 -05:00
Alexei Gradinari
fbee505611 res_pjsip_notify: improve realtime performance on CLI completion on the endpoint
The module 'res_pjsip_notify' inefficiently makes a lot of DB requests
on CLI completion on the endpoint.

For example if there are 10k endpoints the module makes 10k requests
of these 10k records.

Even if a part of the endpoint entered
the module makes the same 10k requests and then filtered them by itself.

This patch gathers endpoints container by prefix
and adds all gathered endpoints to completion at once.

ASTERISK-28137 #close

Change-Id: Ic20024912cc77bf4d3e476c4cd853293c52b254b
2018-10-27 17:50:53 -05:00
Pascal Cadotte Michaud
6c2f9b730e contrib/sip_to_pjsip: handle setvar in conversion
Given a sip.conf with the following content:

setvar FOO=1
setvar BAR=42

I want my generated pjsip.conf to containt the following set_vars

set_var FOO=1
set_var BAR=42

in the matching endpoint section.

Change-Id: I6c822401fda4133c3b44bf31e655b4eb939d4d26
2018-10-27 10:59:15 -04:00
Torrey Searle
3ba66b8a9d res_pjsip_session: add new flag use_callerid_contact
Add a new global flag to res_pjsip to allow the callerid to be used
as the username in the contact header.  This allows chan_pjsip to have
the same behavour as chan_sip

ASTERISK-28087 #close

Change-Id: I9a720e058323f6862a91c62f8a8c1a4b5c087b95
2018-10-26 02:42:27 -05:00
Joshua Colp
3f4f31fed6 Merge "app_dial/queue/followme: 'I' options to block initial updates in both directions" into 16 2018-10-25 07:46:16 -05:00
Joshua Colp
d69a0cee03 Merge "bridge_softmix: Add SDP "label" attribute to streams" into 16 2018-10-25 07:45:40 -05:00
Joshua Colp
b0b03c8295 Merge "modules.conf.sample: Update preload usage documentation." into 16 2018-10-25 06:56:21 -05:00
Richard Mudgett
fbb577577c logger.c: Fix default console logging when no logger.conf available.
Default logging was not setup correctly when there was no logger.conf.
This resulted in many expected log messages not actually getting out to
the console.

Change-Id: I542e61c03b2f630ff5327f9de5641d776c6fa70c
2018-10-24 17:18:12 -05:00
Alexei Gradinari
190b3d7412 app_dial/queue/followme: 'I' options to block initial updates in both directions
The 'I' option currently blocks initial CONNECTEDLINE or REDIRECTING updates
from the called parties to the caller.

This patch also blocks updates in the other direction before call is
answered.

ASTERISK-27980

Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
2018-10-24 14:15:17 -05:00
Richard Mudgett
11427a9665 modules.conf.sample: Update preload usage documentation.
Change-Id: Id449d4435c38148b56ac4cfd61ae4d90ac66bb90
2018-10-24 12:50:08 -05:00
George Joseph
fec66b8f01 bridge_softmix: Add SDP "label" attribute to streams
Adding the "label" attribute used for participant info correlation
was previously done in app_confbridge but it wasn't working
correctly because it didn't have knowledge about which video
streams belonged to which channel.  Only bridge_softmix has that
data so now it's set when the bridge topology is changed.

ASTERISK-28107

Change-Id: Ieddeca5799d710cad083af3fcc3e677fa2a2a499
2018-10-24 07:38:13 -06:00
George Joseph
4eef448acc Merge "astobj2: Eliminate usage of legacy container allocation macros." into 16 2018-10-24 08:30:56 -05:00
George Joseph
891a270275 Merge "app_dial/app_queue: Update application option documentation" into 16 2018-10-24 07:47:29 -05:00
George Joseph
7e6a7dcdc0 Merge "lock: Replace __ast_mutex_logger with private log_mutex_error." into 16 2018-10-24 07:46:30 -05:00
Richard Mudgett
1413200c7c Merge "samples: PARKINGSLOT -> PARKING_SPACE in parking sample config" into 16 2018-10-22 10:20:52 -05:00
Corey Farrell
dee1165d31 astobj2: Eliminate usage of legacy container allocation macros.
These macros have been documented as legacy for a long time but are
still used in new code because they exist.  Remove all references to:
* ao2_container_alloc_options
* ao2_t_container_alloc_options
* ao2_t_container_alloc

These macro's are still available for use but only in modules.  Only
ao2_container_alloc remains due to it's use in over 100 places.

Change-Id: I1a26258b5bf3deb081aaeed11a0baa175c933c7a
2018-10-19 17:33:02 -04:00
Corey Farrell
90887af808 lock: Replace __ast_mutex_logger with private log_mutex_error.
__ast_mutex_logger used the variable `canlog` without accepting it as a
argument.  Replace with internal macro `log_mutex_error` which takes
canlog as the first arguement.  This will prevent confusion when working
with lock.c code, many of the function declare the canlog variable and
in some cases it previously appeared to be unused.

Change-Id: I83b372cb0654c5c18eadc512f65a57fa6c2e9853
2018-10-19 11:43:25 -05:00
Jenkins2
14d1e6ca2a Merge "Fix 'statement' typo throughout code." into 16 2018-10-19 09:05:56 -05:00
George Joseph
a3116842ff Merge "modules: Add missing run time module support levels." into 16 2018-10-19 08:39:32 -05:00
George Joseph
6989915ab6 Merge "taskprocessor: Warn on unused result from pushing task." into 16 2018-10-19 08:38:40 -05:00
Richard Mudgett
00284352b3 app_dial/app_queue: Update application option documentation
* Update the post-answer documentation and example.  The Dial example was
incorrect and misleading for the post-answer subroutine useage.

* Fix note and warning paragraphs in option descriptions.  They don't show
up in the wiki.

Change-Id: I81019a1fd75d5b9151f76b52c38e2a90da682d14
2018-10-18 17:22:14 -05:00
Sean Bright
495a1e7e5c samples: PARKINGSLOT -> PARKING_SPACE in parking sample config
PARKINGSLOT was deprecated in Asterisk 12 but the sample config was not
updated to reflect that.

Change-Id: I3e087c19d9ee587094fa5304102d8084a79c2b3c
2018-10-18 14:57:58 -05:00
Richard Mudgett
2384d6eb87 Fix 'statement' typo throughout code.
Most were in comments.  A couple were in warning messages.

Pointed out by Jonathan H on the Asterisk users mailing list.

Change-Id: I6286939dff5d0a27a2758140570106f1cb351855
2018-10-18 12:44:03 -05:00
Richard Mudgett
718ccd51a3 res_rtp_asterisk.c: Add conditional module dependency to res_pjproject
* The dependency ensures that res_pjproject cannot be manually unloaded
before res_rtp_asterisk.
* The dependency allows startup loading errors to report that
res_rtp_asterisk depends upon res_pjproject.

Change-Id: Icf5e7581f4ddd6189929f6174c74dd951f887377
2018-10-17 16:08:19 -05:00
Richard Mudgett
7687630074 modules: Add missing run time module support levels.
Change-Id: I29b9dbfa4bbfc49f21eba356858e38b1d3041824
2018-10-17 14:34:55 -05:00
George Joseph
7c7cdab2af Merge "bundled pjproject: Remove timer cleanup usage patch." into 16 2018-10-17 10:15:43 -05:00
Corey Farrell
abee4fd072 taskprocessor: Warn on unused result from pushing task.
Add attribute_warn_unused_result to ast_taskprocessor_push,
ast_taskprocessor_push_local and ast_threadpool_push.  This will help
ensure we perform the necessary cleanup upon failure.

Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d
2018-10-17 08:27:25 -05:00
George Joseph
ebd8e0720d Merge "refdebug: Create refstats.py script." into 16 2018-10-16 13:43:19 -05:00
Richard Mudgett
3fe9c41342 bundled pjproject: Remove timer cleanup usage patch.
This patch is not in the upstream pjproject and does unsafe things with
the timer->_timer_id and timer->_grp_lock values in pj_timer_entry_reset()
outside of the timer heap lock.  pj_timer_entry_reset() is also called for
timers that are not about to be rescheduled in a few places.

Change-Id: I4fe0b4bc648f7be5903cf4531b94fc87275713c1
2018-10-16 12:37:36 -05:00