summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2016-08-02asterisk.c: Add auto generation and persistence of UUIDGeorge Joseph
Upcoming features will require the generation and persistence of a UUID. Change-Id: I3ec0062427e133217db6ef496a4216f427c3b92d
2016-08-02Remove SILK payload mappings from Asterisk core.Mark Michelson
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 d50895c7b04036aeaad58990089399e46db4c817)
2016-08-01Merge "pbx.c: Fix handling of '-' in extension name and callerid" into 13zuul
2016-07-29Merge "pbx.c: Allow dangerous functions when adding a hint to dialplan." into 13zuul
2016-07-28Merge "dsp.c: Add fax and DTMF detection unit tests." into 13Joshua Colp
2016-07-28Merge "dsp.c: Added descriptive comments to Goertzel calculations." into 13Joshua Colp
2016-07-28Merge "dsp.c: Fix incorrect format reference typo." into 13Joshua Colp
2016-07-28pbx.c: Fix handling of '-' in extension name and calleridCorey Farrell
This adds a two strings to ast_exten. name to go with exten and cidmatch_display to go with cidmatch. The new fields contain input used to add the extension in the first place. The existing fields now contain stripped input that excludes insignificant spaces and dashes. These stripped fields should always be used for comparisons. The unstripped fields should normally be used for display, but displaying stripped values will not cause runtime errors. Note the actual string is only stored twice if it contains dashes. If no dashes are found then both 'char *' fields point to the same memory. So this change has a minimum effect on memory usage. The existing functions ast_get_extension_name and ast_get_extension_cidmatch return unstripped values as they did before this change. Other similar bugs likely still exist where unstripped extensions are saved outside pbx.c then passed back in. ASTERISK-26233 #close Change-Id: I6cd61ce57acc1570ca6cc14960c4c3b0a9eb837f
2016-07-28pbx.c: Allow dangerous functions when adding a hint to dialplan.Richard Mudgett
We can allow dangerous functions when adding a hint since altering dialplan is itself a privileged activity. Otherwise, we could never execute dangerous functions. ASTERISK-25996 #close Reported by: Andrew Nagy Change-Id: I4929ff100ad1200a0198262d069a34f2296e77ba
2016-07-27rtp_engine: Failed assertion and wrong name given for codecKevin Harwell
Fixed an assert check that would trigger when the passed in value was negative. The negative value was being cast to an unsigned value. This resulted in the check failing. Also fixed another problem when loading formats in the engine. When setting the mime type the format's name was being passed in instead of the codec's name. Change-Id: I1a201cd419ba4d8e9a40d337e36b6fbe1737192c
2016-07-26dsp.c: Add fax and DTMF detection unit tests.Richard Mudgett
* Add fax amplitude and frequency sweep tests. * Add DTMF amplitude and twist unit tests. Change-Id: I8d77c9a1eec89e440d715f998c928687e870c3f7
2016-07-26dsp.c: Added descriptive comments to Goertzel calculations.Richard Mudgett
* Added doxygen to describe some struct members and what is going on in the code. Change-Id: I2ec706a33b52aee42b16dcc356c2bd916a45190d
2016-07-26dsp.c: Fix incorrect format reference typo.Richard Mudgett
Change-Id: Ia131da3ec29acf385cb43a586a29ecc975eb3896
2016-07-25dsp.c: Fix erroneous fax tone detection.Richard Mudgett
The Goertzel calculations get less accurate the lower the signal level being worked with becomes because there is less resolution remaining. If it is too low we can erroneously detect a tone where none really exists. The searched for fax frequencies not only need to be so much stronger than the background noise they must also be a minimum strength. * Add needed minimum threshold test to tone_detect(). * Set TONE_THRESHOLD to allow low volume frequency spread detection. ASTERISK-26237 #close Reported by: Richard Mudgett Change-Id: I84dbba7f7628fa13720add6a88eae3b129e066fc
2016-07-21Merge "res_pjsip: Add fax_detect_timeout endpoint option." into 13Joshua Colp
2016-07-19Add conditional support for noreturn functions.Corey Farrell
This adds support for tagging functions with the noreturn attribute. If DO_CRASH is enabled then ast_do_crash never returns. If AST_DEVMODE and DO_CRASH are enabled then failed assertions never return. This can resolve a large number of false positives with static analyzers. ASTERISK-26220 #close Change-Id: Icfb61e5fe54574eced4c3e88b317244f467ec753
2016-07-19res_pjsip: Add fax_detect_timeout endpoint option.Richard Mudgett
The new endpoint option allows the PJSIP channel driver's fax_detect endpoint option to timeout on a call after the specified number of seconds into a call. The new feature is disabled if the timeout is set to zero. The option is disabled by default. ASTERISK-26214 Reported by: Richard Mudgett Change-Id: Id5a87375fb2c4f9dc1d4b44c78ec8735ba65453d
2016-07-14features.c: Remove unneeded adsi.h include.Corey Farrell
adsi.h is no longer used by features.c since parking was moved to a module. Change-Id: I2248b8a455225a17cb6ddaafd6c20c511a1eaf59
2016-07-14Merge "Update support for SILK format." into 13zuul
2016-07-14Update support for SILK format.Mark Michelson
This commit adds scaffolding in order to support the SILK audio format on calls. Roughly, this is what is added: * Cached silk formats. One for each possible sample rate. * ast_codec structures for each possible sample rate. * RTP payload mappings for "SILK". In addition, this change overhauls the res_format_attr_silk file in the following ways: * The "samplerate" attribute is scrapped. That's native to the format. * There are far more checks to ensure that attributes have been allocated before attempting to reference them. * We do not SDP fmtp lines for attributes set to 0. These changes make way to be able to install a codec_silk module and have it actually work. It also should allow for passthrough silk calls in Asterisk. Change-Id: Ieeb39c95a9fecc9246bcfd3c45a6c9b51c59380e
2016-07-14Merge "translate: explicit format destination not properly set" into 13zuul
2016-07-14Merge "threadpool: Fix leak in ast_threadpool_serializer_group error path." ↵Joshua Colp
into 13
2016-07-14Merge "pbx: Fix leak of timezone for time based includes." into 13zuul
2016-07-14Merge "stasis_endpoint.c: Fix contactstatus_to_json()." into 13zuul
2016-07-14pbx: Fix leak of timezone for time based includes.Corey Farrell
Create include_free to run ast_destroy_timing and ast_free, use that in all places that freed an ast_include structure. This fixes a couple of paths that previously did not run ast_destroy_timing. ASTERISK-26196 #close Change-Id: I1671bd111bef0dc113e8bf8f77f89fcfc395d838
2016-07-13Merge "res/res_corosync: Raise a Stasis message on node join/leave events" ↵Joshua Colp
into 13
2016-07-13translate: explicit format destination not properly setKevin Harwell
If the destination format's name differed from the codec name then the translator's explict_dst field would be improperly set. In some circumstances it would end up setting it to a newly created format that has the same name as the codec when it actually needed to be the given destination codec. This could cause the translation path to use the wrong format. For instance, if an endpoint had specified 'myulaw' as a format the translator could end up using a 'ulaw' format (with whatever/default settings) instead. If the format attribute settings differed between the two then there may unexpected results during processing. This patch removes the name check when building the translation path. This should make it always set the translator's explicit_dst to the given destination format as long as the sample rate and types match. Change-Id: Iaf8a03831d68e657d89569d54b505074efbefab5
2016-07-13stasis_endpoint.c: Fix contactstatus_to_json().Richard Mudgett
The roundtrip_usec json member is optional. If it isn't present then don't put it into the converted json structure where ast_json_pack() will choke on it. Change-Id: I39bb2f86154ef54591270c58bfda8635070f9ea0
2016-07-13threadpool: Fix leak in ast_threadpool_serializer_group error path.Corey Farrell
ast_threadpool_serializer_group leaks a reference to ser when listener is allocated but tps is not. Although listener takes the reference to ser cleanup functions are not run without tps. ASTERISK-26191 #close Change-Id: Ie3ccf69a3f1e676c2ef62a77067c0cb57dc9a585
2016-07-11ast_expr2: Fix off-nominal memory leak.Richard Mudgett
Thanks to ibercom for pointing out a memory leak that was missed in the earlier patch for the issue. ASTERISK-26119 Reported by: Alexei Gradinari Change-Id: I9a151f5c4725d97fb82a9e938bc73dc659532b71
2016-07-07REF_DEBUG: Prevent logging of container node objects.Corey Farrell
Using AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE can result in an unref being recorded to the refs log for the node being replaced. This prevents logging of those unrefs since they would produce errors in refcounter.py. ASTERISK-26181 #close Change-Id: Ie4fded84e8a1a58b3a59ce59dfd7eb0da3ddc5d4
2016-07-06res/res_corosync: Raise a Stasis message on node join/leave eventsMatt Jordan
When res_corosync detects that a node leaves or joins, it currently is informed of this via Corosync callbacks. However, there are a few limitations with the information presented: (1) While we have information that Corosync is aware of - such as the Corosync nodeid - that information is really only useful inside of Corosync or res_corosync. There's no way to translate a Corosync nodeid to some other internally useful unique identifier for the Asterisk instance that just joined or left the cluster. (2) While res_corosync is notified of the instance joining or leaving the cluster, it has no mechanism to inform the Asterisk core or other modules of this event. This limits the usefulness of res_corosync as a heartbeat mechanism for other modules. This patch addresses both issues. First, it adds the notion of a cluster discovery message both within the Stasis message bus, as well as the binary event messages that res_corosync uses to transmit data back and forth within the cluster. When Asterisk joins the cluster, it sends a discovery message to the other nodes in the cluster, which correlates the Corosync nodeid along with the Asterisk EID. res_corosync now maintains a hash of Corosync nodeids to Asterisk EIDs, such that it can map changes in cluster state with the Asterisk instance that has that nodeid. Likewise, when an Asterisk instance receives a discovery message from a node in the cluster, it now sends its own discovery message back to the originating node with the local Asterisk EID. This lets Asterisk instances within the cluster build a complete picture of the other Asterisk instances within the cluster. Second, it publishes the discovery messages onto the Stasis message bus. Said messages are published whenever a node joins or leaves the cluster. Interested modules can subscribe for the ast_cluster_discovery_type() message under the ast_system_topic() and be notified when changes in cluster state occur. Change-Id: I9015f418d6ae7f47e4994e04e18948df4d49b465
2016-06-30features: Fix channel datastore access.Richard Mudgett
Found as a result of the testsuite tests/callparking test crashing. Several calls to ast_get_chan_featuremap_config() and ast_get_chan_features_xfer_config() did not lock the channel before calling so the channel's datastore list was accessed without the lock's protection. Apparently another thread deleted a datastore on the channel's list while the crashing thread was walking the list. Crash at 0xdeaddead due to MALLOC_DEBUG's memory filler value as a result. * Add missing channel locks to calls that were not already protected as the doxygen for those calls indicates. Change-Id: Id273b3d305cc616406c353cbc841b2b7655efaa1
2016-06-28codecs: Fix ABI incompatibility created by adding format_name to ast_codecGeorge Joseph
Adding format_name even to the end of ast_codec caused issued with binary codec modules because the pointer would be garbage in asterisk when they registered. So, the ast_codec structure was reverted and an internal_ast_codec structure was created just for use in codec.c. A new internal-only API was also added (__ast_codec_register_with_format) so that codec_builtin could register codecs with the format_name in a separate parameter rather than in the ast_codec structure. ASTERISK-26144 #close Reported-by: Alexei Gradinari Change-Id: I6df1b08f6a6ae089db23adfe1ebc8636330265ba
2016-06-28BuildSystem: Fix a few issues hightlighted by gcc 6.xGeorge Joseph
gcc 6.1.1 caught a few more issues. Made sure the unit tests still pass for the func_env and stdtime issues. ASTERISK-26157 #close Change-Id: I6664d8f34a45bc1481d2a854481c7878b0c1cf8e
2016-06-22Merge "Fix Alembic upgrades." into 13zuul
2016-06-22Fix Alembic upgrades.Mark Michelson
A non-existent constraint was being referenced in the upgrade script. This patch corrects the problem by removing the reference. This patch fixes another realtime problem as well. Our Alembic scripts store booleans as yes or no values. However, Sorcery tries to insert "true" or "false" instead. This patch updates Sorcery to use "yes" and "no" ASTERISK-26128 #close Change-Id: I366dbbf91418a9cb160b3ca74b0e59b5ac284bec
2016-06-21Merge "fix: memory leaks, resource leaks, out of bounds and bugs" into 13zuul
2016-06-20fix: memory leaks, resource leaks, out of bounds and bugsAlexei Gradinari
ASTERISK-26119 #close Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c
2016-06-20http: leverage 'bindaddr' for TLS in http.confAlexander Traud
The internal HTTP/WebSocket server supports both TCP and TLS, which can be activated separately via the file http.conf. The source code intends to re-use the TCP parameter 'bindaddr' for TLS, even if 'tlsbindaddr' is not specified explicitly. This did not work because of a typo. This change resolves this typo. ASTERISK-26126 #close Change-Id: I5efb0409ae12044dfb3495b6b97b6d40a8c9c51f
2016-06-10core: Not the configured but granted number of possible file descriptors.Alexander Traud
With CLI "core show settings", simply the parameter maxfiles of the file asterisk.conf was shown. If that parameter was not set, nothing was displayed although the environment might have set a default number itself. Or if maxfiles were not granted (completely), still maxfiles was shown. Now, the maximum number of possible file descriptors in the environment is shown. ASTERISK-26097 Change-Id: I2df5c58863b5007b34b77adbe28b885dfcdf7e0b
2016-06-10Merge "cel: Ensure only one dial status per channel exists." into 13Joshua Colp
2016-06-09Merge "stasis: Add setting subscription congestion levels." into 13Joshua Colp
2016-06-09Merge "sorcery: Add setting object type congestion levels." into 13Joshua Colp
2016-06-09Merge "taskprocessors: Implement high/low water mark alerts." into 13zuul
2016-06-09cel: Ensure only one dial status per channel exists.Joshua Colp
CEL wrongly assumed that a channel would only have a single dial event on it. This is incorrect. Particularly in a queue each call attempt to a member will result in a dial event, adding a new dial status in CEL without removing the old one. This would cause the container to grow with only one dial status being removed when the channel went away. The other dial status entries would remain leaking memory. This change fixes the memory leak by ensuring that only one dial status will only ever exist for each channel. The behavior during the scenario where multiple events are received has also been improved. For failure cases the first failure will be the dial status. If an answer dial status is received, though, it will take priority and the dial status for the channel will be answer. Memory usage has also been decreased by storing the minimal amount of information and the code has been cleaned up slightly. ASTERISK-25262 #close Change-Id: I5944eb923db17b6a0faa7317ff6abc9307c009fe
2016-06-09Merge "astfd: Not maximum size of a single file but maximum file ↵zuul
descriptors." into 13
2016-06-08Merge "BuildSystem: Avoid 'ar cru' and use 'ar cr' instead." into 13zuul
2016-06-08Merge "Fix #include poll.h and sys/cdefs.h" into 13Joshua Colp
2016-06-08astfd: Not maximum size of a single file but maximum file descriptors.Alexander Traud
With menuselect "DEBUG_FD_LEAKS" and CLI "core show fd", the maximum size of a single file was shown. Now, the maximum number of possible file descriptors is shown. ASTERISK-26097 Change-Id: Icf98d145774b38cac144ca76d19eaef42ce659a3