Recently in Asterisk VoIP Category

In case you're interested in Sun/Oracle Openstorage, Fiberchannel Enterprise technologies or just want to drink a glass of fine beer - drop a note.

May 19th I am at Frankfurt Int'l Airport (Sheraton Airport Hotel) and from May 20th to 30th I will be staying in Cameroon meeting friends.

For Cameroon I am interested in internet connections. Last time I set up Orange Wimax connections and I am particularly interested in Camtel and MTN's offerings.

You may contact me at +49 171 6522660.


Asterisk on a NCD Thinstar 564.NET (532.NET) - Installation

| | TrackBacks (0)
After having set up the thinstar box  the next step consisted of the installation of Asterisk from source.

I installed unixODBC, unixODBC-devel, the mysql ODBC driver and the mysql server + libraries from the Suse 10.3 CD. After that I compiled the UW IMAP 2007 toolkit to have access to the IMAP voicemail feature of Asterisk.

Asterisk itself took 2 hours to compile, not really terrific...

show translation is also really low end:

thinstar*CLI> core show translation
         Translation times between formats (in milliseconds) for one second of data
          Source Format (Rows) Destination Format (Columns)

          g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722
     g723    -   -    -    -        -     -    -     -    -     -    -    -    -
      gsm    -   -   27   27       58    30   26   129    -     -    -   58    -
     ulaw    -  91    -    1       33     5    1   104    -     -    -   33    -
     alaw    -  91    1    -       33     5    1   104    -     -    -   33    -
 g726aal2    - 119   30   30        -    33   29   132    -     -    -    1    -
    adpcm    -  93    4    4       35     -    3   106    -     -    -   35    -
     slin    -  90    1    1       32     4    -   103    -     -    -   32    -
    lpc10    - 161   72   72      103    75   71     -    -     -    -  103    -
     g729    -   -    -    -        -     -    -     -    -     -    -    -    -
    speex    -   -    -    -        -     -    -     -    -     -    -    -    -
     ilbc    -   -    -    -        -     -    -     -    -     -    -    -    -
     g726    - 120   31   31        1    34   30   133    -     -    -    -    -
     g722    -   -    -    -        -     -    -     -    -     -    -    -    -

I also included chan_sccp to be able to access my Cisco 7960 phone.

Performance: Using 1 voice connection from ISDN to the Cisco phone, the CPU has approx 20 % load and no clicks or lost packets on the line. Remember, no format conversion is done in that case (alaw -> alaw).

Power consumption: 9 watts with the hard disk, 7 watts without. Not bad for an asterisk server.

I completed it with MySQL ODBC storage for the call data records and an Apache Webserver to be able to look these records from everywhere in the world...
At a company I saw many of these Thinstar terminals in a recycling container, ready to disassemble. I asked whether I could get some of them and yes, I was lucky.

thinasterisk1.jpgAfter opening the case I saw a Cyrix Geode GX processor, operated at 300 MHz, a 64 MB S0DIMM-RAM and a 32 MB Flash module, containing the Windows CE operating system.

I thought I could make an asterisk box out of it. There were two problems:

  1. The maximum RAM you can put into the S0DIMM slot is 128 MB, so a swap partition will be mandatory. Swapping on Flash is not something you really want to do.
  2. The 32 MB flash "disk" is far too small to install a Linux operating system and asterisk.

I decided to use a 160 GB 2,5" hard disk for storage and an AVM Fritz! ISDN card (PCI) to build up my test system. On the picture above you can see the mounted hard disk (it is fixed via screws on the front panel), the installed 128 MB notebook RAM module (66 MHz or 100 MHz (which is compatible to 66), a 133 will NOT work!) and the installed ISDN interface card.

BeroNet BN2S0 with Asterisk and misdn

| | TrackBacks (0)
Scenario: Two ISDN phones (a wireless DECT one and a comfortable one with cable) are to be connected to my Asterisk server which calls out via IAX2, SIP and ISDN.

As my mini case (which contains a VIA embedded board) does only have one PCI slot (via riser card), I chose the BN2S0 from BeroNet (Berlin).
It features a Cologne Chipset Design HFC chipset with 2 S0 (ISDN S/T) interfaces (click to enlarge):

IMG_41432.jpgEach port has to be configured for NT (acting as a phone line) or TE (acting as a client/phone device) mode.

Georgia on my mind - Asterisk plays music!

| | TrackBacks (0)
While surfing on wikipedia, I found a nice article about the georgia anthem "Georgia on my mind". There is also an OGG file included of the Georgia chorus sung by the Air National Guard Band of the Southwest.

As I will use this file as a fine example and in fact it is licensed with a Creative Commons License, Attribution 2.5. I state: "This was performed as an exhibition by the Air National Guard Band of the Southwest, at the Moorpark College Jazz Festival on May 12, 2007. The vocals are sung by a woman."

For the fastest: Dial 1-678-954-8235 and you'll hear that chorus.

Back to Asterisk.
As I like the state of Georgia I tried to put that chorus on my asterisk server so I could ring it to hear it (ok I won't do it too often but I wanted to have some kind of reason to tell my fiancée that I am sitting again in front of that terminal...).

In the United States, digital voice communications in telephone systems are normally done with the ulaw format using 8000 samples per seconds, 8-bit wide each. It includes a dynamic compression, originally each sample is 16 bits wide. The ulaw algorithm makes a 8 bit sample out of it. Sampling accuracy is high at nearly silent tones and mediocre for louder sounds.
In Europe a similar technique is used, but we call it alaw here, in fact it does the same, it compresses 16 bits to 8. It is very simple to convert ulaw digital data to alaw and vice versa, just use a 255-value-table of compound alaw/ulaw sample pairs.

The first thing to do is to convert the ogg sound file to ulaw (and alaw). I'll use the swiss army knife of sound converters, sox.

sox ANGB_Georgia.ogg -r 8000 -U -c 1 -t raw georgia.ulaw resample -ql


sox ANGB_Georgia.ogg -r 8000 -A -c 1 -t raw georgia.alaw resample -ql

The "-c 1" downmixes the stereo output samples of the ogg file to mono (stereo on a phone system wouldn't really not make any sense), "-r 8000" tells sox to create a 8000 samples/sec output file. "-U" is the selector for ulaw, "-A" for alaw.

After copying these files to /var/lib/asterisk/sounds/pascal, I have been able to define this:

exten => 16789548235,1,Answer(1000)
exten => 16789548235,n,Playback(pascal/georgia)
exten => 16789548235,n,Hangup

So whenever a call comes in to 1-678-954-8235, you will hear the chorus, as Asterisk answers the phone first, then plays back the file and then hang up the line.

As you can see, Playback uses files relative to /var/lib/asterisk/sounds, (if you installed Asterisk in its standard locations). The file extension ".ulaw" is added automatically. Asterisk uses the ulaw file because it is an american phone line.

To have a usage for my alaw file, I just put it on one of my numbers of my ISDN line in Germany, using alaw. In that asterisk box, I had to define that:

exten => 3614219,1,Answer(1000)
exten => 3614219,n,Playback(pascal/georgia)
exten => 3614219,n,Hangup

Not really exciting, is it? The sole difference between the above US example and this one is the fact it will use the alaw file - German ISDN's voice transmissions are in alaw format.

So for the next days, you will be able to hear that chorus on

1-678-954-8235  (USA) and
(011)-49-7531-3614219   (German ISDN)

Enjoy :)
In case you did not know it, you can define outgoing MSNs in asterisk and misdn (Linux). It is even possible to tie a specific local telephone to another outbound channel:

exten => _X.,1,Set(OUTBOUNDMETHOD="mISDN/1/${EXTEN}");
exten => _X.,n,ExecIf($[ "${CALLERID(num)}" = "*1"],Set,CALLERID(num)=3614217)
exten => _X.,n,ExecIf($[ "${CALLERID(num)}" = "*2"],Set,CALLERID(num)=3614218)
exten => _X.,n,ExecIf($[ "${CALLERID(num)}" = "*6"],Set,
exten => _X.,n,Dial(${OUTBOUNDMETHOD})

In this case, the local phones *1 and *2 will send 3614217 or 3614218 respectively as local number on outgoing calls. *6 will allways use the sip provider defined as "sipPASCAL" in sip.conf.

Since many isdn providers list charges by msn in their invoices this is neat.

*1 and *6 are lines defined on my Cisco 7960 phone at my desk so I may choose myself which line I will use for callout.
my_7960.jpgFinally I got my Skinny Cisco 7960 phone working with my Asterisk server at home.

I am using chan-sccp-b, and I built it:

sassandra:/home/pascal/chan_sccp-20071213 $ make
sh ./ "/usr/include"
Now compiling .... chan_sccp.c          1855 lines
Now compiling .... sccp_actions.c       1643 lines
Now compiling .... sccp_channel.c       1155 lines
Now compiling .... sccp_device.c        927 lines
Now compiling .... sccp_line.c          117 lines
Now compiling .... sccp_utils.c         1703 lines
Now compiling .... sccp_pbx.c           1004 lines
Now compiling .... sccp_cli.c           819 lines
Now compiling .... sccp_softkeys.c      558 lines
Now compiling .... sccp_socket.c        394 lines
Now compiling .... sccp_indicate.c      329 lines

The resulting .so-File has to be copied in the asterisk modules directory (/usr/lib/asterisk/modules if you have installed asterisk in standard locations).

Insert these lines in your modules.conf (/etc/asterisk/modules.conf):

noload =>
load =>

A sample sccp.conf:

keepalive = 30              
context = default
dateFormat = D.M.Y            ; date format         
bindaddr =            ; interface to bind to
port = 2000                   ; port to bind to (2000 = skinny)
debug = 4
accountcode=skinny            ; recordname appearing in cdr
callwaiting_tone = 0x2d       ; turn off callwaiting tone == 0
echocancel = on
silencesuppression = off
cfwdall = on                  ; turn on call forward button
cfwdbusy = on                 ; turn on call forward when busy button
dnd = on                      ; turn on "do not disturb"
mwioncall = on                ; lit message waiting light when new messages are
                              ; in voicemailbox
digittimeoutchat = #          ; type hash to stop dialing timeout
disallow = all
allow = alaw
allow = ulaw                  ; european isdn is alaw, so i use alaw as first preference

type        = 7960            ; my phone is a 7960
description = Pascal          ; name appearing in the upper right
tzoffset    = 0
autologin   = *1,*6           ; we have exten *1 and *6
speeddial   = 1234567890,Important Number 1
speeddial   = 0987654321,Important Number 2
speeddial   = 0015552522631,Fake Number
speeddial   = 0310,Test
device => SEP000CCE3A88CA     ; This is the device Name (SEP+Mac)

id            = *1            ; Extension
label         = 3614217       ; label on line button
description   = Pascal       
context       = default       ; incoming call context
callwaiting   = 1
incominglimit = 3             ; max 3 incoming calls
mailbox       = 1@default     ; corresponding voicemail box
vmnum         = *9            ; extension to dial to access VoiceMailMain()
cid_name      = Pascal Gienger
cid_num       = *1
line => *1

id            = *6
label         = 584298
description   = Pascal
context       = default
callwaiting   = 1
incominglimit = 3
cid_name      = Pascal Gienger
cid_num       = *6
line => *6

Extensions *1 and *6 are listed as line buttons on my 7960 screen, the second arguments of the speeddial-Commands are Strings which are displayed on the 7960's screen. If you omit them, the numbers will be shown.

In your dhcp server setting for the phone, don't forget to define option 150 (I am using ISC dhcp):

option cisco-tftp code 150 = array of ip-address;

subnet netmask {
        default-lease-time 86400;
        max-lease-time 172800;
        option domain-name-servers;
        option routers;

Then you may define the phone entry:

host phone1 {
        hardware ethernet 00:0c:ce:3a:88:ca;
        option cisco-tftp;

In my configuration on the asterisk host ( a tftp server is running and there the phone should at least find 1 file:

  • SEPxxxxxxxxxxxx.cnf.xml (xxxxxxxxxxxx = MAC of your phone, uppercase!)
You do NOT need an "XMLDefaults.cnf.xml"-File unless you want to include also unknown devices (without a proper SEPxxxx-File)!

My SEP-file has the name SEP000CCE3A88CA.cnf.xml and looks like this:

    <member  priority="0">
 <versionStamp>{Jan 28 2008 19:01:00}</versionStamp>

The most important part are the lines




as they define the address and port of your Asterisk server!
I wanted my phone to display all messages in french but my dialtone like in the united kingdom (i like that sound). I copied the needed messages from a cisco call manager to my tftp server. Due to copyright issues I can't post them here.

To make your phone reload any changes you made in this file you have to set up

 <versionStamp>{Jan 28 2008 19:01:00}</versionStamp>

as the phone compares this date to know that you want the configuration to be updated.

Even if your phone does not find  these files, it will still work - using the locale ist loaded the last time successfully - on new phones this will be English/United States.

After these steps the 7960 works in my asterisk environments. I can call out on ISDN and SIP lines and still have an SCCP (Skinny) phone on the desk.

The Dial() device parameter in extensions.conf  is "SCCP", so you may write:

exten => *1,Dial(SCCP/*1)


exten => 3614217,Dial(SCCP/*1)

to map an external ISDN number (in my case) to the local line *1 on the Cisco phone.

December 2015

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    


This blog is owned by:

Pascal Gienger
Jägerstrasse 77
8406 Winterthur

Google+: Profile
YouTube Channel: pascalgienger