summaryrefslogtreecommitdiff
path: root/channels
AgeCommit message (Collapse)Author
2017-12-18Merge "chan_pjsip.c: Improve ast_request() diagnostic msgs." into 15George Joseph
2017-12-15chan_pjsip.c: Improve ast_request() diagnostic msgs.Richard Mudgett
Attempting to dial PJSIP/endpoint when the endpoint doesn't exist and disable_multi_domain=no results in a misleading empty endpoint name message. The message should say the endpoint was not found. * Added missing endpoint not found message. * Added more information to the empty endpoint name msgs if available. * Eliminated RAII_VAR in request(). Change-Id: I21da85ebd62dcc32115b2ffcb5157416ebae51e4
2017-12-15chan_sip: Add security event for calls to invalid extension.Corey Farrell
Log a message to security events when an INVITE is received to an invalid extension. ASTERISK-25869 #close Change-Id: I0da40cd7c2206c825c2f0d4e172275df331fcc8f
2017-12-13Merge "chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)" into 15Jenkins2
2017-12-13Merge "chan_sip: Don't crash in Dial on invalid destination" into 15Joshua Colp
2017-12-12chan_sip: Don't send trailing \0 on keep alive packetsSean Bright
This is a partial fix for ASTERISK~25817 but does not address the comments regarding RFC 5626. Change-Id: I227e2d10c0035bbfa1c6e46ae2318fd1122d8420
2017-12-12chan_sip: Don't crash in Dial on invalid destinationSean Bright
Stripping the DNID in a SIP dial string can result in attempting to call the argument parsing macros on an empty string, causing a crash. ASTERISK-26131 #close Reported by: Dwayne Hubbard Patches: dw-asterisk-master-dnid-crash.patch (license #6257) patch uploaded by Dwayne Hubbard Change-Id: Ib84c1f740a9ec0539d582b09d847fc85ddca1c5e
2017-12-12chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)Richard Mudgett
This patch does three things associated with the initial incoming INVITE request URI. 1) Add access to the full initial incoming INVITE request URI. 2) We were not setting DNID on incoming PJSIP channels. The DNID is the user portion of the initial incoming INVITE Request-URI. The value is accessed by reading CALLERID(dnid). 3) Fix CHANNEL(pjsip,target_uri) documentation. * The initial incoming INVITE request URI is now available using CHANNEL(pjsip,request_uri). * Set the DNID on PJSIP channel creation so CALLERID(dnid) can return the initial incoming INVITE request URI user portion. * CHANNEL(pjsip,target_uri) now correctly documents that the target URI is the contact URI. * Refactored print_escaped_uri() out of channel_read_pjsip() to handle pjsip_uri_print() error condition when the buffer is too small. ASTERISK-27478 Change-Id: I512e60d1f162395c946451becb37af3333337b33
2017-12-08utils: Add convenience function for setting fd flagsSean Bright
There are many places in the code base where we ignore the return value of fcntl() when getting/setting file descriptior flags. This patch introduces a convenience function that allows setting or clearing file descriptor flags and will also log an error on failure for later analysis. Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7
2017-12-04security-events: Fix SuccessfulAuth using_password declaration.Richard Mudgett
The SuccessfulAuth using_password field was declared as a pointer to a uint32_t when the field was later read as a uint32_t value. This resulted in unnecessary casts and a non-portable field value reinterpret in main/security_events.c:add_json_object(). i.e., It would work on a 32 bit architecture but not on a 64 bit big endian architecture. Change-Id: Ia08bc797613a62f07e5473425f9ccd8d77c80935
2017-12-01AST-2017-013: chan_skinny: Call pthread_detach when sess threads endGeorge Joseph
chan_skinny creates a new thread for each new session. In trying to be a good cleanup citizen, the threads are joinable and the unload_module function does a pthread_cancel() and a pthread_join() on any sessions that are active at that time. This has an unintended side effect though. Since you can call pthread_join on a thread that's already terminated, pthreads keeps the thread's storage around until you explicitly call pthread_join (or pthread_detach()). Since only the module_unload function was calling pthread_join, and even then only on the ones active at the tme, the storage for every thread/session ever created sticks around until asterisk exits. * A thread can detach itself so the session_destroy() function now calls pthread_detach() just before it frees the session memory allocation. The module_unload function still takes care of the ones that are still active should the module be unloaded. ASTERISK-27452 Reported by: Juan Sacco Change-Id: I9af7268eba14bf76960566f891320f97b974e6dd
2017-11-21chan_sip: ICE contained square brackets around IPv6 addresses.Alexander Traud
ASTERISK-27434 Change-Id: Iaeed89b4fa05d94c5f0ec2d3b7cd6e93d2d5a8f7
2017-11-15chan_pjsip.c: Improve answer failure log messages.Richard Mudgett
* Balanced the session->inv_session refs on answer failure. Change-Id: I33542d639d37e692cb46550b972a5fcfc3b804b8
2017-11-11core: Add cache_media_frames debugging option.Richard Mudgett
The media frame cache gets in the way of finding use after free errors of media frames. Tools like valgrind and MALLOC_DEBUG don't know when a frame is released because it gets put into the cache instead of being freed. * Added the "cache_media_frames" option to asterisk.conf. Disabling the option helps track down media frame mismanagement when using valgrind or MALLOC_DEBUG. The cache gets in the way of determining if the frame is used after free and who freed it. NOTE: This option has no effect when Asterisk is compiled with the LOW_MEMORY compile time option enabled because the cache code does not exist. To disable the media frame cache simply disable the cache_media_frames option in asterisk.conf and restart Asterisk. Sample asterisk.conf setting: [options] cache_media_frames=no ASTERISK-27413 Change-Id: I0ab2ce0f4547cccf2eb214901835c2d951b78c00
2017-11-09chan_pjsip.c: Fix uninitialized cause value on failure.Richard Mudgett
Change-Id: I3f9dd3c31bd582e54a30381500077de2319d8cc3
2017-11-06Merge "dtls: Add support for ephemeral DTLS certificates." into 15Jenkins2
2017-11-06dtls: Add support for ephemeral DTLS certificates.Sean Bright
This mimics the behavior of Chrome and Firefox and creates an ephemeral X.509 certificate for each DTLS session. Currently, the only supported key type is ECDSA because of its faster generation time, but other key types can be added in the future as necessary. ASTERISK-27395 Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4
2017-11-02Add missing menuselect dependencies.Corey Farrell
This adds menuselect dependencies for modules that use symbols of other modules. ASTERISK-27390 Change-Id: Ia2d2849f5b87a72af7324a82edc3f283eafb5385
2017-10-24chan_sip: Fix SUBSCRIBE with missing "Expires" header.Corey Farrell
When chan_sip receives a SUBSCRIBE request with no "Expires" header it processes the request as an unsubscribe. This is incorrect, per RFC3264 when the "Expires" header is missing a default expiry should be used. ASTERISK-18140 Change-Id: Ibf6dcd4fdd07a32c2bc38be1dd557981f08188b5
2017-10-21chan_sip: Crypto attribute not last but first on SDP media level.Alexander Traud
This matches the behavior of the other SIP channel driver, chan_pjsip. ASTERISK-27365 Change-Id: I8f23a51290a58b75816da2999ed1965441dfc5d6
2017-10-18chan_sip: Fix output of 'sip set debug off'.Corey Farrell
When sip.conf contains 'sipdebug=yes' it is impossible to disable it using CLI 'sip set debug off'. This corrects the output of that CLI command to instruct the user to turn sipdebug off in the configuration file. ASTERISK-23462 #close Change-Id: I1cceade9caa9578e1b060feb832e3495ef5ad318
2017-10-14chan_dahdi: wrap include file which is not present on BSD systems in #ifdefGuido Falsi
The sys/sysmacros.h include file does not exist in BSD systems and is not required to build this module there. Since an "#if defined(__NetBSD__) || defined(__FreeBSD__)" section already exist I moved that include line inside it's #else branch. ASTERISK-27343 #close Change-Id: Ibfb64f4e9a0ce8b6eda7a7695cfe57916f175dc1
2017-10-11chan_vpb: Fix a gcc 7 out-of-bounds complaintGeorge Joseph
chan_vpb was trying to use sizeof(*p->play_dtmf), where p->play_dtmf is defined as char[16], to get the length of the array but since p->play_dtmf is an actual array, sizeof(*p->play_dtmf) returns the size of the first array element, which is 1. gcc7 validly complains because the context in which it's used could cause an out-of-bounds condition. Change-Id: If9c4bfdb6b02fa72d39e0c09bf88900663c000ba
2017-10-05res_pjsip_caller_id chan_sip: Comply to RFC 3323 values for privacyDaniel Tryba
Currently privacy requests are only granted if the Privacy header value is exactly "id" (defined in RFC 3325). It ignores any other possible value (or a combination there of). This patch reverses the logic from testing for "id" to grant privacy, to testing for "none" and granting privacy for any other value. "none" must not be used in combination with any other value (RFC 3323 section 4.2). ASTERISK-27284 #close Change-Id: If438a21f31a962da32d7a33ff33bdeb1e776fe56
2017-09-25build: A few gcc 7 error fixesGeorge Joseph
Change-Id: I7b5300fbf1af7d88d47129db13ad6dbdc9b553ec
2017-09-21bridge: Change participant SFU streams when source streams change.Joshua Colp
Some endpoints do not like a stream being reused for a new media stream. The frame/jitterbuffer can rely on underlying attributes of the media stream in order to order the packets. When a new stream takes its place without any notice the buffer can get confused and the media ends up getting dropped. This change uses the SSRC change to determine that a new source is reusing an existing stream and then bridge_softmix renegotiates each participant such that they see a new media stream. This causes the frame/jitterbuffer to start fresh and work as expected. ASTERISK-27277 Change-Id: I30ccbdba16ca073d7f31e0e59ab778c153afae07
2017-09-21Merge "chan_sip: Expose read-only access to the full SIP INVITE Request-URI" ↵Joshua Colp
into 15
2017-09-20chan_pjsip: Ignore AST_CONTROL_STREAM_TOPOLOGY_CHANGED for nowGeorge Joseph
chan_pjsip_indicate was missing a case for the recently added AST_CONTROL_STREAM_TOPOLOGY_CHANGED condition and was returning an error and causing the call to be hung up instead of just ignoring it. ASTERISK-27260 Reported by: Daniel Heckl Change-Id: I4fecbb00a0b8a853da85155065c1a6bddf235e80
2017-09-20chan_sip: Expose read-only access to the full SIP INVITE Request-URIDavid J. Pryke
Provide a way to get the contents of the the Request URI from the initial SIP INVITE in dial plan function call. (In this case "${CHANNEL(ruri)}") ASTERISK-27278 Reported by: David J. Pryke Tested by: David J. Pryke Change-Id: I1dd4d6988eed1b6c98a9701e0e833a15ef0dac3e
2017-09-13chan_rtp: Use μ-law by default instead of signed linearSean Bright
Multicast/Unicast RTP do not use SDP so we need to use a format that cleanly maps to one of the static RTP payload types. Without this change, an Originate to a Multicast or Unicast channel without a format specified would produce no audio on the receiving device. ASTERISK-21399 #close Reported by: Tzafrir Cohen Change-Id: I97e332b566e85da04b0004b9b0daae746cfca0e3
2017-09-08Merge "chan_sip: when getting sip pvt return failure if not found" into 15Jenkins2
2017-09-06chan_sip: when getting sip pvt return failure if not foundScott Griepentrog
In handle_request_invite, when processing a pickup, a call is made to get_sip_pvt_from_replaces to locate the pvt for the subscription. The pvt is assumed to be valid when zero is returned indicating no error, and is dereferenced which can cause a crash if it was not found. This change checks the not found case and returns -1 which allows the calling code to fail appropriately. ASTERISK-27217 #close Reported-by: Bryan Walters Change-Id: I6bee92b8b8b85fcac3fd66f8c00ab18bc1765612
2017-09-06chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITEVitezslav Novy
If directmedia=yes is configured, when call is answered, Asterisk sends reINVITE to both parties to set up media path directly between the endpoints. In this reINVITE msg SDP origin line (o=) contains IP address of endpoint instead of IP of asterisk. This behavior violates RFC3264, sec 8: "When issuing an offer that modifies the session, the "o=" line of the new SDP MUST be identical to that in the previous SDP, except that the version in the origin field MUST increment by one from the previous SDP." This patch assures IP address of Asterisk is always sent in SDP origin line. ASTERISK-17540 Reported by: saghul Change-Id: I533a047490c43dcff32eeca8378b2ba02345b64e
2017-09-05chan_pjsip: Suppress frame warnings.Ben Ford
When rtp_keepalive is on for a PJSIP endpoint dialing to another Asterisk instance also using PJSIP, Asterisk will continue to print warning messages about not being able to send frames of a certain type. This suppresses that warning message. Change-Id: I0332a05519d7bda9cacfa26d433909ff1909be67
2017-08-30chan_pjsip: Add tag info in CHANNEL functionAndre Nazario
Create local_tag and remote_tag in CHANNEL info to get tag from From and To headers of a SIP dialog. ASTERISK-27220 Change-Id: I59b16c4b928896fcbde02ad88f0e98922b15d524
2017-08-28Merge "res/res_pjsip_session: allow SDP answer to be regenerated" into 15Jenkins2
2017-08-25res/res_pjsip_session: allow SDP answer to be regeneratedTorrey Searle
If an SDP answer hasn't been sent yet, it's legal to change it. This is required for PJSIP_DTMF_MODE to work correctly, and can also have use in the future for updating codecs too. ASTERISK-27209 #close Change-Id: Idbbfb7cb3f72fbd96c94d10d93540f69bd51e7a1
2017-08-22chan_pjsip.c: Fix topology refresh response code accuracy.Richard Mudgett
There are other 1xx and 2xx codes than 100 and 200 respectively. Change-Id: I680db0997343256add1478714f5bf5b5569aee17
2017-08-09res_rtp_asterisk: Make P2P bridge Asymmetric codec awareTorrey Searle
Introduce a new property to rtp-engine to make it aware of the desire for assymetric codecs or not. If asymmetric codecs is not allowed, the bridge will compare read/write formats and shut down the p2p bridge if needed ASTERISK-26745 #close Change-Id: I0d9c83e5356df81661e58d40a8db565833501a6f
2017-08-04Merge "Fix compile error for old versions of GCC." into 15Joshua Colp
2017-08-03Correct some leaks in unit tests.Corey Farrell
* chan_sip: channel in test_sip_rtpqos_1. * test_config: config hook, config info and global config holder. * test_core_format: format in format_attribute_set_without_interface. * test_stream: unneeded frame duplication. * test_taskprocessor: task_data. Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31
2017-08-03Fix compile error for old versions of GCC.Corey Farrell
Use -Wno-format-truncation only if supported by compiler. ASTERISK-27171 #close Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6
2017-08-01Revert "res_pjsip_session: Release media resources on session end quicker."George Joseph
This reverts commit 6c374d863c420d2519a52fffba3de5f935a30cdb. Change-Id: Ia89836005df66ef540885afd6f171886de0db442
2017-08-01res_pjsip_session: Release media resources on session end quicker.Joshua Colp
A change was made long ago where the session was kept around until the underlying INVITE session had been destroyed. This had the side effect of also keeping the underlying media resources around for this time as well. This change ensures that when we know the session is ending we release the media resources immediately. ASTERISK-27110 Change-Id: I3c6a82fe7d2c50b9dc9197cb12ef22f20d337501
2017-08-01Fix compiler warnings on Fedora 26 / GCC 7.Corey Farrell
GCC 7 has added capability to produce warnings, this fixes most of those warnings. The specific warnings are disabled in a few places: * app_voicemail.c: truncation of paths more than 4096 chars in many places. * chan_mgcp.c: callid truncated to 80 chars. * cdr.c: two userfields are combined to cdr copy, fix would break ABI. * tcptls.c: ignore use of deprecated method SSLv3_client_method(). ASTERISK-27156 #close Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
2017-08-01chan_pjsip: add a new function PJSIP_DTMF_MODETorrey Searle
This function is a replica of SIPDtmfMode, allowing the DTMF mode of a PJSIP call to be modified on a per-call basis ASTERISK-27085 #close Change-Id: I20eef5da3e5d1d3e58b304416bc79683f87e7612
2017-07-24core: Add VP9 passthrough support.Joshua Colp
This change adds VP9 as a known codec and creates a cached "vp9" media format for use. Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc
2017-07-17Merge "res_pjsip: Add "webrtc" configuration option"Jenkins2
2017-07-14chan_iax2: On reload make sure to check for existing MWI subscriptionSergej Kasumovic
On every reload of chan_iax2 module, MWI subscription was added, which results in additional taskprocessors being accumulated over time. This commit fixes it by making sure we check for existing subscription first. This was verified with 'core show taskprocessors' CLI command. ASTERISK-27122 #close Change-Id: Ie2ef528fd5ca01b933eeb88188cc10967899cfb9
2017-07-13res_pjsip: Add "webrtc" configuration optionKevin Harwell
This patch creates a new configuration option called "webrtc". When enabled it defaults and enables the following options that are needed in order for webrtc to work in Asterisk: rtcp-mux, use_avpf, ice_support, and use_received_transport=enabled media_encryption=dtls dtls_verify=fingerprint dtls_setup=actpass When "webrtc" is enabled, this patch also parses the "msid" media level attribute from an SDP. It will also appropriately add it onto the outgoing session when applicable. Lastly, when "webrtc" is enabled h264 RTCP FIR feedback frames are now sent. ASTERISK-27119 #close Change-Id: I5ec02e07c5d5b9ad86a34fdf31bf2f9da9aac6fd