简体   繁体   English

有没有办法检测来自Android的收费电话?

[英]Is there a way to detect incoming toll calls from Android?

Well, I'm gonna try to explain what's my problem. 好吧,我将尝试解释我的问题。 Here in Brazil we can make a normal call and the recieving person will pay for it. 在巴西,我们可以拨打普通电话,接待人员将为此付费。 I mean, A calls to B, then if B picks the phone, then he pays and not the one who called to him. 我的意思是,A打电话给B,然后如果B接了电话,那么他付钱,而不是给他打电话的人。
When A calls to B in this way he must prefix a number before the B's real number. 当A以这种方式呼叫B时,他必须在B的实数之前加一个数字。 I mean, if B's phone number is 55555555, then A needs to call him like this: 909055555555. 我的意思是,如果B的电话号码是55555555,那么A需要像这样打给他:909055555555。

When i check it in incoming calls, it appears only as normal number of A without any information about it. 当我在拨入电话中对其进行检查时,它仅显示为正常的A号,而没有有关它的任何信息。 Does anyone know how to detect this kind of call? 有人知道如何检测这种呼叫吗?

Try this link 试试这个连结

http://www.krvarma.com/2010/08/detecting-incoming-and-outgoing-calls-in-android/ http://www.krvarma.com/2010/08/detecting-incoming-and-outgoing-calls-in-android/

Essentially, you register for the android.intent.action.PHONE_STATE intent and check for the extra on the intent for EXTRA_INCOMING_NUMBER to get who is dialing you. 本质上,您注册了android.intent.action.PHONE_STATE意图,并检查EXTRA_INCOMING_NUMBER意图的其他内容,以了解谁在拨打您的电话。 (your java code and then look at the number and do any decision making.) (您的Java代码,然后查看编号并进行任何决策。)

The link notes that 该链接指出

TelephonyManager.EXTRA_INCOMING_NUMBER. TelephonyManager。EXTRA_INCOMING_NUMBER。 This variable contains the incoming phone number. 此变量包含传入的电话号码。 Note that this variable will not be present when the state is not TelephonyManager.EXTRA_STATE_RINGING. 请注意,当状态不是TelephonyManager.EXTRA_STATE_RINGING时,此变量将不存在。

I assume that the user need to pick up the call for your application detect the number, which may be a deal-braker for you. 我假设用户需要接听电话,以便您的应用程序检测到该号码,这可能对您来说是个麻烦。

UPDATE 更新

I understand your question better now. 现在,我对您的问题有了更好的了解。 It seems like the transformation to the real number from 9090* number is done by your cellular operator. 似乎是由您的移动运营商完成了从9090 *数字到实数的转换。 I don't think you have a way to detect it, because your phone doesn't see a difference between the two calls. 我认为您没有办法检测到它,因为您的手机在两次通话之间看不到任何区别。 It sees them as the same caller. 它认为他们是同一个呼叫者。 You may have a better answer if you talk to your cellular operator. 如果您与移动运营商交谈,则可能会有更好的答案。

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

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