AsteriskInstall

This is a rough summary of what I did to connect (register) my asterisk to FrancoisBotha's. This allows him to forward incomming calls to me, in spite of the fact that I am behing a NAT router and that the router does not support SIP connection tracking. I use a SIP phone program (Linphone) to connect to my asterisk server. This SIP phone is what rings when I'm called.

I'm running Ubuntu Breezy, and installed most of the asterisk packages. Should be directly applicable to Debian. Also, the asterisk config file extracts should be useful irrespective of what distribution you are using.

Added to sip.conf:

[brick]
type=friend                     ; either "friend" (peer+user), "peer" or "user"
context=default
fromuser=brick                  ; overrides the callerid, e.g. required by FWD
host=dynamic                    ; we have a static but private IP address
nat=no                          ; there is not NAT between phone and Asterisk
canreinvite=yes                 ; allow RTP voice traffic to bypass Asterisk
dtmfmode=rfc2833                ; either RFC2833 or INFO for the BudgeTone
incominglimit=1                 ; permit only 1 outgoing call at a time
                                ; from the phone to asterisk
mailbox=1234@default  ; mailbox 1234 in voicemail context "default"
disallow=all                    ; need to disallow=all before we can use allow=
allow=gsm                       ; Allow codecs in order of preference
allow=speex
allow=ulaw
allow=alaw

This will prolly require some more tweaking w.r.t. mailboxes, etc. BTW, you need to change dtmfmode to match whatever your SIP client does, or DTFM number-pressing won't work. I also had to tell my client to use a different UDP port to the standard, since Asterisk was already binding to it.

In extensions.conf I have a bunch of hacky stuff tacked onto the [demo] section. Guess I should clean it up at some stage.

; Create an extension, 502, for dialing the
; FBBVoice demo.
;
;exten => 502,1,Playback(demo-abouttotry); Let them know what's going on'
exten => 502,1,Dial(IAX2/FBBVoice/1000)	; Call the Asterisk demo
exten => 502,2,Playback(demo-nogo)	; Couldn't' connect to the demo site
exten => 502,3,Goto(s,6)		; Return to the start over message.

;
; Forwards calls to extention 1001 to the brick SIP account as defined
;in sip.conf
;
exten => 1001,1,Dial(SIP/brick,100)
exten => 1001,2,VoiceMail(1001@default)
exten => 1001,3,PlayBack(vm-goodbye)
exten => 1001,4,HangUp()

In iax.conf add, near the other demo register lines:

 ;
 ; We can register with another IAX server to let him know where we are
 ; in case we have a dynamic IP address for example

register => nmarais:xxxx@voip.lagged.za.net

and using the IAX account details uncle Estaga gives you,

[FBBVoice]
type=peer
username=nmarais
secret=xxxxx
host=voip.lagged.za.net
context=default

This is super leet. It even seems to work for incoming calls over NAT.

In oh323.conf, to make it shut up: (this is a diff)

--- ./oh323.conf	2005-08-13 16:47:33.000000000 +0200
+++ /etc/asterisk/oh323.conf	2005-12-21 23:03:24.000000000 +0200
@@ -100,7 +100,7 @@
 ;   GKID:<gatekeeper's id>
 ;
 ;gatekeeper=192.168.1.2
-gatekeeper=DISCOVER
+gatekeeper=DISABLE
 ;
 ; Set the gatekeeper password
 ;