summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2016-08-27Merge "res_pjsip: Cache global config options." into 13Joshua Colp
2016-08-25res_pjsip: Cache global config options.Richard Mudgett
We may check a global config option hundreds of times a second or more. Asking sorcery for the global configuration from the config files backend involves several allocations and container traversals. Using realtime without a memory cache is a lot worse because you have to lookup in the realtime database each time to reconstitute the sorcery object. With a memory cache for realtime, there is about the same amount of overhead as for config files. Either way, it is still fairly expensive to access the sorcery object that much. * Cache the global config options so we can access them faster. You must now always perform a res_pjsip reload to change the global options. Change-Id: Ice16c7a4cbca4614da344aaea21a072b86263ef7
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-25res_fax.c: Fix deadlock in fax_gateway_indicate_t38().Richard Mudgett
fax_gateway_indicate_t38() calls ast_indicate_data() which cannot be called with any channel locks already held. A deadlock can happen if the function is operating on a local channel. * Made fax_gateway_indicate_t38() unlock the channel before calling ast_indicate_data() since fax_gateway_indicate_t38() is always called with the channel locked. * Made fax_gateway_indicate_t38() return void since nothing cared about its return value. ASTERISK-26203 Reported by: Etienne Lessard ASTERISK-24822 Reported by: David Brillert ASTERISK-22732 Reported by: Richard Mudgett Change-Id: I701ff2d26c5fc23e0d5a48a3fd98759a9fd09407
2016-08-25res_fax.c: Add chan locked precondition comments.Richard Mudgett
Change-Id: Ic10ae434536bbf7fb7055d6ab36cc50b8748a4e7
2016-08-25ast_framehook_detach() must be called with the channel locked.Richard Mudgett
The framehook container could become corrupted if the channel lock is not held before calling. Change-Id: If0a1c7ba0484ed3a191106a7516526b905952584
2016-08-25ast_framehook_attach() must be called with the channel locked.Richard Mudgett
The framehook container could become corrupted if the channel lock is not held before calling. Change-Id: I1a6b957a1f7b899eb29a186915f8cccab886a438
2016-08-24res_rtp_multicast: Fix SEGV in ast_multicast_rtp_create_optionsGeorge Joseph
ast_multicast_rtp_create_options now checks for NULL or empty options Change-Id: Ib845eae46a67a9787e89a87ebd1027344e5e0362
2016-08-22Merge "compilation failed with -Werror=maybe-uninitialized" into 13zuul
2016-08-21res_odbc_transaction: add dep on generic_odbcDavid M. Lee
When res_odbc_transaction depended on res_odbc, it got the generic_odbc headers and libs implicitly. Now that it no longer depends on res_odbc, its dependency on generic_odbc must be explicit. Change-Id: I9db88f7af7388437f49903d3008ba8d4890d5911
2016-08-19Merge "res_ari: Add http prefix to generated docs" into 13zuul
2016-08-19Merge "res_odbc: Correct the dependency relationship with ↵zuul
res_odbc_transaction" into 13
2016-08-19Merge "rest-api: Swagger scripts were not replacing format variable in file ↵zuul
brief" into 13
2016-08-19Merge "res_format_attr_g729: Add annexb=no format parameter to SDPs" into 13zuul
2016-08-19compilation failed with -Werror=maybe-uninitializedAlexei Gradinari
The compilation failed for devmode --enable DONT_OPTIMIZE --enable BETTER_BACKTRACES --enable DO_CRASH --enable TEST_FRAMEWORK res_pjsip/pjsip_configuration.c: In function dtls_handler: res_pjsip/pjsip_configuration.c:974:20: error: back may be used uninitialized in this function [-Werror=maybe-uninitialized] int size = strlen(front); ^ cc1: all warnings being treated as errors Change-Id: I7f082ead0312792a577ec7c73015ba64dabca580
2016-08-19Merge "res_pjsip: Add contact_user to endpoint" into 13zuul
2016-08-18rest-api: Swagger scripts were not replacing format variable in file briefKevin Harwell
Given resource paths did not have 'json' substituted in for the '{format}'. For some auto generated documentation/comment strings it resulted in something like the following: "... REST handler for /api-docs/sounds.{format}" This patch makes sure the resource api's path is properly substituted. ASTERISK-25472 #close Change-Id: Ie3e950a35db4043e284019d6c9061f3b03922e23
2016-08-18res_format_attr_g729: Add annexb=no format parameter to SDPsKevin Harwell
Historically, Asterisk has always specified annexb=no for the g729 format. However, when using res_pjsip no format attribute was specified. This patch makes it so the SDP now contains a format attribute line with annexb=no. Note, that this means only g729a is negotiated. Even for pass through support. According to rfc7261 the type of annex used (a or b) is dependent upon the answerer. However, Asterisk being a back to back user agent makes this tricky to support at this time, thus we only allow annex 'a' for now. ASTERISK-26228 #close patches: res_format_attr_g729.c submitted by Jason Parker (license 4993) Change-Id: I76bc20cc0a01af01536e9915afef319c269c22d0
2016-08-18res_odbc: Correct the dependency relationship with res_odbc_transactionGeorge Joseph
The MODULEINFO dependencies between these 2 modules was reversed. res_odbc should depend on res_odbc_transaction, not the other way around. ASTERISK-25984 #close Change-Id: Ifcfbb49c0b51cf6640a5446d47cd6c48caf1331f
2016-08-17res_pjsip_session.c: Fix unbound srv failover tests.Richard Mudgett
Commit 1b666549f33d69dc080b212bf92126f3bc3a18b2 broke the srv failover functionality if a TCP connection gets disconnected. Under these conditions, session_inv_on_state_changed() gets a PJSIP_EVENT_TRANSPORT_ERROR and restarts the INVITE transaction on a new transport. Unfortunately, session_inv_on_tsx_state_changed() also gets the same PJSIP_EVENT_TRANSPORT_ERROR event and unconditionally terminates the session. * Made session_inv_on_tsx_state_changed() complete terminating the session on PJSIP_EVENT_TRANSPORT_ERROR only if the session state is still PJSIP_INV_STATE_DISCONNECTED. ASTERISK-26305 #close Reported by: Richard Mudgett Change-Id: If736e766b5c55b970fa38ca6c8a885caf27b897d
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-17res_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
2016-08-16Merge "Refactor usage pattern of xmldoc info tag." into 13zuul
2016-08-16Merge "res_sorcery_config.c: Cleanup ao2 container usage idioms." into 13Joshua Colp
2016-08-16Merge "core: Entity ID is not set or invalid" into 13zuul
2016-08-15Refactor usage pattern of xmldoc info tag.Corey Farrell
This updates func_channel.c and main/message.c to use a generic xpointer include instead of including info from each channel driver. Now the name attribute of info is CHANNEL or CHANNEL_EXAMPLES to be included in documentation for func_channel. Setting the name attribute of info to MessageToInfo or MessageFromInfo causes it to be included in the MessageSend application and AMI action. Change-Id: I89fd8276a3250824241a618009714267d3a8d1ea
2016-08-15Merge "res_agi: Improve documentation" into 13Joshua Colp
2016-08-15res_sorcery_config.c: Cleanup ao2 container usage idioms.Richard Mudgett
Change-Id: Iad24b335fb121a2bc7f1d048ab7420569edcba5a
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-13res_agi: Improve documentationMatt Jordan
* Groups of AGI commands that have similar functionality now reference each other, and all reference the AGI application for ease of wiki reference. * The documentation for the AGI application has been improved, in particular noting the various AGI types and how they are invoked. * A warning message has been added to DeadAGI, noting that it is deprecated. Change-Id: I479ccdee8a7393f01b18692c3d4ab7e6bdd1875d
2016-08-12Merge "res_pjsip: Fail global load if debug or default_from_user are empty" ↵zuul
into 13
2016-08-12Merge "res_pjsip_caller_id: Copy header name to short header name" into 13zuul
2016-08-12Merge "location.c: Misc fixes and cleanups." into 13zuul
2016-08-12Merge "res_pjsip res_pjsip_mwi: Misc fixes and cleanups." into 13zuul
2016-08-12Merge "pjsip_distributor.c: Add missing allocation failure check." into 13zuul
2016-08-11res_pjsip_caller_id: Copy header name to short header nameGeorge Joseph
When compact_headers was set, we were sending a zero-length header name for PAI and RPID because we always forced the short header name length to 0. We did this because we cloned the header from "From" and wanted to clear "f" from the sname. By cloning however, we bypass pjproject's automatic logic that sets sname to name if there's no compact form of the header, which there isn't for PAI and RPID. So now we force sname to be the same as name right after we set name. res_pjsip_diversion needed the same treatment for the Diversion header. ASTERISK-26241 #close Change-Id: I633ec139630cd83809aae00336cee4a10077e467
2016-08-11res_pjsip: Fail global load if debug or default_from_user are emptyGeorge Joseph
If debug was specified in the global configuration but left blank, the logger would treat it as a wildcard and log all hosts. If default_from_user was empty, a crash would result. The global apply handler now checks for empty strings. ASTERISK-26239 #close ASTERISK-26238 #close Change-Id: Ie75727f5cd5808845d92cc81f5713842fb203336
2016-08-11res_pjsip res_pjsip_mwi: Misc fixes and cleanups.Richard Mudgett
* Eliminated RAII_VAR() usage in ast_sip_persistent_endpoint_update_state(). * Added a missing allocation failure check to persistent_endpoint_find_or_create(). * Made persistent_endpoint_find_or_create() create the new object without a lock as it isn't needed. * Cleaned up some ao2 container allocation idioms. * Reordered res_pjsip_mwi.c load_module() and unload_module() Change-Id: If8ce88fbd82a0c72a37a2388f74f77237a6a36a8
2016-08-11location.c: Misc fixes and cleanups.Richard Mudgett
* Eliminated most RAII_VAR() usage. * Added several missing allocation failure checks. * Made ast_sip_for_each_contact() allocate the wrapper ao2 object without a lock as it is not needed. Change-Id: Ie20913365156c95dd79e5d471cfd25e99ae880bc
2016-08-11res_pjsip: Make aor named lock a mutex.Richard Mudgett
The named aor lock was always being locked for writes so a rwlock adds no benefit and may be slower because rwlocks are biased toward read locking. Change-Id: I8c5c2c780eb30ce5441832257beeb3506fd12b28
2016-08-11pjsip_distributor.c: Add missing allocation failure check.Richard Mudgett
Change-Id: I932ab2cea845e534d9ff318035b6de39972d3b28
2016-08-10Merge "pjsip: Fix deadlock with suspend taskprocessor on masquerade" into 13zuul
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-10Merge "res_rtp_asterisk: Cache local RTCP address." into 13Joshua Colp
2016-08-09res_rtp_asterisk: Cache local RTCP address.Mark Michelson
When an RTCP packet is sent or received, res_rtp_asterisk generates a Stasis event that contains the RTCP report as well as the local and remote addresses that the report pertains to. The addresses are determined using ast_find_ourip(). For the local address, this will typically result in a lookup of the hostname of the server, and then a DNS lookup of that hostname. If you do not have the host in /etc/hosts, then this results in a full DNS lookup, which can potentially block for some time. This is especially problematic when performing RTCP reads, since those are done on the same thread responsible for reading and writing media. This patch addresses the issue by performing a lookup of the local address when RTCP is allocated. We then use this cached local address for the Stasis events when necessary. ASTERISK-26280 #close Reported by Mark Michelson Change-Id: I3dd61882c2e57036f09f0c390cf38f7c87e9b556
2016-08-09Merge "res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack" into 13zuul
2016-08-09Merge "res_pjsip_outbound_publish: Use a serializer shutdown group for ↵Joshua Colp
unload." into 13
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-04res_pjsip_outbound_publish: Use a serializer shutdown group for unload.Joshua Colp
This change replaces the custom unload process for the outbound publish module with the common serializer shutdown group. ASTERISK-25217 #close Change-Id: I280a0384d860c486202d87d2d674394cca77ffb6