VoIP SIP (Voice Calls) System : Source Code

sfsameer

Well-Known Member
Licensed User
Longtime User
Thank you for the invitation to create the required components independently
But I repeat I don't know where to start
When you write

"..2-Call a client that is connected to another service provider (You will have to edit the source code to enable the srvVoIPSIP service to read the client's IP and Port) .."

what do you mean exactly?
I mean, in the VOIP SIP SDK project every Android client communicates with the Bj4 server, how is it possible to call another client that hasn't registered yet?
I imagine that a Voip provider, for example Messagenet.com, from the logical point of view is seen as a 'sip server' by the clients who have to register on it before being able to use its services
But a mobile phone, for example mine phone, never registers on the messagenet servers, and therefore even assuming that from my B4J server it manages to register me on the Messagenet.com sip servers, but how to call my phone number mobile phone?
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 :

Thank you,
Saif
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello everyone :)

After testing the Public connection there are some service providers that block SIP calls.

Even after you are connected successfully to your public server you won't be able to make phone calls, some of the SIP providers use Proxy to enable the users to make audio calls even if their service providers block the SIP.

Example of a service provider that block the SIP :

*Service provider means : Internet provider or 3G or 4G provider

Thank you,
Saif
 

jm_gz_itza

Member
Licensed User
Unfortunately the only resolution to this issue is to ask the provider to stop blocking SIP on your service (which some will do) or to change to another internet service provider.

You may also choose to use a VPN service to circumvent the ISP's blocking, although this may have a negative impact on call quality and is not a recommended solution.
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Unfortunately the only resolution to this issue is to ask the provider to stop blocking SIP on your service (which some will do) or to change to another internet service provider.

You may also choose to use a VPN service to circumvent the ISP's blocking, although this may have a negative impact on call quality and is not a recommended solution.
Hello,

If the VPN was implemented in the same Voip Sip server then there will not be any lag and there won't be any delays :)
 

MarcoRome

Expert
Licensed User
Longtime User
Hi all.
Does anyone know a paid or free STUN or VOIP server where you can test and possibly buy the service ?
Thank you
Marco
 

amorosik

Expert
Licensed User
Hi all.
Does anyone know a paid or free STUN or VOIP server where you can test and possibly buy the service ?
Thank you
Marco

Messagenet.com
You can free register and with your virtual number you are able to receive call from public telephone network
With 6 euro, you can buy ( 6.00 / 0.02 euro/min) 300 minute of outbound call

Voipvoice.it i don't know how much cost
 

amorosik

Expert
Licensed User
Hello everyone :)

After testing the Public connection there are some service providers that block SIP calls.

Even after you are connected successfully to your public server you won't be able to make phone calls, some of the SIP providers use Proxy to enable the users to make audio calls even if their service providers block the SIP.

Example of a service provider that block the SIP :

*Service provider means : Internet provider or 3G or 4G provider

Thank you,
Saif

When you write "... testing public connection ..." you mean running the B4j server on a machine outside the corporate offices, right?
What is the advantage of putting a pbx on a server outside the corporate offices?
If the internet connection is missing for any reason, the internal-to-internal transfer would also be impossible
 

amorosik

Expert
Licensed User
Hi all.
Does anyone know a paid or free STUN or VOIP server where you can test and possibly buy the service ?
Thank you
Marco

Do you have any ideas on how to make a client communicate with a telephone on the public telephone network?
This article should give you useful information, but I honestly don't know where to start doing what
 

amorosik

Expert
Licensed User
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 :

Thank you,
Saif

Yes of course, I understand that it is possible to do this
The problem is: from within the SIP VOIP SDK project code, how do you do it?
Can you suggest the documentation to study to understand how to achieve this goal?
 

amorosik

Expert
Licensed User
But it's too expensive to be honest, The more traffic, CPU Usage, Data Storage the more you will pay
We pay around 3000-4000 USD per month for one of the servers (Pay as you go method) because we use it for really heavy duty :)

BTW currently we are in the middle of signing a contract with a telecommunication company and we will be releasing our own VPS servers very soon which will be 8GB RAM, 4Core, 180GB SSD for only 35$ (Special Price for B4X Members only ;)


3-4K usd / month seems like a really big price
I would be curious to understand what technical characteristics are ensured for a service of this type? (connection speed, cpu number, disk space, ...)
 

sfsameer

Well-Known Member
Licensed User
Longtime User
When you write "... testing public connection ..." you mean running the B4j server on a machine outside the corporate offices, right?
Yes it means you can use the B4J server publicly and you would be able to connect to it outside the corporate offices

If the internet connection is missing for any reason, the internal-to-internal transfer would also be impossible
Yes if the internet connection is missing then you wont be able to contact the B4J Server if it was a public connection
 

amorosik

Expert
Licensed User
I see that the b4j server writes to two files, one of which is very large, tens of gigabytes
I tried putting a rem (//) at the beginning of the line

properties.setProperty ("gov.nist.javax.sip.DEBUG_LOG", "sipphonedebug.txt");

but the file is produced anyway
The question is: how to prevent this file from being produced?
 

sfsameer

Well-Known Member
Licensed User
Longtime User
After a very long time running the B4J server the log file will increase.

So do the following :
Open the module MainMenu
Then Remove both of these lines from the inline java :
inline java:
  properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32");
properties.setProperty("gov.nist.javax.sip.DEBUG_LOG",  "sipphonedebug.txt");
        properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "sipphonelog.txt");

This way it will stop the server from generating Log files.


**After removing the above lines, the log files are completely removed :
1619443801336.png


Thank you,
Saif
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
Messagenet.com
You can free register and with your virtual number you are able to receive call from public telephone network
With 6 euro, you can buy ( 6.00 / 0.02 euro/min) 300 minute of outbound call

Voipvoice.it i don't know how much cost

The service releases a user code and pw it does not seem to me that the service releases an ip and a port to be able to carry out tests with the app. What I am looking for is a server that gives an ip and relative port with UDP service in and out
 

MarcoRome

Expert
Licensed User
Longtime User
Tell me dear what would you like to do and we will help you :)
Thank you Saif for your support.
I would like, if possible, to find a server that gives the service already available, instead of having to buy a vps, configure, etc. So look for a server that gives an ip address and relative port to access the voip through your app. In order to be able to test, evaluate and, if necessary, buy the service
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Thank you Saif for your support.
I would like, if possible, to find a server that gives the service already available, instead of having to buy a vps, configure, etc. So look for a server that gives an ip address and relative port to access the voip through your app. In order to be able to test, evaluate and, if necessary, buy the service
If you would like a free VoIP SIP Service to test on then as it's mentioned :

1-Go here :
2-Then click on Signup
3- Enter your information
4- Once you have signed up the following will appear :
iptel.png


6- Download the Sample SIP app from :

7-change the information in the B4A with your information
8- You are ready to go :)


**If you would like to use the above without the sample app then open the source codes we sent you then edit the service : srvVoiPSIP and remove the port number
also make sure you allow letters and not just numbers in the DialerPad Activity

--If you need further assistance please let us know :)
 

MarcoRome

Expert
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

1619454880182.png


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.
 
Top