termux / termux-api-package

Termux package containing scripts to call functionality in Termux:API.
MIT License
989 stars 311 forks source link

termux-telephony-call not working. #19

Open jmerinoWork opened 6 years ago

jmerinoWork commented 6 years ago

Hi,

Im trying to perform a call from termux to a phone number, i did install termux-api-package in termux terminal, and then installed termux api from the app store (add on for termux), when i execute termux-telephony-call [phone number] in termux terminal, no feedback is provided, command seems to keep working but the other phone did not receive call.

package termux-api 0.28 installed (stable) in termux.

Grimler91 commented 6 years ago

Termux-telephony-call opens your default phone-call app and makes a call so termux should open another app if it works.

Which android version are you on?

jmerinoWork commented 6 years ago

Im in version 5.1, kernel version 3.10...

im searching my phone info, in sim state says "phone number: unknown", ¿maybe that is the problem? i can make calls with it without problems, in service state says "in service"

ghost commented 5 years ago

im searching my phone info, in sim state says "phone number: unknown"

This is bug of some SIM cards. On my device even system information shows that number unknown, however on different SIM card it is shown correctly.

khansaad1275 commented 1 year ago

I am having the same issue, after executing the command i am getting nothing.

Device Info : OS: Android 13 aarch64 Host: google Pixel 4 XL Kernel: 4.14.276

Please give any leads to solve this issue

evorion commented 1 year ago

I am also having issues starting a call using termux-telephony-call via sshd but only prior to opening the Termux activity. My setup is such that on boot, termux-boot will start sshd. I am then able to login via ssh after around a minute of settling. But, after I login via ssh if I try termux-telephony-call XXXXXXX it just returns a 0 and the phone call is not initiated. If I then start the Termux activity and after that try the same termux-telephony-call XXXXXXXX via ssh now it will work both via ssh and directly in the Termux activity. These are the access denied messages that occur after termux-telephony-call via ssh prior to opening the Termux activity:

06-14 12:51:12.867 14892 14892 W bash : type=1400 audit(0.0:5204): avc: granted { execute } for name="termux-telephony-call" dev="dm-14" ino=237638 scontext=u:r:untrusted_app_27:s0:c177,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c177,c257,c512,c768 tclass=file app=com.termux.api 06-14 12:51:12.871 14892 14892 W bash : type=1400 audit(0.0:5205): avc: granted { execute } for name="termux-telephony-call" dev="dm-14" ino=237638 scontext=u:r:untrusted_app_27:s0:c177,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c177,c257,c512,c768 tclass=file app=com.termux.api 06-14 12:51:12.871 14892 14892 W bash : type=1400 audit(0.0:5206): avc: granted { execute_no_trans } for path="/data/data/com.termux/files/usr/bin/termux-telephony-call" dev="dm-14" ino=237638 scontext=u:r:untrusted_app_27:s0:c177,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c177,c257,c512,c768 tclass=file app=com.termux.api 06-14 12:51:12.871 14892 14892 W bash : type=1400 audit(0.0:5207): avc: granted { execute } for name="dash" dev="dm-14" ino=211224 scontext=u:r:untrusted_app_27:s0:c177,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c177,c257,c512,c768 tclass=file app=com.termux.api 06-14 12:51:12.871 14892 14892 W termux-telephon: type=1400 audit(0.0:5208): avc: granted { execute } for path="/data/data/com.termux/files/usr/bin/dash" dev="dm-14" ino=211224 scontext=u:r:untrusted_app_27:s0:c177,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c177,c257,c512,c768 tclass=file app=com.termux.api 06-14 12:51:13.034 14894 14894 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 10433 <<<<<< 06-14 12:51:13.038 14894 14894 E libc : Access denied finding property "persist.device_config.runtime_native_boot.profilebootclasspath" 06-14 12:51:13.038 14894 14894 E libc : Access denied finding property "persist.device_config.runtime_native_boot.enable_apex_image" 06-14 12:51:13.038 14894 14894 I AndroidRuntime: Using default boot image 06-14 12:51:13.038 14894 14894 E libc : Access denied finding property "persist.device_config.runtime_native_boot.disable_lock_profiling" 06-14 12:51:13.038 14894 14894 I AndroidRuntime: Leaving lock profiling enabled 06-14 12:51:13.038 14894 14894 E libc : Access denied finding property "persist.device_config.runtime_native_boot.enable_generational_cc" 06-14 12:51:13.136 14894 14894 D app_process: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat 06-14 12:51:13.136 14894 14894 D app_process: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt66l.dat 06-14 12:51:13.169 14894 14894 W app_process: JNI RegisterNativeMethods: attempt to register 0 native methods for android.media.AudioAttributes 06-14 12:51:13.177 14894 14894 D AndroidRuntime: Calling main entry com.termux.termuxam.Am 06-14 12:51:13.217 14894 14894 D AndroidRuntime: Shutting down VM

agnostic-apollo commented 1 year ago

ACTION_CALL -> Note: there will be restrictions on which applications can initiate a call; most applications should use the ACTION_DIAL

Android doesn't list which restrictions apply there, but I am assuming a service started from background isn't allowed to do it. Similar restrictions exist for microphone/camera. It won't be denied by SeLinux but by a framework component, there should be other log entries that you need to look for. You can also start termux activity via ssh with am start -n com.termux/.app.TermuxActivity after granting termux Draw over apps permissions, once started, you can start the call and hopefully it should work.

Would be good for termux to add ACTION_DIAL support in future, which shouldn't have this restriction, technically can be done with am command though.

https://developer.android.com/reference/android/content/Intent#ACTION_CALL

https://developer.android.com/reference/android/content/Intent#ACTION_DIAL

https://developer.android.com/reference/android/Manifest.permission#CALL_PHONE

https://developer.android.com/about/versions/11/privacy/foreground-services

https://github.com/termux/termux-api/blob/d2f205113e55b344980bceff8f061e873f996d27/app/src/main/java/com/termux/api/TermuxApiReceiver.java#L220

https://github.com/termux/termux-api/blob/d2f205113e55b344980bceff8f061e873f996d27/app/src/main/java/com/termux/api/apis/TelephonyAPI.java#L399