Asterisk
Overview
I am once again messing around with Asterisk systems. Now it's version 13. I used Asterisk for several years and then I went to a simpler system for a time. VOIP Then I went to having only the mobile.
My long history of using VOIP, compressed. Packet8 ($30/month) then Les.net (gone) then Grandcentral + GISMO5 (free!) then Google ate Grandcentral AND GISMO5 and gutted them. Then mobile phones for years.
Incoming calls
Currently all incoming calls route through my Google Voice number. I might be able to get Asterisk to pick up Google calls again some day?
Outgoing calls
I have used Les.net and voipjet.com which are both out of business. Nothing right now. I need to revisit this.
Business Asterisk system
Setting up PostgreSQL
When building Asterisk from source, you must have the postgres dev package installed before you do ./configure. Asterisk build is not good about telling you what is available when ./configure completes. You can do 'make menuselect' and see what will be available.
CEL = Channel Event Log, more details than CDR (CDR = Call Detail Record)
In cel.conf
enable=yes
In cel_pgsql.conf, at the bottom
hostname=localhost port=5432 dbname=asterisk password=yoursecretpasswordhere user=asterisk table=cel ; SQL table where CEL's will be inserted appname=asterisk ; Postgres application_name support (optional). Whitespace not allowed.
If you wish, follow suit and fix up res_pgsql.conf and cdr_pgsql.conf too.
Create the database, user and appropriate permission
su - postgres createdb asterisk echo "CREATE USER asterisk WITH PASSWORD 'yoursecretpasswordhere';" | psql echo "GRANT ALL ON DATABASE asterisk TO asterisk;" | psql
I got this code from voipinfo.org http://www.voip-info.org/wiki/view/Asterisk+cdr+odbc
CREATE TABLE cel ( id serial, eventtime timestamp with time zone NOT NULL DEFAULT now(), eventtype character varying(80) NOT NULL DEFAULT ::character varying, userdeftype character varying(80) NOT NULL DEFAULT ::character varying, cid_name character varying(80) NOT NULL DEFAULT ::character varying, cid_num character varying(80) NOT NULL DEFAULT ::character varying, cid_ani character varying(80) NOT NULL DEFAULT ::character varying, cid_rdnis character varying(80) NOT NULL DEFAULT ::character varying, cid_dnid character varying(80) NOT NULL DEFAULT ::character varying, exten character varying(80) NOT NULL DEFAULT ::character varying, context character varying(80) NOT NULL DEFAULT ::character varying, channame character varying(80) NOT NULL DEFAULT ::character varying, appname character varying(80) NOT NULL DEFAULT ::character varying, appdata character varying(80) NOT NULL DEFAULT ::character varying, accountcode character varying(20) NOT NULL DEFAULT ::character varying, peeraccount character varying(80) NOT NULL DEFAULT ::character varying, uniqueid character varying(32) NOT NULL DEFAULT ::character varying, linkedid character varying(80) NOT NULL DEFAULT ::character varying, amaflags integer NOT NULL DEFAULT 0, userfield character varying(255) NOT NULL DEFAULT ::character varying, peer character varying(80) NOT NULL DEFAULT ::character varying, CONSTRAINT cel_pkey PRIMARY KEY (id) );
See also source code contrib/scripts/realtime/postgresql/
for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" asterisk` ; do psql -c "alter table $tbl owner to asterisk" asterisk ; done
Sequences:
for tbl in `psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" asterisk` ; do psql -c "alter table $tbl owner to asterisk" asterisk ; done
Views:
for tbl in `psql -qAt -c "select table_name from information_schema.views where table_schema = 'public';" asterisk` ; do psql -c "alter table $tbl owner to asterisk" asterisk ; done
Personal Asterisk system
Hardware
Server is bellman (appropriate name for this) which runs Linux. I think Debian; at the moment its in storage!
1 Grandstream BT-100 Budgetone phone
1 Desktop running Ubuntu on the LAN with Ekiga softphone installed
Not using at the moment: 1 Packet8 DTA-310, reflashed to be a Leadtek BVA8051. See http://www.voip-info.org/wiki-Packet8+DTA310+and+Asterisk and http://www.stromcarlson.com/projects/dta-310/
Softphone
Using Ekiga on the same system that has Asterisk installed on it meant I had to run gconf-editor (apps->Ekiga->Protocols) to change the SIP listen port from 5060 to 5061 since Asterisk was already using 5060.
Ekiga is the softphone installed by default with Ubuntu 8.10 Hardy Heron. I've seen softphones I like more but it works for testing and I use hard phones most of the time.
Implementation
To install on Linux Mint 14 (or Ubuntu 12):
apt-get install asterisk asterisk-mp3 asterisk-mysql asterisk-flite asterisk-mobile
This installs dependencies that I also want, including voicemail and sound and music on hold files.
Customizations
As much as possible I keep general changes out of main config files by using include files. This makes updates much simpler. In sip.conf add this line: #include sip-wildsong.conf and in extensions.conf add this: #include extensions-wildsong.conf The voicemail.conf file warns agains this approach so I edit it directly.
For each of the extensions, I then add entries in sip-wildsong.conf and extensions-wildsong.conf and voicemail.conf.
I edit the web settings for the hard phones and the configuration settings for the Ekiga softphones.
That's about it.