Capture incoming packets on port opended by other application - c#

I'm considering interfacing my application with my VOIP system. My VOIP comes with client application that registers with the VOIP server and when acall comes the app displays call info on computer's screen. I identified local port that listens to the VOIP server. I identified the packet that contains the phone number of incoming call. I identified hex position of that phone number within the packet. So now I want to listen on the Socket for a Stream and create an event when expected packet comes. There are two questions:
Will Windows allow me to listed to packets coming on a port opened by another application?
I've never written Socket listener code. Can you refer me to an example or a tutorial?

One possible solution would be to create a man-in-the-middle application:
Client Application <----> Your Application <----> VOIP Server
Your application will act as a proxy between the Client Application and the VOIP server and at the same time do whatever it wants with the data.

Related

How to configure the TCP/IP protocol correctly?

I need to set up a TCP server and the sensor devices need to connect to it as TCP clients.
Also, when I add an mp3 file to a device in the admin panel on react, I need to send that file to the appropriate client.
In turn, the device may send me certain data.
I wanted to know how the logic and structure of this whole process should be established correctly?
What should I put my TCP server on? (.Net Core Console, API or Worker Service?)
How can I transfer my mp3 file to my TCP server from the admin panel? and so on
Thanks in advance

Sending raw data to Windows store app without Azure

I want to build a chat application but I don't want to use WNS because WNS required a visa card. Is there any way to send and receive raw data to Windows store app without WNS?
I found Push Notifications without Azure service? but it is MPNS for Windows phone, not for windows store app.
Is there any way to send and receive raw data to Windows store app
without WNS?
You can send and receive raw data by establishing socket connection between your application and server and handle the information in foreground or background task.
To know how to use stream socket to send and receive data , please see StreamSocket Sample on GitHub.
Moreover, you can use SocketAcitivityTrigger class to register a background task to notify the socket broker when your app is not active. For the complete sample , please refer to SocketActivityStreamSocket sample, which requires the capability Private Networks (Client & Server). And if your app uses socket activity triggers, you must specify the User Notification Listener capability in the app manifest.
The sample consists of SocketActivityStreamSocket (for client side) and StreamSocketListenerServer (for server side), please note the sample scenario will not work if both apps are testing on the same machine. Be sure to run the apps on separate machine so that they can communicate with each other.

Is it possible to connect gps reciever (teltonika fm1110) to a home server?

My friend has got a Gps receiver installed in his car. The Gps receiver emits signal using GPRS-UMTS network.
I have created a server socket (C#) and listening for connections but am not getting any of them which should be sent from the receiver itself.
The receiver does not have an interface it just sends data and because of that I can not program a client socket on it.
How should I solve such problem? Do I have to have specialised mobile servers to catch such data or am I able to this with my Home server (actually a normal computer which acts as a server).
when you communicate with teltonika fm1100 first you confgure your router to redirect traffic via a specific port number wich you use when configuring your gps
that you have to configure the gps tyo communicate to your public IP server
than you need a parser to read data received from gps. and first the device send it's IMEI you have to respond to this message with "1" if IMEI is correct "0" if it's not
if you need a c# parser I just wrote one this may help you begin:
https://github.com/temala/Teltonika-FM1100

Communication between Desktop Application and Windows Mobile Compact Framework c#

I am writing a desktop application that will have to communicate with a windows mobile application in the compact framework 3.5. The communication must occur over the internet between these two applications to send data between them on command if the connection is available.
The system will send messages and objects like Images between device and desktop application and check to see if the desktop can see the device by sending a command and have a timeout on response. (Application will then know that the device is not available).
The mobile device will send a message to the desktop application when online as well that the desktop knows that the mobile is connected(Type of registering for communication)
Can someone please inform me of the best way to follow to accomplish this.
I did some research and found this site is near to something like event based driven communication I would want but do not have the availability of setting up an email on each device.
Battery life and internet open on device is not an issue.
Should I check in on working with the System.Net.Socket class for this type of communication between the two application and if so how will I set up so firewalls will not interfere and have my desktop application be seen over the internet by the mobile application ?
Hope someone can spread some light over this for me, if you have a answer please provide a link so I can read up on it.
your description is something basic. OK, regardless of what TCP/IP communication you decide for (HTTP, sockets) you must always have your internet router forward packages on a specified incoming port to your PC and the firwall must accept these incoming requests.
So, the device will have to send data to the PC and vice versa. So you need a server and a client on the PC and on the PC.
Possibly you can use an already available cloud like Dropbox to exchange files between PC and device.
What are about your skills in socket programming? The main server (PC) must be written multithread to be able to server multiple device client requests.
A simple socket comm is done in my SocketWedge [http://www.hjgode.de/wp/2010/05/27/transmit-data-from-winmo-device-to-pc-socketwedge-and-socketsend/]. A way of multithreaded communication using a web server on the device is available here [http://www.hjgode.de/wp/2012/10/19/windows-mobile-a-simple-web-server-with-extended-features/].
Will SQL with data synchronization be a possible choice?
Can you describe the application in more detail?
~josef

UDP broadcasting in windows phone 7

I am working an application in windows phone 7 that must detect the devices connected to particular port no or network. I have desktop application that is implemented in c++ that uses UDP broadcast. I read some articles and know windows phone 7 doesn't support UDP broadcasting. I have tried UDP multicasting in WP7 but due to desktop application have implemented in UDP broadcast, I am not able to do that.
Help me Guys...........
You can use socket.ConnectAsync with e.Buffer containing the message you want to broadcast. In this case, the message will be sent automatically when connection is established. More information about this trick you can read here
You could send a broadcast packet through just SendToAsync method by using limited broadcast IP, not local broadcast IP(such as 255.255.255.255) This means, if your NIC device is in 192.168.0.x IP range, you should shoot a packet to 192.168.0.255. (this IP might be vary on your netmask setting)
However, it works.
Additionally, response back is also allowed but FOR 5 SECONDS ONLY. Your host received a UDP packet from Windows Phone 7.1 device, the host should response back to the port that UDP packet came from, IN 5 SECONDS. Unless, Windows Phone will close the port then, and it has to be gone.
It's very tricky, weird, and ununderstandable(like this word) way.
but it works as far I know.

Categories