The only change was the targetSDKversionhello, so we need to make some changes? if so, which ones?
We will include the modified codes in the next update
The only change was the targetSDKversionhello, so we need to make some changes? if so, which ones?
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
AddPermission(android.permission.USE_SIP)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_WIFI_STATE)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.RECORD_AUDIO)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(android.permission.VIBRATE)
AddPermission(android.permission.PROCESS_OUTGOING_CALLS)
AddPermission(android.permission.READ_PHONE_STATE)
'-----New
AddPermission(android.permission.CONFIGURE_SIP)
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS)
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false"/>)
AddManifestText(<uses-feature android:name="android.software.sip" android:required="true" />)
AddManifestText(<uses-feature android:name="android.software.sip.voip" android:required="true" />)
AddManifestText(<uses-feature android:name="android.hardware.microphone" android:required="true" />)
AddManifestText(<uses-feature android:name="android.hardware.wifi" android:required="true" />)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
Sub Activity_Create(FirstTime As Boolean)
If File.Exists(File.DirInternal,"db.db") = False Then
File.Copy(File.DirAssets,"db.db",File.DirInternal,"db.db")
End If
SQl1.Initialize(File.DirInternal,"db.db",False)
GrantPermission
End Sub
Sub Activity_Resume
End Sub
Sub GrantPermission
Try
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
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_PROCESS_OUTGOING_CALLS)
Wait For Activity_PermissionResult (permission As String, Result As Boolean)
If Result Then
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_PHONE_STATE)
Wait For Activity_PermissionResult (permission As String, Result As Boolean)
If Result Then
Add_FieldToDB
StartService(srvVoIPSIP) '--- SHould start after the permission
StartActivity(MainMenu)
Activity.Finish
End If
End If
End If
End If
Catch
Log(LastException)
End Try
End Sub
We would like to connect with you using anydesk same as yesterday to inspect the problem if that's okay with youHi Saif, All
So I tried to set requestpermission again.
Otherwise, it is not possible to enter it on the Play Store.
This is the Manifest:
B4X:AddManifestText( <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/>) SetApplicationAttribute(android:icon, "@drawable/icon") SetApplicationAttribute(android:label, "$LABEL$") CreateResourceFromFile(Macro, Themes.LightTheme) 'End of default text. AddPermission(android.permission.USE_SIP) AddPermission(android.permission.INTERNET) AddPermission(android.permission.ACCESS_WIFI_STATE) AddPermission(android.permission.ACCESS_NETWORK_STATE) AddPermission(android.permission.RECORD_AUDIO) AddPermission(android.permission.WAKE_LOCK) AddPermission(android.permission.VIBRATE) AddPermission(android.permission.PROCESS_OUTGOING_CALLS) AddPermission(android.permission.READ_PHONE_STATE) '-----New AddPermission(android.permission.CONFIGURE_SIP) AddPermission(android.permission.MODIFY_AUDIO_SETTINGS) AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false"/>) AddManifestText(<uses-feature android:name="android.software.sip" android:required="true" />) AddManifestText(<uses-feature android:name="android.software.sip.voip" android:required="true" />) AddManifestText(<uses-feature android:name="android.hardware.microphone" android:required="true" />) AddManifestText(<uses-feature android:name="android.hardware.wifi" android:required="true" />) SetApplicationAttribute(android:usesCleartextTraffic, "true")
This is the code:
B4X:Sub Activity_Create(FirstTime As Boolean) If File.Exists(File.DirInternal,"db.db") = False Then File.Copy(File.DirAssets,"db.db",File.DirInternal,"db.db") End If SQl1.Initialize(File.DirInternal,"db.db",False) GrantPermission End Sub Sub Activity_Resume End Sub Sub GrantPermission Try 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 Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_PROCESS_OUTGOING_CALLS) Wait For Activity_PermissionResult (permission As String, Result As Boolean) If Result Then Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_PHONE_STATE) Wait For Activity_PermissionResult (permission As String, Result As Boolean) If Result Then Add_FieldToDB StartService(srvVoIPSIP) '--- SHould start after the permission StartActivity(MainMenu) Activity.Finish End If End If End If End If Catch Log(LastException) End Try End Sub
It arrives on Sip.Register and no events are triggered
Any idea ?
Thank you
Thank you Saif. For me now isnt possible. But i send you ( email ) an example already set up like this.We would like to connect with you using anydesk same as yesterday to inspect the problem if that's okay with you
Send me the ID via private message
It's okay, later when you do have the time just let us know and we will connect with you right away.Thank you Saif. For me now isnt possible. But i send you ( email ) an example already set up like this.
Thank you Saif.It's okay, later when you do have the time just let us know and we will connect with you right away.
And we can't test it because we don't have android 12 so we are not sure where or why it's failing to register
Hello,
in SIP you are able to contact other clients even if they are not registered on the same server, it's very possible.
More information :
SIP redirect server - VoIP-Info
A SIP redirect server is a user agent server that generates 3xx responses to requests it receives, directing the client to contact an alternate set of URIs.www.voip-info.org
Thank you,
Saif
let me explain the process :I am trying to initiate a telephone call from a B4A sip client, as in Voip Sip System project, to a telephone connected to the public telephone network
Re-reading your advice, I should locate the uri address of the phone at which I want to initiate the 'invite' command
I seem to have understood that a 'redirect server' must be queried to get the address of the destination phone in response
But how to understand which 'redirect servers' are available?
And once the address of the destination phone is obtained, how to initiate the call?
Unfortunately we don't have any knowledge regarding this matter except the concept of how to do it which we mentioned it aboveThe process to follow is clear, it was already so before
What I still can't do, and for which I am looking for help in the forum, is the sending of the request from the B4j server to the voip provider, the external trunk
And the subsequent audio connection between caller (B4A client in LAN) and recipient (public network telephone)
java.lang.IllegalArgumentException: Bad message: Null requestURI
at gov.nist.javax.sip.stack.DefaultRouter.getNextHop(DefaultRouter.java:170)
at gov.nist.javax.sip.stack.SIPTransactionStack.getNextHop(SIPTransactionStack.java:1583)
at gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.java:337)
at b4j.example.mainmenu$MySipListener.processInvite(mainmenu.java:1286)
at b4j.example.mainmenu$MySipListener.processRequest(mainmenu.java:1527)
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:223)
at gov.nist.javax.sip.EventScanner.run(EventScanner.java:492)
at java.base/java.lang.Thread.run(Thread.java:834)
Hello,Hi Saif,
When I tried to make call the follow error appears in log:
B4X:java.lang.IllegalArgumentException: Bad message: Null requestURI at gov.nist.javax.sip.stack.DefaultRouter.getNextHop(DefaultRouter.java:170) at gov.nist.javax.sip.stack.SIPTransactionStack.getNextHop(SIPTransactionStack.java:1583) at gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.java:337) at b4j.example.mainmenu$MySipListener.processInvite(mainmenu.java:1286) at b4j.example.mainmenu$MySipListener.processRequest(mainmenu.java:1527) at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:223) at gov.nist.javax.sip.EventScanner.run(EventScanner.java:492) at java.base/java.lang.Thread.run(Thread.java:834)
Hello,
This error means one of the clients were disconnected before establishing or receiving the call.
Make sure both of the clients are registered correctly.
Also this is very important because we had a lot of clients that made the same mistake :
If the b4j server is set to Udp make sure the clients are also UDP
And the same case goes for TCP
What is the protocol you are using?
Android version?
Local connection or public connection?
Did you open the port in your firewall? (inbound and outbound)
Thank you,
Saif
Hello,What is the protocol you are using? TCP
Android version? 9
Local connection or public connection? Local
Did you open the port in your firewall? (inbound and outbound) Yes Both, including I stop the firewall in my tests.
Hello,
We have tested it today using android 8,9,10 and they worked perfectly, but we need to inspect the problem you are facing, so we would like to connect with you using anydesk or teamviewer, if that's okay with you then send us the ID via PM and we will connect with you right away.
Thank you,
Saif
Done, sent to you via PMHi can you send me the download link again please
UDP is working fine but the problem is with TCP only,Consider that it doesn't even work with the UDP protocol (at least here by me)