1

transfer call という新しい機能を追加するために CSipSimple を使用しています。この機能には、 call の callID が必要です。

を呼び出すと、次の関数が呼び出されることがわかりました。

public void placeCallWithOption(Bundle b) {
        if (service == null) {
            return;
        }
        String toCall = "";
        Long accountToUse = SipProfile.INVALID_ID;
        // Find account to use
        SipProfile acc = accountChooserButton.getSelectedAccount();
        if(acc == null) {
            return;
        }

        accountToUse = acc.id;
        // Find number to dial
        toCall = digits.getText().toString();
        if(isDigit) {
            toCall = PhoneNumberUtils.stripSeparators(toCall);
        }

        if(accountChooserFilterItem != null && accountChooserFilterItem.isChecked()) {
            toCall = rewriteNumber(toCall);
        }

        if (TextUtils.isEmpty(toCall)) {
            return;
        }

        // Well we have now the fields, clear theses fields
        digits.getText().clear();

        // -- MAKE THE CALL --//
        if (accountToUse >= 0) {
            // It is a SIP account, try to call service for that
            try {
                service.makeCallWithOptions(toCall, accountToUse.intValue(), b);
              //  service.xfer(callId,"01628105601");
            } catch (RemoteException e) {
                Log.e(THIS_FILE, "Service can't be called to make the call");
            }
        } else if (accountToUse != SipProfile.INVALID_ID) {
            // It's an external account, find correct external account
            CallHandlerPlugin ch = new CallHandlerPlugin(getActivity());
            ch.loadFrom(accountToUse, toCall, new OnLoadListener() {
                @Override
                public void onLoad(CallHandlerPlugin ch) {
                    placePluginCall(ch);
                }
            });
        }
    }

しかし、これから、呼び出しの callId を取得できません。各通話の callId を取得するにはどうすればよいですか? どんなアドバイスもとても役に立ちます。

4

1 に答える 1

0

SipCallSession を使用して通話 ID をフェッチする

SipCallSession callInfo = new SipCallSession();
callinfo.getCallid();
于 2019-04-23T11:44:50.203 に答える