This is a quick guide on how to get up and running with iWar with IAX2.
DISCLAIMER: Be sensible ;)
IAX2 is the protocol used by Asterisk PBXes to peer VoIP calls. A few VoIP providers accept IAX connections, the ones coming to mind being freeworlddialup and provisionally voipuser.org. For this tutorial, I'll assume you have a FWD account, with IAX2 activated. See how to activate IAX on your FWD account here.
Another option is to use your own Asterisk PBX, for example using the excellent tutorial by 10nix. See the end of the tutorial on instructions on how to configure your PBX to talk to iWar.
You will need
To follow this tutorial you'll need:
- A linux box, preferably Debian (I'm going to describe it from a debian point of view in any case)
- An internet connection
- A VoIP account with IAX2 (as above)
- A copy of iaxclient and iwar from the iWar website
- Time
Although you can use any *nix (in theory), I have written this tutorial after doing this on a Debian Etch box. I did start trying to do this on a FreeBSD box but then found that iaxclient wouldn't easily compile, so switched over to Linux. Most of the config should be the same on any other *nix, though you might need to mess about to get libraries installed. If you manage to get it running on another distro/system, do share any tweaks you made to make it work :)
Building iWar with iaxclient
You might want the following libraries ready:
apt-get install libiax-dev
This should install the required dependancies. I don't have them installed myself, but I think I might have them installed manually in a previous experiment!
You'll need to grab a copy of Beave's modified iaxclient. For the case of freshness, I suggest you find the link to it on the iWar website.
wget http://www.softwink.com/iwar/download/iaxclient-01-12-2006-beave.tar.gz tar xfz iaxclient-01-12-2006-beave.tar.gz cd iaxclient-01-12-2006-beave/lib/In this version I had to patch the code slightly to get it to compile. Here's the patch:
--- iaxclient_lib.h 2008-04-21 19:28:47.000000000 +0100 +++ iaxclient_lib.h.old 2005-01-03 21:03:39.000000000 +0000 @@ -191,7 +191,7 @@ extern iaxc_event_callback_t iaxc_event_ extern MUTEX iaxc_lock; /* external audio functions */ -static void iaxc_external_service_audio(); +void iaxc_external_service_audio(); /* post_event_callback */ int post_event_callback(iaxc_event e);
Then, compile the library and get it installed.
make sudo cp libiaxclient.a /usr/lib sudo cp iaxclient.h /usr/include sudo ldconfig
Awesome.
As long as that went well, all we need to do now is get and compile iwar. I've configured it without MySQL, as i don't care much for that. However if you'd like to use MySQL logging, you'll need the MySQL libraries installed and remove the --without-mysql from the configure command. To get the libraries installed, do something like:
apt-get install libmysqlclient15-dev
That should do the job.
Now, I'm downloading the iWar source - again I suggest you check the iWar website to make sure you get the latest version.
cd wget http://www.softwink.com/iwar/download/iwar-0.071.tar.gz tar xzf iwar-0.071.tar.gz cd iwar-0.071 ./configure --without-mysql make sudo make install
This should all go fine - IAX2 should be enabled if it finds the library okay.
Configuring iWar
Since we're not using a modem, we'll need to edit the config file slightly.
By default, the config file is in /usr/local/etc/iwar.conf. So lets edit that
editor /usr/local/etc/iwar.conf
You want to scroll down to the iax section, and change some values. For FWD, use something like this:
iax2_usernameiax2_password iax2_host iax2.fwdnet.net iax2_callerid_number
Obviously, you can put in a different host if you're not using FWD. Remember that you need IAX enabled on your account to let this happen. It takes them a little while to get it enabled, so don't expect to activate and be able to use it immediately. See the beginning of the tutorial for how to get that done.
Running iWar
Now we're (almost) ready to roll. There are a couple of differences with running iWar with VoIP as opposed to a real modem. It won't detect carriers, ringing, busy tones or otherwise. You'll need to skip/mark numbers by listening to them yourself. There have been mutterings about including some DSP in the future to detect carriers and such, but I wouldn't hold out for anything just yet. For carrier detection and system identification, you can also use iWar with a real modem, which is beyond the scope of this tutorial.
If you want to scan the US toll free numbers 1-800-253900 to 1-800-253999, then you'll probably want to use a predial. This is the part of the number that stays the same for every call, in this case only the last 2 digits change, so your predial will be 1-800-2539, and the range will be 00-99.
To enable IAX dialing, use the -i option. Lowercase i take a parameter, which is the IAX logfile - good for debugging. Uppercase I takes no parameters, and dumps debug info.
As an example, to dial the range above, the command line might look something like this
iwar -i iwar-iax.log -e *18002539 -r 00-99
(with FWD, to call toll free US numbers you need to use *1800. Change this for your provider if required).
And off you go! iWar uses the soundcard output so you can listen to the calls. To skip a number, press SPACE. To mark a number as interesting, press M. Both keystrokes will disconnect the call immediately and go onto the next number.
Once the scan is complete, you'll find that iwar.log contains a list of the numbers you marked as interesting.
For more info on command line options, check out the README that comes with iWar. There are a bunch of cool options, including full logging and other things.
Configuring Asterisk to talk to iWar
If you're using your own Asterisk PBX to dial from (which is probably better than using FWD directly), you'll need to add a few lines to your iax.conf file.
[iwar] type=friend host=dynamic username=iwar secret=context=local
You might want to change the host to the IP that the machine using iWar will be on, rather than dynamic. Also, set the context variable to whatever context you'd like iWar to be dialing from.
And that's about it!
Have fun and be sensible with your new found wardialing powerz :p