Dispose the notification on call end

This commit is contained in:
Yann Diorcet 2013-01-17 10:22:44 +01:00
parent 672c14f34e
commit 1da32bd0c4
3 changed files with 19 additions and 3 deletions

View file

@ -297,6 +297,7 @@ static BuschJaegerMainView* mainViewInstance=nil;
case LinphoneCallError:
case LinphoneCallEnd:
{
[self dismissIncomingCall:call];
if ((linphone_core_get_calls([LinphoneManager getLc]) == NULL)) {
[navigationController popToViewController:welcomeView animated:FALSE]; // No animation... Come back when Apple have learned how to create a good framework
}
@ -308,6 +309,16 @@ static BuschJaegerMainView* mainViewInstance=nil;
}
}
- (void)dismissIncomingCall:(LinphoneCall*)call {
LinphoneCallAppData* appData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call);
if(appData != nil && appData->notification != nil) {
// cancel local notif if needed
[[UIApplication sharedApplication] cancelLocalNotification:appData->notification];
[appData->notification release];
}
}
- (void)displayIncomingCall:(LinphoneCall *)call {
if (![[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
|| [UIApplication sharedApplication].applicationState == UIApplicationStateActive) {

View file

@ -152,7 +152,7 @@ typedef struct _LinphoneManagerSounds {
- (void)acceptCall:(LinphoneCall *)call;
- (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer;
- (void)reloadSounds;
- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key;
- (NSString*)lpConfigStringForKey:(NSString*)key;
- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key forSection:(NSString*)section;

View file

@ -1614,7 +1614,12 @@ static void audioRouteChangeListenerCallback (
[currentSettings release];
currentSettings = newSettings;
[currentSettings retain];
[self reloadSounds];
return YES;
}
- (void)reloadSounds {
/* Configure sounds */
if(sounds.call) {
AudioServicesDisposeSystemSoundID(sounds.call);
@ -1641,7 +1646,7 @@ static void audioRouteChangeListenerCallback (
}
}
return YES;
}
// no proxy configured alert