Android SipDemo传出呼叫

Android SipDemo传出呼叫,android,sip,sipdroid,csip-simple,Android,Sip,Sipdroid,Csip Simple,我完全参与了SipDemo应用程序。我正在进行Sip呼叫,呼叫已完成。我能听到声音,但其他人听不到我的声音 这是我的注册码:- public void initializeLocalProfile() { if (manager == null) { return; } if (me != null) { closeLocalProfile(); } //sipcallid // username and pass

我完全参与了SipDemo应用程序。我正在进行Sip呼叫,呼叫已完成。我能听到声音,但其他人听不到我的声音

这是我的注册码:-

 public void initializeLocalProfile() {
    if (manager == null) {
        return;
    }
    if (me != null) {
        closeLocalProfile();
    }

    //sipcallid
   // username and password should be same
 //   sipAddress = "101@217.xx.xxx.xxx";
    String domain =  sipAddress.substring(sipAddress.indexOf('@')+1);
    String username = sipAddress.substring(0,sipAddress.indexOf('@'));
    Toast.makeText(outcall.this, "domain = "+domain+" username "+username, Toast.LENGTH_LONG).show();

    try {
        SipProfile.Builder builder = new SipProfile.Builder(username, domain);
        builder.setPassword("123456");
        builder.setOutboundProxy(domain);
        builder.setDisplayName(username);
        builder.setAuthUserName(username);
        //builder.setDisplayName(username);
       // builder.setAutoRegistration(true);
       // builder.setSendKeepAlive(true);

        me = builder.build();

        manager.setRegistrationListener(me.getUriString(), new SipRegistrationListener() {
                public void onRegistering(String localProfileUri) {
                   updateStatus("Registering with SIP Server...");
                }

                public void onRegistrationDone(String localProfileUri, long expiryTime) {
                    updateStatus("Ready");
                }

                public void onRegistrationFailed(String localProfileUri, int errorCode,
                        String errorMessage) {
                    updateStatus("Registration failed.  Please check settings.");
                }
            });
    } catch (SipException se) {
        updateStatus("Connection error.");
    } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
这是我的电话:-

    // sipcallid = "rahul22@sip2sip.info";
    updateStatus(sipcallid);

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

            @Override
            public void onCallEstablished(SipAudioCall call) {
                call.startAudio();
                //call.setSpeakerMode(true);
                call.toggleMute();
                updateStatus1("on call established");

            }
            @Override
            public void onCallEnded(SipAudioCall call) {
                updateStatus1("on call end");
                 finish();
            }



        };

        call = manager.makeAudioCall(me.getUriString(), sipcallid, listener, 30);

        updateStatus1(""+call.getState());
    }
    catch (Exception e) {
        Toast.makeText(outcall.this, "Error when trying to close manager"+ e.getMessage(), Toast.LENGTH_LONG).show();

        if (me != null) {
            try {
                manager.close(me.getUriString());
            } catch (Exception ee) {
                Toast.makeText(outcall.this, "ee"+ e.getMessage(), Toast.LENGTH_LONG).show();
                ee.printStackTrace();
            }
        }
        if (call != null) {
            call.close();
        }
    }
}
请除外。我能听到别人的声音,但别人听不到我的声音


请帮帮我!。谢谢你的时间安排。

我看到你打电话给call.toggleMute()

可能是你把麦克风静音了吗?SipDemo应用程序有一个按钮,用于取消麦克风静音

public boolean onTouch(View v, MotionEvent event) {
    if (call == null) {
        return false;
    } else if (event.getAction() == MotionEvent.ACTION_DOWN && call != null && call.isMuted()) {
        call.toggleMute();
    } else if (event.getAction() == MotionEvent.ACTION_UP && !call.isMuted()) {
        call.toggleMute();
    }
    return false;
}

也许您只是在启动呼叫时将麦克风静音,但从不取消静音?

当您的IP地址通常是NAT地址时,它会升高。Android默认不支持NAT。为了支持NAT,您将使用其他外部库,如CSipSimple。

嘿,我使用相同的代码,但没有连接到sip服务器。你找到解决办法了吗?请与我联系。