简体   繁体   English

使用本机android sip库没有音频

[英]No audio using native android sip library

So I'm using the native sip library, and I can connect and register with the server just fine. 因此,我正在使用本机sip库,可以很好地连接并向服务器注册。 And when I make the call, it hits a proxy that routes it to a regular phone call, then calls the number inputed. 当我拨打电话时,它会命中一个代理,将其路由到常规电话,然后呼叫输入的号码。 It will connect fine, and the phone on the other end receives the call, but there is no audio. 它将正常连接,另一端的电话可以接听电话,但没有音频。 I know the proxy can handle audio because there is an iPhone app hitting the same server and it connects just fine. 我知道代理服务器可以处理音频,因为有一个iPhone应用程序命中了同一台服务器,并且连接正常。

Here's my code for making the call : 这是我拨打电话的代码:

public void makeCall(String s) {

    SipAudioCall.Listener listener = new SipAudioCall.Listener() {

        @Override
        public void onCallEstablished(SipAudioCall call) {


                Log.d(TAG, "Call Established");
                call.startAudio();

                //I've tried with speaker mode on and off
                call.setSpeakerMode(true);


        }

        @Override
        public void onCallEnded(SipAudioCall call) {

            Log.d(TAG, "Call Ended");

        }
    };

    if (sipManager != null && sipProfile != null) {
        try {
            Log.d(TAG, "Make call");
            sipManager.makeAudioCall(sipProfile.getUriString(), app.sipToUri(s, sipProfile.getProxyAddress()), listener, 30);
        } catch (SipException e) {
            e.printStackTrace();
        }
    }

}

In my manifest I have 我的清单上有

<uses-permission android:name="android.permission.USE_SIP"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<uses-feature android:name="android.hardware.sip.voip" android:required="true" />
<uses-feature android:name="android.hardware.wifi" android:required="true" />
<uses-feature android:name="android.hardware.microphone" android:required="true" />

And I'm using a sip enabled tablet as well as a sip enabled note 2 to test. 我正在使用启用Sip的平板电脑和启用Sip的Note 2进行测试。

This maybe unnecessary 这可能是不必要的

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

SIP related 与SIP相关

<uses-permission android:name="android.permission.CONFIGURE_SIP" />
<uses-feature android:name="android.software.sip" android:required="true" />
<uses-feature android:name="android.software.sip.voip" android:required="true" />

This you need if you use speaker 使用扬声器时需要

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM