Skip to content

Commit

Permalink
Added option to block calls not to registered username. Twarts phishi…
Browse files Browse the repository at this point in the history
…ng attempts.
  • Loading branch information
Chris Hiszpanski committed Apr 1, 2012
1 parent 4d36936 commit 601fb85
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 494 deletions.
10 changes: 10 additions & 0 deletions Classes/AccountController.m
Expand Up @@ -891,6 +891,16 @@ - (void)SIPAccountDidReceiveCall:(AKSIPCall *)aCall {
}
}

NSLog(@"user = %@, username = %@", [[aCall localURI] user], [[aCall account] username]);
if ([[NSUserDefaults standardUserDefaults] boolForKey:kBlockPhishingAttempts]) {
NSLog(@"checking username...");
// Check if "To: " sip field equals username on the account, dump call if no
if (![[[aCall localURI] user] isEqualToString:[[aCall account] username]]) {
NSLog(@"blocked!");
return;
}
}

[[NSApp delegate] pauseITunes];

CallController *aCallController
Expand Down
1 change: 1 addition & 0 deletions Classes/AppController.m
Expand Up @@ -289,6 +289,7 @@ + (void)initialize {
[defaultsDict setObject:[NSNumber numberWithBool:NO]
forKey:kAutoCloseMissedCallWindow];
[defaultsDict setObject:[NSNumber numberWithBool:YES] forKey:kCallWaiting];
[defaultsDict setObject:[NSNumber numberWithBool:YES] forKey:kBlockPhishingAttempts];

NSString *preferredLocalization
= [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
Expand Down
1 change: 1 addition & 0 deletions Classes/PreferencesController.h
Expand Up @@ -66,6 +66,7 @@ extern NSString * const kPauseITunes;
extern NSString * const kAutoCloseCallWindow;
extern NSString * const kAutoCloseMissedCallWindow;
extern NSString * const kCallWaiting;
extern NSString * const kBlockPhishingAttempts;
//
// Account keys
extern NSString * const kDescription;
Expand Down
1 change: 1 addition & 0 deletions Classes/PreferencesController.m
Expand Up @@ -65,6 +65,7 @@
NSString * const kAutoCloseCallWindow = @"AutoCloseCallWindow";
NSString * const kAutoCloseMissedCallWindow = @"AutoCloseMissedCallWindow";
NSString * const kCallWaiting = @"CallWaiting";
NSString * const kBlockPhishingAttempts = @"BlockPhishingAttempts";

NSString * const kDescription = @"Description";
NSString * const kFullName = @"FullName";
Expand Down

0 comments on commit 601fb85

Please sign in to comment.