This SIP forwarding daemon acts as a stateless SIP proxy to essentially forward a SIP address to another SIP server. This is useful if you already have an account with a SIP provider, but aren't too happy about the SIP URL you got and instead prefer to use a SIP URL with your own domain name (but don't want to run a full-blown SIP server like Asterisk or OpenSER).
So it allows you to use and publish SIP URLs of the form sip:email@example.com with the minimum possible effort.
Of course, your existing SIP provider has to allow incoming connections via SIP (unfortunately, some providers choose to block direct SIP connections and only allow connections via PSTN).
For compiling the source code, you need to have the following packages available (in addition to the standard development environment):
- SQLite 3
- The GNU oSIP library
- UDNS (optional)
UDNS is only needed for DNS SRV support and can be disabled in the Makefile (see -DHAVE_UDNS).
In order to run your own SIP forwarding daemon, there are two things to consider:
- IP address: it is advised to explicitly bind the daemon to a specific IP (or IPv6) address using the -b command line option.
- DNS: in order to have SIP requests for example.com routed to your SIP forwarding server, you will either have to set up your DNS zone such that A/AAAA records for example.com point to the SIP forwarding server, or add an SRV record for _sip._udp.example.com.
As an example, have a look at the setup for the cmeerw.org domain which has a SRV record:
_sip._udp.cmeerw.org. 28800 IN SRV 10 0 5060 edge.cmeerw.net.
and A/AAAA records for edge.cmeerw.net:
edge.cmeerw.net. 28800 IN A 220.127.116.11 edge.cmeerw.net. 28800 IN AAAA 2001:6f8:~131c::1
Consequentially, the SIPFwd daemon is bound to these IP addresses using the the -b command line option:
sipfwd -b 18.104.22.168 -b 2001:6f8:~131c::1
Configuration information is stored in an SQLite3 database in the "forward" table. To add a forwarding rule, you simply have to insert it into the database, e.g.
$ sqlite3 /var/lib/sipfwd/sipfwd.db > INSERT INTO forward (local, remote) VALUES ('firstname.lastname@example.org', 'sip:email@example.com'); > INSERT INTO forward (local, remote) VALUES ('firstname.lastname@example.org', 'sip:email@example.com'); > INSERT INTO forward (local, remote) VALUES ('firstname.lastname@example.org', 'sip:email@example.com');
This will forward any SIP connections for firstname.lastname@example.org to email@example.com.
Note that the local column has to be specified as username@domain, whereas the remote column has to be specified as a full SIP URI.
For demonstration purposes I have added the users spam and time to the SIPFwd daemon configuration running on cmeerw.org (these will seemlessly forward to services provided by Voipfone). So just point your SIP client to sip:firstname.lastname@example.org and sip:email@example.com to give it a try...
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for full details.