过在呼叫上行发送DTMF音 [英] Sending DTMF tones over the uplink in-call

查看:465
本文介绍了过在呼叫上行发送DTMF音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作要求我的应用程序,以便能够在通话过程中发送DTMF音频对语音的上行频率的项目。

I'm working on a project that requires my app to be able to send DTMF tones on the voice's uplink frequency during an active call.

我的2个条件是:

  • 我们不使用定制的Andr​​oid平台
  • 我们并不需要以root的手机

我已经花了好几天做我的功课,我知道,在-调用发送DTMF不支持当前的SDK /标准API。但是,通过使用相关的类 com.android.internal.telephony 我希望模仿如何本地电话应用程序做到这一点。我跟着<一个href="https://devmaze.word$p$pss.com/2011/01/18/using-com-android-internal-part-1-introduction/">this网站如何使用内部API标准的第三方应用。

I've spent several days doing my homework and am aware that in-call DTMF sending is not supported by the current SDK/standard APIs. However, by using the relevant classes in com.android.internal.telephony I am hoping to mimic how the native Phone app does this. I followed this site on how to use internal APIs for standard 3rd party apps.

我也给自己定下了Android操作系统开发环境和我能够在一个模拟器运行在调试模式下的Phone应用图其内部运作。

I've also set myself up with the Android OS dev environment and am able to run the Phone app in debug mode on an emulator to figure its inner workings.

我想尽各种办法对一只股票的标准仿真器,但我得到的错误是:

I tried various ways on a stock standard emulator but the errors I got were:

  1. 在试图安装基于使用android.uid.phone的sharedUserId Phone.apk的源重命名的应用程序,我得到了:

  1. After trying to install a renamed app based on Phone.apk's source using the sharedUserId of android.uid.phone, I got:

安装错误:INSTALL_FAILED_SHARED_USER_INCOMPATIBLE

Installation error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE

毫无疑问,由于这一事实,我没有系统证书上签字。

No doubt due to the fact I don't have the system cert to sign it.

在试图基于相关DTMF音频从Phone.apk源发送code编写自定义应用程序,我得到了下面的错误建立PhoneFactory;

After trying to write a custom app based on the relevant DTMF tone sending code from Phone.apk's source, I get the following error at setting up the PhoneFactory;

java.lang.SecurityException异常:权限被拒绝:不允许发送广播android.provider.Telephony.SPN_STRINGS_UPDATED

java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.provider.Telephony.SPN_STRINGS_UPDATED.

毫无疑问,由于这一事实,我的应用程序没有正确的权限,但AndroidManifest.xml中被设定与相同的权限Phone.apk。

No doubt due to the fact my app doesn't have the right permissions, although AndroidManifest.xml is setup with the same permissions as Phone.apk.

我在茫然,还有什么我可以试试。有没有人有什么建议?

I'm at a loss as to what else I could try. Does anyone have any suggestions?

在此先感谢, 西蒙。

推荐答案

您已经采取了一个有趣的方法,我赞赏你的努力。不幸的是,也有一些保留的内部权限(显然,如 SPN_STRINGS_UPDATED ),您不允许作为一个应用程序开发者,这或多或少打破了这种方式来使用。你可以尝试删除的code导致此领域,但我敢肯定你会遇到阻塞问题。

You've taken an interesting approach, and I commend your efforts. Unfortunately, there are some reserved internal privileges (evidently, such as SPN_STRINGS_UPDATED) that you aren't allowed to use as an app developer, which more or less breaks this approach. You could try removing the area of code causing this, but I'm fairly certain you will run into a blocking problem.

因此​​,这恐怕是不可能的时刻。有在Android 一个打开的功能要求在现有的手机发送DTMF音打电话,但一直处于休眠状态有近两年了。

Hence, I'm afraid this is not possible at the moment. There's an open feature request on Android for sending DTMF tones over an existing phone call, but it has been dormant there for almost two years.

据我所知,这并不能解决您的问题,但要注意,您可以直接拨打号码后发送DTMF音频:

I understand that this doesn't resolve your problem, but take note that you can send DTMF tones directly after dialing a number:

Intent i = new Intent("android.intent.action.CALL",
                      Uri.parse("tel://" + number + "," + dtmfTones));

这篇关于过在呼叫上行发送DTMF音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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