Las devoluciones de llamada de SipRegistrationListener no se disparan
Estoy tratando de ejecutar el SIPDemo descargado de aplicaciones de Google Andoid muestra, pero no es capaz de hacerlo funcionar.
El problema al que me enfrento es que después de invocar SipManager.open pasándolo un perfil y una intención pendiente, debería iniciar el proceso de registro con el Proveedor SIP, en mi caso estoy usando una cuenta ya registrada para conectarse. Pero ninguna de las devoluciones de llamada en SipRegistrationListener se disparan. No está seguro de que la aplicación sea capaz de registrarse o no, el clima de la aplicación es capaz de incluso golpear el servidor SIP o no.
- Problema de calidad de voz en Android VoIP app con PJSIP
- Android: Implementación de un programa VoIP
- ¿Cómo funciona SIP en la red celular?
- ¿Hay un api libre de voip para android
- Chat y aplicación VOIP
También tenga en cuenta que estoy pasando null como listner en SipManager.open llamada, pero en la siguiente línea proporcionando el oyente invocando SipManager.setRegistrationListener.
A continuación se muestra el código completo de FullScreenActivity que he modificado un poco después de descargar.
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(); } } /** * Logs you into your SIP provider, registering this device as the location to * send SIP calls to for your SIP address. */ 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); // This listener must be added AFTER mSIPManager.open is called, // Otherwise the methods aren't guaranteed to fire. mSIPManager.setRegistrationListener(mLocalSIPProfile.getUriString(), new SipRegistrationListener() { public void onRegistering(String localProfileUri) { Toast.makeText(CallActivity.this, "Registering with SIP Server...", Toast.LENGTH_SHORT).show(); } public void onRegistrationDone(String localProfileUri, long expiryTime) { Toast.makeText(CallActivity.this, "Ready", Toast.LENGTH_SHORT).show(); } public void onRegistrationFailed(String localProfileUri, int errorCode, String errorMessage) { Toast.makeText(CallActivity.this, "Registration failed. Please check settings.", Toast.LENGTH_SHORT).show(); } }); } catch (ParseException pe) { Toast.makeText(CallActivity.this, "ParseException=" + pe.getMessage(), Toast.LENGTH_SHORT).show(); } catch (SipException se) { Toast.makeText(CallActivity.this, "SIPException=" + se.getMessage(), Toast.LENGTH_SHORT).show(); } } /** * Closes out your local profile, freeing associated objects into memory * and unregistering your device from the server. */ public void closeLocalProfile() { Toast.makeText(CallActivity.this, "Closing Profile", Toast.LENGTH_SHORT).show(); if (mSIPManager == null) { return; } try { if (mLocalSIPProfile != null) { mSIPManager.close(mLocalSIPProfile.getUriString()); } } catch (Exception ee) { Toast.makeText(CallActivity.this, "Exception=" + ee.getMessage(), Toast.LENGTH_SHORT).show(); Log.d(TAG_CALL_ACTIVITY, "Failed to close local profile.", ee); } } }
- Implementación de App-to-App llamando a Android
- Construcción de perfiles Sip: Android
- Flujo de aplicaciones para la conexión peer to peer de Android?
- Sipdroid - Otra llamada entrante no se muestra mientras se continúa
- Cómo enviar y recibir Voice Stream utilizando RTP
- Configuración de cancelación de eco de Speex
- Audífono SIP de Android enEncallEnded demora cuando termina la llamada
- VOIP en bibliotecas de Android o código de ejemplo
- Cómo actualizar sólo valores NOT NULL al escribir datos en Realm
- Para la depuración de Android JNI / NDK bajo Eclipse, ¿por qué se están ignorando mis puntos de interrupción?