summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2017-08-31Merge "pjsip_message_ip_updater: Fix issue handling "tel" URIs" into 13Jenkins2
2017-08-31Merge "AST-2017-006: Fix app_minivm application MinivmNotify command ↵Jenkins2
injection" into 13
2017-08-30pjsip_message_ip_updater: Fix issue handling "tel" URIsGeorge Joseph
sanitize_tdata was assuming all URIs were SIP URIs so when a non SIP uri was in the From, To or Contact headers, the unconditional cast of a non-pjsip_sip_uri structure to pjsip_sip_uri caused a segfault when trying to access uri->other_param. * Added PJSIP_URI_SCHEME_IS_SIP(uri) || PJSIP_URI_SCHEME_IS_SIPS(uri) checks before attempting to cast or use the returned uri. ASTERISK-27152 Reported-by: Ross Beer Change-Id: Id380df790e6622c8058a96035f8b8f4aa0b8551f
2017-08-30AST-2017-006: Fix app_minivm application MinivmNotify command injectionCorey Farrell
An admin can configure app_minivm with an externnotify program to be run when a voicemail is received. The app_minivm application MinivmNotify uses ast_safe_system() for this purpose which is vulnerable to command injection since the Caller-ID name and number values given to externnotify can come from an external untrusted source. * Add ast_safe_execvp() function. This gives modules the ability to run external commands with greater safety compared to ast_safe_system(). Specifically when some parameters are filled by untrusted sources the new function does not allow malicious input to break argument encoding. This may be of particular concern where CALLERID(name) or CALLERID(num) may be used as a parameter to a script run by ast_safe_system() which could potentially allow arbitrary command execution. * Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp() instead of ast_safe_system() to avoid command injection. * Document code injection potential from untrusted data sources for other shell commands that are under user control. ASTERISK-27103 Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
2017-08-30res_rtp_asterisk: Only learn a new source in learn state.Joshua Colp
This change moves the logic which learns a new source address for RTP so it only occurs in the learning state. The learning state is entered on initial allocation of RTP or if we are told that the remote address for the media has changed. While in the learning state if we continue to receive media from the original source we restart the learning process. It is only once we receive a sufficient number of RTP packets from the new source that we will switch to it. Once this is done the closed state is entered where all packets that do not originate from the expected source are dropped. The learning process has also been improved to take into account the time between received packets so a flood of them while in the learning state does not cause media to be switched. Finally RTCP now drops packets which are not for the learned SSRC if strict RTP is enabled. ASTERISK-27013 Change-Id: I56a96e993700906355e79bc880ad9d4ad3ab129c
2017-08-28Merge "res/res_pjsip_session: allow SDP answer to be regenerated" into 13Jenkins2
2017-08-24res_smdi: Clean up memory leakSean Bright
Change-Id: I1e33290929e1aa7c5b9cb513f8254f2884974de8
2017-08-22Merge "res_xmpp: fix inverted return code check in OAuth" into 13Jenkins2
2017-08-22res/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-22res_xmpp: fix inverted return code check in OAuthMichael Kuron
fetch_access_token calls func_curl via ast_func_read. The latter returns 0 upon success and -1 if the function is not available. This commit inverts the return code check so that an error is printed if the module is not loaded and not if it is loaded. ASTERISK-27207 #close Change-Id: I9ef903f80702d1218e8701f65a4e5e918e6548fb
2017-08-17res_calendar_icalendar: Properly handle recurring eventsSean Bright
When looking for recurring events, use the correct end time based on the configured 'timeframe.' ASTERISK-27174 #close Reported by: Mark Thompson Change-Id: Id90c3cfc79d561a5521d79be176683e225f2edef
2017-08-15res_pjsip: Fix prune_on_boot to remove only contacts for the host.Richard Mudgett
* Check that the contact's reg_server matches the host's name before deleting any prune_on_boot contacts. We don't want to delete reliable transport contacts made with other servers if the ps_contacts database table is shared with other servers. Thanks to Ross Beer for pointing out that the original prune logic would delete reliable transport contacts from other servers. ASTERISK-27147 Change-Id: I8e439d0d1c266ffdfd7b73d1e5e466180a689bd0
2017-08-15Merge "res_xmpp: Google OAuth 2.0 protocol support for XMPP / Motif" into 13Jenkins2
2017-08-15res_xmpp: Google OAuth 2.0 protocol support for XMPP / MotifAndrey Egorov
Add ability to use tokens instead of passwords according to Google OAuth 2.0 protocol. ASTERISK-27169 Reported by: Andrey Egorov Tested by: Andrey Egorov Change-Id: I07f7052a502457ab55010a4d3686653b60f4c8db
2017-08-10res_pjsip_outbound_registration.c: Re-REGISTER on transport shutdown.Richard Mudgett
The fix for the issue is broken up into three parts. This is part three which handles the client side of REGISTER requests. The registered contact may no longer be valid on the server when the transport used is reliable and the connection is broken. * Re-REGISTER our contact if the reliable transport is broken after registration completes. We attempt to re-REGISTER immediately to minimize the time we are unreachable. Time may have already passed between the connection being broken and the loss being detected. * Reorder sip_outbound_registration_state_alloc() so the STATSD_GUAGE's are still correct if an allocation failure happens. ASTERISK-27147 Change-Id: I3668405b1ee75dfefb07c0d637826176f741ce83
2017-08-10res_pjsip: Remove ephemeral registered contacts on transport shutdown.Richard Mudgett
The fix for the issue is broken up into three parts. This is part two which handles the server side of REGISTER requests when rewrite_contact is enabled. Any registered reliable transport contact becomes invalid when the transport connection becomes disconnected. * Monitor the rewrite_contact's reliable transport REGISTER contact for shutdown. If it is shutdown then the contact must be removed because it is no longer valid. Otherwise, when the client attempts to re-REGISTER it may be blocked because the invalid contact is there. Also if we try to send a call to the endpoint using the invalid contact then the endpoint is not likely to see the request. The endpoint either won't be listening on that port for new connections or a NAT/firewall will block it. * Prune any rewrite_contact's registered reliable transport contacts on boot. The reliable transport no longer exists so the contact is invalid. * Websockets always rewrite the REGISTER contact address and the transport needs to be monitored for shutdown. * Made the websocket transport set a unique name since that is what we use as the ao2 container key. Otherwise, we would not know which transport we find when one of them shuts down. The names are also used for PJPROJECT debug logging. * Made the websocket transport post the PJSIP_TP_STATE_CONNECTED state event. Now the global keep_alive_interval option, initially idle shutdown timer, and the server REGISTER contact monitor can work on wetsocket transports. * Made the websocket transport set the PJSIP_TP_DIR_INCOMING direction. Now initially idle websockets will automatically shutdown. ASTERISK-27147 Change-Id: I397a5e7d18476830f7ffe1726adf9ee6c15964f4
2017-08-10res_pjsip: PJSIP Transport state monitor refactor.Richard Mudgett
The fix for the issue is broken up into three parts. This is part one which refactors the transport state monitor code to allow more modules to be able to monitor transports. * Pull the management of PJPROJECT's transport state callback code from res_pjsip_transport_management.c into res_pjsip. Now other modules can dynamically add and remove themselves from transport monitoring without worrying about breaking PJPROJECT's callback chain. * Add the ability for other modules to get a callback whenever a specific transport is shutdown. ASTERISK-27147 Change-Id: I7d9a31371eb1487c9b7050cf82a9af5180a57912
2017-08-10res_pjsip_transport_management.c: Rename some variables.Richard Mudgett
* Use monitored instead of the misleading keepalive name. Change-Id: I9e5bcbb4ab2b82d49bcd0f06dfe85d15e0b552b6
2017-08-10Merge "res_pjsip_messaging: IPv6 receive address needs brackets" into 13Jenkins2
2017-08-10res_pjsip_messaging: IPv6 receive address needs bracketsScott Griepentrog
When handling an incoming SIP MESSAGE, PJSIP attaches the IP address that the message was received from to the message in the variable PJSIP_RECVADDR. When the IP address is IPv6 the :PORT appended results in an unparseable mess. By using an additional bit flag on the pj_sockaddr_print call, the conventional use of brackets around the address is achieved. ASTERISK-27193 #close Change-Id: I12342521f2ce87a5b6e4883d480a3fd957aa9fd9
2017-08-09Merge "res_rtp_asterisk: enable rtcp & QOS stats on native bridge" into 13Jenkins2
2017-08-09Merge "res_rtp_asterisk: Make P2P bridge Asymmetric codec aware" into 13Joshua Colp
2017-08-07Merge "res_pjsip_session: Release media resources on session end quicker." ↵Jenkins2
into 13
2017-08-07Merge "res_pjsip_nat.c: Remove unnecessary CMP_STOP." into 13Jenkins2
2017-08-07Merge "Support GMIME 3.0" into 13Jenkins2
2017-08-07res_rtp_asterisk: enable rtcp & QOS stats on native bridgeTorrey Searle
Asterisk wasn't generating or forwarding RTCP packets when native bridge was activated. Also the stats weren't available via CHANNEL(qos). Now the RTCP stats are always calculated. ASTERISK-27158 #close Change-Id: I46fb8f61c95e836b9d2dda6054b0cf205c16037b
2017-08-05res_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: I643e431d5c3bf05cda220c1d39e824a505a29b82
2017-08-04Merge "res_pjsip_transport_websocket.c: Fix serializer ref leak." into 13Jenkins2
2017-08-04Support GMIME 3.0Tzafrir Cohen
Support building the Asterisk httpd with version 3.0 of gmime as well as earlier versions of that library. ASTERISK-27173 Change-Id: I7e13dd05a3083ccb0df2dabf83110223f6a9fa8f
2017-08-04Merge "res_pjsip_outbound_registration.c: Misc fixes." into 13Jenkins2
2017-08-04res_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-03res_pjsip_transport_websocket.c: Fix serializer ref leak.Richard Mudgett
Change-Id: Ib5a19bfd597f63d9021baeb645fc11153b3afa57
2017-08-03res_pjsip_outbound_registration.c: Misc fixes.Richard Mudgett
* Remove unnecessary CMP_STOP. * In handle_client_registration() use DEBUG_ATLEAST() to only do work needed for the debug log message when the debug log message is needed. * In sip_outbound_registration_state_destroy() check state->registration for NULL. Change-Id: I656d0fa11dda0b00048103efb1558e67a426fd80
2017-08-03res_pjsip_nat.c: Remove unnecessary CMP_STOP.Richard Mudgett
Change-Id: I6279b0d723bc3b75b8d65e81e02da9ea9bc0c3da
2017-08-03res_pjsip_registrar.c: Remove unnecessary CMP_STOP.Richard Mudgett
Most uses of CMP_STOP are superfluous and are only respected when OBJ_MULTIPLE is used to search the container. Change-Id: I20571a202ec0aa1098bb2749eeba18de7ca110b8
2017-08-01Revert "res_pjsip_session: Release media resources on session end quicker."George Joseph
This reverts commit 98709642d640b490f327d220fdcdea6d45fd65d7. See the 15 branch review. Change-Id: I8476b3cdacaad5157fa36b6247d0e4cdf1e8d5c6
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-01res_pjsip_pidf_eyebeam_body_supplement: Correct status presentationSean Bright
This change fixes PIDF content generation when the underlying device state is considered in use. Previously it was incorrectly marked as closed meaning they were offline/unavailable. The code now correctly marks them as open. Additionally: * Generate an XML element for our activity instead of a using a text node. * Consider every extension state other than "unavailable" to be 'open' status. * Update the XML namespaces and structure to reflect those documented in RFC 4480 * Use 'on-the-phone' (defined in RFC 4880) instead of 'busy' as the "in use" activity. This change results in eyeBeam using the appropriate icon for the watched user. This was tested on eyeBeam 1.5.20.2 build 59030 on Windows. ASTERISK-26659 #close Reported by: Abraham Liebsch patches: ASTERISK-26659.diff submitted by snuffy (license 5024) Change-Id: I6e5ad450f91106029fb30517b8c0ea0c2058c810
2017-08-01res_pjsip: Add support for dnsmgr to external_media_address.Joshua Colp
The "external_media_address" option on transports is now resolved using dnsmgr. This allows it to be automatically refreshed regularly if refreshes are enabled in dnsmgr. If the system is using a dynamic IP address a dynamic DNS hostname can be provided to keep the IP address up to date. Change-Id: Ia54771720dff0105bde55d5bbb81a3ba437e05b2
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-26res_rtp_asterisk: Fix mapping of pjsip's ICE roles to oursSean Bright
Change-Id: Ia578ede1a55b21014581793992a429441903278b
2017-07-25res_stasis_device_state: Unsubscribe should remove old subscriptionsSergej Kasumovic
Case scenario with Applications ARI: * Once you subscribe to deviceState with Applications REST API, it will be added into subscription pool. * When you unsubscribe it will remove from the device_state_subscription hash table but not from the subscription pool. * When you subscribe again, it will add it to pool again. * Now you will have two subscriptions and you will receive same event twice. This fix should now remove deviceState subscription from pool and it should fix unsubscribe on deviceState. ASTERISK-27130 #close Change-Id: I718b70d770a086e39b4ddba4f69a3c616d4476c4
2017-07-17Merge "res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use." ↵Joshua Colp
into 13
2017-07-16res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use.Joshua Colp
This change makes it so that if an RTCP packet is being sent the RTP ICE component is used for sending if RTCP-MUX is in use. ASTERISK-27133 Change-Id: I6200f611ede709602ee9b89501720c29545ed68b
2017-07-14res/res_stasis_snoop: generate silence when audiohook returns nullTorrey Searle
Currently when rtp is paused, no packets are written to the recorded audio file, causing the silence to be skipped and recording not properly time aligned. The read handler as been adapted to return a silence frame of the correct size. ASTERISK-27128 #close Change-Id: I2d7f60650457860b9c70907b14426756b058a844
2017-07-13Merge "res/res_pjsip_t38 ensure t38 requests get rejected quickly" into 13Jenkins2
2017-07-11res_musiconhold: Add kill_escalation_delay, kill_method to classGeorge Joseph
By default, when res_musiconhold reloads or unloads, it sends a HUP signal to custom applications (and all descendants), waits 100ms, then sends a TERM signal, waits 100ms, then finally sends a KILL signal. An application which is interacting with an external device and/or spawns children of its own may not be able to exit cleanly in the default times, expecially if sent a KILL signal, or if it's children are getting signals directly from res_musiconhoild. * To allow extra time, the 'kill_escalation_delay' class option can be used to set the number of milliseconds res_musiconhold waits before escalating kill signals, with the default being the current 100ms. * To control to whom the signals are sent, the "kill_method" class option can be set to "process_group" (the default, existing behavior), which sends signals to the application and its descendants directly, or "process" which sends signals only to the application itself. Change-Id: Iff70a1a9405685a9021a68416830c0db5158603b
2017-07-11Merge "res_pjsip: Fix crash with from_user containing invalid characters." ↵Jenkins2
into 13
2017-07-10res_pjsip: Fix crash with from_user containing invalid characters.Benjamin Keith Ford
If the from_user field contains certain characters (like @, {, ^, etc.), PJSIP will return a null value for the URI when attempting to parse it. This causes a crash when trying to dial out through a trunk that contains these invalid characters in its from_user field. This change checks the configuration and ensures that an endpoint will not be created if the from_user contains an invalid character. It also adds a null check to the PJSIP URI parsing as a backup. ASTERISK-27036 #close Reported by: Maxim Vasilev Change-Id: I0396fdb5080604e0bdf1277464d5c8a85db913d0