Re: spa3000 in asterisk ; This is most of what i could find in my * that may help you get kick started. Needs editing and fixing for you. But is is a start more than any one else has given so far.
;Here are chunks from my sip.conf
;Nothing in register => section! (for PSTN)
;
[pstn_spa]
username=asterisk ; spa username you setup for PSTN
fromuser=asterisk ; same as above
secret=spa3000pstn from your spa3000 PSTN page
; auth=md5
dtmfmode=rfc2833
;canreinvite=no
context=from-PSTN
host=192.168.101.136 ; IP address of SPA3000
insecure=very
nat=no
port=5061 ; important !
qualify=yes
type=peer;
;
; One of these is superflous, comments are experiments that I did earlier. Caller ID is ignored by PSTN. Either virtual extension 1100 or 1020 is used but I haven't proven which is working for me. I believe my spa is set for 1020. I thought there was once a reason for two virtual numbers long ago.
;
; Verizon line 0
[1100]
; disallow=all
; allow=ulaw
; allow=alaw
type=friend
host=dynamic
context=from-PSTN
username=1100; Sias Family on Verizon
; fromuser=1100
;authuser=1100
secret=pwd00
port=5062 ; Correct! ( for me, not you)
qualify=no
callerid="Sias Fam incoming" <mypstn num>
mailbox=1100
dtmfmode=rfc2833 ; inband
nat=no
canreinvite=no
;
; Verizon line 0
[1020]
; disallow=all
; allow=ulaw
; allow=alaw
type=friend
host=dynamic
context=from-PSTN
username=1020; Sias Family on Verizon
; fromuser=1020
;authuser=md5
secret=secret from spa3000 FXO port
port=5061
qualify=no
callerid="Sias Fam outcall" <pstn phone no>
mailbox=1020
dtmfmode=rfc2833 ; inband
nat=no
canreinvite=no
;
;=========
;from extensions.conf
;===== This is my dial pstn macro, place just before dial sip macro
;
;
;
[macro-dial-pstn]
;
; Enter with these
; ARG1 = number to dial
; ARG2 = timeout value
; ARG3 = flag determines if hangup or return on noanswer
; HR = hangup and return (default)
; RT = return without hangup (must set)
;
; Returns with FOUNDME = DIALSTATUS
;
;
; the 9w dials 9 then waits .5 sec for outside dialtone
;
exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
;exten => s,2,Dial(${PSTN}/9w${ARG1},${ARG2})
exten => s,2,Dial(SIP/${ARG1}@pstn_spa,${ARG2},Ttrw)
; I use a lot of pass parameters here, just put you values in the Dial() command.
exten => s,3,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,4,Goto(s-${DIALSTATUS},1)
;
; returns here if busy
;
exten => s-BUSY,1,BackGround(custom/the-party-you-are-calling)
exten => s-BUSY,2,BackGround(custom/is-curntly-busy)
exten => s-BUSY,n,BackGround(custom/try-again-later)
exten => s-BUSY,n,BackGround(goodbye)
exten => s-BUSY,n,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,n,Goto(s-CLEANEXIT,1)
;
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(custom/is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
exten => s-NOANSWER,1,BackGround(custom/nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
exten => s-.,1,BackGround(something-Usr2bly-wrong)
exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,3,Goto(s-CLEANEXIT,1)
;
exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp
;
;
;======= piece from outbound call handling ===
;
; NOTE: I use 60-69 for accessing each of my providers by dial code.
; handle outbound long distance calls - force PSTN trunk
;
exten => _66NXXNXXXXXX,1,Macro(dial-pstn,${EXTEN:2},${LONGTIMEOUT})
exten => _661NXXNXXXXXX,1,Macro(dial-pstn,${EXTEN:2},${LONGTIMEOUT})
;
;===== from inbound for PSTN =====
;
[from-PSTN]
exten => s,1,NoOp
;exten => s,n,Dial(${ALL_EXTV},${DEFTIMEOUT},Ttrw)
exten => s,n,Dial(SIP/19,${DEFTIMEOUT},Ttrw)
exten => s,n,Playback(tt-weasles)
;
;next extension (1020) is to handle incoming PSTN calls
;exten => 1020,1,GotoIf($["${CALLERIDNUM:0:2}" = "00"]?2:3)
;exten => 1020,2,SetCIDNum(${CALLERIDNUM:2})
;exten => 1020,3,SetMusicOnHold(default)
;exten => 1020,4,Answer
;exten => 1020,5,Wait(1)
;exten => 1020,6,Background(custom/welcome)
;exten => 1020,7,DigitTimeout,2
;exten => 1020,8,ResponseTimeout,2
;
;next extension (1100) is to handle incoming PSTN calls
exten => 1100,1,GotoIf($["${CALLERIDNUM:0:2}" = "00"]?2:3)
exten => 1100,2,SetCIDNum(${CALLERIDNUM:2})
exten => 1100,3,SetMusicOnHold(default)
exten => 1100,4,Answer
exten => 1100,5,Wait(0)
exten => 1100,6,Background(custom/welcome-sias)
exten => 1100,7,DigitTimeout,2
exten => 1100,8,ResponseTimeout,2
;
exten => _XXX,1,GoTo(house-in,s,1)
;
exten => _0,1,Dial(${ALL_EXTV},${DEFTIMEOUT},t)
;
exten => t,1,Answer
exten => t,2,Wait(0)
exten => t,3,Background(custom/pls-hold-while-try)
exten => t,4,Dial(${ALL_EXTV},${DEFTIMEOUT},t)
; exten => t,4,Dial(SIP/16&SIP/19,27,m)
exten => t,5,VoiceMail(548@sias)
exten => t,6,Hangup
;
exten => i,1,Answer
exten => i,2,Wait(1)
exten => i,3,Playback(custom/wrong-try-again-smarty)
exten => i,4,Goto(1100,5)
;
;===== here are some definitions used above ===
; from [globals] of extensions.conf
; I use 2 digit extensions for all the spas I have connected. I define 3 digit extensions as virtural numbers and mailboxes for all the rooms and then I have sections that define global vars that match them all up. TO reassing extn, just redefine the globals. ALL_EXTN rings all extns in list at once. One answers, then others can't join in on convo. , they get a dial tone.
ALL_EXTN=SIP/11&SIP/12&SIP/13&SIP/14&SIP/15&SIP/16&SIP/17&SIP/19&SIP/20&SIP/21&SIP/22&SIP/23&SIP/24&SIP/26
ALL_EXTV=SIP/11&SIP/12&SIP/15&SIP/16&SIP/17&SIP/19&SIP/20&SIP/21&SIP/22&SIP/23&SIP/24&SIP/26
;ALL_EXTN=SIP/11&SIP/13&SIP/15&SIP/16&SIP/17&SIP/19&SIP/21
DYNAMIC_FEATURES=blindxfer#disconnect#automon#atxf er#testfeature#flash#outflash#stopmonitor#startmon itor#moh#testfeature1
SIPCO1=@Sunrocket-out ; Sunrocket host
SIPCO2=@Sunrocket-out2 ; Sunrocket host
SIPCO3=@net2phone ; Net2Phone host
STAN03=@stan-out
CALL08=@callcentric
SUIT09=@onesuite
SIPC11=@fwd
SIPC12=@fwd4
;SIPCID=phoneno1
;
STANCID=stanid
SIP1CID=phoneno1
SIP2CID=phoneno2
SUITCID=secret |