VoIP SIP (Voice Calls) System : Source Code

sfsameer

Well-Known Member
Licensed User
Longtime User
Hi Saif, i would like to suggest something for the encryption, in my opinion, the best aproach for thin could be provide that anyone could apply the encryption freely..
Like this...

[VOIP Client 1 (encrypt packets)] =====> [(decrypt packets) VOIP Server (encrypt packets)] =====> [(decrypt packets) VOIP Client 2]

To make de encryption/decryption , we can insert any kind of encryption , MD5, SHA or including particular one... you code is going to be the same, you only need to provide a way to insert some new external code (when applied) to "decode" any packet from in/out buffer in the client's and server. Tha way could be simple and anyone could use.
Hello,

The server side (B4J) is easier to control regarding the encryption, but the difficult part is in the client side, why?
Because every byte sent, is sent in real-time and the encryption process will slow down the process (even if it was 10 ms or less) which will cause a loss in the connection between the server and the client sides.

That's why we are still trying to figuring out the best way possible and to avoid the loss in the connection.

Thank you,
Saif
 

prbmjr

Active Member
Licensed User
Hello,

The server side (B4J) is easier to control regarding the encryption, but the difficult part is in the client side, why?
Because every byte sent, is sent in real-time and the encryption process will slow down the process (even if it was 10 ms or less) which will cause a loss in the connection between the server and the client sides.

That's why we are still trying to figuring out the best way possible and to avoid the loss in the connection.

Thank you,
Saif
Hi Saif,

Thank you for your explanation about your concerns about the encryption/decryption process, but let me understand, you said that any kind of encryption process cause loss of connection, this means that you have some time-out issue? or the connection fails because you need constant flow of data to keep the connection live? Could you give me more information? I need to understand that to could explain to my client why we have this kind of problems with the encryption and try to help you (if i could...) to find a solution... 😁

Thank you in advance for you time!
 

sfsameer

Well-Known Member
Licensed User
Longtime User
this means that you have some time-out issue? or the connection fails because you need constant flow of data to keep the connection live?
Hello,

The data is sent/received in real-time meaning any data interruption for example data decryption will cause the connection to fail, without forgetting to mention that the packets are sent as is using an audio codec, so any data manipulation (in this case encryption/decryption) will cause a connection failure.

Thank you,
Saif
 

sfsameer

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

Please use the same download link we sent you earlier to download the new update source codes.
The update contains : Password (The password is mandatory now) in B4J VoIP Client App

The new updated file will be under the name : B4JVoiPClient-updated

Also make sure to copy and paste the .jar + .xml files to your B4J additional libraries folder.

You can now set the password in the B4J VoIP Client :
1629443011102.png



*This update will be the last update on the VoIP project (B4J Server, B4A Client, B4J Client),, as we will be focusing on releasing the B4i Client.
We can't disclose the date yet, once it's ready we will release the project.


*As for @prbmjr special request (Data encryption) we can't disclose the release date of this request until we figure out a way to do it and see if it's even possible to accomplish.

Thank you,
Saif
 

amorosik

Expert
Licensed User
*This update will be the last update on the VoIP project (B4J Server, B4A Client, B4J Client),, as we will be focusing on releasing the B4i Client.
We can't disclose the date yet, once it's ready we will release the project.

If there are no other updates for the B4J and B4A environments, can we have the sources of the libraries used?
 

prbmjr

Active Member
Licensed User
*As for @prbmjr special request (Data encryption) we can't disclose the release date of this request until we figure out a way to do it and see if it's even possible to accomplish.


Hi Saif,

Ok , thank you for your answer, please keep me posted about this...

The data is sent/received in real-time meaning any data interruption for example data decryption will cause the connection to fail, without forgetting to mention that the packets are sent as is using an audio codec, so any data manipulation (in this case encryption/decryption) will cause a connection failure.

About the answer above, This happens even if the result of the decryption is the same original data packet before the encryption?

Thank you!
 

Magma

Expert
Licensed User
Longtime User
Tip-1: Encryption is always salted... so bigger strings/byte
Tip-2: Cutting to smaller pieces the strings/bytes making faster the communication
Tip-3: Using many ports could help to secure but also making it faster too - but it will using more bandwidth
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hi Saif,

Ok , thank you for your answer, please keep me posted about this...



About the answer above, This happens even if the result of the decryption is the same original data packet before the encryption?

Thank you!
Hello,

Below is what happens in the background once the call is being established :

1-in the B4J Server inline java, you can see there is :
MySipListener

Which is a listener that works in a multi-thread manner and responsible to send/receive any packets between the clients.

2- Every packet is sent to the server, it will include the header data and the body data :
The header data contains :
From address
To Address
Call-ID
ContactURI
Expires
Type of request (Register, Call, Disconnect, Busy, etc...)
Password (Which we have added recently)
and other details...

3- Once the above is received in the B4J server, the request will be filtered and "MessageFactory" will send the stage 1 response to the other client
4- if the response is a call request then "processInvite" will start and "clientTransactionId.sendRequest();" will be sent.
5- The ACK dialog will be created "processAck" , it's responsible to create the invite and initiate the call by holding all of the above information and send them to the receiver.
6- Once the ACK Dialog is sent, a new Hashtable :
"private Hashtable<URI, URI> currUser = new Hashtable();"

will be created which will be responsible for sending/receiving the audio packets.


*Every above step happens in real-time except "processRegister" which is responsible to read the password and check if it's true or not.
As you can see there is no room to add any encryption/decryption .

*All of the above are just in B4J server, a more complicated process happens in the B4A & B4J clients.

*There are a lot of other steps, for example reading the packets codecs, clients information,Registration expiration time etc... the other background steps happen in the .jar file.

To have a better understanding on how the transactions are working in the background :

Thank you,
Saif
 

prbmjr

Active Member
Licensed User
Hello,

Below is what happens in the background once the call is being established :

1-in the B4J Server inline java, you can see there is :
MySipListener

Which is a listener that works in a multi-thread manner and responsible to send/receive any packets between the clients.

2- Every packet is sent to the server, it will include the header data and the body data :
The header data contains :
From address
To Address
Call-ID
ContactURI
Expires
Type of request (Register, Call, Disconnect, Busy, etc...)
Password (Which we have added recently)
and other details...

3- Once the above is received in the B4J server, the request will be filtered and "MessageFactory" will send the stage 1 response to the other client
4- if the response is a call request then "processInvite" will start and "clientTransactionId.sendRequest();" will be sent.
5- The ACK dialog will be created "processAck" , it's responsible to create the invite and initiate the call by holding all of the above information and send them to the receiver.
6- Once the ACK Dialog is sent, a new Hashtable :
"private Hashtable<URI, URI> currUser = new Hashtable();"

will be created which will be responsible for sending/receiving the audio packets.


*Every above step happens in real-time except "processRegister" which is responsible to read the password and check if it's true or not.
As you can see there is no room to add any encryption/decryption .

*All of the above are just in B4J server, a more complicated process happens in the B4A & B4J clients.

*There are a lot of other steps, for example reading the packets codecs, clients information,Registration expiration time etc... the other background steps happen in the .jar file.

To have a better understanding on how the transactions are working in the background :

Thank you,
Saif

Thank you for all these explanation!

But if I encrypt your final packet, with all header and data already done and decrypt in the other side, whatever it is (client or server), before your first execution, decrypting the sent packet to the exactly original packet to be process, could this work?
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Thank you for all these explanation!

But if I encrypt your final packet, with all header and data already done and decrypt in the other side, whatever it is (client or server), before your first execution, decrypting the sent packet to the exactly original packet to be process, could this work?
We have tried this before and it didn't work, because there is an audio codec that needs to be read in the library and if we do encrypt it the server and the other client won't be able to know what they are reading.

We are working on finding a solution for your request as soon as possible, we will keep you in the loop.

Thank you,
Saif
 

prbmjr

Active Member
Licensed User
We have tried this before and it didn't work, because there is an audio codec that needs to be read in the library and if we do encrypt it the server and the other client won't be able to know what they are reading.

We are working on finding a solution for your request as soon as possible, we will keep you in the loop.

Thank you,
Saif

Ok, now I understand the real situation... Maybe the audio codec needs to be processed out of the library ... Then the encryption/decryption could be implemented before the audio codec process the data, but I think that you already tested it...

Thank you !
 

prbmjr

Active Member
Licensed User
We have tried this before and it didn't work, because there is an audio codec that needs to be read in the library and if we do encrypt it the server and the other client won't be able to know what they are reading.

We are working on finding a solution for your request as soon as possible, we will keep you in the loop.

Thank you,
Saif
Hi Saif!

Any news about the encryption?

br,

Paulo Bueno
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hi Saif!

Any news about the encryption?

br,

Paulo Bueno
Hello,

Within 24-48 hours we will announce either it's possible or not.

So far we were successful to encrypt the connection and incoming/outgoing bytes but the connection breaks after seconds so we are figuring out this part.

Thank you,
Saif
 

prbmjr

Active Member
Licensed User
Hello,

Within 24-48 hours we will announce either it's possible or not.

So far we were successful to encrypt the connection and incoming/outgoing bytes but the connection breaks after seconds so we are figuring out this part.

Thank you,
Saif
Hi Saif !

Any news?
 

Star-Dust

Expert
Licensed User
Longtime User
Not 24 hours have passed yet
 

Star-Dust

Expert
Licensed User
Longtime User
I do not think so. They are 24/48 working hours. consider that they work one hour a day
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hi Saif !

Any news?
Hello,

Not yet, it's still under development.

I do not think so. They are 24/48 working hours. consider that they work one hour a day

I have always respected your contribution to the B4X community and liked almost 100% of your posts on B4X but i never though you would make a disrespectful comment on our project.
Is this unnecessary and disrespectful remark really needed to be wrote here ?

Thank you,
Saif
 
Last edited:
Top