Age | Commit message (Collapse) | Author |
|
A patch I did back in 2014 modified ast_config_text_file_save2 to check the
writability of the main file and include files before truncating and re-writing
them. An unintended side-effect of this was that if a file doesn't exist,
the check fails and the write is aborted.
This patch causes ast_config_text_file_save2 to check the writability of the
parent directory of missing files instead of checking the file itself. This
allows missing files to be created again. A unit test was also added to
test_config to test saving of config files.
The regression was discovered when app_voicemail's passwordlocation=spooldir
feature stopped working.
ASTERISK-25917 #close
Reported-by: Jonathan Rose
Change-Id: Ic4dbe58c277a47b674679e49daed5fc6de349f80
|
|
In sorcery based config files where there are multiple categories with the same
name, you can't use the (+) operator to reliably append to a category because
config.c stops looking when it finds the first one with the same name.
Example:
[1000]
type = endpoint
[1000]
type = aor
[1000](+)
authenticate_qualify = yes
This config will fail because config.c appends authenticate_qualify to the
first category it finds, the endpoint, and that's not valid for endpoint.
Solution:
The capability to find a category that contains a certain variable already
exists so the only real change was to parse anything after the '+' that's not a
comma, as a filter string.
[1000]
type = endpoint
[1000]
type = aor
[1000](+type=aor)
authenticate_qualify = yes
This now works as expected.
Although the following example doesn't make any sense for pjsip, you can even
specify multiple filters:
[1000](+type=aor&qualify_frequency=10)
ASTERISK-25868 #close
Reported-by: Nick Repin
Change-Id: I10773da4c79db36fbf1993961992af63d3441580
|
|
There were a number of places in the res_pjsip stack that were getting
all endpoints or all aors, and then filtering them locally.
A good example is pjsip_options which, on startup, retrieves all
endpoints, then the aors for those endpoints, then tests the aors to see
if the qualify_frequency is > 0. One issue was that it never did
anything with the endpoints other than retrieve the aors so we probably
could have skipped a step and just retrieved all aors. But nevermind.
This worked reasonably well with local config files but with a realtime
backend and thousands of objects, this was a nightmare. The issue
really boiled down to the fact that while realtime supports predicates
that are passed to the database engine, the non-realtime sorcery
backends didn't.
They do now.
The realtime engines have a scheme for doing simple comparisons. They
take in an ast_variable (or list) for matching, and the name of each
variable can contain an operator. For instance, a name of
"qualify_frequency >" and a value of "0" would create a SQL predicate
that looks like "where qualify_frequency > '0'". If there's no operator
after the name, the engines add an '=' so a simple name of
"qualify_frequency" and a value of "10" would return exact matches.
The non-realtime backends decide whether to include an object in a
result set by calling ast_sorcery_changeset_create on every object in
the internal container. However, ast_sorcery_changeset_create only does
exact string matches though so a name of "qualify_frequency >" and a
value of "0" returns nothing because the literal "qualify_frequency >"
doesn't match any name in the objset set.
So, the real task was to create a generic string matcher that can take a
left value, operator and a right value and perform the match. To that
end, strings.c has a new ast_strings_match(left, operator, right)
function. Left and right are the strings to operate on and the operator
can be a string containing any of the following: = (or NULL or ""), !=,
>, >=, <, <=, like or regex. If the operator is like or regex, the
right string should be a %-pattern or a regex expression. If both left
and right can be converted to float, then a numeric comparison is
performed, otherwise a string comparison is performed.
To use this new function on ast_variables, 2 new functions were added to
config.c. One that compares 2 ast_variables, and one that compares 2
ast_variable lists. The former is useful when you want to compare 2
ast_variables that happen to be in a list but don't want to traverse the
list. The latter will traverse the right list and return true if all
the variables in it match the left list.
Now, the backends' fields_cmp functions call ast_variable_lists_match
instead of ast_sorcery_changeset_create and they can now process the
same syntax as the realtime engines. The realtime backend just passes
the variable list unaltered to the engine. The only gotcha is that
there's no common realtime engine support for regex so that's been noted
in the api docs for ast_sorcery_retrieve_by_fields.
Only one more change to sorcery was done... A new config flag
"allow_unqualified_fetch" was added to reg_sorcery_realtime.
"no": ignore fetches if no predicate fields were supplied.
"error": same as no but emit an error. (good for testing)
"yes": allow (the default);
"warn": allow but emit a warning. (good for testing)
Now on to res_pjsip...
pjsip_options was modified to retrieve aors with qualify_frequency > 0
rather than all endpoints then all aors. Not only was this a big
improvement in realtime retrieval but even for config files there's an
improvement because we're not going through endpoints anymore.
res_pjsip_mwi was modified to retieve only endpoints with something in
the mailboxes field instead of all endpoints then testing mailboxes.
res_pjsip_registrar_expire was completely refactored. It was retrieving
all contacts then setting up scheduler entries to check for expiration.
Now, it's a single thread (like keepalive) that periodically retrieves
only contacts whose expiration time is < now and deletes them. A new
contact_expiration_check_interval was added to global with a default of
30 seconds.
Ross Beer reports that with this patch, his Asterisk startup time dropped
from around an hour to under 30 seconds.
There are still objects that can't be filtered at the database like
identifies, transports, and registrations. These are not going to be
anywhere near as numerous as endpoints, aors, auths, contacts however.
Back to allow_unqualified_fetch. If this is set to yes and you have a
very large number of objects in the database, the pjsip CLI commands
will attempt to retrive ALL of them if not qualified with a LIKE.
Worse, if you type "pjsip show endpoint <tab>" guess what's going to
happen? :) Having a cache helps but all the objects will have to be
retrieved at least once to fill the cache. Setting
allow_unqualified_fetch=no prevents the mass retrieve and should be used
on endpoints, auths, aors, and contacts. It should NOT be used for
identifies, registrations and transports since these MUST be
retrieved in bulk.
Example sorcery.conf:
[res_pjsip]
endpoint=config,pjsip.conf,criteria=type=endpoint
endpoint=realtime,ps_endpoints,allow_unqualified_fetch=error
ASTERISK-25826 #close
Reported-by: Ross Beer
Tested-by: Ross Beer
Change-Id: Id2691e447db90892890036e663aaf907b2dc1c67
|
|
ASTERISK-25700 #close
Change-Id: I096da84f9c62c6095f68bcf98eac4b7c7868e808
|
|
Change-Id: I06e346e9a5c63cc5071e7eda537310c4b43bffe0
|
|
The memory corruption could happen if the [section](+) is the last section
in the file with trailing comments. In this case process_text_line() has
left *last_cat is set to newcat and newcat is destroyed.
Change-Id: I0d1d999f553986f591becd000e7cc6ddfb978d93
|
|
An #include right after a [section](+) would associate any variable
assignments before a new section in the #include with the wrong section.
* Fix section association by setting the current section to the appended
section.
* Fix '+' and '!' section flag interaction corner case depending upon
which flag came first. If the '!' came first then it would be ignored.
If the '!' came after then it would affect the appended section. The '!'
will now no longer be ignored.
ASTERISK-25461 #close
Reported by: Sean Pimental
Change-Id: Ic9d3191c8758048e2cbce6432f854b32531731c3
|
|
When a mapping does not exist between a sorcery.conf defined object and
a realtime mapping in extconf, currently, the user will receive a slew
of ERROR messages that don't really tell what is happening. Some ERROR
messages may even be misleading, as they occur after the sorcery API has
already given up on the attempt to load and create the sorcery object.
This patch adds a bit of debug and a useful WARNING message for when a
wizard's open callback fails for a particular object type. In the bad
configurations that resulted in this patch, this provided a 'root cause'
WARNING message that pointed in the right direction of the configuration
problem.
Change-Id: I1cc7344f2b015b8b9c85a7e6ebc8cb4753a8f80b
|
|
The config wizard was always pulling the first occurrence of
a variable from an ast_variable list but this gets the template
value from the list instead of any overridden value. This patch
creates ast_variable_find_last_in_list() in config.c and updates
res_pjsip_config_wizard to use it instead of
ast_variable_find_in_list. Now the overridden values, where they
exist, are used instead of template variables.
Updated test_config to test the new API.
ASTERISK-25089 #close
Reported-by: George Joseph <george.joseph@fairview5.com>
Tested-by: George Joseph <george.joseph@fairview5.com>
Change-Id: Ifa7ddefc956a463923ee6839dd1ebe021c299de4
|
|
This patch fixes clang compilers warnings for unused functions. Specifically:
* channels/chan_iax2: removed user_ref function
* main/dsp.c: removed goertzel_update function
* main/config.c: made variable_list_switch static
Review: https://reviewboard.asterisk.org/r/4527
ASTERISK-24917
Reported by: dkdegroot
patches:
rb4527.patch submitted by dkdegroot (License 6600)
........
Merged revisions 433678 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Since 'core stop now' and 'core restart now' do not stop modules,
it is unsafe for most of the core to run cleanups. Originally all
cleanups used ast_register_atexit, and were only changed when it
was shown to be unsafe. ast_register_atexit is now used only when
absolutely required to prevent corruption and close child processes.
Exceptions that need to use ast_register_atexit:
* CDR: Flush records.
* res_musiconhold: Kill external applications.
* AstDB: Close the DB.
* canary_exit: Kill canary process.
ASTERISK-24142 #close
Reported by: David Brillert
ASTERISK-24683 #close
Reported by: Peter Katzmann
ASTERISK-24805 #close
Reported by: Badalian Vyacheslav
ASTERISK-24881 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4500/
Review: https://reviewboard.asterisk.org/r/4501/
........
Merged revisions 433495 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Using DEBUG_CHAOS several instances of a null
pointer crash, and one uninitialized variable
were uncovered and fixed. Also added details
on why Asterisk failed to initialize.
Review: https://reviewboard.asterisk.org/r/4468/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
In this collection of small patches to prevent
Valgrind errors are: fixes for reference leaks
in config hooks, evaluating a parameter beyond
bounds, and accessing a structure after a lock
where it could have been already free'd.
Review: https://reviewboard.asterisk.org/r/4407/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
When a crash was fixed due to usage of the REALTIME function in r423003, a
regression was introduced into ast_update2_realtime where the update fields
passed to the function would be skipped and the lookup field processed twice.
The use of this function is a bit interesting: A variable argument list is
used with two sentinel values - the first marks the end of the lookup
fields/values; the second marks the end of the update fields/values.
Unfortunately, ast_update2_realtime parses over the lookup fields twice, as
opposed to parsing over the update fields. This causes the lookups to succeed,
but the updates itself to have no effect.
Note that the most common instance of this problem occurred in app_voicemail
during the updating of a mailbox password.
Thanks to the issue reporter, Paddy Grice, for pointing out the problem.
Review: https://reviewboard.asterisk.org/r/4356/
ASTERISK-24231
ASTERISK-24626 #close
Reported by: Paddy Grice
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Let's say you have a template T with variable VAR1 = ON and you have a
context C(T) that doesn't specify VAR1. If you read C, the effective value
of VAR1 is ON. Now you change T VAR1 to OFF and call
ast_config_text_file_save. The current behavior is that the file gets
re-written with T/VAR1=OFF but C/VAR1=ON is added. Personally, I think this
is a bug. It's preserving the effective state of C even though I didn't
specify C/VAR1 in th first place. I believe the behavior should be that if
I didn't specify C/VAR1 originally, then the effective value of C/VAR1 should
continue to follow the inherited state. Now, if I DID explicitly specify
C/VAR1, the it should be preserved even if the template changes.
Even though I think the existing behavior is a bug, it's been that way forever
so I'm not changing it. Instead, I've created ast_config_text_file_save2()
that takes a bitmask of flags, one of which is to preserve the effective context
(the current behavior). The original ast_config_text_file_save calls *2 with
the preserve flag. If you want the new behavior, call *2 directly without a
flag.
I've also updated Manager UpdateConfig with a new parameter
'PreserveEffectiveContext' whose default is 'yes'. If you want the new behavior
with UpdateConfig, set 'PreserveEffectiveContext: no'.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4297/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Add
const char *ast_variable_find_in_list(const struct ast_variable *list,
const char *variable);
ast_variable_find() requires a config category to search whereas
ast_variable_find_in_list() just needs the root list element which is
useful if you don't have a category.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4217/
........
Merged revisions 428733 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
When a config file is read, an unescaped semicolon signals comments which are
stripped from the value before it's stored. Escaped semicolons are then
unescaped and become part of the value. Both of these behaviors are normal
and expected. When the config is serialized either by 'dialplan save' or
AMI/UpdateConfig however, the now unescaped semicolons are written as-is.
If you actually reload the file just saved, the unescaped semicolons are
now treated as start of comments.
Since true comments are stripped on read, any semicolons in
ast_variable.value must have been escaped originally. This patch
re-escapes semicolons in ast_variable.values before they're written to
file either by 'dialplan save' or config/ast_config_text_file_save which
is called by AMI/UpdateConfig. I also fixed a few pre-existing formatting
issues nearby in pbx_config.c
Tested-by: George Joseph
ASTERISK-20127 #close
Review: https://reviewboard.asterisk.org/r/4132/
........
Merged revisions 427275 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
My recent refactor of config.c accidentally removed the capability for an
object to inherit from a non-template object.
This patch restores the capability to inherit from both template and
non-template objects.
Tested-by: George Joseph
Reported-by: Scott Griepentrog
ASTERISK-24487 #close
Review: https://reviewboard.asterisk.org/r/4147/
........
Merged revisions 427227 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Fix infinite loop when calling ast_variable_retrieve inside an
ast_category_browse loop when there is more than 1 category with
the same name.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4089/
........
Merged revisions 425713 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
With MALLOC_DEBUG the /main/config config_basic_ops test was causing a
SEGV while doing an ast_category_delete in an ast_category_browse loop.
Apparently this never worked but was also never tested. I removed the
test, added 2 notes to config.h indicating that it's not supported and
added a few lines of code to ast_category_delete to prevent the SEGV
should someone attempt it in the future.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4078/
........
Merged revisions 425525 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
This patch provides the capability to manipulate templates and categories
with non-unique names via AMI.
Summary of changes:
GetConfig and GetConfigJSON: Added "Filter" parameter: A comma separated list
of name_regex=value_regex expressions which will cause only categories whose
variables match all expressions to be considered. The special variable name
TEMPLATES can be used to control whether templates are included. Passing
'include' as the value will include templates along with normal categories.
Passing 'restrict' as the value will restrict the operation to ONLY templates.
Not specifying a TEMPLATES expression results in the current default behavior
which is to not include templates.
UpdateConfig: NewCat now includes options for allowing duplicate category
names, indicating if the category should be created as a template, and
specifying templates the category should inherit from. The rest of the
actions now accept a filter string as defined above. If there are non-unique
category names, you can now update specific ones based on variable values.
To facilitate the new capabilities in manager, corresponding changes had to be
made to config, most notably the addition of filter criteria to many of the
APIs. In some cases it was easy to change the references to use the new
prototype but others would have required touching too many files for this
patch so a wrapper with the original prototype was created. Macros couldn't
be used in this case because it would break binary compatibility with modules
such as res_digium_phone that are linked to real symbols.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4033/
........
Merged revisions 425383 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
If you call ast_category_insert with a match category that doesn't exist, the
list traverse runs out of 'next' categories and you get a SEGV. This patch
adds check for the end-of-list condition and changes the signature to return
an int for success/failure indication instead of a void.
The only consumer of this function is manager and it was also changed to use
the return value.
Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3993/
........
Merged revisions 423276 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 423277 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 423278 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@423279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Also has could affect with anything that goes through ast_destroy_realtime.
If a CLI user used the command 'realtime destroy <family>' with only a single
column/value pair, Asterisk would crash when trying to create a variable list
from a NULL value.
ASTERISK-24231 #close
Reported by: Niklas Larsson
Review: https://reviewboard.asterisk.org/r/3985/
........
Merged revisions 422984 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@422985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
ast_config_text_file_save() currently truncates include files as they
are processed. If a subsequent include file or the main config file has
a permissions error that prevents writing, earlier include files are left
truncated resulting in a frantic search for backups.
This patch causes ast_config_text_file_save to check for write access
on all files before it truncates any of them.
Will be applied 1.8 > trunk.
Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3986/
........
Merged revisions 422900 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 422903 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 422904 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@422905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
When updated configuration is written back to the conf
file - for example when a user changes their voicemail
pin, make sure that any config hook that wants to know
of changes is informed.
Review: https://reviewboard.asterisk.org/r/3708/
........
Merged revisions 418366 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 418369 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Prior to this patch, sequential variables would be ordered in reverse
from the order specified in the manager action.
Review: https://reviewboard.asterisk.org/r/3588/
........
Merged revisions 415359 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 415390 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 415410 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
The twisted logic determining if a config file should be reloaded was
mostly broken and disabled. The incorrect test that ASTERISK-23383 fixed
actually reenabled the broken logic. The incorrect test was causing the
timestamp to always be cleared which caused config files with includes to
always be reloaded.
* Made wildcard includes always cause a reload. Determining if a file was
deleted cannot be determined without restructuring the cache to determine
if any files are missing from the last files actually loaded. Also
without refactoring config_text_file_load(), the glob loop couldn't check
more than one file for changes anyway.
* Made remove the cache entry if the file no longer exists when trying to
get its timestamp or it is no longer a regular file. This fixes the
corner case where the file was loaded, then deleted, then the config
reloaded, then the file restored with the same timestamp, and then the
config reloaded again.
* Made remove the cache entry include list when actually loading the file.
This gets rid of any stale includes the file had from the last time the
file was loaded.
ASTERISK-23683 #close
Reported by: tootai
Review: https://reviewboard.asterisk.org/r/3575/
........
Merged revisions 415225 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 415229 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 415230 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
When invoking UpdateConfig AMI action with Action set to EmptyCat, Asterisk
will make all categories empty in the config but the one requested with a
Cat variable. This is due to a bug in ast_category_empty (main/config.c)
that makes an incorrect comparison for a category name.
This patch corrects the comparison such that only the requested category
is cleared.
Review: https://reviewboard.asterisk.org/r/3573/
#ASTERISK-23803 #close
Reported by: zvision
patches:
manager.c.diff uploaded by zvision (License 5755)
........
Merged revisions 414880 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 414881 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 414882 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
This resolves a large number of compiler warnings from GCC 4.10 which
cause the build to fail under dev mode. The vast majority are
signed/unsigned mismatches in printf-style format strings.
........
Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Fix a long standing bug in CB_ADD_LEN() behaving like CB_ADD().
ASTERISK-23546 #close
Reported by: Walter Doekes
........
Merged revisions 411960 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 411961 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 411962 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
There is enough indication from the CLI that we are loading a realtime engine
as it is.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Realtime backends' update and store callbacks return the number of rows affected,
or -1 if there was a failure. There were a couple of issues:
* The config API was treating 0 as a successful return, and positive values as
a failure. Now the config API treats anything >= 0 as a success.
* res_sorcery_realtime was treating 0 as a successful return from the store
procedure, and any positive values as a failure. Now sorcery treats anything
> 0 as a success. It still considers 0 a "failure" since there is no change
to report to observers.
Review: https://reviewboard.asterisk.org/r/3341
........
Merged revisions 410592 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
This patch creates the AST_SORCERY dialplan function which allows someone to
retrieve any value from a sorcery-based config file. It's similar to
AST_CONFIG.
The creation of the function itself was fairly straightforward but it required
changes to the underlying sorcery infrastructure that rippled into individual
sorcery objects. The changes stemmed from inconsistencies in how sorcery
created ast_variable objectsets from sorcery objects and the inconsistency
in how individual objects used that feature especially when it came to
parameters that can be specified multiple times like contact in aor and match
in identify. You can read more here...
http://lists.digium.com/pipermail/asterisk-dev/2014-February/065202.html
So, what this patch does, besides actually creating the AST_SORCERY function,
is the following...
* Creates ast_variable_list_append which is a helper to append one ast_variable
list to another.
* Modifies the ast_sorcery_object_field_register functions to accept the
already-defined sorcery_fields_handler callback.
* Modifies ast_sorcery_objectset_create to accept a parameter indicating return
type preference...a single ast_variable with all values concatenated or an
ast_variable list with multiple entries. Also fixed a few bugs.
* Modifies individual sorcery object implementations to use the new function
definition of the ast_sorcery_object_field_register functions.
* Modifies location.c and res_pjsip_endpoint_identifier_ip.c to implement
sorcery_fields_handler handlers so they return multiple occurrences as an
ast_variable_list.
* Added a whole bunch of tests to test_sorcery.
(closes issue ASTERISK-22537)
Review: http://reviewboard.asterisk.org/r/3254/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
The test of the result of the stat() call was inverted such that its
output was only used if the call failed. This inverts the test so that
the output of stat() is used correctly. This was causing full reloads
on unchanged files.
(closes issue ASTERISK-23383)
Reported by: David Woolley
........
Merged revisions 409916 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 409917 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 409918 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
When nanosecond time resolution was added for identifying config file
changes, it didn't cover all of the myriad of ways that one might obtain
nanosecond time resolution off of struct stat.
Rather than complicate the #if even further figuring out one system from
the next, this patch directly tests for the three struct members I know
about today, and #ifdef's accordingly.
Review: https://reviewboard.asterisk.org/r/3273/
........
Merged revisions 409833 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 409834 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 409835 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Fixed memory leaks in ast_sip_cli_print_sorcery_objectset and
ast_variable_list_sort.
(closes issue ASTERISK-23266)
Review: http://reviewboard.asterisk.org/r/3200/
........
Merged revisions 408520 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
modified config file information.
Repeatedly modifying config files and reloading too fast sometimes fails
to reload the configuration because the cached modification timestamp has
one second resolution.
* Added file size and nanosecond resolution fields to the cached config
file modification timestamp information. Now if the file size changes or
the file system supports nanosecond resolution the modified file has a
better chance of being detected for reload.
* Added a missing unlock in an off-nominal code path.
(closes issue AST-1303)
Review: https://reviewboard.asterisk.org/r/3235/
........
Merged revisions 408387 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 408388 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 408389 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
The old code depended on undefined va_arg behaviour: calling a function
twice with the same va_list parameter and expecting it to continue where
it left off. The changed code behaves like the manpage says it should.
Also added a bunch of early returns to trap errors (e.g. OOM) instead of
crashing.
The problem was found by Julian Lyndon-Smith. The deviant behaviour on
the raspberry PI also uncovered another bug (fixed in r407875) in the
res_config_pgsql.so driver.
Reported by: jmls
Tested by: jmls
Review: https://reviewboard.asterisk.org/r/3201/
........
Merged revisions 407968 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
extconfig.conf was hard-coded to not allow nested includes for some reason.
The code has been this way since a patch was merged for ASTERISK-3333 (revision
4889), which was a significant update to this code ("Merge config updates").
I can't figure out any good reason why this should be limited. This patch just
removes the limit and uses the default nesting depth limit.
Closes issue ASTERISK-17837
Review: https://reviewboard.asterisk.org/r/3159/
........
Merged revisions 406643 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 406644 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 406645 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
Implements the following cli commands:
pjsip list aors
pjsip list auths
pjsip list channels
pjsip list contacts
pjsip list endpoints
pjsip show aor(s)
pjsip show auth(s)
pjsip show channels
pjsip show endpoint(s)
Also...
Minor modifications made to the AMI command implementations to facilitate
reuse.
New function ast_variable_list_sort added to config.c and config.h to implement
variable list sorting.
(issue ASTERISK-22610)
patches:
pjsip_cli_v2.patch uploaded by george.joseph (License 6322)
........
Merged revisions 404480 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
ConfBridge allows custom DTMF menus to be created in the confbridge.conf
file by assigning a DTMF key sequence to a sequence of actions as follows:
DTMF-sequence = action,action...
Unfortunately, the normal config file processing code interprets an
initial '#' character as starting a directive such as #include.
* Add the ability to escape the first non-blank character in a config line
so the '#' character can be used without triggering the directive
processing code.
(closes issue AFS-2)
(closes issue ASTERISK-22478)
Reported by: Nicolas Tanski
Patches:
jira_asterisk_22478_v11.patch (license #5621) patch uploaded by rmudgett (modified)
Review: https://reviewboard.asterisk.org/r/2969/
........
Merged revisions 402407 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 402416 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
main/config.c - cleanup cache fie includes
res/res_security_log.c - unregister logger level
channesl/chan_sip.c - cleanup io context and notify_types
main/translator.c - cleanup at shutdown
main/named_acl.c - cleanup cli commands
main/indications.c - ast_get_indication_tone() unref default_tone_zone if used
(closes issues ASTERISK-22378)
Reported by: Corey Farrell
Patches:
config_shutdown.patch uploaded by coreyfarrell (license 5909)
res_security_log.patch uploaded by coreyfarrell (license 5909)
chan_sip-11.patch uploaded by coreyfarrell (license 5909)
indications_refleak.patch uploaded by coreyfarrell (license 5909)
named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909)
translate_shutdown.patch uploaded by coreyfarrell (license 5909)
........
Merged revisions 398102 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 398103 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 398116 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
This change does the following:
1. Adds the sorcery realtime module
2. Adds unit tests for the sorcery realtime module
3. Changes the realtime core to use an ast_variable list instead of variadic arguments
4. Changes all realtime drivers to accept an ast_variable list
Review: https://reviewboard.asterisk.org/r/2424/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
If a system allows for its usage, Asterisk will use glob to help parse
Asterisk .conf files. The config file loading routine was leaking the memory
allocated by the glob() routine when the config file was in an unmodified
or invalid state.
This patch properly calls globfree in those off nominal paths.
(closes issue ASTERISK-21412)
Reported by: Corey Farrell
patches:
config_glob_leak.patch uploaded by Corey Farrell (license 5909)
........
Merged revisions 386672 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 386677 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
When reading configuration data from an Asterisk .conf file or when pulling
data from an Asterisk RealTime backend, Asterisk was copying the data on the
stack for manipulation. Unfortunately, it is possible to read configuration
data or realtime data from some data source that provides a large blob of
characters. This could potentially cause a crash via a stack overflow.
This patch prevents large sets of data from being read from an ARA backend or
from an Asterisk conf file.
(issue ASTERISK-20658)
Reported by: wdoekes
Tested by: wdoekes, mmichelson
patches:
* issueA20658_dont_process_overlong_config_lines.patch uploaded by wdoekes (license 5674)
* issueA20658_func_realtime_limit.patch uploaded by wdoekes (license 5674)
........
Merged revisions 378375 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 378376 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
config-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
........
Merged revisions 377104 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 377105 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 377106 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
With the SCOPED_LOCK macro, you can create a variable
that locks a specific lock and unlocks the lock when the
variable goes out of scope. This is useful for situations
where many breaks, continues, returns, or other interruptions
would require separate unlock statements. With a scoped lock,
these aren't necessary.
There are specializations for mutexes, read locks, write locks,
ao2 locks, ao2 read locks, ao2 write locks, and channel locks.
Each of these is a SCOPED_LOCK at heart though.
Review: https://reviewboard.asterisk.org/r/2060
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
The strtol family of functions will return *_MIN/*_MAX on overflow. To
detect when an overflow has happened, errno must be set to 0 before
calling the function, then checked afterward.
(closes issue ASTERISK-20120)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2073/
........
Merged revisions 371392 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 371398 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 371399 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|
|
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().
(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........
Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
|