Ekiga as an Asterisk client
The information in these notes will tell how to connect an Ekiga softphone to a local Asterisk PBX and how to get the most out of it.
I will assume that you already have an Asterisk up and running so I will not say much about the setup of Asterisk. There is plenty of Asterisk information available on the Internet. In addition to the main Asterisk website you may consult the Asterisk page on Voip-Info or AsteriskGuru. The latter has a good tutorial on Asterisk installation and configuration. The best information on Asterisk is found in this book: Asterisk: The Future of Telephony, Jared Smith et al, O'Reilly 2005, ISBN 0-596-00962-3. It is also available online.
The setup I will use in these notes is this: Asterisk is installed on the gateway/router to the Internet and Ekiga is installed on an 'inside' workstation.
This setup has the advantage that it does away with NAT problems since Asterisk is on a host that has an official IP address.
- It is very feasable to have Asterisk and Ekiga on the same host. I will still assume that Asterisk is connected directly to the Internet. Since Ekiga and Asterisk both use the same SIP port (5060) you will have to move Ekiga to another port, e.g. 5061. I will later show what has to be done on Asterisk in this situation.
- In the foolwing you will make several changes to the Asterisk configuration files. It is not necessary to stop and start Asterisk after each change. Instead, start an Asterisk console on the Asterisk host:
$ asterisk -rvvv
- The 3 vs will give you enough output from Asterisk to let you follow what is going on. After each change to e.g. sip.conf you can execute a 'sip reload' at the console. Likewise, after each change to extensions.conf excute a 'extensions reload'. Use the TAB key for keyword completion.
Assuming that your Asterisk is in place and functioning, the first step is to make Ekiga a client of your Asterisk. You do this by having the following lines in sip.conf – one of Asterisk's many configuration files:
[general] context=default srvlookup=yes videosupport=yes disallow=all ; First disallow all codecs allow=alaw ; Allow codecs in order of allow=ilbc ; preference allow=gsm allow=h261  type=friend secret=welcome qualify=yes ; Qualify peer is not more than 2000 mS away nat=no ; This phone is not natted host=dynamic ; This device registers with us canreinvite=no ; Asterisk by default tries to redirect context=home ;port=5061 ; Uncomment this line if Ekiga and Asterisk ; are on the same host
The videosupport=yes is required in order to make Asterisk handle the video stream to and from Ekiga.
101 and welcome are the name and password we will use later when we configure Ekiga.
nat=no means that there is no firewall between Asterisk and Ekiga.
canreinvite=no is very important. Without it the two parties in a conversation will try to talk directly to each other by issuing re-invite requests. This will fail if a firewall is incolved.
context=home defines which section ('context') in the dialplan will handle calls from 101 (you!).
We define the home context in extensions.conf:
[home] exten => 101,1,Dial(SIP/101) exten => 600,1,Answer() exten => 600,2,Playback(demo-echotest) ; Let them know what ; is going on exten => 600,3,Echo() ; Do the echo test exten => 600,4,Playback(demo-echodone) ; Let them know it ;is over exten => 600,5,Hangup()
The first exten makes it possible for you to call yourself. Since Ekiga is not a multi-line phone you cannot use this feature with Ekiga but other phones e.g. X-lite has this facility. Instead you can call 600 and be taken through the same echo test as you hear on sip:firstname.lastname@example.org.
That's all there is to it on the Asterisk side.
Configuration of Ekiga is equally simple:
The important thing here is to use the same user name and password as you used in sip.conf. The IP address of your Asterisk may of course be replaced with its FQDN.
A couple of seconds after you close the window you should see that your Ekiga is registered with your Asterisk.
- If you have several hosts on a home network, you can add each of them as clients to Asterisk. You can give them extension numbers 102, 103 etc. For Asterisk you add a section in sip.conf for each extension, e.g. by copy-and-paste from the 101-section (don't forget to change extension number and possibly password!) It is even simpler in extensions.conf: Just add a line such as ”exten => 102,1,Dial(SIP/102)” for each host. This setup allows all the local extensions to call each other.
You can now either call yourself (on extension 101) or call your echo service (on extension 600).
If the Ekiga client is to be run on the same host as the Asterisk server, the listening SIP port has to be modified to the same value as the "port" property in asterisk's sip.conf. Instructions on how to do it can be found here.
Asterisk will handle video if you add the line
to the [general] section in sip.conf. Note that Asterisk handles video in 'pass-thru' mode and does not do codec translation for video (as contrasted to audio), so the codecs must be compatible end-to-end. This means that you only will be able to use video with friends that use SIP phones which use the H.261 video codec. For a list of such softphones, see: Which programs work with Ekiga ?
Bent 15:03, 10 November 2006 (CET)