gpt4 book ai didi

android - 需要帮助才能在第 3 方 VOIP 应用程序中使用 native IN-CALL 屏幕

转载 作者:太空狗 更新时间:2023-10-29 15:17:20 25 4
gpt4 key购买 nike

我正在开发一个 VoIP 应用。

My app registers to a SIP based back-end server using a User-ID and password.
Once the registration is successful, the user can make sip calls through this app.
If the user uses the native phone dialer to dial out a number, My app intercepts the call and places the call through SIP.
Once the call is intercepted, the native phone dialer goes to background and my app's 'call status' screen is displayed(my app comes to foreground).

我的要求如下:

一旦通话被拦截,我们需要显示 native 拨号器(默认电话拨号器)“通话状态”/“通话进度”屏幕(如三星手机的三星 Touchwiz,HTC 的 HTC Sense),而不是显示我的应用程序的用户界面电话等),但调用应通过我的应用程序(SIP)进行。我们的应用程序应控制 native 拨号器“通话状态”屏幕的所有功能。

例如:如果用户在 native 拨号器的“通话状态”屏幕上点击“通话结束”按钮,我的应用程序应该结束通话。同样, native 拨号器“调用状态”屏幕上的所有控件都应将控制权移交给我的应用程序以采取必要的操作。

请告诉我是否有可能实现这一点以及如何实现。

*public void onReceive(final Context context, Intent intent) {
final String intentAction = intent.getAction();
if (intentAction.equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
SharedPreferences getPrefs = PreferenceManager
.getDefaultSharedPreferences(context);
boolean bool_CustomFlag = getPrefs.getBoolean(
"use_custom_dialer_preference", true);
if (bool_CustomFlag == true) {
setResultData(null);
final String strPhoneNum = intent*
.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
(new Thread() {
public void run() {
try {
Intent intent = new Intent(Intent.ACTION_CALL,Uri.fromParts("my_data_scheme",
Uri.decode(strPhoneNum),null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);

} catch (Exception e) {
e.printStackTrace();
}
}
}).start();

}}*

我已经为我的呼出 Activity 创建了我自己的数据方案,以便 brodcastreciver 可以收听 Action_outgoing_call 并在通过 native 拨号器调用电话时启动我的呼出 Activity 。

*<activity
android:name=".OutgoingCallActivity"
android:screenOrientation="portrait">
<intent-filter >
<action android:name="android.intent.action.CALL" />
<category android:name= "android.intent.category.DEFAULT" />
<data android:scheme = "sip" />
<data android:scheme="my_data_scheme" />
</intent-filter>
</activity>*`

最佳答案

抱歉,Android 没有任何 API 可以使用内置调用状态屏幕执行您想要执行的操作。

唯一记录在案的方法是调出您自己的通话状态屏幕。许多 SIP 应用程序模拟内置的 android 通话状态屏幕,因此看起来都一样。

关于android - 需要帮助才能在第 3 方 VOIP 应用程序中使用 native IN-CALL 屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11624779/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com