VoIP SIP (Voice Calls) System : Source Code

sfsameer

Well-Known Member
Licensed User
Longtime User
Hi Saif.
Have you tried the code on Android 12 ?
Despite having entered the permissions:
B4X:
    Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_USE_SIP)
        Wait For Activity_PermissionResult (permission As String, Result As Boolean)
        If Result Then
                Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_RECORD_AUDIO)
                Wait For Activity_PermissionResult (permission As String, Result As Boolean)
                If Result Then
                        Load_SIPSettings
                        StartActivity(MainMenu)
                        Activity.Finish
                End If
        End If

View attachment 112346

When it comes on the line Sip.Register
B4X:
....
                    
            If Starter.strProtocol.ToLowerCase = "udp" Then
                 
            Else
                Sip.Protocol = Starter.strProtocol.ToLowerCase
                     
            End If
            Sip.Register '<----- HERE'

in module srvVoIPSIP no events are displayed. No errors, nothing despite having all the events.

B4X:
Sub SIP_Registering
    Log("Registering")
End Sub

Sub SIP_RegistrationFailed (ErrorCode As Int, ErrorMessage As String)
    Log("Failed, ErrorCode=" & ErrorCode & ", Message=" & ErrorMessage)
'    ToastMessageShow("Registration failed.", True)
End Sub

Sub SIP_RegistrationDone (ExpiryTime As Long)
    Log("RegistrationDone, ExpiryTime=" & ExpiryTime)
    ToastMessageShow("SIP registered sucessfully", True)
End Sub

if i try the same program on an android 8 version it all runs.
There are other permissions that are missing, replace the above with the following :
B4X:
For Each permission As String In Array(Starter.rp.PERMISSION_USE_SIP, Starter.rp.PERMISSION_READ_PHONE_STATE, Starter.rp.PERMISSION_RECORD_AUDIO,Starter.rp.PERMISSION_PROCESS_OUTGOING_CALLS)
            Starter.rp.CheckAndRequest(permission)
            Wait For Activity_PermissionResult (permission As String, Result As Boolean)
            If Result Then
                Load_SIPSettings
       
                StartActivity(MainMenu)
                Activity.Finish
            Else
                ToastMessageShow("No permission",True)
                Activity.Finish
               
               
            End If
        Next

Also post the error log so we can help you better :)

**Also if it's still didn't work then remove the targetSDKversion from the manifest file.
 

MarcoRome

Expert
Licensed User
Longtime User
There are other permissions that are missing, replace the above with the following :
B4X:
For Each permission As String In Array(Starter.rp.PERMISSION_USE_SIP, Starter.rp.PERMISSION_READ_PHONE_STATE, Starter.rp.PERMISSION_RECORD_AUDIO,Starter.rp.PERMISSION_PROCESS_OUTGOING_CALLS)
            Starter.rp.CheckAndRequest(permission)
            Wait For Activity_PermissionResult (permission As String, Result As Boolean)
            If Result Then
                Load_SIPSettings
      
                StartActivity(MainMenu)
                Activity.Finish
            Else
                ToastMessageShow("No permission",True)
                Activity.Finish
              
              
            End If
        Next

Also post the error log so we can help you better :)

**Also if it's still didn't work then remove the targetSDKversion from the manifest file.
Already tried so ....
You had entered the same in a commented way. But:
1) if I use For each, it asks for the first permission and then remains pending on others.
So I used the above method.
2) I also tried to add Starter.rp.PERMISSION_READ_PHONE_STATE, Starter.rp.PERMISSION_PROCESS_OUTGOING_CALLS, even if not required (see Permission Windows) but the result doesn't change
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Already tried so ....
You had entered the same in a commented way. But:
1) if I use For each, it asks for the first permission and then remains pending on others.
So I used the above method.
2) I also tried to add Starter.rp.PERMISSION_READ_PHONE_STATE, Starter.rp.PERMISSION_PROCESS_OUTGOING_CALLS, even if not required (see Permission Windows) but the result doesn't change
1-The project works if you just remove the targerSDKversion from the manifest file
2-Could you please post the error log so we can help you better
 

MarcoRome

Expert
Licensed User
Longtime User
1-The project works if you just remove the targerSDKversion from the manifest file
2-Could you please post the error log so we can help you better
This is your manifest, already tried
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5"/>
<supports-screens android:largeScreens="true"
....
but on Android 12 dont work...

1619456202992.png

Translate.."This App was made for an older version of Android and may not work properly..."

i add also:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
....
in this way ask me permession, but anyway no event is trigger
 

sfsameer

Well-Known Member
Licensed User
Longtime User
This is your manifest, already tried
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5"/>
<supports-screens android:largeScreens="true"
....
but on Android 12 dont work...

View attachment 112347
Translate.."This App was made for an older version of Android and may not work properly..."

i add also:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
....
in this way ask me permession, but anyway no event is trigger
When you remove the targetSDKversion from the manifest file it will work without any problem even if it will show the above message.

We have just tested the project in android 10 even if we set the targetSDKversion in the manifest file it worked without a problem, but we didn't test it in android 12 that's why am telling you to post the error log to be able to understand where the problem is

:)
 

sfsameer

Well-Known Member
Licensed User
Longtime User
We would like to connect with you using anydesk or teamviewer to inspect the problem if that's okay with you :)
 

MarcoRome

Expert
Licensed User
Longtime User
When you remove the targetSDKversion from the manifest file it will work without any problem even if it will show the above message.

We have just tested the project in android 10 even if we set the targetSDKversion in the manifest file it worked without a problem, but we didn't test it in android 12 that's why am telling you to post the error log to be able to understand where the problem is

:)
in log (filter or no) gives absolutely no error, arrives on Sip.Registrer and stop.
No freeze, no crash, nothing
 

sfsameer

Well-Known Member
Licensed User
Longtime User
in log (filter or no) gives absolutely no error, arrives on Sip.Registrer and stop.
No freeze, no crash, nothing

We would like to connect with you using anydesk or teamviewer to inspect the problem if that's okay with you :)
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Although it remains a mystery why on Android 8 it ran without any problem with UDP Protocol
In the Android Sip the default protocol is TCP so it seems that in Android 8 it worked because it registered using the default protocol even if it was not provided.

In Android 12 it seems it didn't care for the default protocol and it was necessary to provide the protocol.

:)
 

Xfood

Expert
Licensed User
In the Android Sip the default protocol is TCP so it seems that in Android 8 it worked because it registered using the default protocol even if it was not provided.

In Android 12 it seems it didn't care for the default protocol and it was necessary to provide the protocol.
[Quote/]


hello, so we need to make some changes? if so, which ones?
 
Top