Commit Graph

30446 Commits

Author SHA1 Message Date
Jenkins2 8a281776d5 Merge "pjsip_options: dynamic contact's fields not updated on reload" 2017-12-13 14:27:52 -06:00
George Joseph afb6e85980 Merge "CLI: Fix 'core show sysinfo' function ordering." 2017-12-13 13:12:27 -06:00
Joshua Colp c50905756b Merge "chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)" 2017-12-13 11:21:15 -06:00
Corey Farrell 5f6a3c4399 CLI: Remove special handling of 'core set verbose' from rasterisk.
rasterisk does not need to handle setting verbose levels locally, it
should just tell the daemon what it wants and print what it is given.
Just max out the verbose level on the local client so all filtering
happens on the daemon.

ASTERISK-20281 #close

Change-Id: Ia305f75f1fc424a9169bfa30ef70d626ace2c8a8
2017-12-13 11:10:37 -06:00
pchero daa3a3009a Add new AMI action for app_voicemail
Currently, to figure out specified voicemail's status, there's only one
way to do it, which is use a VoicemailUserEntry AMI message.
But it consumed it too much resource(it check everything).
So, added new AMI action.

ASTERISK-27470

Change-Id: Ie4eba1424a142e5fbd1d9fb1821a3fc1a1e238b7
2017-12-13 10:31:24 -06:00
Joshua Colp 62f2860c39 AST-2017-012: Place single RTCP report block at beginning of report.
When the RTCP code was transitioned over to Stasis a code change
was made to keep track of how many reports are present. This count
controlled where report blocks were placed in the RTCP report.

If a compound RTCP packet was received this logic would incorrectly
place a report block in the wrong location resulting in a write
to an invalid location.

This change removes this counting logic and always places the report
block at the first position. If in the future multiple reports are
supported the logic can be extended but for now keeping a count
serves no purpose.

ASTERISK-27382
ASTERISK-27429

Change-Id: Iad6c8a9985c4b608ef493e19c421211615485116
2017-12-13 07:36:39 -06:00
Jenkins2 58514c7442 Merge "chan_sip: Don't crash in Dial on invalid destination" 2017-12-13 07:14:13 -06:00
Joshua Colp 3370cd21df res_pjsip_session: Reinvite using active stream topology if none requested.
When a connected line update is sent to an endpoint we do not request
a specific stream topology to be used. Previously this resulted in the
configured stream topology being used which may actually differ from the
currently negotiated topology. PJSIP is helpful in this regard in that
it will fill in any missing streams with removed ones. This results in
our own state not matching the SDP, though, and we do not apply the
negotiated SDP.

This change tweaks the code to use the actively negotiated stream
topology if it is present with a fallback to the configured one. This
results in the SDP and the state having matching information and the
world is happy.

ASTERISK*27397

Change-Id: I7a57117f0183479e6884b7bf3a53bb8c7464f604
2017-12-13 06:58:49 -06:00
Jenkins2 e7dccbe708 Merge "chan_sip: Don't send trailing \0 on keep alive packets" 2017-12-13 06:36:03 -06:00
Joshua Colp 0b532367bd pjsip: Ignore state changes from old transactions.
When we fail over to a new target we create a new transaction
and it becomes the current INVITE transaction. This does not
prevent the previous transaction from raising state changes
and causing the session to be prematurely disconnected if a
transport error occurs immediately.

This change backports a fix from PJSIP that eliminates the
incorrect state change and reduces when they would be raised
in the first place.

ASTERISK-27408

Change-Id: Id22d087591782eee31311753d11e7eca4b95ef34
2017-12-13 05:09:27 -06:00
Yasuhiko Kamata cb249b2419 chan_sip: 3PCC patch for AMI "SIPnotify"
A patch for sending in-dialog SIP NOTIFY message
with "SIPnotify" AMI action.

ASTERISK-27461

Change-Id: I5797ded4752acd966db6b13971284db684cc5ab4
2017-12-13 13:42:35 +09:00
Ivan Poddubny c7f94e570e app_queue: Fix extension state subscriptions removed on dialplan reload
The approach with having a single global subscription to all extension
state changes has one issue: dynamically created hints don't have any
watchers and are therefore garbage collected on the first dialplan
reload.

This change creates a state subscription for every queue member with a
hint as state_interface, thus increasing the count of watches for
hints, so they are not destroyed prematurely anymore.

There are 2 side effects:
1. The state change callback in app_queue is not executed when
   there are no members referring to the extension.
2. The callback is called multiple times for the same hint if it's
   associated with more than one queue member.

Reported by: Steven T. Wheeler

ASTERISK-18411 #close

Change-Id: I4956af2136ea2a7f110ac9272eae5f6e676d8f89
2017-12-12 23:00:51 +01:00
Sean Bright 0c9cc7e975 chan_sip: Don't send trailing \0 on keep alive packets
This is a partial fix for ASTERISK~25817 but does not address the
comments regarding RFC 5626.

Change-Id: I227e2d10c0035bbfa1c6e46ae2318fd1122d8420
2017-12-12 15:52:25 -06:00
Sean Bright 5039b5741c chan_sip: Don't crash in Dial on invalid destination
Stripping the DNID in a SIP dial string can result in attempting to call
the argument parsing macros on an empty string, causing a crash.

ASTERISK-26131 #close
Reported by: Dwayne Hubbard
Patches:
	dw-asterisk-master-dnid-crash.patch (license #6257) patch
	uploaded by Dwayne Hubbard

Change-Id: Ib84c1f740a9ec0539d582b09d847fc85ddca1c5e
2017-12-12 15:35:17 -06:00
Corey Farrell 6a67828b46 menuselect: Tweak check for recently run configure.
Recently menuselect has randomly produced an error stating that
configure was just run and make had to be restarted.  I believe this is
due to an incorrect menuselect/Makefile rule.  The original rule
produced an error if makeopts or autoconfig.h were older than
makeopts.in or autoconfig.h.in.  I believe this can create an issue if
makeopts is older than autoconfig.h.in or if autoconfig.h is older than
makeopts.in.  The new rules compare files independently.

Change-Id: Ibca155035fa1392c95e33cbf25f257902abba17b
2017-12-12 16:16:38 -05:00
Richard Mudgett 22810fc635 chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)
This patch does three things associated with the initial incoming INVITE
request URI.

1) Add access to the full initial incoming INVITE request URI.

2) We were not setting DNID on incoming PJSIP channels.  The DNID is the
user portion of the initial incoming INVITE Request-URI.  The value is
accessed by reading CALLERID(dnid).

3) Fix CHANNEL(pjsip,target_uri) documentation.

* The initial incoming INVITE request URI is now available using
CHANNEL(pjsip,request_uri).

* Set the DNID on PJSIP channel creation so CALLERID(dnid) can return the
initial incoming INVITE request URI user portion.

* CHANNEL(pjsip,target_uri) now correctly documents that the target URI is
the contact URI.

* Refactored print_escaped_uri() out of channel_read_pjsip() to handle
pjsip_uri_print() error condition when the buffer is too small.

ASTERISK-27478

Change-Id: I512e60d1f162395c946451becb37af3333337b33
2017-12-12 13:46:42 -06:00
Sean Bright ec1f4bf48d res_pjsip: Add TLSv1.1 and TLSv1.2 support
Support for these protocols was added in the same commit as the 'proto'
field, so we can safely use the same ./configure check.

For reference: https://trac.pjsip.org/repos/changeset/4968

Change-Id: Icf4975d785d6bfb8f30ac7ffa695a0adf9382dac
2017-12-12 11:45:44 -06:00
Sean Bright 0b9d2135a9 res_pjsip: Assign support levels to a few modules
Change-Id: I51f6945c4023cb93fc7b87be5ab4c50e9e6ee27d
2017-12-12 11:07:33 -06:00
Corey Farrell c01ba7437e CLI: Fix 'core show sysinfo' function ordering.
Handle CLI initialization before any processing occurs.

Change-Id: I598b911d2e409214bbdfd0ba0882be1d602d221c
2017-12-11 20:21:16 -05:00
Kevin Harwell b088cddc03 pjsip_options: wrongly applied "UNKNOWN" status
A couple of places were setting the status to "UNKNOWN" when qualifies were
being disabled. Instead this should be set to the "CREATED" status that
represents when a contact is given (uri available), but the qualify frequency
is set to zero so we don't know the status.

This patch updates the relevant places with "CREATED". It also updates the
"CREATED" status description (value shown in CLI/AMI/ARI output) to a value
of "NonQualified"/"NonQual" as this description is hopefully less confusing.

ASTERISK-27467

Change-Id: Id67509d25df92a72eb3683720ad2a95a27b50c89
2017-12-11 15:27:29 -06:00
Richard Mudgett c2ec82bf36 stasis_channels.c: Don't set channel snapshot caller_dnid twice.
Change-Id: Ib8d45bbdfbda81e65045f6dff874d189b74e5471
2017-12-11 14:14:57 -06:00
Jenkins2 38dcdf2d68 Merge "codec_opus: Make libcurl a dependency in menuselect" 2017-12-11 12:22:21 -06:00
Jenkins2 b7e79d7baf Merge "astdb: Improve prefix searches in astdb" 2017-12-11 12:12:58 -06:00
Jenkins2 f81a884033 Merge "loader: Refactor resource_name_match." 2017-12-11 11:44:34 -06:00
Joshua Colp 5d43a4d4ff Merge "res_stasis and res_speech: Fix load order." 2017-12-11 11:12:25 -06:00
Jenkins2 710b3a29c3 Merge "utils: Add convenience function for setting fd flags" 2017-12-11 10:13:09 -06:00
Sean Bright 00578fae0a codec_opus: Make libcurl a dependency in menuselect
ASTERISK-27475 #close

Change-Id: If7384bc6ed002ef140dec69798d14c52b7cfd800
2017-12-11 09:45:36 -06:00
Jenkins2 cd741136c5 Merge "pjsip: Improve CLI completion performance" 2017-12-11 09:36:54 -06:00
Jenkins2 6d25b26933 Merge "CDR: Fix deadlock setting some CDR values." 2017-12-11 09:06:41 -06:00
Sean Bright 521f741b04 pjsip: Improve CLI completion performance
Use the new ast_cli_completion_add() function to improve completion
performance for commands like 'pjsip show endpoint.'

Change-Id: I76d802294d2ac1766110dc75f7d117c8541ce348
2017-12-10 12:57:24 -06:00
Sean Bright 9a9edc6c9e astdb: Improve prefix searches in astdb
Using the LIKE operator requires a full table scan of 'astdb', whereas a
comparison operation is able to use the primary key index.

This patch adds a new function to the AstDB API for quick prefix matches
and updates res_sorcery_astdb to utilize it. This showed substantial
performance improvement in my test environment.

Related to ASTERISK~26806, but does not completely resolve it.

Change-Id: I7d37f9ba2aea139dabf2ca72d31fbe34bd9b2fa1
2017-12-10 12:51:16 -06:00
Corey Farrell d2e87b8e14 loader: Refactor resource_name_match.
Optimize resource_name_match.  This change eliminates use of
ast_strdupa, instead verifying that both basename's are the same length,
then using strncasecmp.

Change-Id: I477275c0e954c99d74be5abfc8bb6545b04e5a3d
2017-12-08 19:51:09 -05:00
Sean Bright dbb376f166 pjsip_configuration: Add correct file header
Change-Id: I25348c386a222bb704aff07f54375108a6402906
2017-12-08 14:59:05 -06:00
Sean Bright 2ffe52a116 utils: Add convenience function for setting fd flags
There are many places in the code base where we ignore the return value
of fcntl() when getting/setting file descriptior flags. This patch
introduces a convenience function that allows setting or clearing file
descriptor flags and will also log an error on failure for later
analysis.

Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7
2017-12-08 13:28:04 -06:00
Corey Farrell e2dbc26376 res_stasis and res_speech: Fix load order.
res_stasis was missing AST_MODFLAG_LOAD_ORDER.  Set res_stasis and
res_speech to start at (AST_MODPRI_APP_DEPEND - 1) so they are ready for
dependent modules.

Change-Id: I27f4f3810a95b6be8a5bfbf62be2ace6bfab6ff3
2017-12-07 19:39:04 -06:00
Kevin Harwell 0e4d31eb9c pjsip_options: contacts sometimes not being updated on reload
For both dynamic and static contacts it was possible that potential AOR
changes were not being applied to all contacts. This was because the qualify
and schedule code was only retrieving AOR's, and contacts with frequencies
greater than zero.

For instance the following could happen: and AOR/contact has a frequency of 5,
it then gets set to 0, and then a reload occurs. All scheduled OPTIONS are
stopped, a list of AOR's is retrieved with frequency > 0, but none are
selected since in this scenario all are 0. The contact for the one previously
set to 5 though does not get updated, so it's status remains "AVAILABLE".

This patch makes it so all contacts (static and dynamic) are selected, and
appropriately updated if need be.

ASTERISK-27467 #close

Change-Id: I7a920170f89c683af9505d4723a44fc6841decdb
2017-12-07 18:40:34 -06:00
Kevin Harwell bd2218ce63 pjsip_options: dynamic contact's fields not updated on reload
Dynamic contacts were not being properly updated on reload. As a matter of
fact any changes to the AOR that a dynamic contact was associated with were
not being applied.

On reload, this patch makes it so for each dynamic contact, the associated
AOR is now retrieved and the AOR's fields are applied to the contact.

ASTERISK-27467

Change-Id: I8e3165dc6a745218c1c9db837f77fafa0516985d
2017-12-07 18:38:23 -06:00
Jenkins2 b0b28446c1 Merge "translate: Skip matrix_rebuild during shutdown." 2017-12-07 14:33:47 -06:00
George Joseph d7f3f8c283 Merge "sounds_index: Avoid repeatedly reindexing." 2017-12-07 13:26:22 -06:00
George Joseph 5cef8b2f3e Merge "media_index: Improve startup." 2017-12-07 13:26:06 -06:00
Corey Farrell c2c9995830 translate: Skip matrix_rebuild during shutdown.
Change-Id: I1e5eef4029cba56e33d786c5a5ade8091e531a1e
2017-12-07 00:35:14 -05:00
Corey Farrell ab191e9782 sounds_index: Avoid repeatedly reindexing.
The sounds index is rebuilt each time a format is registered or
unregistered.  This causes the index to be repeatedly rebuilt during
startup and shutdown.

This patch significantly reduces the work done by delaying sound index
initialization until after modules are loaded.  This way a reindex only
occurs if a format module is loaded after startup.  We also skip
reindexing when format modules are unloaded during shutdown.

Change-Id: I585fd6ee04200612ab1490dc804f76805f89cf0a
2017-12-06 18:47:28 -05:00
Richard Mudgett 3078b7adc2 CDR: Fix deadlock setting some CDR values.
Setting channel variables with the AMI Originate action caused a deadlock
when you set CDR(amaflags) or CDR(accountcode).  This path has the channel
locked when the CDR function is called.  The CDR function then
synchronously passes the job to a stasis thread.  The stasis handling
function then attempts to lock the channel.  Deadlock results.

* Avoid deadlock by making the CDR function handle setting amaflags and
accountcode directly on the channel rather than passing it off to the CDR
processing code under a stasis thread to do it.

* Made the CHANNEL function and the CDR function process amaflags the same
way.

* Fixed referencing the wrong message type in cdr_prop_write().

ASTERISK-27460

Change-Id: I5eacb47586bc0b8f8ff76a19bd92d1dc38b75e8f
2017-12-06 15:59:59 -06:00
Corey Farrell 2af59ebb3a media_index: Improve startup.
This eliminates some wasteful operations in media_index startup.

* Replace statically set string-fields with char[0].
* Eliminate pointless RAII_VAR's.
* alloc_variant: Avoid pointless ao2_find on new info->variant.
* Stop trying find_variant before alloc_variant.
* process_media_file: replace ast_str with ast_asprintf.  This avoids
  reallocation of file_id_str.

Overall sounds_index.c is about 27% of Asterisk startup time when using
sample configs.  This patch reduces it to 20%.  This is a half-fix.  The
real problem is that the media_index is regenerated repeatedly - 68
times in my test.

Change-Id: Ia50b752f8efb356f852b05c4be495a6631af8652
2017-12-06 14:34:32 -05:00
Richard Mudgett e97e41552e bridge_basic.c: Update transfer diagnostic messages addendum.
* Added start DTMF transfer verbose messages.
* Made associated transfer messages use a similar message format.
* Adjusted message verbose level as requested by initial reporter.

ASTERISK-27449

Change-Id: I2045714586414b3c5ef1f3cc56c1c4af4b31f551
2017-12-06 07:51:24 -06:00
Jenkins2 3fc1490bcb Merge "bridge_basic.c: Update transfer diagnostic messages." 2017-12-06 06:51:31 -06:00
Jenkins2 f761206f47 Merge "Add new object for VoicemailUserEntry" 2017-12-05 20:10:51 -06:00
Joshua Colp 628a0af6de Merge "res_rtp_asterisk.c: Increase strictrtp learning timeout time." 2017-12-05 19:31:14 -06:00
Jenkins2 cc81f4eb42 Merge "pjproject: Clean up disabling of WebRTC support." 2017-12-05 18:30:42 -06:00
Niklas Larsson 9d00583164 bridge_basic.c: Update transfer diagnostic messages.
* Add the channel name to diagnostic messages so you will know which
channel failed to transfer.

* Promoted some debug messages to verbose 4 messages.

ASTERISK-27449 #close

Change-Id: Idac66b7628c99379cc9269158377fd87dc97a880
2017-12-05 15:39:19 -06:00