1

我正在使用 CSipSimple 添加一个新功能,即 transfer call 。对于此功能,我需要 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 回答