Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion Messaging/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2310,9 +2310,9 @@
foreach (var uid in recentAndUnanswered)
{
var message = await inbox.GetMessageAsync(uid);
var fromNumberStart = message.Subject.IndexOf("from 1");

Check warning on line 2313 in Messaging/Program.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 2313 in Messaging/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 2313 in Messaging/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.
var toNumberStart = message.Subject.IndexOf("to 1");
var justTheText = message.TextBody.Split(Environment.NewLine);

Check warning on line 2315 in Messaging/Program.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 2315 in Messaging/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 2315 in Messaging/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.
emails.Add(new InboundEmail(message.Subject, justTheText.FirstOrDefault() ?? message.TextBody, message.Subject.Substring(toNumberStart + 3, 11), message.Subject.Substring(fromNumberStart + 5, 11)));
_ = await inbox.StoreAsync(uid, new StoreFlagsRequest(StoreAction.Add, MessageFlags.Seen) { Silent = true }, cls);
}
Expand Down Expand Up @@ -2605,7 +2605,6 @@
public string PostgresqlProd { get; set; } = string.Empty;
public string BulkVSUsername { get; set; } = string.Empty;
public string BulkVSPassword { get; set; } = string.Empty;
public string TeleAPI { get; set; } = string.Empty;
public string PComNetUsername { get; set; } = string.Empty;
public string PComNetPassword { get; set; } = string.Empty;
public string PComNetIncomingToken { get; set; } = string.Empty;
Expand Down
1 change: 0 additions & 1 deletion Messaging/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"PostgresqlProd": "",
"BulkVSUsername": "",
"BulkVSPassword": "",
"TeleAPI": "",
"PComNetUsername": "",
"PComNetPassword": "",
"PComNetIncomingToken": "",
Expand Down
2 changes: 0 additions & 2 deletions NumberSearch.DataAccess/Models/PhoneNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public enum IngestProvider
BulkVS,
TeliMessage,
FirstPointCom,
Peerless,
Call48,
IntegrationTest
}

Expand Down
2 changes: 1 addition & 1 deletion NumberSearch.Mvc/Controllers/SearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SearchController(MvcConfiguration mvcConfiguration) : Controller
private readonly MvcConfiguration _configuration = mvcConfiguration;

/// <summary>
/// This is the default route in this app. It's a search page that allows you to query the TeleAPI for phone numbers.
/// This is the default route in this app. It's a search page that allows you to query for available phone numbers.
/// </summary>
/// <param name="query"> A complete or partial phone number. </param>
/// <param name="city"></param>
Expand Down
8 changes: 0 additions & 8 deletions NumberSearch.Mvc/Models/MvcConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
{
public class MvcConfiguration
{
public string TeleAPI { get; set; } = string.Empty;
public string CallFlow { get; set; } = string.Empty;
public string ChannelGroup { get; set; } = string.Empty;
public string PComNetUsername { get; set; } = string.Empty;
public string PComNetPassword { get; set; } = string.Empty;
public string BulkVSAPIKEY { get; set; } = string.Empty;
Expand All @@ -17,19 +14,14 @@ public class MvcConfiguration
public string SmtpPassword { get; set; } = string.Empty;
public string MicrosoftClientId { get; set; } = string.Empty;
public string MicrosoftClientSecret { get; set; } = string.Empty;
public string PeerlessAPIKey { get; set; } = string.Empty;
public string InvoiceNinjaToken { get; set; } = string.Empty;
public string Data247Username { get; set; } = string.Empty;
public string Data247Password { get; set; } = string.Empty;
public string EmailOrders { get; set; } = string.Empty;
public string EmailDan { get; set; } = string.Empty;
public string EmailTom { get; set; } = string.Empty;
public string EmailSupport { get; set; } = string.Empty;
public string AzureStorageAccount { get; set; } = string.Empty;
public string TeleDynamicsUsername { get; set; } = string.Empty;
public string TeleDynamicsPassword { get; set; } = string.Empty;
public string Call48Username { get; set; } = string.Empty;
public string Call48Password { get; set; } = string.Empty;
public string CallWithUsAPIKEY { get; set; } = string.Empty;
public string FusionPBXUsername { get; set; } = string.Empty;
public string FusionPBXPassword { get; set; } = string.Empty;
Expand Down
1 change: 0 additions & 1 deletion NumberSearch.Mvc/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
}
},
"ConnectionStrings": {
"TeleAPI": "",
"PComNetUsername": "",
"PComNetPassword": "",
"BulkVSAPIKEY": "",
Expand Down
8 changes: 0 additions & 8 deletions NumberSearch.Mvc/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"ConnectionStrings": {
"TeleAPI": "",
"CallFlow": "",
"ChannelGroup": "",
"PComNetUsername": "",
"PComNetPassword": "",
"PComNetIncomingToken": "",
Expand All @@ -18,19 +15,14 @@
"SmtpPassword": "",
"MicrosoftClientId": "",
"MicrosoftClientSecret": "",
"PeerlessAPIKey": "",
"InvoiceNinjaToken": "",
"Data247Username": "",
"Data247Password": "",
"EmailOrders": "",
"EmailDan": "",
"EmailTom": "",
"EmailSupport": "",
"AzureStorageAccount": "",
"TeleDynamicsUsername": "",
"TeleDynamicsPassword": "",
"Call48Username": "",
"Call48Password": "",
"CallWithUsAPIKEY": "",
"MessagingAPISecret": "",
"OpsUsername": "",
Expand Down
2 changes: 1 addition & 1 deletion NumberSearch.Ops/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public async Task<IActionResult> Ingests(int cycle, string ingestedFrom, string
}

/// <summary>
/// This is the default route in this app. It's a search page that allows you to query the TeleAPI for phone numbers.
/// This is the default route in this app. It's a search page that allows you to query for available phone numbers.
/// </summary>
/// <param name="query"> A complete or partial phone number. </param>
/// <returns> A view of nothing, or the result of the query. </returns>
Expand Down
6 changes: 0 additions & 6 deletions NumberSearch.Ops/Models/OpsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
{
public class OpsConfig
{
public string TeleAPI { get; set; } = string.Empty;
public string CallFlow { get; set; } = string.Empty;
public string ChannelGroup { get; set; } = string.Empty;
public string PComNetUsername { get; set; } = string.Empty;
public string PComNetPassword { get; set; } = string.Empty;
public string BulkVSAPIKEY { get; set; } = string.Empty;
Expand All @@ -17,10 +14,7 @@ public class OpsConfig
public string SmtpPassword { get; set; } = string.Empty;
public string MicrosoftClientId { get; set; } = string.Empty;
public string MicrosoftClientSecret { get; set; } = string.Empty;
public string PeerlessAPIKey { get; set; } = string.Empty;
public string InvoiceNinjaToken { get; set; } = string.Empty;
public string Data247Username { get; set; } = string.Empty;
public string Data247Password { get; set; } = string.Empty;
public string EmailOrders { get; set; } = string.Empty;
public string EmailDan { get; set; } = string.Empty;
public string EmailTom { get; set; } = string.Empty;
Expand Down
1 change: 0 additions & 1 deletion NumberSearch.Ops/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
}
},
"ConnectionStrings": {
"TeleAPI": "",
"PComNetUsername": "",
"PComNetPassword": "",
"BulkVSAPIKEY": "",
Expand Down
6 changes: 0 additions & 6 deletions NumberSearch.Ops/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
}
},
"ConnectionStrings": {
"TeleAPI": "",
"CallFlow": "",
"ChannelGroup": "",
"PComNetUsername": "",
"PComNetPassword": "",
"BulkVSAPIKEY": "",
Expand All @@ -22,10 +19,7 @@
"SmtpPassword": "",
"MicrosoftClientId": "",
"MicrosoftClientSecret": "",
"PeerlessAPIKey": "",
"InvoiceNinjaToken": "",
"Data247Username": "",
"Data247Password": "",
"EmailOrders": "",
"EmailDan": "",
"EmailTom": "",
Expand Down
3 changes: 0 additions & 3 deletions NumberSearch.Tests/Functional.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace NumberSearch.Tests
{
public class Functional : IClassFixture<WebApplicationFactory<Startup>>
{
//private readonly Guid token;
//private readonly ITestOutputHelper output;
//private readonly IConfiguration configuration;
protected readonly HttpClient _client;
Expand All @@ -27,8 +26,6 @@ public class Functional : IClassFixture<WebApplicationFactory<Startup>>

// configuration = config;

// token = Guid.Parse(config.GetConnectionString("TeleAPI"));

// _client = factory.CreateClient();
//}

Expand Down
29 changes: 1 addition & 28 deletions NumberSearch.Tests/Ingest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ namespace NumberSearch.Tests
{
public class FunctionalIngest
{
private readonly Guid token;
private readonly ITestOutputHelper output;
private readonly Credentials pComNetCredentials;
private readonly string bulkVSKey;
private readonly string bulkVSSecret;
private readonly string bulkVSUsername;
private readonly string bulkVSPassword;
private readonly string postgresql;
private readonly string peerlessAPIKey;
private readonly string invoiceNinjaToken;
private readonly string call48Username;
private readonly string call48Password;
private readonly IConfiguration configuration;
private readonly IngestConfiguration ingestConfiguration;

Expand All @@ -50,12 +46,8 @@ public FunctionalIngest(ITestOutputHelper output)
bulkVSSecret = config.GetConnectionString("BulkVSAPISecret");
bulkVSUsername = config.GetConnectionString("BulkVSUsername");
bulkVSPassword = config.GetConnectionString("BulkVSPassword");
token = Guid.Parse(config.GetConnectionString("TeleAPI"));
postgresql = config.GetConnectionString("PostgresqlProd");
peerlessAPIKey = config.GetConnectionString("PeerlessAPIKey");
invoiceNinjaToken = config.GetConnectionString("InvoiceNinjaToken");
call48Username = config.GetConnectionString("Call48Username");
call48Password = config.GetConnectionString("Call48Password");

var appConfig = new IngestConfiguration
{
Expand Down Expand Up @@ -200,32 +192,13 @@ public void CategorizeNumbers()
// //Assert
// }

// This test is slow too.
//[Fact]
//public async Task OwnedTeleMessage()
//{
// // Arrange

// // Act
// var results = await Owned.TeleMessageAsync(token).ConfigureAwait(false);

// // Assert
// Assert.NotNull(results);
// output.WriteLine(results.Count().ToString());
//}

//[Fact]
//public async Task UpdateBulkVSPortRequestStatusesAsync()
//{
// // Update the statuses of all the active port requests with BulkVS.
// await PortRequests.UpdateStatusesBulkVSAsync(configuration);
//}

//[Fact]
//public async Task Call48Get360Test()
//{
// // Update the statuses of all the active port requests with BulkVS.
// _ = await Provider.Call48Async(call48Username,call48Password, PhoneNumbersNA.AreaCode.States.ToArray().Where(x => x.State == "Oregon" || x.State == "Washington").ToArray(), postgresql);
//}

}
}
128 changes: 0 additions & 128 deletions NumberSearch.Tests/Integration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ public Integration(ITestOutputHelper output)
invoiceNinjaToken = config.GetConnectionString("InvoiceNinjaToken");
_teleDynamicsUsername = config.GetConnectionString("TeleDynamicsUsername");
_teleDynamicsPassword = config.GetConnectionString("TeleDynamicsPassword");
//_call48Username = config.GetConnectionString("Call48Username");
//_call48Password = config.GetConnectionString("Call48Password");
//_callWithUsAPIkey = config.GetConnectionString("CallWithUsAPIKEY");
//_peerlessApiKey = config.GetConnectionString("PeerlessAPIKey");
}

// Takes 6 seconds to run
Expand Down Expand Up @@ -563,21 +560,6 @@ public async Task CreateAndUpdateBillingClientByIdAsync()
// //output.WriteLine(JsonSerializer.Serialize(result));
//}

// We are no longer using data 24/7 for cnam lookups.
//[Fact]
//public async Task LIDBLookupAsync()
//{
// // Arrange
// string phoneNumber = "14257808879";

// // Act
// var result = await LIDBLookup.GetAsync(phoneNumber, _data247username, _data247password);

// // Assert
// Assert.NotNull(result);
// output.WriteLine(JsonSerializer.Serialize(result));
//}

[Fact]
public async Task RateCenterLookupAsync()
{
Expand Down Expand Up @@ -993,116 +975,6 @@ public async Task BulkVSRESTGetPortRequestsAsync()
output.WriteLine(JsonSerializer.Serialize(result));
}

//[Fact]
//public async Task Call48LoginTestAsync()
//{
// // Act
// var result = await Login.LoginAsync(_call48Username, _call48Password);

// Assert.NotNull(result);
// Assert.NotNull(result.data.token);
// Assert.True(result.code == 200);
// output.WriteLine(JsonSerializer.Serialize(result));
//}

//[Fact]
//public async Task Call48LocalNumberLookupTestAsync()
//{
// // Act
// var result = await Login.LoginAsync(_call48Username, _call48Password);

// var results = await Search.GetLocalNumbersAsync("WA", string.Empty, "206", string.Empty, result.data.token);

// if (results is null || !results.data.result.Any())
// {
// results = await Search.GetLocalNumbersAsync("WA", string.Empty, "425", string.Empty, result.data.token);
// }

// Assert.NotEmpty(results.data.result);
// output.WriteLine(results.data.result.Length.ToString());
// foreach (var number in results.data.result)
// {
// Assert.False(string.IsNullOrWhiteSpace(number.number));
// Assert.True(number.state == "WA");
// Assert.False(string.IsNullOrWhiteSpace(number.ratecenter));
// output.WriteLine(JsonSerializer.Serialize(number));
// }

//}

//[Fact]
//public async Task Call48GetNumbersTestAsync()
//{
// // Act
// var cred = await Login.LoginAsync(_call48Username, _call48Password);

// var results = await Search.GetAsync("OR", 541, cred.data.token);

// if (results is null || !results.Any())
// {
// results = await Search.GetAsync("WA", 425, cred.data.token);
// }

// Assert.NotEmpty(results);
// output.WriteLine(results.Count().ToString());
// foreach (var result in results)
// {
// Assert.True(result.NPA > 99);
// Assert.True(result.NXX > 99);
// // XXXX can be 0001 which as an int is 1.
// Assert.True(result.XXXX > 0);
// Assert.False(string.IsNullOrWhiteSpace(result.DialedNumber));
// // Reenabled these after June 2020 starts.
// //Assert.False(string.IsNullOrWhiteSpace(result.City));
// //Assert.False(string.IsNullOrWhiteSpace(result.State));
// Assert.False(string.IsNullOrWhiteSpace(result.IngestedFrom));
// output.WriteLine(JsonSerializer.Serialize(result));
// }
//}

//[Fact]
//public async Task Call48GetRatecentersTestAsync()
//{
// // Act
// var cred = await Login.LoginAsync(_call48Username, _call48Password);

// var results = await Ratecenter.GetAllRatecentersAsync(PhoneNumbersNA.AreaCode.States.ToArray(), cred.data.token);

// Assert.NotEmpty(results);
// output.WriteLine(results.Length.ToString());
// foreach (var result in results)
// {
// Assert.NotEmpty(result.Ratecenters);
// output.WriteLine(JsonSerializer.Serialize(result));
// }

//}

// Disabled so as not to purchase a bunch of numbers by accident.
//[Fact]
//public async Task Call48PurchaseLocalNumberTestAsync()
//{
// // Act
// var cred = await Login.LoginAsync(_call48Username, _call48Password);

// var results = await Search.GetAsync("WA", 206, cred.data.token);

// Assert.NotEmpty(results);
// output.WriteLine(results.Count().ToString());
// var number = results.FirstOrDefault();

// var checkExist = await Search.GetLocalNumbersAsync(string.Empty, number.State, number.NPA.ToString(), number.NXX.ToString(), cred.data.token);

// var numberToPurchase = checkExist.data.result.Where(x => x.did.Replace("-", string.Empty) == number.DialedNumber).FirstOrDefault();
// output.WriteLine(JsonSerializer.Serialize(numberToPurchase));

// var purchaseOrder = await Purchase.PurchasePhoneNumberAsync(checkExist.data.loc, numberToPurchase, cred.data.token);
// output.WriteLine(JsonSerializer.Serialize(purchaseOrder));

// Assert.NotNull(purchaseOrder);
// Assert.True(purchaseOrder.code == 200);
//}

[Fact]
public async Task GetCarrierByOCNAsync()
{
Expand Down
Loading
Loading