Using Native SIP Dialer while making SIP call from Application
Pergunta
I am developing android application for SIP. I am successful in making SIP Stack using Jain -sip-stack but for making call, i want to integrate my application with Native SIP dialer for making calls. which is default and also available in android phones. Is is possible to use native dialer to make sip calls through native SIP Dialer.
Any help would be appreciated..
Thanks!!!!!
Solução
Yes, You can use native dialer to make sip calls.
For that you need to add one BroadcastReceiver
class...like below...
public class Dialer extends BroadcastReceiver
{
@Override
public void onReceive(Context context, final Intent intent) {
if (intent.getAction().equals("android.intent.action.NEW_OUTGOING_CALL")) {
String phoneNumber = intent.getExtras().getString( "android.intent.extra.PHONE_NUMBER");
// Call some function from here to make SIP Call using this phoneNumber.
// Use this "phoneNumber" to your sip application & setResultData null.
setResultData(null);
}
}
You need to add <intent-filter>
to your AndroidManifest.xml
<receiver android:name=".Dialer" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow