Android Question Forward a call on Android (B4A)

Valentino.b

Member
Hi all
I would like to create an APP to forward an incoming call.
F.e., after working-hours, if the call coming from a specific number or a list of numbers or a prefix, then I need to forward the call to another number.

B4X:
Dim PE As PhoneEvents

Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
Log("Status is " & State & ".")

  If State = "RINGING" Then
    If IncomingNumber = "++443219876543" and DateTime.Date(DateTime.now) > cTimeStopWork Then
   
    ------>FORWARD

    End If
  End If
End Sub

With this cose I'm able to intercept the call and the caller.
But how can I forward the call to another mobile (or not mobile) number?


I not want for forward ALL incoming calls (using *21** code)
 

MikeSW17

Active Member
Licensed User
Longtime User
Wild Idea :eek: Absolutely no idea if it can be done....o_O

Might it be possible to invoke the "forward ALL incoming calls (using *21** code)" function, WHILE an (the one you want to divert) incoming call (before answering) is in progress?
Whether you could, and if the provider would accept and act on it is another matter! Worth an experiment maybe.
 
Upvote 0

MikeSW17

Active Member
Licensed User
Longtime User
@MikeSW17 I tried while the phone was ringing but it doesn't seem to have any effect

Initially I guessed it probably wouldn't work as the call is already 'established' with the phone.
But on thinking a bit more, I believe there a 'forward if NOT answered' (sub-)option? (maybe only provider specific).
This would require the ability to 'take back' the call by the provider for re-route?
I'm not too up on the *21** code but maybe some variant might work? :rolleyes:
 
Upvote 0

MikeSW17

Active Member
Licensed User
Longtime User
Ok, My provider offers 4 forwarding options: (a) Always Forward; (b) Forward when busy; (c) Forward when Unanswered; (d) Forward when Unreachable.
What happens if you set Forward when Unreachable and when the wanted incoming call arrives, turn on Flight Mode (briefly) to become Unavailable?
 
Last edited:
Upvote 0
Top