summaryrefslogtreecommitdiff
path: root/channels
AgeCommit message (Collapse)Author
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-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-19chan_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 14Jenkins2
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-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-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 14Jenkins2
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-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-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-05Merge "chan_sip: Only when different, add TCP|TLS in autodomain (SIP Domain ↵Jenkins2
Support)." into 14
2017-07-05Merge "chan_pjsip: Fix ability to send UPDATE on COLP" into 14George Joseph
2017-07-03chan_sip: Only when different, add TCP|TLS in autodomain (SIP Domain Support).Alexander Traud
When sip.conf contained tcpenable=yes and autodomain=yes, the TCP domain was added in any case, because of a local Boolean-negation error of the return value of ast_sockaddr_cmp. After fixing this error for TCP and TLS, the TLS domain was still always added with tlsenable=yes, because the domains were not compared just on the address but also on the port – and TLS is always on a different port than UDP/TCP. ASTERISK-27106 Change-Id: I14fe9e319e238320b094016980445ef3a5b3337c
2017-07-03chan_sip: Fix a typo for tlsbindaddr in autodomain (SIP Domain Support).Alexander Traud
Because of a copy-and-paste error when the struct ast_sockaddr changed, tlsbindaddr was not added, when sip.conf contained autodomain=yes; see "show sip domains" on the command-line interface (CLI) of Asterisk. ASTERISK-27106 Change-Id: I3d0957150017c223136968ef1266f275d0d6695e
2017-06-29chan_pjsip: Fix ability to send UPDATE on COLPGeorge Joseph
When connected_line_method is "invite", we're supposed to determine if the client can support UPDATE and if it can, send UPDATE instead of INVITE to avoid the SDP renegotiation. Not only was pjproject not setting the PJSIP_INV_SUPPORT_UPDATE flag, we were testing that invite_tsx wasn't NULL which isn't always the case. * Updated chan_pjsip/update_connected_line_information to drop the requirement that invite_tsx isn't NULL. * Submitted patch to pjproject sip_inv.c that sets the PJSIP_INV_SUPPORT_UPDATE flag correctly. * Updated pjsip.conf.sample to clarify what happens when "invite" is specified. ASTERISK-27095 Change-Id: Ic2381b3567b8052c616d96fbe79564c530e81560
2017-06-26res_pjsip: Add DTMF INFO Failback modeTorrey Searle
The existing auto dtmf mode reverts to inband if 4733 fails to be negotiated. This patch adds a new mode auto_info which will switch to INFO instead of inband if 4733 is not available. ASTERISK-27066 #close Change-Id: Id185b11e84afd9191a2f269e8443019047765e91
2017-06-15chan_pjsip: Fix PJSIP_MEDIA_OFFER dialplan function read.Richard Mudgett
The construction of the returned string assumed incorrectly that the supplied buffer would always be initialized as an empty string. If it is not an empty string we could overrun the supplied buffer by the length of the non-empty buffer string plus one. It is also theoreticaly possible for the supplied buffer to be overrun by a string terminator during a read operation even if the supplied buffer is an empty string. * Fix the assumption that the supplied buffer would already be an empty string. The buffer is not guaranteed to contain an empty string by all possible callers. * Fix string terminator buffer overrun potential. Change-Id: If6a0806806527678c8554b1dcb34fd7808aa95c9
2017-06-13Merge "pjsip: Extend 'asymmetric_rtp_codec' option to include us changing." ↵Joshua Colp
into 14
2017-06-07chan_pjsip: Update device state when in early media.Joshua Colp
The chan_pjsip module uses a calculation approach for determining device state. This means that in situations where we would expect device state to change we need to tell the core to query. A scenario that was missed is when early media was signaled. This change adds the notification for the core to query device state when we are told that early media is being provided. ASTERISK-27039 Change-Id: Iafebfd152894966344ff2e950a3cee9f59a3eb6f
2017-06-07pjsip: Extend 'asymmetric_rtp_codec' option to include us changing.Joshua Colp
PJSIP support in Asterisk differs from chan_sip in that it allows media to be sent as-is without transcoding provided the codecs were negotiated in the SDP. This is allowed according to the RFC. Support for this differs quite a lot though and some endpoints do not handle it well. This change extends the 'asymmetric_rtp_codec' option to also cover this case. When set to no (the default) the code behaves as chan_sip does - the best codec is selected and we will only ever send that, unless we change what we are sending if the remote side changes. When set to yes we will send media as-is without transcoding if the codec has been negotiated in the SDP. ASTERISK-26996 Change-Id: Ib1647f6902a0843e8c435946f831c2159e8d1d51
2017-06-06res_pjsip: Add support for returning only reachable contacts and use it.Joshua Colp
This introduces the ability for PJSIP code to specify filtering flags when retrieving PJSIP contacts. The first flag for use causes the query code to only retrieve contacts that are not unreachable. This change has been leveraged by both the Dial() process and the PJSIP_DIAL_CONTACTS dialplan function so they will now only attempt calls to contacts which are not unreachable. ASTERISK-26281 Change-Id: I8233b4faa21ba3db114f5a42e946e4b191446f6c
2017-05-22chan_sip: Better ICE handling for RTCP-MUXSean Bright
If we are offered or are offering RTCP-MUX, don't consider RTCP ICE candidates. This confuses certain browsers (current Firefox for example) and causes intial audio setup delays. ASTERISK-26982 #close Change-Id: Ifeaf47e83972fe8dbe58b7fb3d6d1823400cfb91
2017-05-19AST-2017-004: chan_skinny: Add EOF check in skinny_sessionGeorge Joseph
The while(1) loop in skinny_session wasn't checking for EOF so a packet that was longer than a header but still truncated would spin the while loop infinitely. Not only does this permanently tie up a thread and drive a core to 100% utilization, the call of ast_log() in such a tight loop eats all available process memory. Added poll with timeout to top of read loop ASTERISK-26940 #close Reported-by: Sandro Gauci Change-Id: I2ce65f3c5cb24b4943a9f75b64d545a1e2cd2898
2017-05-12chan_sip: Change sip_get_codec() to return correct codec listVitezslav Novy
Return cahnnel nativeformats to fix bridge technology selection process. Same approach as in pjsip module. ASTERISK-26143 Reported-by: Henning Holtschneider Change-Id: I64e863753954d6ad67a9e722df2ebc328705ad48
2017-05-02channels/chan_sip.c: use binding IP address for outgoing TCP SIP connectionsThierry Magnien
For outgoing TCP connections, Asterisk uses the first IP address of the interface instead of the IP address we asked him to bind to. ASTERISK-26922 #close Reported-by: Ksenia Change-Id: I43c71ca89211dbf1838e5bcdb9be8d06d98e54eb
2017-04-27Merge "res_pjsip_session: Add cleanup to ast_sip_session_terminate" into 14Jenkins2
2017-04-27res_pjsip_session: Add cleanup to ast_sip_session_terminateGeorge Joseph
If you use ast_request to create a PJSIP channel but then hang it up without causing a transaction to be sent, the session will never be destroyed. This is due ot the fact that it's pjproject that triggers the session cleanup when the transaction ends. app_chanisavail was doing this to get more granular channel state and it's also possible for this to happen via ARI. * ast_sip_session_terminate was modified to explicitly call the cleanup tasks and unreference session if the invite state is NULL AND invite_tsx is NULL (meaning we never sent a transaction). * chan_pjsip/hangup was modified to bump session before it calls ast_sip_session_terminate to insure that session stays valid while it does its own cleanup. * Added test events to session_destructor for a future testsuite test. ASTERISK-26908 #close Reported-by: Richard Mudgett Change-Id: I52daf6f757184e5544c261f64f6fe9602c4680a9
2017-04-26chan_sip: Trigger reinvite if the SDP answer is included in the SIP ACKJean Aunis
Some equipments may send a re-INVITE containing an SDP in the final ACK request. If this happens in the context of direct media, the remote end should be updated with a re-INVITE. This patch queues an "update RTP peer" frame to trigger the re-INVITE, instead of the "source change" frame wich was used previously. ASTERISK-26951 Change-Id: I3644d2025f20e086ea9f8f62b486172c52b5b2e6
2017-04-12modules: change module LOAD_FAILUREs to LOAD_DECLINESGeorge Joseph
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-04-03chan_sip: Session Timers required but refused wrongly.Alexander Traud
SIP user-agents indicate which protocol extensions are allowed in headers like Supported and Required. Such protocol extensions are Session Timers (RFC 4028) for example. Session Timers are supported since Mantis-10665. Since ASTERISK-21721, not only the first but multiple Supported/Required headers in a message are parsed. In that change, an existing variable was re-used within a newly added do-loop. Currently, at the end of that loop, that variable is an empty string always. Previously, that variable was used within log output. However, the log output was not changed. ASTERISK-26915 #close Change-Id: I09315f31b4d78fb214bb2a9fb6c0f5e143eae990
2017-03-20thread safety: Don't use getprotobyname()Sean Bright
POSIX does not require getprotobyname() to be thread safe and some implementations use static memory which causes issues when multiple threads are used. Further, our usage of it today is just to ultimately get IPPROTO_TCP for calls to setsockopt(). So instead we just use IPPROTO_TCP directly. Change-Id: I2e14e58674808f7ce99b2f5e900d0f90d0d8da48
2017-03-17chan_sip: Add rtcp-mux supportSean Bright
ASTERISK-26846 #close Change-Id: I541a1602ff55ab73684e9f8002edb9e0e745d639
2017-03-14chan_iax2: Reload of iax peer results in loss of host address/portRichard Begg
When using a non-dynamic peer address, build_peer() invalidates the peer address structure by setting the address family to unspecified. However, if dnsmgr is enabled, the subsequent call to ast_dnsmgr_lookup() will not amend the peer address if the cache is still valid, resulting in peer connectivity failures. To fix this, we call ast_dnsmgr_refresh() instead. ASTERISK-26865 Change-Id: Id8a89a2f771ebbaf32255a35fe596a6dcb97a082
2017-03-14Merge "chan_pjsip: Don't assume a session will have a channel." into 14Joshua Colp
2017-03-13chan_pjsip: Don't assume a session will have a channel.Joshua Colp
When querying for PJSIP specific information using the dialplan function CHANNEL() it is possible that the underlying session will no longer have a channel associated with it. This is most likely to occur when the RTCP HEP module attempts to get the channel name. If this happens then a crash will occur. This change just adds a check that the channel exists on the session before querying it. ASTERISK-26857 Change-Id: I113479cffff6ae64cf8ed089e9e1565223426f01
2017-03-10chan_sip: Call not cancelled after receiving a 422 responseJean Aunis
When receiving a 422 response, the invitestate variable must be reset to INV_CALLING. ASTERISK-26841 Change-Id: Ia0502d6b02192664cefa4e75bafdd2645ce56099
2017-03-09pjsip/cli_commands: pjsip show channelstats shows wrong codecDaniel Journo
* cli_commands.c Fixed CLI output ASTERISK-26822 #close Change-Id: I3889ef6a8f6738fc312fab42db5efacd6e452b01
2017-03-02core: Cleanup ast_get_hint() usage.Richard Mudgett
* manager.c:manager_state_cb() Fix potential use of uninitialized hint[] if a hint does not exist for the requested extension. Ran into this when developing a testsuite test. The AMI event ExtensionStatus came out with the hint header value containing garbage. The AMI event PresenceStatus also had the same issue. * manager.c:action_extensionstate() no need to completely initialize the hint[]. Only initialize the first element. * pbx.c:ast_add_hint() Remove unnecessary assignment. * chan_sip.c: Eliminate an unneeded hint[] local variable. We only care about the return value of ast_get_hint() there. Change-Id: Ia9a8786f01f93f1f917200f0a50bead0319af97b
2017-02-15chan_unistim: fix char type to have consistent behavior on ARMIgor Goncharovsky
There is difference exists in behaviour of char type on x86 and ARM. On x86 by default char variable type means signed char, but in ARM unsigned char used. This make binary calculations and negative values works wrong on ARM. This patch change type of char variables used for store negative values and binary calculations to signed char. ASTERISK-26714 Change-Id: Id78716dee9568a58419d4ef63c038affc3dfc7ab
2017-02-14Merge "cli: Fix various CLI documentation and completion issues" into 14zuul