1

I've been learning SIP for a while now but I can't think of a way to accomplish a scenario which I have in my mind.

Lets assume I have a number of SIP clients and a SIP server at home, in a private network (behind a NAT/firewall, inaccessible from the public Internet). Then there's a SIP server in the public Internet which I also have access to. Now assume I also have a mobile device with a SIP client. I'm interested in the ability to make and receive phone calls between all SIP clients in this one logical network, regardless of the mobile SIP client being connected to the private network or to the public Internet (the system should adapt to changes in the environment). Additionally, I need to make sure that the SIP server in the private network could work on its own, when the connection to the public Internet is not available. That is, the connection to the public Internet is an optional extension in this setup, which possibly enables mobile SIP clients to be connected to the private network.

I don't really know if that's possible with SIP protocol and its extensions. I'm curious how these two SIP servers would be connected (in what "mode"?) so that it could work.

Do you know what software do I need to implement such a scenario, e.g. FreeSWITCH, Asterisk, Kamailio?

Any hints would be appreciated.

Adam Romanek
  • 1,809
  • 1
  • 19
  • 36

1 Answers1

1

I would do this with FreeSWITCH:

  1. define a SIP service domain name, and set up two resolvers: the one on your home LAN points to the local server, and in public Internet this domain would point to your outside server.

  2. On the external server, you can use "User-Specific Gateways", see details at https://wiki.freeswitch.org/wiki/XML_User_Directory_Guide . So, when the user registers on the external server, the external server makes a connection to your LAN server (it has to be accessible from public Internet, for example by means of port forwarding on your firewall). Then the calls can be forwarded to your LAN server, and bridged with other extensions.

Also here's my short tutorial for starters: https://github.com/voxserv/freeswitch_conf_minimal/blob/tutorials/docs/tutorial_01_simple_pbx.md

I think it's also quite doable with Asterisk, but I have much less experience with it. Also I would recommend FreeSWITCH for any greenfield project.

Stanislav Sinyagin
  • 1,973
  • 10
  • 10
  • Thanks for your input. Still, could you be more specific? What are these two resolvers? Do you refer to anything DNS related? And isn't there a way to establish a connection to the public Internet based SIP server from the SIP server located in the private network, and operate on this connection bidirectly, to avoid the need to expose the host from the private network via port forwarding etc? Would a kind of proxy or some kind of a tunnel help here? – Adam Romanek May 18 '15 at 17:46
  • it's also possible, but needs more work. Your internal server needs to know the location of an external user, and the method that I described works out of the box, without the need to add any logic on top of it. Yes, I meant DNS resolvers. I could make a prototype for you, but it will be expensive :) – Stanislav Sinyagin May 18 '15 at 21:34