[Asterisk-Users] Newbie Questions - Any help appreciated

Paul A Brown paul at fowlmere.com
Fri Mar 17 17:19:13 MST 2006


Sorry for the long email but I am having all sorts of 
probs................................

I basically have a number od sip phones in the house....

I have 3 incoming numbers (sipgate) and one outbound service (sipdiscount)

I want all extensions to be able to call out using the outbound lines (one 
at a time obviousley) and I want various extensions to ring depending on 
which inbound number is called.

Problems............

1) When I boot Asterisk it no longer connects to sipgate to register the 
inbound lines, it did earlier on today but isn't anymore, does it look like 
I did something with my config?
2) When I select the extension and try and dial out, I immediately get the 
engaged tone on the phone. It hasn't had time to dial out so I know its at 
the asterisk end.
3) When I dial from ext to ext the voicemail doesn't work.....

Ho hum...............

Here are my sip and extensions conf. Any help appreciated

______________________________________________________________________________________
extensions.conf

;
; Static extension configuration file, used by
; the pbx_config module. This is where you configure all your
; inbound and outbound calls in Asterisk.
;

;
; The "General" category is for certain variables.
;
[general]
static=yes
writeprotect=no

[globals]
 PHONES1=SIP/220
 PHONES1VM=220
 PHONES2=SIP/221
 PHONES2VM=221
 PHONES3=SIP/222
 PHONES3VM=222
 PHONES4=SIP/223
 PHONES4VM=223
 PHONES5=SIP/224
 PHONES5VM=224
 PHONES5=SIP/225
 PHONES5VM=225

[sipdiscount-outbound]
exten => <220>,1,Dial(${EXTEN}@sipdiscount)
exten => <221>,1,Dial(${EXTEN}@sipdiscount)
exten => <222>,1,Dial(${EXTEN}@sipdiscount)
exten => <223>,1,Dial(${EXTEN}@sipdiscount)
exten => <224>,1,Dial(${EXTEN}@sipdiscount)
exten => <225>,1,Dial(${EXTEN}@sipdiscount)

[sipgate-inbound]
exten => 3858313,1,Dial(SIP/220&SIP/221&SIP/223)
exten => 3858294,1,Dial(SIP/220)
exten => 3858817,1,Dial(SIP/221&SIP/220))
[local]
;
; Master context for local, toll-free, and iaxtel calls only
;
ignorepat => 9
include => default
include => parkedcalls
include => trunklocal
; include => iaxtel700
include => trunktollfree
include => iaxprovider
include => sipdiscount-outbound

;This will create a macro we will use in the dialling plan
 [macro-vmessage]
 exten => s,1,VoiceMail2(u${ARG1})
 exten => s,2,Playback(groovy)
 exten => s,3,Playback(goodbye)
 exten => s,4,Hangup

[macro-stdexten];
;
; Standard extension macro:
;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
;   ${ARG2} - Device(s) to ring
;
exten => s,1,Dial(${ARG2},20)     ; Ring the interface, 20 seconds maximum
exten => s,2,Goto(s-${DIALSTATUS},1)    ; Jump based on status 
(NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => s-NOANSWER,1,Voicemail(u${ARG1})  ; If unavailable, send to 
voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1)   ; If they press #, return to start

exten => s-BUSY,1,Voicemail(b${ARG1})   ; If busy, send to voicemail w/ busy 
announce
exten => s-BUSY,2,Goto(default,s,1)    ; If they press #, return to start

exten => _s-.,1,Goto(s-NOANSWER,1)    ; Treat anything else as no answer

exten => a,1,VoicemailMain(${ARG1})    ; If they press *, send the user into 
VoicemailMain



; ----------------------------------------------
; DEFINE EXTENSIONS
; ----------------------------------------------

 [home]

 exten => 220,1,Dial(${PHONES1},20,Ttm)
 exten => 220,2,Macro(vmessage,${PHONES1VM})
 exten => 220,3,Hangup

 ; Line 2

 exten => 221,1,Dial(${PHONES2},20,Ttm)
 exten => 221,2,Macro(vmessage,${PHONES2VM})
 exten => 221,3,Hangup

 ; Line 3

 exten => 222,1,Dial(${PHONES3},20,Ttm)
 exten => 222,2,Macro(vmessage,${PHONES3VM})
 exten => 222,3,Hangup

 ; Line 4

 exten => 223,1,Dial(${PHONES4},20,Ttm)
 exten => 223,2,Macro(vmessage,${PHONES4VM})
 exten => 223,3,Hangup

 ; Line 5

 exten => 224,1,Dial(${PHONES5},20,Ttm)
 exten => 224,2,Macro(vmessage,${PHONES5VM})
 exten => 224,3,Hangup

 ; Line 6

 exten => 225,1,Dial(${PHONES6},20,Ttm)include => sipdiscount-outbound
 exten => 225,2,Macro(vmessage,${PHONES6VM})
 exten => 225,3,Hangup

; ----------------------------------------------
; END DEFINE EXTENSIONS
; ----------------------------------------------

___________________________________________________________________________________________


sip.conf

;
; SIP Configuration example for Asterisk
;
; Syntax for specifying a SIP device in extensions.conf is
; SIP/devicename where devicename is defined in a section below.
;
; You may also use
; SIP/username at domain to call any SIP user on the Internet
; (Don't forget to enable DNS SRV records if you want to use this)
;
; If you define a SIP proxy as a peer below, you may call
; SIP/proxyhostname/user or SIP/user at proxyhostname
; where the proxyhostname is defined in a section below
;
; Useful CLI commands to check peers/users:
;   sip show peers  Show all SIP peers (including friends)
;   sip show users  Show all SIP users (including friends)
;   sip show registry  Show status of hosts we register with
;
;   sip debug   Show all SIP messages
;
;   reload chan_sip.so  Reload configuration file
;    Active SIP peers will not be reconfigured
;

[general]
context=default   ; Default context for incoming calls
bindport=5060   ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0  ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes   ; Enable DNS SRV lookups on outbound calls
    ; Note: Asterisk only uses the first host
    ; in SRV records
    ; Disabling DNS SRV lookups disables the
    ; ability to place SIP calls based on domain
    ; names to some other SIP users on the Internet

defaultexpiry=3600  ; Default length of incoming/outoing registration
videosupport=yes  ; Turn on support for SIP video
recordhistory=yes  ; Record SIP history by default
;sipdebug = yes   ; Turn on SIP debugging by default, from
    ; the moment the channel loads this configuration
register =>3858294:password at sipgate.co.uk/3858294
register =>3858817:password at sipgate.co.uk/3858817
register =>3858313:password at sipgate.co.uk/3858313

externip = 84.1.1.115  ; Address that we're going to put in outbound SIP 
messages
    ; if we're behind a NAT

    ; The externip and localnet is used
    ; when registering and communicating with other proxies
    ; that we're registered with
externhost=whatever.co.uk ; Alternatively you can specify an
    ; external host, and Asterisk will
    ; perform DNS queries periodically.  Not
    ; recommended for production
    ; environments!  Use externip instead
localnet=192.192.192.0/255.255.255.0; All RFC 1918 addresses are local 
networks

allow=ulaw
allow=alaw



[220]
type=friend
context=home
callerid=Paul<220>
nat=yes
host=dynamic
defaultip=192.192.192.220
username=220
secret=password
mailbox=220
dtmfmode=rfc2833

[221]
type=friend
context=home
callerid=Ellie<221>
nat=yes
host=dynamic
defaultip=192.192.192.221
username=221
secret=password
mailbox=221
dtmfmode=rfc2833

[222]
type=friend
context=home
callerid=Ellie<222>
nat=yes
host=dynamic
defaultip=192.192.192.222
username=222
secret=password
mailbox=222
dtmfmode=rfc2833

[223]
type=friend
context=home
callerid=Garage<223>
nat=yes
host=dynamic
defaultip=192.192.192.223
username=223
secret=PASSWORD
mailbox=223
dtmfmode=rfc2833

[sipdiscount]
type=peer
host=sip1.sipdiscount.com
fromdomain=sip1.sipdiscount.com
progressinband=yes
dtmfmode=inband
disallow=all
allow=alaw
allow=ulaw  ; only alaw works with sip1...
;allow=g729             ; but no way to have DMTF with G.729 !
nat=yes
canreinvite=no
qualify=yes
insecure=very
context=incoming
authuser=user1
username=user1
fromuser=user1
secret=password

[sipgate]
type=friend
host=sipgate.co.uk
insecure=very
context=sipgate-inbound

;[cisco1]
;type=friend
;secret=blah
;qualify=200   ; Qualify peer is no more than 200ms away
;nat=yes   ; This phone may be natted
    ; Send SIP and RTP to the IP address that packet is
    ; received from instead of trusting SIP headers
;host=dynamic   ; This device registers with us
;canreinvite=no   ; Asterisk by default tries to redirect the
    ; RTP media stream (audio) to go directly from
    ; the caller to the callee.  Some devices do not
    ; support this (especially if one of them is
    ; behind a NAT).
;defaultip=192.168.0.4  ; IP address to use until registration
;username=goran   ; Username to use when calling this device before 
registration
    ; Normally you do NOT need to set this parameter
;setvar=CUSTID=5678  ; Channel variable to be set for all calls from this 
device





More information about the asterisk-users mailing list