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:user@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):
In order to run your own SIP forwarding daemon, there are two things to consider:
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 217.11.63.119 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 217.11.63.119 -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 ('user@example.com', 'sip:account@sipprovider.example.com');
> INSERT INTO forward (local, remote)
VALUES ('sales@example.com', 'sip:166@voipfone.co.uk');
> INSERT INTO forward (local, remote)
VALUES ('time@example.com', 'sip:123@voipfone.co.uk');
This will forward any SIP connections for user@example.com to account@sipprovider.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:spam@cmeerw.org and sip:time@cmeerw.org 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.