USSD Blocks and Call Blocks

66 views
Skip to first unread message

A

unread,
Jul 6, 2026, 3:02:35 AMJul 6
to Automate for Android
Dear Henrik,

Regarding USSD Blocks and Call Blocks:

1) Are they based on the Android's Telephony's API functions?

2) For USSD Blocks, is it using the Android's Telephony API function of the Call Dialler to dial the USSD code and call out?

3) Difference between USSD Blocks and Call Blocks is the return of the USSD status return is only available in USSD Blocks, whereas there is no USSD status return in the Call Blocks?

4) If there are failures, how to tell the failures are from Android's Telephony's side or from Telco's side?

5) Are failures always due to Telco's side (except for flight mode which arises due to no connections - i.e. connection off at the phone)?

6) Error from USSD and Call Blocks are only ""java.io.IOException: Request failed""? Or there are other types of errors for USSD and Call Blocks?

7) As such, error like "java.io.IOException: Request failed" arises due to the failure from the Telco side? Or due to Android's Telephony API's side?

Thanks.

A
 

Henrik "The Developer" Lindqvist

unread,
Jul 6, 2026, 2:05:30 PMJul 6
to Automate for Android
  1. The USSD request block is. The Call number block is just an intent that starts the "dialer" app.
  2. See #1
  3. Yes, that's correct.
  4. Sadly, not possible, since the Android API has no (official) specific error codes for it. 
  5. See #4
  6. Yes, for the USSD request block there's also "java.lang.IllegalStateException: Telephony service unavailable", and just in case of an undocumented failure "java.lang.RuntimeException: Unknown error: <number>"
  7. See #4

мJ ZЖУ

unread,
Jul 8, 2026, 8:57:45 AMJul 8
to Automate for Android
USSD failure if you try to call it too fast maybe add some delay while USSD menu load.

A

unread,
Jul 9, 2026, 10:19:33 AMJul 9
to Automate for Android
Thanks Henrik.

Does that mean  ""java.io.IOException: Request failed"" refers to failure due to Telco's end; and "java.lang.IllegalStateException: Telephony service unavailable" refers to failure due to Android Telephony's end?
If otherwise, what does these 2 errors refer to / mean?

Thus far had never encountered this   "java.lang.IllegalStateException: Telephony service unavailable" error before, even for flight mode being turned on.

A

unread,
Jul 9, 2026, 10:24:41 AMJul 9
to Automate for Android
Thanks  мJ ZЖУ.

Yes, did use delay block before which Henrik advised too. Thanks :)

Was trying to see if there is a way to differentiate the failure is due to what issues.

Henrik "The Developer" Lindqvist

unread,
Jul 9, 2026, 10:35:54 AMJul 9
to Automate for Android
As said, it's not really possible to tell. "Service unavailable" is probably a local issue, see Android documentation.

A

unread,
Aug 11, 2026, 3:07:07 AM (2 days ago) Aug 11
to Automate for Android
Hi Henrik,

Thanks for your earlier reply.

Would Automate be able to enhance the USSD Block to return the raw error codes (-1 vs -2) in addition to IOException?
This would make it easier to search logs and distinguish Android vs. telco issues.

Based on Android documentation:
- USSD_ERROR_SERVICE_UNAVAIL → -2: Telephony service unavailable (Android Telephony issue).
- USSD_RETURN_FAILURE → -1: Mobile network failed to complete USSD request (Telco issue).

Having these codes exposed would help users know whether to escalate to the telco or treat it as a handset/Android problem, and allow flows to handle retries more intelligently.

Separately, has anyone encountered the anomaly where a USSD Block call forwarding status check error return took more than half an hour (I once saw ~23 hours)?
From my experience, manual CF status checks respond within 1–3 minutes at most for failed USSD, so this seems abnormal and likely tied to Android Telephony handling rather than the telco.

Appreciate any insights or confirmation from others.

Thanks.

A

мj Zк*у

unread,
Aug 11, 2026, 8:32:10 AM (2 days ago) Aug 11
to Automate for Android
I think the issue is overload too many 5g users in your area.

This cause simple USSD command that should take in seconds took some minutes to wait.

You could also use Cell pick block and use call command on which cell/tower is not overloaded.

Henrik "The Developer" Lindqvist

unread,
Aug 11, 2026, 9:34:23 AM (2 days ago) Aug 11
to Automate for Android
Use the Failure catch block to handle the failure, its Failure type output should tell which error it is.
Reply all
Reply to author
Forward
0 new messages