Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e4d1514
add subscribe logging for 403s
Jan 10, 2018
f95aa18
add 500 error logs
Jan 12, 2018
6036f26
c_str doh
Jan 12, 2018
d14c2fa
Merge pull request #2075 from Metaswitch/500logs
br1-msw Jan 12, 2018
2ee20ee
Merge remote-tracking branch 'origin/master' into apple_scrumble
rkday-pro Jan 16, 2018
3106297
Use apple_scrumble branch of cpp-common
rkday-pro Jan 16, 2018
b80a027
Use apple_scrumble branch of cpp-common
rkday-pro Jan 17, 2018
7e9c346
Use apple_scrumble branch of cpp-common
rkday-pro Jan 17, 2018
99dcc8e
fix @file headings
Jan 18, 2018
0c825ef
Use apple_scrumble branch of cpp-common
rkday-pro Jan 18, 2018
74cb92c
Warn on overload
rkday-pro Jan 18, 2018
1f0caa1
WIP: load from /etc/clearwater/dns.json
rkday-pro Jan 23, 2018
4394185
Bring dns.json changes into apple_scrumble branch
rkday-pro Jan 24, 2018
0a768a0
:x
Jan 24, 2018
e9474ec
Load records from /etc/clearwater/dns.json
rkday-pro Jan 23, 2018
7313e43
fix up file comment
Jan 25, 2018
c1c0ff3
raise logging for 504s from sprout to error status
Jan 25, 2018
0ea6e73
set all errors we've seen into dummy values
Jan 25, 2018
2f0b2ad
Merge remote-tracking branch 'origin/master' into apple_scrumble
RobDover Jan 25, 2018
90a2cd4
Improve distinction between error codes
rkday-pro Jan 25, 2018
581f054
Take latest cpp-common
rkday-pro Jan 25, 2018
1a2ef2f
Take latest cpp-common
rkday-pro Jan 25, 2018
3e72b5b
Merge remote-tracking branch 'origin/dns_json_reload2' into apple_scr…
rkday-pro Jan 26, 2018
17cd8be
SAS log on high post-dial delay
rkday-pro Feb 5, 2018
20c175d
Downgrade log triggered by valid RPH header
rkday-pro Feb 5, 2018
e46fd2a
Update cpp-common
rkday-pro Feb 5, 2018
5200661
Log out observed call setup time
rkday-pro Feb 5, 2018
7a1eda2
Update cpp-common
rkday-pro Feb 6, 2018
66b140e
Update cpp-common
rkday-pro Feb 6, 2018
37df15f
Update cpp-common
rkday-pro Feb 6, 2018
4cee034
Increasing memcached timeout
RobDover Feb 13, 2018
66906c0
Taking the correct cpp-common branch
RobDover Feb 13, 2018
bca08a0
Revert "Improve distinction between error codes"
BennettAllen1 Feb 13, 2018
74e9145
Revert "set all errors we've seen into dummy values"
BennettAllen1 Feb 13, 2018
a298402
Error code changes
BennettAllen1 Feb 14, 2018
e31f106
Logging lvl changes
BennettAllen1 Feb 14, 2018
2a8c8eb
Merge remote-tracking branch 'origin/master' into apple_scrumble_merge
BennettAllen1 Feb 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/scscfsproutlet.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class SCSCFSproutlet : public Sproutlet
/// @param tsx_start_time_usec - The time the request was received.
/// @param video_call - True if INVITE was for a video session,
/// false otherwise.
void track_session_setup_time(uint64_t tsx_start_time_usec, bool video_call);
uint64_t track_session_setup_time(uint64_t tsx_start_time_usec, bool video_call);

/// Translate RequestURI using ENUM service if appropriate.
///
Expand Down
1 change: 1 addition & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SPROUT_COMMON_SOURCES := logger.cpp \
stack.cpp \
dnsparser.cpp \
dnscachedresolver.cpp \
static_dns_cache.cpp \
baseresolver.cpp \
sipresolver.cpp \
bono.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/authenticationsproutlet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ void AuthenticationSproutletTsx::create_challenge(pjsip_digest_credential* crede
// We've failed to store the nonce in memcached, so we have no hope of
// successfully authenticating any repsonse to a 401 Unauthorized. Send
// a 500 Server Internal Error instead.
TRC_DEBUG("Failed to store nonce in memcached");
TRC_DEBUG("Failed to store nonce in memcached, for impi %s", impi.c_str());
rsp->line.status.code = PJSIP_SC_INTERNAL_SERVER_ERROR;
rsp->line.status.reason = *pjsip_get_status_text(PJSIP_SC_INTERNAL_SERVER_ERROR);

Expand Down
2 changes: 1 addition & 1 deletion src/compositesproutlet.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file compositesproutlet.h
* @file compositesproutlet.cpp
*
* Copyright (C) Metaswitch Networks 2017
* If license terms are provided to you in a COPYING file in the root directory
Expand Down
2 changes: 1 addition & 1 deletion src/dnsresolver.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file enumservice.cpp class implementation for an ENUM service provider
* @file dnsresolver.cpp class implementation for a DNS resolver
*
* Copyright (C) Metaswitch Networks 2015
* If license terms are provided to you in a COPYING file in the root directory
Expand Down
2 changes: 1 addition & 1 deletion src/enumservice.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file dnsresolver.cpp class implementation for a DNS resolver
* @file enumservice.cpp class implementation for an ENUM service provider
*
* Copyright (C) Metaswitch Networks 2017
* If license terms are provided to you in a COPYING file in the root directory
Expand Down
1 change: 1 addition & 0 deletions src/icscfsproutlet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ void ICSCFSproutletRegTsx::on_rx_response(pjsip_msg* rsp, int fork_id)
// capabilitires, or the HSS is temporarily unavailable). There was at
// least one valid S-CSCF (as this is retry processing). The I-CSCF
// must return 504 (TS 24.229, 5.3.1.3) in this case.
TRC_ERROR("I-CSCF can't select an S-CSCF for REGISTER request");
rsp->line.status.code = PJSIP_SC_SERVER_TIMEOUT;
rsp->line.status.reason =
*pjsip_get_status_text(rsp->line.status.code);
Expand Down
12 changes: 11 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ extern "C" {
#include "sprout_alarmdefinition.h"
#include "sproutlet_options.h"
#include "astaire_impistore.h"
#include "updater.h"

enum OptionTypes
{
Expand Down Expand Up @@ -2033,7 +2034,15 @@ int main(int argc, char* argv[])
hc);

// Create a DNS resolver and a SIP specific resolver.
dns_resolver = new DnsCachedResolver(opt.dns_servers, opt.dns_timeout);
dns_resolver = new DnsCachedResolver(opt.dns_servers,
opt.dns_timeout,
"/etc/clearwater/dns.json");

// Reload dns.json on SIGHUP
Updater<void, DnsCachedResolver>* dns_updater =
new Updater<void, DnsCachedResolver>(dns_resolver,
std::mem_fun(&DnsCachedResolver::reload_static_records));

if (opt.pcscf_enabled)
{
sip_resolver = new SIPResolver(dns_resolver, opt.sip_blacklist_duration, 0);
Expand Down Expand Up @@ -2595,6 +2604,7 @@ int main(int argc, char* argv[])
delete enum_service;
delete scscf_acr_factory;

delete dns_updater;
delete sip_resolver;
delete http_resolver;
delete astaire_resolver;
Expand Down
6 changes: 3 additions & 3 deletions src/rphservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ SIPEventPriorityLevel RPHService::lookup_priority(std::string rph_value,
// We received a message with an unknown RPH value. This could be because:
// - It is not defined in the IANA namespace.
// - It is not assigned a priority value in the rph.json file.
TRC_WARNING("An unknown RPH value \"%s\" was received on an incoming message."
" This message will be handled, but will not be prioritized.",
rph_value.c_str());
TRC_DEBUG("An unknown RPH value \"%s\" was received on an incoming message."
" This message will be handled, but will not be prioritized.",
rph_value.c_str());
SAS::Event event(trail, SASEvent::RPH_VALUE_UNKNOWN, 0);
event.add_var_param(rph_value);
SAS::report_event(event);
Expand Down
17 changes: 14 additions & 3 deletions src/scscfsproutlet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void SCSCFSproutlet::track_app_serv_comm_success(const std::string& uri,
}
}

void SCSCFSproutlet::track_session_setup_time(uint64_t tsx_start_time_usec,
uint64_t SCSCFSproutlet::track_session_setup_time(uint64_t tsx_start_time_usec,
bool video_call)
{
// Calculate how long it has taken to setup the session.
Expand All @@ -357,6 +357,8 @@ void SCSCFSproutlet::track_session_setup_time(uint64_t tsx_start_time_usec,
{
_audio_session_setup_time_tbl->accumulate(ringing_usec);
}

return ringing_usec;
}

SCSCFSproutletTsx::SCSCFSproutletTsx(SCSCFSproutlet* scscf,
Expand Down Expand Up @@ -858,7 +860,15 @@ void SCSCFSproutletTsx::on_tx_response(pjsip_msg* rsp)
((st_code == PJSIP_SC_RINGING) ||
PJSIP_IS_STATUS_IN_CLASS(st_code, 200)))
{
_scscf->track_session_setup_time(_tsx_start_time_usec, _video_call);
uint64_t setup_time = _scscf->track_session_setup_time(_tsx_start_time_usec, _video_call);
if (setup_time > 2000000)
{
pjsip_cid_hdr* cid = PJSIP_MSG_CID_HDR(rsp);
TRC_VERBOSE("Call setup time exceeded 2 seconds for Call-ID %.*s (was %lu us)",
cid->id.slen,
cid->id.ptr,
setup_time);
}
_record_session_setup_time = false;
}
}
Expand Down Expand Up @@ -1115,6 +1125,7 @@ pjsip_status_code SCSCFSproutletTsx::determine_served_user(pjsip_msg* req)
if ((http_code == HTTP_SERVER_UNAVAILABLE) || (http_code == HTTP_GATEWAY_TIMEOUT))
{
// Send a SIP 504 response if we got a 500/503 HTTP response.
TRC_VERBOSE("AS retargeting failed to lookup IFCs for served user");
status_code = PJSIP_SC_SERVER_TIMEOUT;
}
else
Expand Down Expand Up @@ -1228,7 +1239,7 @@ pjsip_status_code SCSCFSproutletTsx::determine_served_user(pjsip_msg* req)
}
else
{
TRC_DEBUG("Failed to retrieve ServiceProfile for %s", served_user.c_str());
TRC_VERBOSE("Failed to retrieve ServiceProfile for %s", served_user.c_str());

if ((http_code == HTTP_SERVER_UNAVAILABLE) || (http_code == HTTP_GATEWAY_TIMEOUT))
{
Expand Down
2 changes: 1 addition & 1 deletion src/thread_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static void reject_rx_msg_overload(pjsip_rx_data* rdata, SAS::TrailId trail)
{
// Respond statelessly with a 503 Service Unavailable, including a
// Retry-After header with a zero length timeout.
TRC_DEBUG("Rejected request due to overload");
TRC_VERBOSE("Rejected request due to overload");

SAS::Marker start_marker(trail, MARKER_ID_START, 1u);
SAS::report_marker(start_marker);
Expand Down