Monday, May 17, 2010

Possible Success?

I've just now been able to make four consecutive calls to John's home number that have gone through to the answering machine, which is certainly a good sign.

Since calls used to wind up with the AT&T (or whatever) lady telling us nicely that
"We're sorry, your call cannot be completed as dialed. Please check the number and dial again." and that we could get some outgoing calls to go through and incoming calls work 100% of the time (as tested so far), I decided that the Asterisk server probably wasn't the problem. I asked on the Asterisk forums which are fairly quiet, but still have a couple people who know what they're talking about frequently giving helpful advice. One of them suggested that it was more than likely some sort of timing issue between the Linksys and the phone company.

Thankfully there aren't many relevant timing settings in the Linksys control panel, so I systematically adjusted one of the 4 or 5 that looked to be likely candidates to see what happened (They're all in the Admin -> Voice -> PSTN Line -> FXO Timer Values section). Neither VoIP Answer Delay or PSTN Answer Delay had any effect, which didn't surprise me because we weren't having issues with answering incoming calls (although I guess I've never tried answering an incoming VoIP call from the Linksys). The PIN timeout settings weren't relevant, and "Ring thru" was not something I'd seen mentioned in any of the guides/webpages I had skimmed researching the problem.

The problem seems to have been that PSTN Dialing Delay , previously set to 1, was not long enough. I don't know what kind of "handshaking" goes on behind the scenes when one tries to connect a PSTN call, but based on the terminology I'd guess that previously Asterisk didn't wait long enough to make the proper connection to the PSTN, perhaps truncating or otherwise corrupting the number in the process and leading to the "We're sorry" message. The setting that is working consistently at the moment is:
PSTN Dialing Delay: 2
Maybe you can try it on your end to see if things are working in Kansas like they are in Virginia?

Friday, May 14, 2010

Still Puzzled....

...as to why Asterisk-to-PSTN calls don't work 3/4 times or so. Haven't found anything conclusive after a couple days of digging.

Monday, May 10, 2010

Asterisk Configuration for SPA3102- Outgoing Calls

In sip.conf I added the "line1" user. Note that this could be whatever you want, but you'd have to change the Linksys configuration.
[line1]
type=friend
host=[IP addr of Linksys]
username=line1
secret=[password]
dtmfmode=rfc2833
context=outbound-local
insecure=port,invite
disallow=all
allow=ulaw
nat=yes
qualify=yes
port=5061
I mentioned a bit earlier that I was getting warnings and errors in the console about registering. The error message was pretty straightforward:
[May 10 19:36:08] NOTICE[23761]: chan_sip.c:21538 handle_request_register: Registration from 'line1 ' failed for '[Linksys IP]' - Peer is not supposed to register
[May 10 19:36:12] ERROR[23761]: chan_sip.c:13010 register_verify: Peer 'line1' is trying to register, but not configured as host=dynamic
Obviously the error was due to the "host" attribute not being dynamic. For some reason calling out didn't work if the host was dynamic and I'm not exactly sure why. To clean up the console I just turned off registration for this particular peer.

In extensions.conf I created a new context:
[outbound-local]
exten => _9XXXXXXX,1,Dial(SIP/${EXTEN:1}@line1,25)
This matches any 8-digit pattern in which the first digit is 9 (patterns are prefaced with an underscore). The ${EXTEN:1} variable passes the number dialed to the trunk, and the ":1" strips off the 9. Sadly this is what took me so long to figure out, and I'm still confused about the syntax of the above "Dial" application, which seems different from what's in the book. Maybe it's a version issue?

Linksys SPA3102 Modified Configuration- Outgoing Calls

I can't remember if I covered this in the post showing the config for the PSTN Line incoming calls, but this is all on the "Line 1" tab in the Linksys Advanced Admin Tab.

-> Line Enable: yes

-> NAT Settings
NAT Mapping Enable: no
NAT Keep Alive Enable: no
-> SIP Settings
SIP Transport: UDP
SIP Port: 5060
-> Proxy and Registration
Proxy: [IP address of Asterisk server]
Use Outbound Proxy: no
Register: no
Make Call Without Reg: yes
Ans Call Without Reg: yes
-> Subscriber Information
Display Name: line1 [ /whatever you want]
User ID: line1
Password: [choose a password]
-> Dial Plan
Dial Plan: (*xx|[3469]11|0|00|[2-9]xxxxxxxxxS0|1xxx[2-9]xxxxxxS0) [this is the default]

Local Calls Success

After several days of treading water, I finally was able to make a local call from XLite to John's house (I didn't leave a message, sorry). In theory I believe anyone should be able to make calls in your area code from XLite, and the dialplan won't recognize numbers longer than 7 digits.

To "dial out", preface the local number with "9" (this could be changed to whatever we want). In XLite (and apparently in most VoIP phones) the dial tone doesn't "pause" like it would on a touchtone phone... probably because there's no dial tone to begin with. The leading 9 is stripped off when Asterisk passes the string to the Linksys. So for example, if the local number was 1234567 you'd enter 91234567 in XLite.

Technical details will be coming soon, as soon as I can figure out exactly how many circles I went in to eliminate me writing the same thing multiple times.

EDIT #1: It takes a few seconds for the PSTN line to start ringing.

EDIT #2: For some reason a flurry of error messages pop up in the console because I had to assign a static IP for the outgoing line's host. Not sure how to get around this at the moment.

Edit #3: Now I get a "We're sorry, the call cannot be completed as dialed" message ...

Edit #4: ...but it connects when I call Sarah? Strange. Maybe you can try it out and let me know how it goes.

Tuesday, May 4, 2010

Dialing Out from Asterisk- Local Calls

I think I've set up the system so that one can dial out to a local phone number from XLite. Put "9" before the 7-digit number and see if it connects. The pattern-matching line I have in there now disallows numbers longer than 7 digits.

(911 should work too, but maybe don't test that one out)

edit: never mind, doesn't work.

Asterisk Configuration for SPA3102- Incoming Calls

Two files needed to be modified for the PSTN-to-Asterisk connection.

I added the user "pstn" to /etc/asterisk/sip.conf
[pstn]
type=friend
host=dynamic
secret=*******
dtmfmode=rfc2833
context=pstn
insecure=very
nat=yes
qualify=yes
To forward an incoming call to my Asterisk extension, I created a new "pstn" context in /etc/asterisk/extensions.conf
[pstn]
exten => 1000,1,Dial(SIP/1000)

Linksys SPA3102 Modified Configuration- Incoming Calls

Here are the settings for the Linksys SPA3102 that allow us to call the local 913 number assigned to the device and have it forward to an XLite softphone. You need to log into the Linksys and switch to admin mode, "advanced" configuration.

**Also note that this is the result of several contradicting directions, found here, here, and here.

These are the options I changed. If something isn't mentioned, the default setting should work.

Router

-> WAN Setup Tab
[Same as initial configuration]
-> LAN Setup Tab
Networking Service: Bridge
Enable DHCP Server: no
-> Application Tab
Enable DMZ: no
Voice

->SIP tab
->SIP Parameters
SIP TCP Port Min: 5060
SP TCP Port Max: 5060
->RTP Parameters
RTP Port Min: 16384
RTP Port Max: 16390
-> NAT Support Parameters
STUN Enable: yes
STUN Test Enable: yes
STUN Server: stun.ekiga.net
EXT IP: [IP address of the box]
->PSTN Line tab
-> Line Enable: yes
-> NAT Settings
NAT Mapping Enable: no
-> SIP Settings
SIP Port: 5061
EXT SIP Port: 5061
SIP Debug Option: full
-> Proxy and Registration
Proxy: [IP address of Asterisk Server]
Register: yes
Make Call Without Reg: no
Answer Call Without Reg: yes
-> Subscriber Information
Display Name: PSTN
User ID: pstn
Password: [whatever you specify]
-> Dial Plans
Dial Plan 1: S0<:1000@[IP addr of Asterisk Server]>

-> VoIP-To-PSTN Gateway Setup
VoIP-To-PSTN Gateway Enable: yes
Line 1 VoIP Caller DP: 1
VoIP Caller Default DP: 1

-> PSTN-To-VoIP Gateway Setup
PSTN-To-VoIP Gateway Enable: yes
PSTN Ring Thru Line 1: no
PSTN CID for VoIP CID: yes
PSTN Caller Default DP: 1
-> FXO Timer Values (sec)
VoIP Answer Delay: 0
PSTN Answer Delay: 2

Monday, May 3, 2010

Initial Configuration of Linksys SPA3102

Initial Confiuration of Linksys SPA3102

Here is what I have done so far ( I have omitted steps that lead to a dead end).

Unpacked and connected cables:
Network cable from my existing router went to “internet” port.
Placed a splitter in the dsl phone line, ran the data side back to the router.
Connected cable from the dsl splitter to the “line” port.
Connected an analog phone to the “phone” port.
Connected the power supply.

With the analog phone:
(had to disconnect the “line” port, evidently default config is to connect the analog phone to the line which messes up the IVR capability of the analog phone)
Dialed ****
Dialed 110# --> msg received: 192.168.1.117
Dialed 7932# 1# 1# --> msg recv: configuration saved (enabled web interface)

From PC connected to the same network:
Browse to 192.168.1.117
Click on Admin Logon
Tab to Wan Setup
Change configuration to:
Connection Type: Static
Static IP: 192.168.1.2
NetMask: 255.255.255.0
Gateway: 192.168.1.1
DNS 208.67.222.222, 208.67.220.220

Downloaded a firmware upgrade from http://www.cisco.com/en/US/products/ps10027/index.html
Upgraded from 3.x to 5.1

Reattached Browser to 192.168.1.2
set admin & user password to ***
Closed browser & reattached
Login OK, it only logs in as user and then allows upgrade to admin

Added SIP access from my router on this network.

PSTN-to-Asterisk Success

The current setup allows someone to call the number for the Linksys and have it ring to my Asterisk extension. However, it's going to take me a while to go back through and document everything I did.

The Linksys seems to take care of all the necessary conversion, turning the analog signal into a SIP trunk. I also haven't figured out how to dial out from XLite to the Linksys yet.

If you log into the server and enter the Asterisk CLI
# asterisk -vvvvvr
and then type
> sip show peers
you'll see the "pstn" peer and the ping. It seems to be holding steady at about 70 ms, which isn't too bad.

Mailboxes in sip.conf

I added the line:
mailbox=XXXX@default
to each user in sip.conf. This stops the annoying
[May 3 14:59:17] NOTICE[8147]: chan_sip.c:21369 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 1000
message from popping up every 3 minutes when I'm in the Asterisk CLI.

Saturday, May 1, 2010

Weasels, Hello World

I forgot to note that I changed the weasels and Hello world extensions to 999 and 998, respectively. Sorry about that; I meant to write it down but didn't.

Wednesday, April 28, 2010

A Handy Macro

I left off the last post with this:
exten => 1000,1,Dial(${MILES},${DELAYTIME})
exten => 1000,n,GoToIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
exten => 1000,n(unavail),VoiceMail(1000@default,u)
exten => 1000,n,Hangup()
exten => 1000,n(busy),VoiceMail(1000@default,b)
exten => 1000,n,Hangup()
As the book points out, this is fine for small implementations of *, but as a system scales this becomes massively inefficient. I followed the book example to turn this into a macro and condense everything down to one line outside the macro's definition.

Macros are created in a pseudo-context prefaced with "macro-" ; I used
[macro-voicemail]
It also differentiates from pure contexts because each step uses the "s" extension. * has some handy built-in variables, including one to call the original extension ${MACRO_EXTEN}. Thus, our macro becomes
[macro-voicemail]
exten => s,1,Dial(${MILES},${DELAYTIME})
exten => s,n,GoToIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
exten => s,n(unavail),VoiceMail(${MACRO_EXTEN}@default,u)
exten => s,n,Hangup()
exten => s,n(busy),VoiceMail(${MACRO_EXTEN}@default,b)
exten => s,n,Hangup()
This is why I had the mailbox extensions the same as the SIP extensions.

The last thing to do was strip the last unique variable in the macro and add it back in as an argument. Since this happened to be my name, we can just put that in as the "n"th argument using the ${ARG n} variable built into the Macro() application. The macro becomes:
[macro-voicemail]
exten => s,1,Dial(${ARG1},${DELAYTIME})
exten => s,n,GoToIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
exten => s,n(unavail),VoiceMail(${MACRO_EXTEN}@default,u)
exten => s,n,Hangup()
exten => s,n(busy),VoiceMail(${MACRO_EXTEN}@default,b)
exten => s,n,Hangup()
And now instead of the messy, 6-line statement in the [internal] context in the dialplan we started out with, we can just write
exten => 1000,1,Macro(voicemail,${MILES})
Here you can see where the ${ARG1} variable gets its value (the first argument after "voicemail" in the Macro application).

Voicemail Details

The original /etc/asterisk/voicemail.conf had a lot of commented options, so I renamed it voicemail.conf.sample and made a new one. There are three contexts: [general] holds various global options, [zonemessages] are for timezones, and [default] (which can be renamed whatever you want) holds the mailbox information.

Currently, this is what each section looks like (with brief explanation):
[general]

format=wav49|gsm|wav
serveremail=asterisk
attach=yes
skipms=3000
maxsilence=10
silencethreshold=128
maxlogins=3
emaildateformat=%A, %B %d, %Y at %r
sendvoicemail=yes
As I said, these are all global options and most are self-explanatory. You can find technical definitions of each option here, along with a bunch of others I didn't include.
[zonemessages]

eastern=America/New_York|'vm-received' Q 'digits/at' IMp
central=America/Chicago|'vm-received' Q 'digits/at' IMp
central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'
military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
european=Europe/Geneva|'vm-received' a d b 'digits/at' HM
These are just time zone settings. Full explanation of zonemessages is midway down the page here.
[default]

1000 => 9999,Miles K,email.removed.to.stop.spam@gmail.com
1001 => 9999,John M
....
Mailboxes are simple to set up. It's the extension followed by the passcode, Name (it knows that the last name is separated from the first name by a space!), and notification e-mail address. You can also add a pager e-mail address (pagers....hah!) and various overrides to the global options that are specified in [general].

The addition of voicemail necessitates changes to the dialplan (extensions.conf) which happened in a somewhat circular way as I followed the book's example. At first there was the no-brainer approach, taking this:
exten => 1000,1,Dial(${MILES},${DELAYTIME})
exten => 1000,n,Playback(vm-nobodyavail)
exten => 1000,n,Hangup()
into this:
exten => 1000,1,Dial(${MILES},${DELAYTIME})
exten => 1000,n,VoiceMail(1000@default,u)
exten => 1000,n,Playback(vm-nobodyavail)
exten => 1000,n,Hangup()
The VoiceMail() application takes two arguments: (mailboxNumber@mailboxContext, statusIdentifier). mailboxNumber and mailboxContext are what got entered into voicemail.conf. statusIdentifier can be either "u" (unavailable) or "b" (busy). The above is not very robust as it only has directions for an "unavailable" user and no instructions if the user is busy. The second incarnation is:
exten => 1000,1,Dial(${MILES},${DELAYTIME})
exten => 1000,n,GoToIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
exten => 1000,n(unavail),VoiceMail(1000@default,u)
exten => 1000,n,Hangup()
exten => 1000,n(busy),VoiceMail(1000@default,b)
exten => 1000,n,Hangup()
This makes use of the DIALSTATUS variable to tell * what message to play in the unavailable/busy scenarios, kind of like a decision tree.

Voicemail

Voicemail should now be set up for all users. I tested it out by calling myself in XLite and leaving a message; it recorded as well as I could expect from my crappy computer microphone and the built-in options seem to work fine.

Some features we have now:

-Internally searchable directory
  • Dial "8" to search by first name (everyone has a first name as entered)
  • Dial "9" to search by last name (Only John, Sarah, Jane, Katie M currently have last names)
-Individual mailboxes that can hold up to 100 messages (this is the default and can be changed upwards or downwards)

-Access to your mailbox by dialing extension "700" and then your Asterisk extension number. It doesn't have to be this way, I just thought it'd be easiest for now.

-Each mailbox is passcode protected- currently the default is 9999 (can be changed).

-Currently when your extension is dialed, Asterisk will ring for 30 seconds before transferring to voicemail.

-I haven't been able to try this out, but in theory if you are on the other line and you receive a call, Asterisk will ring for 30 seconds before automatically sending the caller an "I'm busy" dialogue before forwarding them to voicemail.

-In theory, Asterisk can be set up to send you e-mail alerts when you have a new voicemail. I entered my gmail address to test it out, but didn't get any e-mails. This is either because notification isn't instant (in which case I have no idea where I'd adjust the time period after which * checks for new voicemail) or something isn't configured right. I'll keep looking into it.

Technical details to follow after I run to the grocery store.

DELAYTIME variable

To make things easier, I defined a global variable in extensions.conf
DELAYTIME=35
...which is the amount of time in seconds that Asterisk will "ring" before giving the "Unavailable" message and hanging up (I'm still reading about voicemail).

Side note: Swiss French keyboards are incredibly annoying with any form of input involving {brackets}, as the { key appears as è while the } key appears as ¨ (the umlaut). Not to mention QWERTZ vs QWERTY...

Linksys ADC

[This is a summary of a couple of e-mails]

John found the Linksys SPA3102 Voice Gateway Router which appears to offer a hardware solution that would solve my inability to install DAHDI on our cloud server. There's even a configuration guide to make it work with Asterisk. If this device does what I think it does, it would eliminate the need to install the DAHDI drivers, as the output of the Linksys appears to be just like any other SIP client. That would be very nice!

Friday, April 23, 2010

Users Added to the Dialplan

I made the necessary adjustments to the dialplan so that the people assigned to a given extension can now dial another person's extension to "call" them- which really means that when a certain extension is dialed, Asterisk now has instructions on what to do upon detecting that extension.

DAHDI Installation Unsuccessful

...and now for today's letdown. I downloaded the latest version of DAHDI and the DAHDI tools from digium, but am running into the "linux sources" error I ran into back in March.
You do not appear to have the sources for the 2.6.32.1-rscloud kernel installed.
make: *** [modules] Error 1
I hesitate to jump to the conclusion (again) that this would be solved using a CentOS or non-cloud version of Linux, but I'm not really sure. What I do know is that extensive searching on "sources for 2.6.32.1-rscloud kernel" does not yield very helpful results other than "such-and-such won't work on a non-CentOS kernel."

Call Success!

John and I made a call to one another today which went very well. The nature of the SIP/SIP connection has Asterisk acting only as a facilitator to get two endpoints talking directly to one another.

SIP/SIP connections mean that call quality is determined by the speed and available bandwidth of the two connecting clients, not on the ability of the Asterisk server to process data quickly. Processor speed and other hardware requirements become an issue with PSTN lines connecting to pretty much everything else, as well as connecting the Asterisk PBX to the cellular network (both scenarios in which additional hardware is required).

Added More Users

Modified /etc/asterisk/sip.conf with 10 additional users as per the e-mail I sent to John. Also changed the existing passwords to something a bit harder to guess.

Friday, April 16, 2010

Zaptel -> Dahdi

I was browsing the Asterisk Support Forums today and came across a post that said Zaptel has been replaced by something called "Dahdi" for more recent versions of the Linux Kernel. I guess that explains why it wouldn't compile.

Friday, April 9, 2010

Silly Mistake Re: "Dial"

Removed the following lines from modules.conf (which, stupidly, were added by me a few days ago) to solve the "dial" problem below.
noload => app_queue.so
noload => app_dial.so
noload => features.so

Thursday, April 8, 2010

"Dial" Application Not Installed?????

I was trying to set up an extension so that SIP user 1000 could call user 1001 by dialing an extension using the Dial() command in extensions.conf. However, it appears that the Dial application wasn't installed?

(Using core show applications from the CLI)
ControlPlayback:
DateTime:
DBdel:
DBdeltree:
DeadAGI: Executes AGI on a hungup channel
Dictate:
Directory:
DISA:
DumpChan:
EAGI: Executes an EAGI compliant application
...definitely not there. Perhaps it was part of Zaptel, although it seems strange to me that Dial wouldn't be installed as a SIP-only configuration seems like it would be fairly common, and not dependent on FXS/FXO analog channels.

Right now I'm trying to find out how to install it.

Wednesday, April 7, 2010

Added Another Test User

I've added another test user to our setup with the following lines in the sip.conf :
[1001]
type=friend
nat=yes
username=1001
context=phones
host=dynamic
secret=4321
Perhaps you'd like to try to get XLite to connect on your end? The following settings should work, although the menus are probably slightly different in Windows.
Display Name: John (can be whatever you want)
User name: 1001
Password: 4321
Authorization user name: 1001
Domain: [IP of the server]
Once you get it to connect, dial "500" and see if you hear the "weasels" message.

Monday, April 5, 2010

Call Success

I tweaked the test dialplan so it plays back the file "tt-weasels" when the number "500" is dialed from XLite. The file played back successfully.

The dialplan:
[globals]

[general]

[default]
exten => s,1,Verbose(1,Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()

[incoming_calls]

[internal]
exten => 500,1,Verbose(1,Echo test application)
exten => 500,n,Playback(tt-weasels)
exten => 500,n,Hangup()

[phones]
include => internal

Some things to keep in mind:
-The book still uses the pipe | symbol as a delimiter. This has since been replaced with the comma, and the asterisk CLI will show a warning if you have a pipe in the dialplan.
-I turned off the various demo contexts from "make samples" by editing modules.conf with the following lines:
; Turns off the pbx_ael "demo"-created contexts in the dialplan
noload => pbx_ael.so
noload => app_queue.so
noload => app_dial.so
noload => features.so
(; precedes comments)
-If you make a change to the dialplan you have to reload it in the asterisk CLI with dialplan reload.

Got XLite to Connect!

After a bit of reading on the sip.conf page on voip-info I figured out what I had to change in order to get the program to connect to the asterisk server.



The book's default sip.conf file was insufficient to deal with the layer of NAT I'm sitting behind with my home router. Luckily asterisk now has an nat option you can put in the sip.conf file that fixes this. The test sip.conf file now looks like this:
[general]

[1000]
type=friend
nat=yes
username=1000
context=phones
host=dynamic
secret=1234
The settings in XLite in the SIP Accounts section:
Display Name: Miles (can be whatever you want)
User name: 1000 (can be whatever you want, but must match "username" in sip.conf)
Password: 1234 (matches "secret" in sip.conf)
Authorization user name: 1000 (not sure what this is, honestly)
Domain:
Everything else was left as default. I also had to forward the ports on my home router (5060-5070).

Thursday, April 1, 2010

Nothing Exciting Today

Right now I think the problem is some combination of NAT, the vsftpd/openssh conflict, and a healthy dose of not knowing exactly what's going on with certain things (mostly the config files and how a SIP connection actually behaves). I didn't do anything noteworthy today (besides walking around the uncomfortably crowded Cherry Blossom Festival).

The distro issue (Ubuntu vs. CentOS vs. whatever) is probably more of a convenience thing at the moment; I did a bunch of searching on various combinations of "asterisk ubuntu" but there's nothing particularly enlightening other than a fair number of websites saying the equivalent of "NAT makes things hard." Of course there's something to be said about starting fresh after a "trial run," although I'm not sure if I want to start the precedent of wiping everything when I hit a roadblock ;-)

I think I'm going to re-read the book and some various guides I came across today, voip-info.org/wiki/view/asterisk in particular looks like it could be helpful.

Wednesday, March 31, 2010

SIP Phone Configuration

Following the steps starting on page 110, (in /etc/asterisk/)
mv sip.conf sip.conf.sample
touch sip.conf
nano sip.conf
Added the lines:
[general]
[1000]
type=friend
context=phones
host=dynamic
The book is a little confusing at this point, vsftpd is already installed, but I followed the directions...
anonymous_enable=NO
was changed in the vsftpd.conf file, then
groupadd PlcmSpIp
useradd PlcmSpIp -g PlcmSpIp -p PlcmSpIp
passwd PlcmSpIp

However,
vsftpd/vsftpd.chroot_list

doesn't seem to exist?

Zaptel Shelved (Again)

After reading some more about Zaptel and its purpose in the Asterisk system (and given the error I mentioned when trying to compile it yesterday) I don't think it is needed for a pure VoIP system. From the book:
For the first few sections on FXO and FXS channels, we’ll assume that
you have a Digium TDM11B kit (which comes with one FXO and one FXS interface).
This will allow you to connect to an analog circuit (FXO) and to an analog telephone
(FXS). Note that this hardware interface isn’t necessary; if you want to build an IP-only configuration, you can skip to the section on configuring SIP.
I figure that if it ever gets to the point where this is important,
  • We'll be working on our own box
  • We'll get to choose the Linux distro to install on the box (CentOS would be nice, as there is a ton of documentation in the support archives for CentOS and not for much else)
  • Analog connections might not be necessary in the first place
  • Being on our own system opens up the possibility of installing AsteriskNOW, which provides a GUI and does the work for you (but requires installation from a CD)
For now I'm ignoring the Zaptel instructions, unless I'm missing something important as to if it's necessary or not?

Asterisk Start/Stop

Since I did the make config command, asterisk can be started and stopped with
service asterisk start
service asterisk stop
(More so I don't have to scroll through the book every time I forget)

Tuesday, March 30, 2010

More Installations

-Tried to actually install Asterisk;
cd /usr/src/asterisk-1.6.2.6
make clean
./configure
However there were errors:
configure: *** XML documentation will not be available because the 'libxml2' development package is missing.
configure: *** Please run the 'configure' script with the '--disable-xmldoc' parameter option
configure: *** or install the 'libxml2' development package.
-Installed libxml2 2.7.7 according to these instructions, but still got the error- installed in the wrong place?

-Tried
./configure --disable-xmldoc
and got the ascii-asterisk logo.
(Which is probably a good thing)

-Did
make menuselect
make install
and got...
+---- Asterisk Installation Complete -------+
+ +
+ YOU MUST READ THE SECURITY DOCUMENT +
+ +
+ Asterisk has successfully been installed. +
+ If you would like to install the sample +
+ configuration files (overwriting any +
+ existing config files), run: +
+ +
+ make samples +
+ +
+----------------- or ---------------------+
+ +
+ You can go ahead and install the asterisk +
+ program documentation now or later run: +
+ +
+ make progdocs +
+ +
+ **Note** This requires that you have +
+ doxygen installed on your local system +
+-------------------------------------------+
-Ran
make samples
make config
-Decided to install Zaptel anyways since the book references it everywhere and seems to imply that it won't work without.
cd /usr/src
wget http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz
tar -zxvf zaptel-1.4-current.tar.gz
-Downloaded and installed libpri
wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
tar -zxvf libpri-1.4-current.tar.gz
-Tried to compile Zaptel;
cd /usr/src/zaptel-1.4.12.1
make clean
./configure
make
...at this point I got an error:
You do not appear to have the sources for the 2.6.32.1-rscloud kernel installed.
exit 1

Clean Up

Moved old tars and .debs to a holder directory.
cd /usr/src/
mkdir old-install-files
mv *.deb old-install-files
mv *.tar.gz old-install-files

Loose Ends

I mentioned that a couple of things in the initial required packages hadn't been installed yet, I took care of the rest of them today thanks to the Asterisk Tips for users of Ubuntu.

-newt-devel (optional) installed:
apt-get install libnewt-dev
-zlib-devel (optional) already installed.

-unixODBC, unixODBC-devel installed
apt-get install unixodbc unixodbc-dev
-OpenSSL already installed.

Linux Headers Figured Out (I think)

After much digging (and learning that the server is amd64 and not i386 after trying to install the i386 package), the Linux Kernel Header problem from earlier should be solved now.

I had to dig through the Debian software packages to find the right files, of which I needed 3:
linux-headers-2.6.32-4-common_2.6.32-10_amd64.deb
linux-kbuild-2.6.32_2.6.32-1_amd64.deb
linux-headers-2.6.32-4-amd64_2.6.32-10_amd64.deb
...all of which were available at
http://ftp.us.debian.org/debian/pool/main/l/[filename].

I used
dpkg -i [filename]
to install them.

More Package Installation

-Ran apt-get update to make sure Ubuntu was updated (following general instructions here)


-Trying to figure out the Linux Kernel Header business...
cat /proc/ver
yields:
Linux version 2.6.32.1-rscloud (root@builder.slicehost.com) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) ) #15 SMP Mon Feb 22 13:22:15 UTC 2010
However
apt-get install linux-headers-`uname -r`
unsurprisingly gives the error
E: Couldn't find package linux-headers-2.6.32.1-rscloud
Tried various combinations of "apt-get install linux-headers-2.6.32***" without success. Left alone for now, but possibly not needed? Will come back to this later. It also might not be possible to install things like this on the VM.

-Following instructions here (which after some Googling seem to be applicable to the cloud setup)...

-Downloaded Asterisk 1.6.2.6 (in cd /usr/src)
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.6.tar.gz
tar -xzvf ./asterisk-1.6.2.6.tar.gz

-Downloaded the add-ons
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-addons-1.6.2.0.tar.gz
tar -xzvf ./asterisk-addons-1.6.2.0.tar.gz

-Downloaded and installed libmxml
wget http://ftp.easysw.com/pub/mxml/2.5/mxml-2.5.tar.gz
tar –xzvt mxml-2.5
cd mxml-2.5
./configure
make
make install
-Downloaded ilbc codec
cd /usr/src/asterisk-1.4.22.1/codecs/ilbc
wget http://www.ietf.org/rfc/rfc3951.txt
wget http://www.ilbcfreeware.org/documentation/extract-cfile.awk
awk -f extract-cfile.awk rfc3951.txt
Zaptel apparently not needed as we can't add a Digium card.

Taking a break for a while.

Monday, March 29, 2010

Starting out...

Tried to install the necessary packages listed on page 67 of the book.

-Successfully installed gcc.

-The ncurses-devel package is covered in libncurses and libncurses-devel for Ubuntu, both of which were successfully installed. Followed instructions from here.

-libtermcap-devel not found

-Kernel Development Headers not found

-gcc c++ not found (but already included with Ubuntu)

-OpenSSL (optional) not attempted

-newt-devel (optional) not found

-zlib-devel (optional) not found

-unixODBC; unixOBDC-devel (optional) not found

-libtool installed successfully

-GNU make already included with Ubuntu

Several of these packages have alternates as suggested on the page I linked to above (Asterisk Tips for...Ubuntu) but I didn't have time to go through them properly tonight. I'll take a closer look at it tomorrow.