简体   繁体   English

从应用程序进行SIP呼叫时使用本机SIP拨号程序

[英]Using Native SIP Dialer while making SIP call from Application

I am developing android application for SIP. 我正在为SIP开发android应用程序。 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. 我成功使用Jain -sip-stack制作了SIP Stack,但为了进行通话,我想将我的应用程序与Native SIP拨号程序集成以便进行通话。 which is default and also available in android phones. 这是默认设置,在Android手机中也可用。 Is is possible to use native dialer to make sip calls through native SIP Dialer. 可以使用本机拨号程序通过本机SIP拨号程序进行Sip呼叫。

Any help would be appreciated.. 任何帮助,将不胜感激..

Thanks!!!!! 谢谢!!!!!

Yes, You can use native dialer to make sip calls. 是的,您可以使用本机拨号器进行Sip呼叫。

For that you need to add one BroadcastReceiver class...like below... 为此,您需要添加一个BroadcastReceiver类...如下所示...

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 您需要将<intent-filter>添加到您的AndroidManifest.xml

<receiver android:name=".Dialer" android:enabled="true">
        <intent-filter>
            <action   android:name="android.intent.action.NEW_OUTGOING_CALL" />
        </intent-filter>
 </receiver> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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