Asterisk: A Bare-Bones VoIP Example
Pages: 1, 2, 3, 4
Testing: Here We Go!
The user on extension 2000 should be able to dial 2001 and the other line will ring. As you watch the console, you should see a flurry of messages showing up as you dial, and after you hang up. If you go immediately to the "Busy" message, it's probably because your phone client hasn't registered with the Asterisk server -- make sure it's sending server registry statements, as these are the "heartbeats" that Asterisk uses to ensure that a remote client is available for inbound calls. If you have your registry interval set to more than 15 seconds, you'll need to wait at least that long for the SIP client to register (once Asterisk is started) before calls can be sent to that phone.
Try leaving voicemail for extension 2000. From extension 2000, dial 2999 and you should hear a prompt for the password -- you won't need to type in the extension for which you are trying to retrieve mail, as it is automatically entered with the addition of the ${CALLERIDNUM} variable as an argument to the VoiceMailMain line -- this types in the correct extension automatically. Extension 2999 has a password of 4321, so type in "4321#" -- the # sign is equivalent to "enter." Then follow the prompts to retrieve the mail. You can also change the greetings on the line -- experiment a bit with the different options within voicemail.
Hopefully this all worked for you. Often, getting the first implementation up and running is a process of trial-and-error, and the added complexity of the SIP clients can make this an exhaustive reduction in variables. Feel free to ask the asterisk-users mailing list any specific questions you might have after reviewing the archives -- both resources are very useful to the beginner.
Debugging
SIP is a bit tricky to start out with. I would strongly suggest that your Asterisk server and both phones are on the same network segment when you begin your testing; having one or more devices processed through a firewall or NAT will cause you quite a few ulcers, and will almost certainly not work during your testing.
Make sure your SIP phones are sending correct REGISTER statements to the server -- without valid registration, the Asterisk process will not know where to send a call destined for that extension. Try sip show peers to see if the IP address of your phone shows up and is valid.
If SIP registration seems to be the problem, you can try removing the secret= lines and specifying an IP address of the phone in the host= line. This will lock the phones onto specific addresses and remove any registration issues you might be having.
I have found the tethereal tool (part of the ethereal network sniffer toolset) to be immensely valuable. tethereal -n ip and port 5060 will debug SIP packets in a human-readable form, and should show you what is happening on the wire when testing.
Another important debugging technique is to run asterisk in "full debug mode." This is done with asterisk -vvvvvgcd and puts all possible debugging information on your console. Also make sure that your SIP client is using the G.711 codec (either alaw or ulaw) as that is a codec that is known to work with Asterisk.
Additional Features
To list Asterisk's full feature set would take quite a while, as it is just as much a toolkit as a set of applications. Some things I've implemented for myself and other customers include:- Telemarketer block: Forces callers without caller ID to enter valid info, or hangs up.
- Zapateller: Used with telemarketer block -- plays three-tone "disconnected number" for callers with no caller ID, which auto-removes from many phone spam networks.
- Dual ring: Phones at the office and at home ring at the same time, during certain hours.
- PBX long distance gateway: PRI interface to Asterisk box, then low-priced ITSP to get better LD rates using existing PBX.
- IVR interface: Use as an inbound call center pre-processor.
- International toll avoidance: One in the HQ in each continent allows for centrex-style dialing over the Internet.
- Voicemail: Stand-alone voicemail server interfaces with existing PBX -- low-cost solution to otherwise expensive upgrade.
- Monitoring system: Intelligent dial-out platform that can verbalize network problems and take actions based on IVR.
- NAT traversal: Asterisk can work with SIP clients behind NATs with no additional software (see
nat=1in sip.conf).
Digium makes a low-cost ($100) analog FXO (Foreign Exchange Office -- meaning, it accepts a wire that has dialtone on it) PCI card that can be used to connect your home or office phone line into Asterisk. Add to this a Cisco ATA-186 (~$150) for two lines of FXS (handsets) use, and you can have a mini-PBX in your house with extremely powerful features for about $250, plus the cost of a reasonably decent old PC that you may have laying around. I've had acceptable experiences running with a 400mhz PIII with two lines. I've found that putting one of these systems together with an FXO card is a fast way to convince others that OSS VoIP platforms are ready to be examined as a serious possibility for the office environment, since one can attach the machine directly to the existing PBX (assuming you can get an analog line off of your PBX system).
|
Related Reading
Practical VoIP Using VOCAL |
More complex Asterisk configurations and some other SIP-related examples can be found on my web site.
Other Projects and Resources
Servers/Software
There are several SIP implementations that are OSS, but they are primarily what are known as "call proxies" instead of more full-featured PBX applications. This means that they function only to connect two endpoints together, and are basically just large, fast, directory servers. Examples of SIP Proxies are ser and Vocal. There are also other open source PBX projects like Bayonne and OpenPBX, which have slightly different feature sets than Asterisk.
Long Distance/Free Services
There are also now retail vendors of SIP long distance service, which are called Internet Telephony Service Providers (ITSPs.) Vendors such as iconnecthere (formerly Deltathree) have rates in the $.01-per-minute category anywhere in the U.S., and I expect that some searching will find similar vendors in Europe and Asia. There are also no-cost solutions like Free World Dialup that are limited to calling users via IP only, but you can mix/match dialplans so you can reach all destinations from the same phone, if that phone is routed through Asterisk. There are other SIP long distance providers, but to my knowledge all of the others (Vonage, Packet8) require you to use their equipment, thus making use with Asterisk impossible.
SIP Hardware
| Cisco ATA-186 | (About $150 new) | Supplies two FXS ports (standard phones plug into FXS ports) |
| Cisco 7960/7940 | (About $300 used) | Deskset with XML-programmable six-line LCD |
| Digium | ($100-$500 new) | Variety of PCI cards for direct telephony connections to Asterisk servers |
| Pingtel | (About $550 new) | Deskset with LCD |
| SNOM 200 | (About $290 new) | Deskset with LCD |
| Grandstream | (About $85 new) | Deskset with small LCD |
SIP Software/Hardware
SIP Product List: Lists of hardphones, softphones, and other servers
IPTel.org: Lists of hardphones, softphones, and other servers
John Todd is the CTO of TalkPlus, Inc. which is a next-generation mobile identity management and enhanced call services provider.
Return to ONLamp.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 13 of 13.
-
Qualitative A-Z termination from AsteriskOUT, 24x7 Support
2005-06-01 06:24:54 AsteriskOUT [Reply | View]
Send Calls around the world and pay for traffic only.
There are no additional or hidden costs. Originate traffic and pay only per minutes.
Real benefits are the following:
1. Instant access to A-Z termination
2. Qualitative routes at good price
3. Online Billing with CDR/failed calls
4. 24x7 online Support team
5. SIP and H323 (config help), IAX is coming soon
6. Simple and user friendly interface
7. A lot of other features
See tariffs at www.AsteriskOUT.com
For the more details please contact our Sales department
Sincerely,
Sales Department
e-mail sales@asteriskout.com
msn: sales@asteriskout.com
icq: 240089256
aol: asteriskout
yahoo: asteriskout
Phone +1 866 744 1140 Fax +1 650 429 2109
*******************************************************
www.AsteriskOUT.com :::: Send Calls Instantly
*******************************************************
-
GrandStream Budge Phone DTMF problem
2005-01-03 07:27:20 ezabi [Reply | View]
In order for the GrandStream phones to work properly with voicemail they should be set to Send DTMF via SIP INFO.
-
Anyone interested in developing for this?
2004-01-05 18:27:43 rich1000 [Reply | View]
Anyone interested in developing a vertical application using this technology?
Software dev experience, java, linux, asterick
-
FreeBSD CPU Load
2003-12-24 12:18:59 anonymous2 [Reply | View]
This is a GREAT article. It helped me set up Asterisk for the first time on our FreeBSD box.
But I discovered that Asterisk is taking up all my CPU. Does anybody have an idea why?
-
Packet8
2003-12-20 17:12:04 anonymous2 [Reply | View]
For more info on Packet8 and to get $20 off Packet8 service, visit http://solarice.typepad.com/packet8/
-
Minor change to example: remove "allow=" line
2003-09-07 11:47:20 anonymous2 [Reply | View]
Due to the way in which Asterisk (now?) handles codec preferences, I would suggest removing the "allow=" line from the sip.conf example that I provided. The long story is that "allow=" or "disallow=" cannot appear by themselves; they must have an offsetting opposite. If neither are present, the system will figure out the correct codec by default, so I would recommend that the first-time user just leaves both out of the sip.conf config.
JT
-
Typo in sip.conf - correction enclosed
2003-07-13 10:37:05 anonymous2 [Reply | View]
My apologies - an alert reader found a typo in sip.conf. Under each SIP peer, the mailbox= lines are incorrect. They should be equal to the extensions. In other words: mailbox=2000 and mailbox=2001 instead of their shown values.
This typo would have prevented your SIP client (if so enabled) from displaying the message waiting lamp or stutter dialtone.
JT
-
At least one example for one of the UA's would help
2003-07-10 13:57:52 anonymous2 [Reply | View]
The article was great, but when I installed asterisk and used the example config, I promptly downloaded X-Lite (free windows soft phone mentioned in the article) and it won't connect. A run with tethereal shows asterisk returning a "401" or "407" depending on if I try to connect to it as a proxy or a service. I'm not certain what exactly is supposed to go in what fields to make it connect correctly. -
At least one example for one of the UA's would help
2003-07-10 14:46:56 anonymous2 [Reply | View]
Try setting "host=1.2.3.4" (where 1.2.3.4 is your UA IP address) in sip.conf and try again. If that is unsuccessful, try removing the username and secret lines in sip.conf. This trims down the number of complex functions the system is trying to do, and should (hopefully) result in calls getting out between UA's. As a last suggestion, try searching the asterisk-users archives for hints on setting sip.conf and client parameters for the X-lite software.








searchcontexts=yes
must exist somewhere in the voicemail.conf file in order for the instructions described in the article to work. Otherwise, the [local] context never gets looked at, and the entries in this context are ignored.