OpenTTD uses port 3979 (both TCP and UDP) by default for multiplayer games. These two ports only need to be open if you are hosting a server. Without the proper port configuration your server will appear as offline.
If you have a router you will need to forward these ports to your computer. If you are not sure how to set up port forwarding, please have a look at the documentation for your router.
you can also check the multiplayer FAQ