I am trying to run SIPDemo, a sample application downloaded from Google Andoid, but could not start it.
The problem that I am facing is that after I call SipManager.open, passing it the profile and waiting for the intent, it should start the registration process with the SIP provider, in my case I will use an already registered account to connect. But not one of the callbacks in the SipRegistrationListener starts. Incorrect weather that the application can register or not, the weather can even hit the SIP server or not.
Also note that I pass null as a listner in a call to SipManager.open, but on the next line providing a listener by calling SipManager.setRegistrationListener.
Below is the full FullScreenActivity code, which I changed a bit after loading.
public class CallActivity extends AppCompatActivity { private static final String INTENT_INCOMING_CALL = "android.SipDemo.INCOMING_CALL"; private static final String TAG_CALL_ACTIVITY = "CallActivity"; public String sipAddress = "yyyyyyyyyyy"; public SipManager mSIPManager; public SipProfile mLocalSIPProfile; public SipAudioCall mSIPAudioCall; public IncomingCallReceiver mCallReceiver; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_call); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.hide(); } IntentFilter filter = new IntentFilter(); filter.addAction(INTENT_INCOMING_CALL); mCallReceiver = new IncomingCallReceiver(); this.registerReceiver(mCallReceiver, filter); initSIPManager(); } public void initSIPManager() { if (mSIPManager == null) { mSIPManager = SipManager.newInstance(this); } if (mSIPManager != null) { Toast.makeText(this, "Created SIPManager Instance", Toast.LENGTH_SHORT).show(); initLocalProfile(); } } public void initLocalProfile() { if (mSIPManager == null) { return; } if (mLocalSIPProfile != null) { closeLocalProfile(); } String username = "xxxxxx"; String password = "xxxxxxxxxx"; String domain = "getonsip.com"; try { SipProfile.Builder builder = new SipProfile.Builder(username, domain); builder.setPassword(password); builder.setAuthUserName("xxxxxxxxxxxx"); builder.setDisplayName("xxxxxxx"); builder.setOutboundProxy("sip.onsip.com"); builder.setPort(5080); mLocalSIPProfile = builder.build(); Intent i = new Intent(); i.setAction(INTENT_INCOMING_CALL); PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, Intent.FILL_IN_DATA); mSIPManager.open(mLocalSIPProfile, pi, null);
android voip sip
Amit
source share