2017-01-17 15 views
0

音につながる:手渡しは私が私のVoIPアプリでCallKitを実施し、すべての罰金1つのシナリオを除いてきた損失

VoIPコールが電話とユーザーを中断した場合を「エンドを選択& Answer "電話が終了し、VoIPコールは応答されますが、数秒後に音が失われます。

この動作は、携帯電話の通話が保留にされたか、VoIP通話が

(でも他のVoIPアプリから)別のVoIP通話を中断する場合は、一時停止し、通話を再開するために必要な音を復元する際に発生しません。 。

誰でもこの問題を再現しているのですか、アイデアがありますか?

ありがとうございます!

答えて

0

応答コール時...コールメディア状態を有効にする必要がある場合は、wheatherがオーディオセッションの有効化を有効にしているかどうかを確認します。

- (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action { 

    NSLog(@"Provider perform Answer Call Action"); 

    // Retrieve the instance corresponding to the action's call UUID 
    SIPCall *call = [_callManager callWithUUID:action.callUUID]; 
    if (!call) { 
     [action fail]; 
     return; 
    } 

    /* 
    Configure the audio session, but do not start call audio here, since it must be done once 
    the audio session has been activated by the system after having its priority elevated. 
    */ 
    [[AudioManager sharedManager] configureAudioSession]; 

    // Trigger the call to be answered via the underlying network service. 
    [call answer]; 

    // Signal to the system that the action has been successfully performed. 
    [action fulfill]; 
} 

また、エンドコールメソッドを確認します。

- (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *)action { 
    NSLog(@"Provider perform End Call Action"); 
    // Retrieve the Voifinity PBX instance corresponding to the action's call UUID 
    SIPCall *call = [_callManager callWithUUID:action.callUUID]; 
    if (!call) { 
     [action fail]; 
     return; 
    } 

    // Stop call audio whenever ending the call. 
    //[[AudioManager sharedManager] disableSoundDevices]; 

    // Trigger the call to be ended via the underlying network service. 
    [call hangUp]; 

    // Signal to the system that the action has been successfully performed. 
    [action fulfill]; 

    // Remove the ended call from the app's list of calls. 
    [_callManager removeCall:call]; 

}

もアクティブにオーディオセッションを確認するか、無効化するかどうかを追加します。 オーディオの呼び出しは、オーディオセッションのアクティブ化後にのみアクティブにする必要があります。 以下のオーディオセッションのトラッキングに代理人を追加します。

//セッション

- (void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession { 
    NSLog(@"Received: %s",__FUNCTION__); 
} 

//セッションに

- (void)provider:(CXProvider *)provider didDeactivateAudioSession:(AVAudioSession *)audioSession { 
NSLog(@"Received: %s",__FUNCTION__); 
} 
を無効に有効に
関連する問題