【问题标题】:Record telephone calls placed from iOS enterprise apps [closed]记录从 iOS 企业应用程序拨打的电话 [关闭]
【发布时间】:2017-01-11 09:24:10
【问题描述】:

我正在编写一个应用程序,它会记录销售代表拨打的电话并将其发送给经理,以便经理可以密切有效地监控他的销售情况。

所以 - 我希望能够只记录从我的应用程序拨打的电话(也带有免责声明),因为侵犯他们的隐私是不正确的。同时,我需要知道我的员工的表现如何。关于如何实现这一目标的任何想法?

我认为 Apple 不会检查我的应用程序,因为它将是一个企业应用程序(我读过没有针对企业应用程序的 App Store 审查)。虽然我不希望 3rd 方 VoIP 参与其中,但我很想知道如何作为一个选项朝着这个方向前进。在这种情况下,越狱绝对不是一种选择。

【问题讨论】:

    标签: ios objective-c swift audio-recording privacy


    【解决方案1】:

    您说得对,既不是强制性的,也不需要批准。 您必须自己分发应用程序,并且在部署企业应用程序时,不应在组织外部分发应用程序。您的客户还必须使用他们自己的企业证书签署您的应用程序。

    但是 - 让我们回答您的问题:不可能以任何方式访问 iOS 调用 API。 没有测试过Durai的方案,建议使用SQLite store。

    【讨论】:

    • SQLite Store 是由 iOS Call 应用创建的,我们必须阅读它
    • 只有在旧的 iOS 版本中才能使用包含历史记录的 call_history.db 文件。
    • 如果我真的能得到通话记录,那就是一个开始。录音呢?不可能吗?
    • 您指的是来自语音备忘录应用程序的数据吗?
    • @pedrouan - 在较新的版本中使用以下代码检查路径 NSFileManager *fileManager = [NSFileManager defaultManager]; NSDirectoryEnumerator *dirnum = [[NSFileManager defaultManager] enumeratorAtPath: @"/private/"]; NSString *nextItem = [NSString string]; while( (nextItem = [dirnum nextObject])) { if ([[nextItem pathExtension] isEqualToString: @"db"] || [[nextItem pathExtension] isEqualToString: @"sqlitedb"]) { if ([fileManager isReadableFileAtPath:nextItem]) { NSLog(@"%@", nextItem); } } }
    【解决方案2】:

    没有公共 API 可以做到这一点。

    由于您不会在应用商店中发布它,因此您拥有使用私有 API 的优势。

    iPhone 通话记录存储在“call_history.db”中,位于以下路径:

    /private/var/root/Library/CallHistory/call_history.db

    现在我们可以使用 sqlite C API 来提取它。

    现在我们知道了调用历史数据库路径和模式,我们可以看到我们对“调用”表感兴趣。感谢上面的链接,我们知道这张表中究竟存储了什么:

    现在我们应该编写一些代码来访问它。以下代码访问“调用”表并将检索到的值存储在字典数组中。您可以编写自己的类并使用该类的对象数组:

    NSString *callHisoryDatabasePath = @"/private/var/wireless/Library/CallHistory/call_history.db";
    BOOL callHistoryFileExist = FALSE;
    callHistoryFileExist = [fileManager fileExistsAtPath:callHisoryDatabasePath];
    [fileManager release];
    NSMutableArray *callHistory = [[NSMutableArray alloc] init];
    
    if(callHistoryFileExist) {
        if ([fileManager isReadableFileAtPath:callHisoryDatabasePath]) {
            sqlite3 *database;
            if(sqlite3_open([callHisoryDatabasePath UTF8String], &database) == SQLITE_OK) {
                sqlite3_stmt *compiledStatement;
                NSString *sqlStatement = [NSString stringWithString:@"SELECT * FROM call;"];
    
                int errorCode = sqlite3_prepare_v2(database, [sqlStatement UTF8String], -1, 
                                                    &compiledStatement, NULL);
                if( errorCode == SQLITE_OK) {
                    int count = 1;
    
                    while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
                        // Read the data from the result row
                        NSMutableDictionary *callHistoryItem = [[NSMutableDictionary alloc] init];
                        int numberOfColumns = sqlite3_column_count(compiledStatement);
                        NSString *data;
                        NSString *columnName;
    
                        for (int i = 0; i < numberOfColumns; i++) {
                            columnName = [[NSString alloc] initWithUTF8String:
                                        (char *)sqlite3_column_name(compiledStatement, i)];
                            data = [[NSString alloc] initWithUTF8String:
                                    (char *)sqlite3_column_text(compiledStatement, i)];
    
                            [callHistoryItem setObject:data forKey:columnName];
    
                            [columnName release];
                            [data release];
                        }
                        [callHistory addObject:callHistoryItem];
                        [callHistoryItem release];
                        count++;
                    }
                }
                else {
                    NSLog(@"Failed to retrieve table");
                    NSLog(@"Error Code: %d", errorCode);
                }
                sqlite3_finalize(compiledStatement);
            }
        }
    }
    

    Reference

    【讨论】:

      猜你喜欢
      • 2017-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多