2

私は 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();
        }
    }
}

除外してください。相手の声は聞こえるが、自分の声は相手に聞こえない。

私を助けてください!。タイミングをありがとう。

4

2 に答える 2

0

通常、IPアドレスがNATアドレスの場合に発生します。Android はデフォルトで NAT をサポートしていません。NAT をサポートするには、CSipSimple などの他の外部ライブラリを使用します。

于 2014-03-18T09:09:14.773 に答える