Penguin
Diff: AsteriskSampleSetup
EditPageHistoryDiffInfoLikePages

Differences between current version and revision by previous author of AsteriskSampleSetup.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 24 Last edited on Sunday, March 4, 2007 9:18:23 pm by LawrenceDoliveiro
Older page: version 22 Last edited on Saturday, May 21, 2005 2:57:25 am by ElroyLiddington Revert
@@ -8,34 +8,37 @@
 Then create a new one as below. This means the asterisk samples are still there to refer to if you want to see more options, and the modules etc should all be setup correctly (we dont change these yet). 
  
 The first step is to configure each phone device in the extensions.conf. 
 Each phone device should be assigned to an extension as below 
- [ [globals] 
+<verbatim>  
+ [globals] 
  PHONES1=SIP/2201 
  PHONES1VM=2201 
+</verbatim>  
  
 This means that there will be a SIP channel on extension 2201, and its voicemail will be stored in voicemail box 2201 
  
 you can keep going and assigning all your phones into their own extensions by simply increasing the numbers 
  
+<verbatim>  
  PHONES2=SIP/2202 
  PHONES2VM=2202 
  PHONES3=SIP/2203 
  PHONES3VM=2203 
  
  ..etc.. 
  
  ;This will create a macro we will use in the dialling plan 
- [ [macro-vmessage] 
+ [macro-vmessage] 
  exten => s,1,VoiceMail2(u${ARG1}) 
  exten => s,2,Playback(groovy) 
  exten => s,3,Playback(goodbye) 
  exten => s,4,Hangup 
  
 ; ----------------------------------------------%%% 
 ; DEFINE EXTENSIONS%%% 
 ; ----------------------------------------------%%% 
- [ [home] 
+ [home] 
  ; Next, add an extension for voicemail . 
  ; now if we dial 8, we can check voicemail. 
 
  exten => 8,1,VoiceMailMain2 
@@ -59,26 +62,27 @@
 
  exten => 2203,1,Dial(${PHONES3},20,Ttm) 
  exten => 2203,2,Macro(vmessage,${PHONES3VM}) 
  exten => 2203,3,Hangup 
-; ----------------------------------------------%%%  
-; END DEFINE EXTENSIONS%%%  
-; ----------------------------------------------%%%  
- 
+; ----------------------------------------------  
+; END DEFINE EXTENSIONS  
+; ----------------------------------------------  
+</verbatim>  
  
 In sip.conf we want to setup the secrets so each phone can authenticate onto the line we just assigned in extensions.conf%%% 
 WS - I find that encapsulating the SIP references with what extension it belongs to useful as well.%%% 
 This makes reading the config file easier for someone who may need to alter it other than yourself%%% 
-The same has been added to other parts of this example code.%%%  
-;------------------------------------------------%%%  
-; RECEPTIONIST - JULIE - EXT. 2202%%%  
-; <extension use> - <users name> - <extension number>%%%  
-;------------------------------------------------%%%  
- [ [general] 
+The same has been added to other parts of this example code.  
+<verbatim>  
+;------------------------------------------------  
+; RECEPTIONIST - JULIE - EXT. 2202  
+; <extension use> - <users name> - <extension number>  
+;------------------------------------------------  
+ [general] 
  ;make sure to add this line, otherwise things dont work as proved by weeks of debugging 
  port=5060 
  ;We want to configure each of the extensions we setup in extensions.conf like this one below (as a simple base) 
- [ [2202] 
+ [2202] 
  type=friend 
  ;Dynamic means you can connect from any IP, you can use host=192.168.1.1 (to limit to that ip) 
  host=dynamic 
  context=home 
@@ -88,36 +92,40 @@
  mailbox=2202 
  dtmfmode=rfc2833 
  nat=0 
  ;context=home (this means that this unit is setup in the dial plan, which we have yet to setup)%%% 
-;------------------------------------------------%%%  
-; END RECEPTIONIST%%%  
-;------------------------------------------------%%%  
- 
+;------------------------------------------------  
+; END RECEPTIONIST  
+;------------------------------------------------  
+</verbatim>  
 keep adding these sip.conf sections for each SIP unit we are adding to the network. 
  
 voicemail is the next section to setup, and just as in the other sections it doesnt take long 
  
 As long as we define them here, Asterisk will automatically create mailbox directories (under /var/spool/asterisk/voicemail). 
  
 Edit voicemail.conf, again in /etc/asterisk 
  
- [ [general] 
+<verbatim>  
+ [general] 
  ; Choose a format to save voicemails as, I use gsm format, it ends up with small files 
  format=gsm 
 
- ; if you set this to yes, the voicemail is attached as a file (so you can play it from your email directly,  
- ; you may want to turn this off if your email is on another server or limited for space or for various other reasons. 
+ ; if you set this to yes, the voicemail is attached as a file (so  
+ ; you can play it from your email directly, you may want to turn  
+ ; this off if your email is on another server or limited for space  
+ ; or for various other reasons. 
 
  attach=yes 
 
  ; Each mailbox is listed in the form <mailbox>=<password>,<name>,<email>,<pager_email> 
  ; if the e-mail is specified, a message will be sent when a message is received, to the given mailbox. 
  ; If pager is specified, a message will be sent there as well. 
 
- [ [home] 
+ [home] 
  2201 => 1234,JON,JON@test.com 
  2202 => 1234,Name,BOB@test.com,bobs_pager@test.com 
+</verbatim>  
  
 Once we are up to here, hopefully (if i havent cut too much out of the samples files as im adding them to the wiki) have a system where we can register sipphones to the asterisk server, and the asterisk server will let you dial from one units extension to the other units extension.. first however we need to start the asterisk server (or reload the configuration if its already running) 
  
 if asterisk is not already running, run it now (you may need to be root) 
@@ -127,24 +135,26 @@
  reload 
  
 while in asterisk try taking a look at the dialplan (so we can work out how this Asterisk thing works 
 Hopefully your dial plan will look something like this (if I haven't screwed up) 
+  
+<verbatim>  
  show dialplan 
  
- [ [ Context 'home' created by 'pbx_config' ]  
- '2201' => 1. Dial(${PHONES1}|20|Ttm) [ [pbx_config]  
- 2. Macro(vmessage|${PHONES1VM}) [ [pbx_config]  
- 3. Hangup() [ [pbx_config]  
- '2202' => 1. Dial(${PHONES2}|20|Ttm) [ [pbx_config]  
- 2. Macro(vmessage|${PHONES2VM}) [ [pbx_config]  
- 3. Hangup() [ [pbx_config]  
- '2203' => 1. Dial(${PHONES3}|20|Ttm) [ [pbx_config]  
- 2. Macro(vmessage|${PHONES3VM}) [ [pbx_config]  
- 3. Hangup() [ [pbx_config]  
- '8' => 1. VoiceMailMain2() [ [pbx_config]  
- 2. Hangup() [ [pbx_config]  
- Include => 'dialout' [ [pbx_config]  
- 
+ [ Context 'home' created by 'pbx_config' ]  
+ '2201' => 1. Dial(${PHONES1}|20|Ttm) [pbx_config]  
+ 2. Macro(vmessage|${PHONES1VM}) [pbx_config]  
+ 3. Hangup() [pbx_config]  
+ '2202' => 1. Dial(${PHONES2}|20|Ttm) [pbx_config]  
+ 2. Macro(vmessage|${PHONES2VM}) [pbx_config]  
+ 3. Hangup() [pbx_config]  
+ '2203' => 1. Dial(${PHONES3}|20|Ttm) [pbx_config]  
+ 2. Macro(vmessage|${PHONES3VM}) [pbx_config]  
+ 3. Hangup() [pbx_config]  
+ '8' => 1. VoiceMailMain2() [pbx_config]  
+ 2. Hangup() [pbx_config]  
+ Include => 'dialout' [pbx_config]  
+</verbatim>  
  
  
 If your dialplan looks something like this now feel free to take whichever sip client you would like, point it to the sip server and see if you can register the client, using 2201 (or whichever extensions you have used), and the secrets you set in sip.conf as your password. 
 If you can register 2 machines, or 2 clients, or if your client lets you setup lets you register different profiles you should be able to register them both, and even ring from one extension to the other. 
@@ -160,8 +170,9 @@
 !Adding FWD to the callplan and reveiving incoming FWD calls. 
  
 To add dialling from and to FreeWorldDialUp, we need to make Asterisk register to the FWD servers with the correct password and username; we also need to make FWD ring the correct phones when Asterisk receives a call from FWD. To do this we need to add the following lines to extensions.conf. This configuration assumes that you also have an extension with the same number as your FWD user ID; if you do not already have this extension you should add it using the templates in the previous section. 
  
+<verbatim>  
  <in globals section> 
  FWDUSERID=<FWDUSERNUMBER> 
  MYNAME=<NAME> 
  MYPHONE=<MYPHONENUMBER> 
@@ -171,9 +182,9 @@
  include => fwd-forced 
  include =>from-sip 
  
  <in context definition part of config file> 
- [ [fwd-forced] 
+ [fwd-forced] 
  ; Check to see if the called number starts with a "7" and 
  ; if so, set the call parameters and bounce the call to the 
  ; Free World Dialup SIP server. 
 
@@ -185,9 +196,9 @@
  exten => _7.,3,Dial(SIP/${EXTEN:1}@fwd) 
  exten => _7.,4,Playback(invalid) 
  exten => _7.,5,Hangup 
  
- [ [from-sip] 
+ [from-sip] 
  ; To receive calls inbound from FWD, we set the extension 
  ; to our FWD user ID, in this case 94896 
  ; Changing the "Dial" 
  ; directive to something like this: 
@@ -202,11 +213,13 @@
  exten => ${FWDUSERID},3,Hangup 
  
  <in home context of extensions.conf> 
  include => dialout 
+</verbatim>  
  
 in sip.conf we have to setup the passwords etc for the FWD account this is done as below 
  
+<verbatim>  
  ; Here we register our FWD phone number so that when someone calls it, 
  ; we'll be able to receive that incoming call over SIP. 
 
  register=<FWDUSERID>:<FWDPASSWORD>@fwd.pulver.com/<FWDUSERID> 
@@ -224,7 +237,7 @@
  nat=yes 
  canreinvite=no 
  disallow=all 
  allow=all 
-  
+</verbatim>  
  
 AsteriskSipPhoneSetup