3

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).

私の要件は次のとおりです。

通話が傍受されたら、アプリのUIを表示する代わりに、ネイティブダイアラー(デフォルトの電話ダイアーラー)の「通話ステータス」/「通話の進行状況」画面を表示する必要があります(Samsung電話用のSamsungのTouchwiz、HTC電話用のHTC Senseなど) 、しかし、呼び出しは私のアプリ(SIP)を経由する必要があります。私たちのアプリは、ネイティブダイヤラの「通話ステータス」画面のすべての機能を制御する必要があります。

例:ユーザーがネイティブダイヤラの[通話ステータス]画面で[通話終了]ボタンをタップした場合、アプリは通話を終了する必要があります。同様に、ネイティブダイヤラの[通話ステータス]画面のすべてのコントロールは、必要なアクションを実行するためにコントロールをアプリに引き継ぐ必要があります。

これを達成できるかどうか、および実装方法を教えてください。

*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();

}} *

brodcastreciverがAction_outgoing_callをリッスンし、ネイティブダイヤラを介して発信されたときに発信コールアクティビティを起動できるように、発信コールアクティビティ用に独自のデータスキームを作成しました。

*<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>*`
4

1 に答える 1