5.7. Getting Real VoIP with Free World Dialup

You want to get your Asterisk server up and running and connected to the outside world as quickly as you can. So, you want to start off with some basic VoIP services and start making calls over the Internet.

Connect your Asterisk server to Free World Dialup (FWD).With Free World Dialup, you can make free calls to other FWD users, and to the users on the networks that FWD peers with.(A notable exception is the party pooper Vonage, which does not wish to associate with other VoIP networks.)

First, go to Free World Dialup (http://www.freeworlddialup.com/) and sign up for an account. When you receive your welcome email, log in and change your password.

Then, go to the Extra Features link and enable IAX because you'll be setting up an IAX trunk for FWD.

Now, fire up your trusty text editor and configure /etc/asterisk/iax.conf and etc/asterisk/extensions.conf. We'll use /etc/asterisk/sip.conf and /etc/asterisk/voicemail.conf from Recipe 5.5.

In these examples, the FWD login is asteriskuser, password 67890, FWD phone number 123456. Incoming FWD calls are routed to Ellen Ripley at extension 250.

	;;iax.conf;;
	[general]
	context=default
	port=4569
	bindaddr=0.0.0.0
	disallow=all
	allow=gsm
	allow=ulaw
	allow=alaw
	register => 123456:67890@iax2.fwdnet.net
	
	[fwd-trunk]
	 type=user
	 context=fwd-iax-trunk
	 auth=rsa
	 inkeys=freeworlddialup

	;;extensions.conf;;
	
	[general]
	autofallthrough=yes
	clearglobalvars=yes

	[globals]
	CONSOLE=Console/dsp

	;free world dialup settings
	FWDNUMBER=123456
	FWDCIDNAME=asteriskuser
	FWDPASSWORD=67890
	FWDRINGS=SIP/ellenr

	[default]

	include => fwd-iax-trunk

	[local-users]
	include => default
	include => outbound

	exten => 250,1,Dial(SIP/ellenr,10)
	exten => 250,2,VoiceMail(250@local-vm-users,u)

	exten => 251,1,Dial(SIP/sarahc,10)
	exten => 251,2,VoiceMail(251@local-vm-users,u)

	exten => 252,1,Dial(SIP/dutchs,10)
	exten => 252,2,VoiceMail(252@local-vm-users,u)

	;Internal users can call each other directly with their 3-digit extensions:
	exten => _2XX,1,Dial(SIP/${EXTEN},30)
	exten => _2XX,n,Voicemail(${EXTEN})
	exten => _2XX,n,Hangup

	;retrieve messages by dialing ext. 550
	exten => 550,1,VoiceMailMain(@local-vm-users)

	[fwd-iax-trunk]
	;incoming Free World Dialup
	exten => ${FWDNUMBER},1,Dial,${FWDRINGS}

	[outbound]
	;outgoing FWD
	exten => _393.,1,SetCallerId,${FWDCIDNAME}
	exten => _393.,2,Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:3},60)
	exten => _393.,3,Congestion

Load the new dialplan:

	asterisk1*CLI> dialplan reload

Configure your firewall to allow port UDP 4569 traffic. Then, dial the FWD echo test at 393613. You'll be able to talk to yourself. Next, go to your your FWD account profile (my.FWD) and click the Callme button. The FWD server will call you and invite you to join a nonexistent conference. Now you know your setup is correct and working.

This gives you an easy way to practice setting up an IAX trunk, and to make and receive pure VoIP calls. Friends and associates can call your FWD number with a SIP or IAX phone and avoid toll charges.

Because Ellen doesn't want to play receptionist forever, Recipe 5.9 tells how to set up a digital receptionist to route incoming calls.

Asterisk 1.4 comes with an encryption key for Free World Dialup in /var/lib/asterisk/keys/freeworlddialup.pub. If you have any problems with the key, download a fresh one from FWD.

This recipe shows how to use user-defined variables in Asterisk. These go in the [globals] section of extensions.conf.