Asterisk Simple example

From open-voip.org

Jump to: navigation, search

Make your first asterisk call, this example uses Asterisk 1.6.1 on Fedora 9

User 1000 call to user 2000 server IP: 192.168.0.147


Save the original configuration files for backup:

 cp /etc/asterisk/sip.conf /etc/asterisk/sip.conf_orig
 cp /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf_orig

replace sip.conf with:

 [general]
 context=default                 ; Default context for incoming calls
 bindport=5060                   ; bindport is the local UDP port that Asterisk will listen on
 bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
 ;
 disallow=all                    ; First disallow all codecs
 allow=gsm                       ; Allow default codec
 allow=ulaw                      ; 
 ;
 ; *** configure the users: ***
 ;
 [1000]
 context=from-sip                ; the context of this setup
 type=friend                     ; Can make inbound and outbound calls
 secret=1234
 callerid="User-A"               ; Set your Caller-id
 host=dynamic                    ; This device needs to register
 nat=yes                         ; user is behind a NAT router
 qualify=yes                     ; keep the router open by sending periodic packets
 ;
 [2000]
 context=from-sip                ; the context of this setup
 type=friend                     ; Can make inbound and outbound calls
 secret=1234
 callerid="User-B"               ; Set your Caller-id
 host=dynamic                    ; This device needs to register
 nat=yes                         ; user is behind a NAT router
 qualify=yes                     ; keep the router open by sending periodic packets

Replace extensions.conf with:

 [general]
 [globals]
 ;
 [from-sip]
 exten => _X.,1,Dial(sip/${EXTEN},30)            ; calls between extensions
 exten => _X.,2,hangup()

Configure the Endpoints: (X-lite in this example):

 File:Simple_example1.gif  File:Simple_example2.gif

Links: Asterisk Install

Asterisk VoiceMail & MWI

Personal tools