Asterisk on xen
so, I don't like giving out my cellphone number, as like most Americans, I have a locked-down (carrier subsidized) cellphone that gives me little control over who can and can not ring my phone. Also, my cellphone plan is a data-only plan (I pay $30/month for unlimited data and txt, but I have no included minutes. if I use the so-called voice features of my sidekick, it costs $0.30 per minute, so I'd prefer to use SIP.)
So, a few years back I signed up with a provider that will rent you IAX trunks for cheap... http://nufone.net (now defunct). I've got an 866 (US toll-free) number, and I had it setup with my previous astrisk setup, something that was not important enough to move last time I moved.
So, I'm setting it up now. I created a 128M Debian image for myself: apt-get install asterisk edit /etc/defaults/asterisk and set RUNASTERISK=yes First, I want to make it so that I can dial into the asterisk system. I've got Ekiga installed on my box (a CentOS 5.2 box; this must have been part of the default install, I don't remember installing it) but first I need to make a sip account on the asterisk server. edit /etc/asterisk/sip.conf - first, change realm=asterisk.xen.prgmr.com scroll down to
- Definitions of locally connected SIP phones
and add
[luke-home] type=friend context=from-sip callerid=Luke Crawford <8664385853> nat=yes ; because my home box is behind a nat qualify=yes; to keep the nat session open secret=*****
(the bit in brackets is the username)
I start it up, I hit edit-> accounts account name: luke-home protocol: sip registrar: asterisk.xen.prgmr.com user: ***** password: *****
at this point, I start up asterisk, and
tail -f /var/log/asterisk/messages
next I conect from my local sip client, I see:
Jul 6 11:43:34 NOTICE[2806] pbx.c: Cannot find extension context 'from-sip'
in the logfile. So, now I go back to my nufone.net control panel.
from my nufone.net control panel, I click 'new device' -> asterisk using iax
from there I created a username/password and 'unique name' (I use the dns name for the host) everything else can be left default.
The next screen gives me:
Add the following to your iax.conf: [NuFone] type=peer host=switch-1.nufone.net secret=********* and the following to extensions.conf: exten => _1NXXNXXXXXX,1,Dial,IAX2/*******@NuFone/${EXTEN} ...in the appropriate context as defined by your source channel (Zap, SIP, etc) There is no need to register for outbound calls. Make sure you set a valid, 10-digit US48 CallerID value. Unset or Invalid CallerID values can cause call failures. Note: This tutorial only details outbound calling. If you have a telephone number from us, you will find the inbound calling tutorial under the Number detail section of the Members Portal.
ok, so I append:
[NuFone] type=peer host=switch-1.nufone.net secret=*********
to iax.conf,
and now I edit extensions.conf, appending:
exten => _1NXXNXXXXXX,1,Dial,IAX2/*******@NuFone/${EXTEN}
I can now make outgoing calls
In the morning, incoming calls.