summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2016-09-30astobj2: Add backtrace to log_bad_ao2.Corey Farrell
* Compile __ast_assert_failed unconditionally. * Use __ast_assert_failed to log messages from log_bad_ao2 * Remove calls to ast_assert(0) that happen after log_bad_ao2 was run. Change-Id: I48f1af44b2718ad74a421ff75cb6397b924a9751
2016-09-30Merge "core: Remove ABI effects of LOW_MEMORY."Joshua Colp
2016-09-29Remove "format_ogg_opus: New format"Kevin Harwell
This reverts commit 40aa28131bc30b4516da2b20eb1a1e043920169c. ASTERISK-26426 #close Change-Id: I81e55c3c512f1dd6f49896f0c6b97a07d74fd8f5
2016-09-29core: Remove ABI effects of LOW_MEMORY.Corey Farrell
This allows asterisk to compiled with LOW_MEMORY to load modules built without LOW_MEMORY. ASTERISK-26398 #close Change-Id: I24b78ac9493ab933b11087a8b6794f3c96d4872d
2016-09-27codec_opus: Replace res_format_attr_opus with the one from codec_opusGeorge Joseph
Preparation ASTERISK-26409 Change-Id: I9f20e7cce00c32464d9a180e81283d49d199d0a3 (cherry picked from commit 59f7662a93bf9c07204fb50e1020a0f5bfbbd5c9)
2016-09-27format_ogg_opus: New formatGeorge Joseph
Add Ogg/Opus playback support. This uses libopusfile in order to be able to read .opus files and play them back. Writing/recording support is not present at this time. ASTERISK-26409 Change-Id: I8815d23345108d8ca7c0bd640f6a1ce6b4f56955 (cherry picked from commit daee8bbd5209b4158bc1785eede845a26e6cbeaa)
2016-09-23chan_sip: Address runaway when realtime peers subscribe to mailboxesGeorge Joseph
Users upgrading from asterisk 13.5 to a later version and who use realtime with peers that have mailboxes were experiencing runaway situations that manifested as a continuous stream of taskprocessor congestion errors, memory leaks and an unresponsive chan_sip. A related issue was that setting rtcachefriends=no NEVER worked in asterisk 13 (since the move to stasis). In 13.5 and earlier, when a peer tried to register, all of the stasis threads would block and chan_sip would again become unresponsive. After 13.5, the runaway would happen. There were a number of causes... * mwi_event_cb was (indirectly) calling build_peer even though calls to mwi_event_cb are often caused by build_peer. * In an effort to prevent chan_sip from being unloaded while messages were still in flight, destroy_mailboxes was calling stasis_unsubscribe_and_join but in some cases waited forever for the final message. * add_peer_mailboxes wasn't properly marking the existing mailboxes on a peer as "keep" so build_peer would always delete them all. * add_peer_mwi_subs was unsubscribing existing mailbox subscriptions then just creating them again. All of this was causing a flood of subscribes and unsubscribes on multiple threads all for the same peer and mailbox. Fixes... * add_peer_mailboxes now marks mailboxes correctly and build_peer only deletes the ones that really are no longer needed by the peer. * add_peer_mwi_subs now only adds subscriptions marked as "new" instead of unsubscribing and resubscribing everything. It also adds the peer object's address to the mailbox instead of its name to the subscription userdata so mwi_event_cb doesn't have to call build_peer. With these changes, with rtcachefriends=yes (the most common setting), there are no leaks, locks, loops or crashes at shutdown. rtcachefriends=no still causes leaks but at least it doesn't lock, loop or crash. Since making rtcachefriends=no work wasnt in scope for this issue, further work will have to be deferred to a separate patch. Side fixes... * The ast_lock_track structure had a member named "thread" which gdb doesn't like since it conflicts with it's "thread" command. That member was renamed to "thread_id". ASTERISK-25468 #close Change-Id: I07519ef7f092629e1e844f855abd279d6475cdd0
2016-09-15sd_notify (systemd status notifications) supportTzafrir Cohen
sd_notify() is used to notify systemd of changes to the status of the process. This allows the systemd daemon to know when the process finished loading (and thus only start another program after Asterisk has finished loading). To use this, use a systemd unit with 'Type=notify' for Asterisk. This commit also adds the function ast_sd_notify(), a wrapper around sd_notify that does nothing if not built with systemd support. Also adds support for libsystemd detection in the configure script. Change-Id: Ied6a59dafd5ef331c5c7ae8f3ccd2dfc94be7811
2016-09-09res_pjsip: Add ignore_uri_user_options option.Richard Mudgett
This implements the chan_sip legacy_useroption_parsing option but with a better name. * Made the caller-id number and redirecting number strings obtained from incoming SIP URI user fields always truncated at the first semicolon. People don't care about anything after the semicolon showing up on their displays even though the RFC allows the semicolon. ASTERISK-26316 #close Reported by: Kevin Harwell Change-Id: Ib42b0e940dd34d84c7b14bc2e90d1ba392624f62
2016-09-09Merge "res/res_pjsip: Add preferred_codec_only config to pjsip endpoint."zuul
2016-09-09res/res_pjsip: Add preferred_codec_only config to pjsip endpoint.Aaron An
This patch add config to pjsip by endpoint. ;preferred_codec_only=yes ; Respond to a SIP invite with the single most preferred codec ; rather than advertising all joint codec capabilities. This ; limits the other side's codec choice to exactly what we prefer. ASTERISK-26317 #close Reported by: AaronAn Tested by: AaronAn Change-Id: Iad04dc55055403bbf5ec050997aee2dadc4f0762
2016-09-07Merge "res_pjsip_session: segfault on already disconnected session"zuul
2016-09-06Merge "sorcery: Create function ast_sorcery_lockable_alloc."zuul
2016-09-06Merge "named_locks: Use ao2_weakproxy to deal with cleanup from container."zuul
2016-09-06Merge "astobj2: Support using a separate object for locking."zuul
2016-09-06res_pjsip_session: segfault on already disconnected sessionAlexei Gradinari
On heavy loaded system the TCP/TLS incoming calls could be disconnected by pjproject while these calls are being processed by asterisk which could use the session's memory pools. If the session in the disconnected state then the session memory pools were already freed, so we get segfault. This patch adds a lifetime control on an INVITE session to pjproject. The lifetime of the session is manipulated by calling pjsip_inv_add_ref/pjsip_inv_dec_ref. This patch uses these functions to inform pjproject that the session is in use. This patch adds check if the session state is not disconnected and also checks if the memory pool is not NULL. This patch also places tasks 'session_end' and 'session_end_completion' into session's serializer to avoid race condition. ASTERISK-26291 #close Change-Id: I4d28b1fb3b91f0492a911d110049d670fdc3c8d7
2016-09-04Merge "codecs: Add Codec 2 mode 2400."Joshua Colp
2016-09-02sorcery: Create function ast_sorcery_lockable_alloc.Corey Farrell
Create an alternative to ast_sorcery_generic_alloc which uses astobj2 shared locking. Use this new method for the 'struct ast_sip_aor' allocator. Change-Id: I3f62f2ada64b622571950278fbb6ad57395b5d6f
2016-09-02named_locks: Use ao2_weakproxy to deal with cleanup from container.Corey Farrell
This allows standard ao2 functions to be used to release references to an ast_named_lock. This change can cause less frequent locking of the global named_locks container. The container is no longer locked when a named_lock reference is being release except when this causes the named_lock to be destroyed. Change-Id: I644e39c6d83a153d71b3fae77ec05599d725e7e6
2016-09-02astobj2: Support using a separate object for locking.Corey Farrell
Create ao2_alloc_with_lockobj function to support shared locking. Change-Id: Iba687eb9843922be7e481e23a32c0700ecf88a80
2016-08-26Merge "res_fax: Fix deadlock in ast_channel_get_t38_state()."Joshua Colp
2016-08-26Merge "res_fax: Fix deadlock setting FAXMODE channel variable."Joshua Colp
2016-08-26Merge "Fix checks for allocation debugging."zuul
2016-08-26Merge "Fix naming mismatch of allocator functions."zuul
2016-08-25res_fax: Fix deadlock in ast_channel_get_t38_state().Richard Mudgett
ast_channel_get_t38_state() calls ast_channel_queryoption() with AST_OPTION_T38_STATE. If the passed in channel is a local channel then a deadlock can happen if a channel lock is held when called. * Made ast_channel_get_t38_state() callers not hold a channel lock before calling. * Update ast_channel_get_t38_state() doxygen to note that no channel locks can be held when calling the function. ASTERISK-26203 #close Reported by: Etienne Lessard ASTERISK-24822 #close Reported by: David Brillert ASTERISK-22732 #close Reported by: Richard Mudgett Change-Id: I49fd76fa9af628b4198009b5c0b82c8b03681214
2016-08-25res_fax: Fix deadlock setting FAXMODE channel variable.Richard Mudgett
ASTERISK-25980 added the FAXMODE channel variable to res_fax.c. Unfortunately, it also introduced a deadlock potential because set_channel_variables() which sets FAXMODE can be called during a masquerade. The ast_channel_get_t38_state() which gets the value used to set FAXMODE cannot be called with the channel locked. As a result, local channels can deadlock because of how they must acquire the locks necessary to operate. The intent of FAXMODE is for dialplan to know how a fax was transferred after the fax completes. However, the previous patch sets FAXMODE to the channel's current T.38 state AFTER the fax has completed and where T.38 may have already disconnected. * Set FAXMODE based upon T.38 negotiations exchanged either with the fax applications or the fax framehooks. ASTERISK-26203 Reported by: Etienne Lessard ASTERISK-24822 Reported by: David Brillert ASTERISK-22732 Reported by: Richard Mudgett Change-Id: Id525747254b64c1efe8b1b5973d52ff9719c2ae1
2016-08-24codecs: Add Codec 2 mode 2400.Alexander Traud
ASTERISK-26217 #close Change-Id: I1e45d8084683fab5f2b272bf35f4a149cea8b8d6
2016-08-19Fix checks for allocation debugging.Corey Farrell
MALLOC_DEBUG should not be used to check if debugging is actually enabled, __AST_DEBUG_MALLOC should be used instead. MALLOC_DEBUG only indicates that debugging is requested, __AST_DEBUG_MALLOC indicates it is active. Change-Id: I3ce9cdb6ec91b74ee1302941328462231be1ea53
2016-08-19Fix naming mismatch of allocator functions.Corey Farrell
Allocator functions that take file/line/func parameters are prefixed with single-underscore when MALLOC_DEBUG is not defined, double-underscore when it is defined. This change updates all allocators that accept file/line/func to have the same prototype in either ABI mode. The parameter order of __ast_vasprintf and __ast_asprintf in utils.h have been changed to match that of astmm.h. End-use allocator macro's have been removed from astmm.h and moved to an unconditional part of utils.h. Change-Id: I823bb6ce2b5675b3a4735948f10a3b420e9a023a
2016-08-19res_ari: Add http prefix to generated docsTorrey Searle
updated the uri handler to include the url prefix of the http server this enables res_ari to add it to the uris when generating docs Change-Id: I279335a2625261a8492206c37219698f42591c2e (cherry picked from commit 6f448f32fe9b7379e2630fab7b06205f901f2ded)
2016-08-17res_pjsip: Add contact_user to endpointGeorge Joseph
contact_user, when specified on an endpoint, will override the user portion of the Contact header on outgoing requests. Change-Id: Icd4ebfda2f2e44d3ac749d0b4066630e988407d4
2016-08-15core: Entity ID is not set or invalidAlexei Gradinari
The Exchanging Device and Mailbox States could not working if the Entity ID (EID) is not set manually and can't be obtained from ethernet interface. This patch replaces debug message to warning and addes missing description about option 'entityid' to asterisk.conf.sample. With this patch the asterisk also: (1) decline loading the modules which won't work without EID: res_corosync and res_pjsip_publish_asterisk. (2) warn if EID is empty on loading next modules: pbx_dundi, res_xmpp Starting with v197 systemd/udev will automatically assign "predictable" names for all local Ethernet interfaces. This patch also addes some new ethernet prefixes "eno" and "ens". ASTERISK-26164 #close Change-Id: I72d712f1ad5b6f64571bb179c5cb12461e7c58c6
2016-08-11Merge "res_resolver_unbound: Allow compilation with libunbound version < 1.5"zuul
2016-08-11Merge "res_srtp: Move SDP SRTP code from the core to res_srtp."zuul
2016-08-10res_srtp: Move SDP SRTP code from the core to res_srtp.Richard Mudgett
A patch made to the master branch (Now the 14 branch) inadvertently made libsrtp a required dependency in order to compile Asterisk. Rather than create dummy defines to substitute for the defines supplied by libsrtp when libsrtp is not available, most of the code in sdp_srtp.c is moved into res_srtp.c. This gets more code out of Asterisk's core that isn't used when SRTP is not available. This also makes another inadvertent required dependency on libsrtp by Asterisk's core unlikely. ASTERISK-26253 #close Reported by: Ben Merrills Change-Id: I0a46cde81501c0405399c2588633ae32706d1ee7
2016-08-10pjsip: Fix deadlock with suspend taskprocessor on masqueradeAlexei Gradinari
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-10res_resolver_unbound: Allow compilation with libunbound version < 1.5George Joseph
libunbound at version 1.4.20 (which CentOS still uses) declared all of their string function parameters as as 'char *'. 1.4.21 changed them all to 'const char *'. Thankfully 1.4.21 also introduced the UNBOUND_VERSION_MAJOR define so configure now checks for that and sets HAVE_UNBOUND_CONST_PARAMS. res_resolver_unbound then checks that and casts away the 'const' if it's not set. Tested compile and testsuite on CentOS6 (1.4.20), Ubuntu14 (1.4.22) and Fedora24 (1.5.4). There are a few failing tests to be addressed though. ASTERISK-26283 #close Change-Id: Ib708b19b706c5d0ba7b7d5473e6df339d9ae4148
2016-08-09Merge "Produce friendly error when AST_MODULE_SELF_SYM is not defined."zuul
2016-08-08Produce friendly error when AST_MODULE_SELF_SYM is not defined.Corey Farrell
Modules must define AST_MODULE_SELF_SYM to be used as the name of a generated function. This produces a friendly error when it's not defined. ASTERISK-26278 #close Change-Id: Ib9d35a08104529c516d636771365e02c6e77a45b
2016-08-08res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stackAlexei Gradinari
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-03Add missing checks during startup.Corey Farrell
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-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-26Merge "codecs: Add iLBC 20."zuul
2016-07-23asterisk.c: Add auto generation and persistence of UUIDGeorge Joseph
Upcoming features will require the generation and persistence of a UUID. Change-Id: I3ec0062427e133217db6ef496a4216f427c3b92d
2016-07-22codecs: Add iLBC 20.Alexander Traud
Asterisk already supported iLBC 30. This change adds iLBC 20. Now, Asterisk defaults to iLBC 20 but falls back to iLBC 30, when the remote party requests this. ASTERISK-26218 #close ASTERISK-26221 #close Reported by: Aaron Meriwether Change-Id: I07f523a3aa1338bb5217a1bf69c1eeb92adedffa
2016-07-21res_pjsip: Whitespace and comment cleanup.Richard Mudgett
Change-Id: I11139a4a95df34e223ba622aa6227e33ab8f6c38
2016-07-21Merge "res_srtp: Enable AES-256 and AES-GCM."zuul
2016-07-21Merge "res_fax: Fix FAXOPT(faxdetect) timeout option."Joshua Colp
2016-07-21Merge "res_pjsip: Add fax_detect_timeout endpoint option."Joshua Colp
2016-07-21Merge "pbx: Create pbx_sw.c for management of 'struct ast_sw'."zuul