summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2016-09-16res_config_odbc.c: Fix buffer size limitation creating invalid SQL.Richard Mudgett
Creating ODBC SQL queries resulted in queries too large to fit into the supplied buffer. The resulting truncated buffer contained an invalid SQL query. * Made SQL query generation code use a thread storage buffer that can increase in size as needed. * Fixed bad multi-line warning messages. ASTERISK-26263 #close Reported by: Jeppe Ryskov Larsen Change-Id: I23f3cdd43c2dac80bed3ded4dd77d18cb17f21ae
2016-09-15res_pjsip_multihomed: Change Contact port to listening port.Joshua Colp
The res_pjsip_multihomed module determines what interface and transport a request is going out on and updates the SIP message accordingly with the address information. This currently incorrectly updates the Contact header for connectionful protocols to the ephemeral connection port, instead of the bound address for the listening socket which can actually accept the connection back. If the remote side attempts to connect back on the epehemeral port it will fail. This change makes it so the port is updated to the bound port on connectionful protocols and is maintained on UDP (as there can be multiple of those). ASTERISK-26374 #close Change-Id: I50f8dab65b9f75117d73ba5f6bbcf6c9871854ab
2016-09-14Merge "res_pjsip_transport_management: Convert time in log message to seconds."zuul
2016-09-14rtp: Preserve timestamps on video frames.Joshua Colp
Currently when receiving video over RTP we store only a calculated samples on the frame. When starting the video it can take some time for this calculation to actually yield a value as it requires constant changing timestamps. As well if a video frame passes over multiple RTP packets this calculation will fail as the timestamp is the same as the previous RTP packet and the number of samples calculated will be 0. This change preserves the timestamp on the frame and allows it to pass through the core. When sending the video this timestamp is used instead of a new one being calculated. ASTERISK-26367 #close Change-Id: Iba8179fb5c14c9443aee4baf670d2185da3ecfbd
2016-09-14Merge "res_pjsip: Add ignore_uri_user_options option."zuul
2016-09-14res_pjsip_transport_management: Convert time in log message to seconds.Joshua Colp
ASTERISK-26375 #close Change-Id: I46496af5cae41413e76d44d2068a7431279f09dc
2016-09-13Merge "res_pjsip: Don't assume a request will have any addresses."zuul
2016-09-13Merge "res_pjsip_messaging.c: Misc cleanups and fixes."zuul
2016-09-13res_pjsip: Don't assume a request will have any addresses.Joshua Colp
When performing DNS resolution the failover code present in res_pjsip currently assumes that a request will always have at least one viable address. In practice this is not true. A domain may be used that has no records. The code now checks that at least one address exists on the request which prevents looping. ASTERISK-26364 #close Change-Id: Ic0761b0264864acd85915c94d878a81624940f4c
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_pjsip: Only invoke unidentified endpoint logic when unidentified.Joshua Colp
The code was incorrectly invoking the unidentified logic when an endpoint had actually been identified, causing log messages to be output. ASTERISK-26349 #close Change-Id: Id8104fc9e3d138d5e8b6f6977ecc08765fd17d4f
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-09res_pjsip: Do not crash on ACKs from unknown endpoints.Mark Michelson
The endpoint identification PJSIP module is intended to identify which endpoint an incoming request is from. If an endpoint is not identified, then an artificial endpoint is used in its place when proceeding. The problem is that the ACK request type is an exception to the rule. The artificial endpoint is not used when processing an ACK. This results in the possibility of having a NULL endpoint being used further on. The reason ACK is an exception is an attempt not to spam security logs with unidentified requests. Presumably, you've already logged the unidentified request on the preceeding INVITE. Up until Asterisk 13.10, retrieving a NULL endpoint in this fashion didn't cause an issue. A new change in 13.10 added endpoint ACL checking shortly after endpoint identification. Because we are accessing a NULL endpoint, this ACL check resulted in a crash. The fix here is to be sure to retrieve the artificial endpoint for all request types. ACKs still do not generate unidentified request security events. ASTERISK-26264 #close Reported by nappsoft AST-2016-006 Change-Id: Ie0c795ae2d72273decb972dd74b6a1489fb6b703
2016-09-08Merge "res_pjsip: Allow global headers to be overridden."zuul
2016-09-07Merge "res/res_stasis_playback: Cancel the entire playlist when a stop occurs"zuul
2016-09-07res_pjsip_messaging.c: Misc cleanups and fixes.Richard Mudgett
* Eliminated RAII_VAR in get_outbound_endpoint(). * Simplify update_to() coding. However, this function can only be a NoOp because the To string can only be a URI and not a name-address formatted string. * Simplify update_from() coding. Also fixed a code path modifying the from string when the caller could still want to use the original string. * Fixed msg_data_create() incompletely removing the "pjsip:" to then add back the "sip:" string if needed. The code didn't handle the "pjsip:sip:" case because it left the colon after pjsip in the string. Change-Id: I68a09a665f6d4daa9eaa59069045ab69122e28db
2016-09-07res_pjsip: Allow global headers to be overridden.Joshua Colp
Currently when you add global headers from the dialplan both the header in the dialplan and the globally configured header are added to the resulting SIP INVITE. This change makes it so the headers in the dialplan take precedence and are the only ones added. Change-Id: I36f864298f38db3632ad503edc11267cb8ffb3ad
2016-09-07Merge "res_resolver_unbound: Fix config documentation."zuul
2016-09-07Merge "res_pjsip_session: segfault on already disconnected session"zuul
2016-09-07Merge "build: Add download capability for external packages"zuul
2016-09-07res_resolver_unbound: Fix config documentation.Joshua Colp
The code was referencing the config section as 'globals' instead of 'general'. This change swaps it over to 'general'. Change-Id: I9dfe7788f41c4a6754c77e103880dc1a747de7fe
2016-09-07Merge "pjsip_configuration.c: Ignore repeated identify by methods."Joshua Colp
2016-09-07Merge "resource_channels.c: add hangup reason "answered_elsewhere"."zuul
2016-09-06Merge "res_pjsip_registrar.c: Reduce stack usage in find_aor_name()."zuul
2016-09-06Merge "config_global.c: Comments and a default expression adjustment."zuul
2016-09-06res/res_stasis_playback: Cancel the entire playlist when a stop occursMatt Jordan
Prior to this patch, a stop issued by a delete of a Playback resource (indicated by the control frame AST_CONTROL_STREAM_STOP) would only stop the current media URI playing. Subsequent URIs specified by a playback operation would then proceed on, even though we had just indicated to the User that the Playback was finished *and* after they had just 'deleted' the resource. Whoops. This patch corrects it by bailing out of the sequence of URIs to play if one of them is terminated with an AST_CONTROL_STREAM_STOP indication. ASTERISK-26341 #close Change-Id: I2da9ec43545ba46cdfffe287c7e4907eae7fca42
2016-09-06build: Add download capability for external packagesGeorge Joseph
The DPMA and g729a, silk, siren7 and siren14 codecs hosted at http://downloads.digium.com/pub/telephony/ are now listed in the "External" sections of the "Resource Modules" and "Codec Translators" pages in menuselect. Any that are selected will automatically be downloaded and installed when "make install" is run. Their LICENSE and README (if avaialble) files will be installed to ASTVARLIBDIR/documentation/thirdparty/<product_name>. Example use with codecs: The codecs/codecs.xml file is a menuselect style xml file that lists the codecs to be included. Their support levels are 'external', which triggers the download and install, and defaultenabled is no. Also because codec_g729a is actually in a directory named codec_g729 on the download server, the newly added 'member_data' element is used to override the default of the directory name being the package name. You can use the 'directory_name' attribute to keep default base URL (http://downloads.digium.com/pub/telephony/) but use the new directory, or you use the 'remote_url' attribute to specify a full URL to the download directory. In this case, you must still follow the same subdirectory naming conventions as that used for the packages located at 'http://downloads.digium.com/pub/telephony'. A new configure option '--with-externals-cache' was added and like '--with-sounds-cache' it allows the installer to cache tarballs so they're not downloaded every time. To assist with the download and install process, each external package now has a manifest.xml file that, among other things, contains a package version and checksums for each file in the tarball. The manifest is saved to both the cache directory and ASTMODDIR and together with the manifest.xml on the downloads site, tells the install scripts whether a download and/or update is needed. bash and xmlstarlet are required for downloader operation. If they're not installed, the external items in menuselect will be unavailable. Change-Id: Id3dcf1289ffd3cb0bbd7dfab3cafbb87be60323a
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-02res_pjsip_registrar.c: Reduce stack usage in find_aor_name().Richard Mudgett
Change-Id: I8aebad1fdcf303bd115b59a4b57fbbd5b2267f09
2016-09-02pjsip_configuration.c: Ignore repeated identify by methods.Richard Mudgett
Change-Id: Ied0c06043d1dfef8fdc9c9a808cf89b118119838
2016-09-02config_global.c: Comments and a default expression adjustment.Richard Mudgett
Change-Id: Ia6a58f8c73a30da6874b3f94364dce162d6f1ad3
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-08-31resource_channels.c: add hangup reason "answered_elsewhere".Jean Aunis
In ARI, the channels API allows to hangup a channel with a hangup reason. This commit adds a new reason "answered_elsewhere". When using a SIP channel, this will eventually allow Asterisk to add a proper "Reason" header to a CANCEL message. ASTERISK-26321 Change-Id: Ia97675bd4acd6a7f58eb467953dfb94559f6583d
2016-08-30res_pjsip: qualify/unqualify added/deleted realtime endpointsAlexei Gradinari
If the PJSIP endpoint's AOR with the permanent contact was deleted from the realtime storage the res_pjsip module continues trying to qualify this contact. The error 'Unable to find an endpoint to qualify contact' appeares every 'qualify_frequency' seconds. This patch deletes this contact in this case. The PJSIP endpoint's AOR with the permanent contact is never qualified if it is added to realtime storage after asterisk started. This patch adds qualifying for the AOR's permanent contacts on the first handling of this AOR. ASTERISK-26319 #close Change-Id: Ib93dded9121edb113076903d1aa95402f799f8fe
2016-08-29res_pjsip: Default endpoints to the "offline" status.Mark Michelson
A recent change attempted to optimize startup by not updating contact status. Instead, code responsible for qualifying contacts updates the status as it becomes known. The code even accounts for contacts/AORs that are not set to be qualified. The problem, though, is when there are no contacts associated with an endpoint. A common case is when an endpoint is set to register its contacts but has not done so yet. In this case, prior to registration, the endpoint's device state will appear to be "not in use" and hints associated with that device will appear to be "idle". In actuality, the device state and hint should both appear as "unavailable". The reason for the failure is that the optimization change made all persistent endpoint states set to "unknown". The fix here is to change the hard-coded "unknown" to be "offline" instead. The default state will be offline until the qualifying code determines that the contact is actually online. This way, if there are no contacts at all, then the state stays as offline, and device state and hints appear correctly. ASTERISK-26269 #close Reported by nappsoft Change-Id: Ie99b84169393983453076f5e9c0d35ff313a456a
2016-08-26Merge "res_pjsip: Cache global config options."zuul
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"zuul
2016-08-22Merge "res_odbc_transaction: add dep on generic_odbc"zuul
2016-08-22compilation 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-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-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)