Having a working phone is good, but the standard configuration of asterisk isn’t exactly what one wishes for a regular telephone. As a clear indication, there should be a dial tone which should be switched off after the first digit dialled and maybe one also doesn’t like the drivers busy and congestion signals.
Asterisk has the dial plan for this, but please see the details for yourself in the appropriate documentation. After one has grasped the idea, configuration of the dial plan (in extensions.conf) is easy and straightforward.
A useful asterisk application for generating the dial tone is
Playtone, which has to be called for example with
Playtones(dial). Contrary to what is stated in the documentation of the Playtones application, it has to be called as
Playtones, not Playtone.
A simple extension map (+ all necessary includes etc. not shown here) that works could be similar to this:
[default]
;
; Default context
;
exten => s,1,Playtones(dial) ; start with dialtone
exten => 0,1,StopPlaytones ; dialling ‘0′ stops dialtone and
exten => 0,2,Goto(dialing1,s,1) ; goes to the ‘dialout’ context
exten => 1,1,StopPlaytones ; ‘1′ is a speed call
exten => 1,2,Dial(SIP/girlfriend,,rg)
exten => 1,3,Goto(prehangup,s,1) ; special handling after hangup
exten => 2,1,StopPlaytones ; and so is ‘2′
exten => 2,2,Dial(SIP/parents,,rg)
exten => 2,3,Goto(prehangup,s,1)
exten => 9,1,StopPlaytones ; ‘9′ calls the echo application, the text below is
copied from the example
exten => 9,2,Playback(demo-echotest) ; Let them know what’s going on
exten => 9,3,Echo ; Do the echo test
exten => 9,4,Playback(demo-echodone) ; Let them know it’s over
exten => 9,5,Goto(prehangup,s,1)
exten => i,1,Goto(prehangup,s,1) ; busy and wait for hangup - nothing more
exten => t,1,Goto(prehangup,s,1)
[dialing1]
;
; context while dialling out
;
exten => s,1,DigitTimeout,2 ; really dial 2 sec after the last digit
exten => s,2,ResponseTimeout,10
exten => t,1,Playtones(busy) ; If nothing happens
exten => _X.,1,Dial(SIP/${EXTEN}@myprovider,60,rg) ; dial
exten => i,1,Playtones(busy) ; happens for single digits
[fromsip]
;
; context reached from outside
;
exten => _X,1,Dial(Console/dsp,30,rg) ; simply dial the console (i.e. the phone!)
[prehangup]
;
; context after a call/action
;
exten => s,1,StopPlaytones
exten => s,2,Playtones(busy) ; hang your damn phone up!
exten => s,3,Wait,36000 ; wait 10h and then maybe give the driver’s busy signal
exten => i,1,Goto(prehangup,s,1) ; invalid number
exten => t,1,Goto(prehangup,s,1) ; timeout
If you want to connect a lot of people, your dial plan will surely look completely different
Of course, a separate configuration of Asterisk’s SIP support is usually necessary, too.
Help us continue our work with a donation
10 queries. 0.660 seconds
January 27th, 2006 at 14:12
This is a great guide/text. Great for learning, everything covered and explained, thank you very much.
January 30th, 2006 at 23:01
just a question, as I am not as framiliar with asterisk as you obviously are (and the documentation frankly is not upto open-source standards). But It seems it would be easier to use a voice modem with the addition of a ringer circuit (and less likely to have echo issues). As I understand this is what the x100p basically is. From what I understand an FXS is just an FXO that can make a phone ring? seems a simple addition, and there are lots of circuits available online. I do not know if you can force asterisk to route incoming voip calls to a modified FXO. Is it feasable to have astrisk actiate a parrallel port pin when the phone is supposed to ring. If this is far more difficult than what you have done. I just assumed the modem would be better matched to the phone lines than anything I build.
March 27th, 2008 at 14:57
many thx for all the efforts. I want to feed pc spkr output to pstn-analog mic input and similarly couple pc mic input with pstn spkr output. the purpose is to forward voip conversation to another pstn subscriber using pstn network.
can anybody provide similarly simple plan.