我完全参与了 SipDemo 应用程序。我正在拨打 Sip 电话,它完成了。我可以听到声音,但其他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();
}
}
}
请除外。我能听到别人的声音,但别人听不到我的声音。
请帮我!。谢谢你的时间。