summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2016-10-13Audit ast_json_pack() calls for needed UTF-8 checks.Richard Mudgett
Added needed UTF-8 checks before constructing json objects in various files for strings obtained outside the system. In this case string values from a channel driver's peer and not from the user setting channel variables. * aoc.c: Fixed type mismatch in s_to_json() for time and granularity json object construction. ASTERISK-26466 Reported by: Richard Mudgett Change-Id: Iac2d867fa598daba5c5dbc619b5464625a7f2096
2016-10-12res_fax: Fix a tight race condition causing fax to crash in audio fallbackTorrey Searle
When T.38 gets rejected and G711 failback occurs there is a period of time where neither AST_FAX_TECH_T38 nor AST_FAX_TECH_AUDIO is set, leading to a crash. Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
2016-10-10res_rtp_asterisk: Fix infinite DTMF issue when switching to P2P bridgeTorrey Searle
If a bridge switched to P2P when a DTMF was in progress it was possible for the DTMF to continue being sent indefinitely. Change-Id: I7e2a3efe0d59d4b214ed50cd0b5d0317e2d92e29
2016-10-10res_pjsip_config_wizard: Memory leak in module_unloadBadalyan Vyacheslav
Fixed a memory leak. It removes only the first element. Added a useful feature in vector.h to remove all items under the CMP through a callback function / macro. ASTERISK-26453 #close Change-Id: I84508353463456d2495678f125738e20052da950
2016-09-27Merge "codec_opus: Replace res_format_attr_opus with the one from ↵George Joseph
codec_opus" into 13
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-25build_tools: Add ability to download variants to download_externalsGeorge Joseph
Some external packages have multiple variants that apply to different builds of asterisk. The DPMA for instance has a "bundled" variant that needs to be downloaded if asterisk was configured with --with-pjproject-bundled. There are 2 ways to specify variants: If you need the user to make the decision about which variant to download, simply create multiple menuselect "member" entries like so... <member name="res_digium_phone" displayname="..snipped.."> <support_level>external</support_level> <depend>xmlstarlet</depend> <depend>bash</depend> <defaultenabled>no</defaultenabled> </member> <member name="res_digium_phone-bundled" displayname="..snipped.."> <support_level>external</support_level> <depend>xmlstarlet</depend> <depend>bash</depend> <defaultenabled>no</defaultenabled> </member> Note that the second entry has "-<variant>" appended to the name. You can then use the existing menuselect facilities to restrict which members to enable or disable. Youy probably don't want the user to enable multiple at the same time. If you want to hide the details of the variants, the better way to do it is to create 1 member with "variant" elements. <member name="res_digium_phone" displayname="..snipped.."> <support_level>external</support_level> <depend>xmlstarlet</depend> <depend>bash</depend> <defaultenabled>no</defaultenabled> <member_data> <downloader> <variants> <variant tag="bundled" condition='[[ "$PJPROJECT_BUNDLED" = "yes" ]]'/> </variants> </downloader> </member_data> </member> The condition must be a bash expression suitable for use with an "if" statement. Any environment variable can be used plus those available in makeopts. In this case, if asterisk was configured with --with-pjproject-bundled the bundled variant will be automatically downloaded. Otherwise the normal version will be downloaded. Change-Id: I4de23e06d4492b0a65e105c8369966547d0faa3e
2016-09-21res_odbc: Make pooling option deprecation notice more useful.Joshua Colp
This changes the notice for the deprecation of the old pooling options to point to the new option for doing pooling. This gives a clearer direction as to what to look into. ASTERISK-26389 #close Change-Id: I2ca9cdfdcd75aec170a7db9d5ff69a4cd25b7c10
2016-09-20Merge "res_pjsip_multihomed: Change Contact port to listening port." into 13zuul
2016-09-15res_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 ↵zuul
seconds." into 13
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." into 13zuul
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_messaging.c: Misc cleanups and fixes." into 13zuul
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-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_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-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_pjsip_session: segfault on already disconnected session" into 13zuul
2016-09-07Merge "build: Add download capability for external packages" into 13Joshua Colp
2016-09-06Merge "res_pjsip_registrar.c: Reduce stack usage in find_aor_name()." into 13zuul
2016-09-06Merge "pjsip_configuration.c: Ignore repeated identify by methods." into 13zuul
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-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-01res_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-01Merge "res_pjsip: qualify/unqualify added/deleted realtime endpoints" into 13zuul
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-29Merge "res_pjsip: Default endpoints to the "offline" status." into 13zuul
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-22res_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-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