Android Question SIP loud speaker OFF and ON

Tasyo28

Member
Licensed User
Hi All,

I'm doing a SIP calling app and i want to create a button that will trigger loud speaker ON or OFF, how to achieve this?

i created two subs is this how to code it in b4a? where i will just call SpeakerOFF if i want loud speaker off?
But i tried it not working still in loud speaker mode.

Please advise


B4X:
Sub SIP_CallEstablished
    'Check that we are not already in a call.
    'Seems like this event can be raised by the SIP service multiple times.
    If CurrentCall.IsInCall Then Return
    'Log("CallEstablished")
    SpeakerON 'this will turn ON loud speaker by default
    ToastMessageShow("Call established", True)
End Sub

Sub SpeakerOFF()
    CurrentCall.StartAudio 'Start the audio
    CurrentCall.SpeakerMode = False
End Sub

Sub SpeakerON()
    CurrentCall.StartAudio 'Start the audio
    CurrentCall.SpeakerMode = True
End Sub
 

Tasyo28

Member
Licensed User
Hi Peter,

Thank you for your reply, i created a button to call the SpeakerOFF and SpeakerON sub but nothing happens still in loud speaker mode.

Is my code correct?
 
Upvote 0
Top