在 VOIP 电话呼叫状态栏上显示连接模式

Show connecting mode on VOIPPhoneCall status bar

我正在 windows phone 10 上实施 VoIP 应用程序,我正在使用 VoipPhoneCall。

当用户拨打电话并将应用程序带入后台时,会显示 VoipPhoneCall,我希望状态栏中的连接模式正确显示,连接模式为拨号时应为 "Dialing",并且当连接模式连接时,它应该是持续时间。这是Viber的VoipPhoneCall状态栏,我也想做。

请帮助我,谢谢

I want connecting mode in that status bar is showed correctly, when connecting mode is dialing it should be "Dialing", and when connecting mode is connected, it should be duration time

重点是,我们不需要调用 VoipPhoneCall.NotifyCallActive method after using VoipCallCoordinator.RequestNewOutgoingCall method

我使用了官方的VoIP示例来解释。

查看 VoipTasks 项目中的 VccCallHelper.cs 文件。

请注意NewOutgoingCall方法(LINK):

VoipPhoneCall call = vCC.RequestNewOutgoingCall( context, contactName, serviceName, VoipPhoneCallMedia.Audio);
if (call != null)
{
                call.EndRequested += Call_EndRequested;
                call.HoldRequested += Call_HoldRequested;
                call.RejectRequested += Call_RejectRequested;
                call.ResumeRequested += Call_ResumeRequested;

                call.NotifyCallActive();//Here!!

                Current.VoipCall = call;

                Current.StartAudio();

                status = true;
}

如果我们调用VoipPhoneCall.NotifyCallActive方法,状态栏会显示活跃的定时器。所以只要注释掉这一行,通知就会在AnswerRequested方法中发送,见NewIncomingCall方法->Call_AnswerRequested