iOS 6+ interruption handling

 //init interruption handler
 AVAudioSession* session = [AVAudioSession sharedInstance];
 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(InterruptionHandler:) name:AVAudioSessionInterruptionNotification object:session];



- (void) InterruptionHandler: (NSNotification*) notification
{
    NSUInteger type = [[notification.userInfo objectForKey:@"AVAudioSessionInterruptionTypeKey"] unsignedIntegerValue];
     switch(type)
    {
        case AVAudioSessionInterruptionTypeBegan:
            printf_console("-> AVAudioSessionInterruptionTypeBegan()\n");
            break;
        case AVAudioSessionInterruptionTypeEnded:
        {
            printf_console("-> AVAudioSessionInterruptionTypeEnded()\n");
            break;
        }
    }
}