如何检查,如果拨打的号码占线或无人接听? [英] How to check if the dialed number is busy or is not answered?

查看:251
本文介绍了如何检查,如果拨打的号码占线或无人接听?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用了如下因素code要拨打的号码:

I have used the folowing code to dial a number:

                    DataBaseHelper db;
                db=new DataBaseHelper(PanicService.this);
                try {

                    db.createDataBase();

                    } catch (IOException ioe) {

                    throw new Error("Unable to create database");

                    }

                Map<String, String > map= db.TelephoneList();
                String[] numbers = new String[]{"number1","number2","number3","number4","number5"};


                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:"+map.get(numbers[0])));
                callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(callIntent);

这是工作的罚款。
现在我需要知道,如果拨打的号码占线或无人接听,而且它是拨号列表中的下一个号码。我只是想知道是否有反正检测通话的状态?

which is working fine. Now I need to know if the dialled number is busy or is unanswered, and it it is dial the next number in the list. I am just wondering if there is anyway to detect the state of the call?

我已经检查这个URL http://developer.android.com/reference /android/telephony/TelephonyManager.html 但我不能找到解决这个概念除了CALL_STATE_OFFHOOK这是不是真的我想要的东西。

I have checked this URL http://developer.android.com/reference/android/telephony/TelephonyManager.html but I can't find anything around that concept apart from CALL_STATE_OFFHOOK which is not really what I want.

我将不胜AP preciate如果有人能指点我这一点。

I would greatly appreciate if anyone can advice me on that.

提前非常感谢。

任何评论是AP preciated。

Any comment is appreciated.

推荐答案

您不能确定在移动网络上的传出呼叫是否有人接听,因为这些信息不是由移动网络提供的手机,即使它是,Android不提供一种方式来接收它。

You cannot determine whether an outgoing call on the mobile network was answered, because this information isn't provided to the handset by the mobile network, and even if it was, Android does not provide a way to receive it.

虽然这是可以确定的外出Internet(SIP)呼叫是否有人接听,Android不目前(果冻豆)的提供这样的一种方式,我可以快速查看源$ C ​​$找到角

While it's possible to determine whether an outgoing Internet (SIP) call was answered, Android doesn't currently (as of Jelly Bean) provide a way of doing this that I can find from a quick look at the source code.

这篇关于如何检查,如果拨打的号码占线或无人接听?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆