简体   繁体   中英

Using Native SIP Dialer while making SIP call from Application

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!!!!!

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> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM