Автор: Alukardd
Дата сообщения: 11.01.2012 22:58
Пол вечера и всю ночь бился над настройкой Asterisk так ни черта и не вышло. Разве что залогиниться удалось почти сразу и Echo Call тоже работает без проблем.
ОС: Debian Squeeze, Asterisk стоит из репов 1.6.2.9.
Файлы конфигурации (те что менял): [more=sip.conf][general]
context=default
allowguest=yes
allowoverlap=yes
alwaysauthreject=no
useragent=voip.mysite.com
defaultexpiry=360
callevents=yes
limitonpeer=yes
tcpenable=no
rtptimeout=60
language=ru
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
tos_sip=cs3
tos_audio=ef
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=g723
dtmfmode=rfc2833
rtpholdtimeout=300
rtpkeepalive=5
canreinvite=no
allowexternaldomains=yes
domain=voip.mysite.com,default
fromdomain=voip.mysite.com
[interzet]
type=peer
secret=MY_SECRET_PWD
username=MY_ACCOUNT
host=voip.interzet.ru
fromuser=MY_ACCOUNT
authname=MY_ACCOUNT
port=5060
insecure=port,invite
call-limit=1
context=incoming
canreinvite=no
qualify=yes
transport=udp
dtmfmode=inband
registersip=yes
[/more], [more=extensions.conf][general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=DAHDI/G2
TRUNKMSD=1
[dundi-e164-canonical]
[dundi-e164-customers]
[dundi-e164-via-pstn]
[dundi-e164-local]
include => dundi-e164-canonical
include => dundi-e164-customers
include => dundi-e164-via-pstn
[dundi-e164-switch]
switch => DUNDi/e164
[dundi-e164-lookup]
include => dundi-e164-local
include => dundi-e164-switch
[macro-dundi-e164]
exten => s,1,Goto(${ARG1},1)
include => dundi-e164-lookup
[iaxtel700]
exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)
[iaxprovider]
[trunkint]
exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})
[trunkld]
exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
[trunklocal]
exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
[trunktollfree]
exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
[international]
ignorepat => 9
include => longdistance
include => trunkint
[longdistance]
ignorepat => 9
include => local
include => trunkld
[local]
ignorepat => 9
include => default
include => trunklocal
include => iaxtel700
include => trunktollfree
include => iaxprovider
include => parkedcalls
[outbound-freenum]
exten => _X*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
[outbound-freenum2]
exten => _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN})
same => n,Set(SUFFIX=${CUT(EXTEN,*,2-)})
same => n,GotoIf($["${FILTER(0-9,${SUFFIX})}" != "${SUFFIX}"]?fn-CONGESTION,1)
same => n,Set(TIMEOUT(absolute)=10800)
same => n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)})
same => n,GotoIf($["${isnresult}" != ""]?from)
same => n,Set(DIALSTATUS=CONGESTION)
same => n,Goto(fn-CONGESTION,1)
same => n(from),Set(SIPFROMUSER=${CALLERID(num)})
same => n,GotoIf($["${GLOBAL(FREENUMDOMAIN)}" = ""]?dial)
same => n,Set(SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)})
same => n(dial),Dial(SIP/${isnresult},40)
same => n,Goto(fn-${DIALSTATUS},1)
exten => fn-BUSY,1,Busy()
exten => _f[n]-.,1,NoOp(ISN: ${DIALSTATUS})
same => n,Congestion()
[macro-trunkdial]
exten => s,1,Dial(${ARG1})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Hangup
exten => s-BUSY,1,Hangup
exten => _s-.,1,NoOp
[stdexten]
exten => _X.,50000(stdexten),NoOp(Start stdexten)
exten => _X.,n,Set(LOCAL(ext)=${EXTEN})
exten => _X.,n,Set(LOCAL(dev)=${ARG1})
exten => _X.,n,Set(LOCAL(cntx)=${ARG2})
exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
exten => _X.,n,Dial(${dev},20)
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1)
exten => stdexten-NOANSWER,1,Voicemail(${mbx},u)
exten => stdexten-NOANSWER,n,NoOp(Finish stdexten NOANSWER)
exten => stdexten-NOANSWER,n,Return()
exten => stdexten-BUSY,1,Voicemail(${mbx},b)
exten => stdexten-BUSY,n,NoOp(Finish stdexten BUSY)
exten => stdexten-BUSY,n,Return()
exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1)
exten => a,1,VoicemailMain(${mbx})
exten => a,n,Return()
[stdPrivacyexten]
exten => _X.,60000(stdPrivacyexten),NoOp(Start stdPrivacyexten)
exten => _X.,n,Set(LOCAL(ext)=${ARG1})
exten => _X.,n,Set(LOCAL(dev)=${ARG2})
exten => _X.,n,Set(LOCAL(dontcntx)=${ARG3})
exten => _X.,n,Set(LOCAL(tortcntx)=${ARG4})
exten => _X.,n,Set(LOCAL(cntx)=${ARG5})
exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
exten => _X.,n,Dial(${dev},20,p)
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1)
exten => stdexten-NOANSWER,1,Voicemail(${mbx},u)
exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER)
exten => stdexten-NOANSWER,n,Return()
exten => stdexten-BUSY,1,Voicemail(${mbx},b)
exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY)
exten => stdexten-BUSY,n,Return()
exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1)
exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1)
exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1)
exten => a,1,VoicemailMain(${mbx})
exten => a,n,Return
[macro-page]
exten => s,1,ChanIsAvail(${ARG1},s)
exten => s,n,GoToIf([${AVAILORIGCHAN} = ""]?fail:autoanswer)
exten => s,n(autoanswer),Set(_ALERT_INFO="RA")
exten => s,n,SIPAddHeader(Call-Info: Answer-After=0)
exten => s,n,NoOp()
exten => s,n,Dial(${ARG1})
exten => s,n(fail),Hangup
[demo]
include => stdexten
exten => s,1,Wait(1)
exten => s,n,Answer
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n(restart),BackGround(demo-congrats)
exten => s,n(instruct),BackGround(demo-instruct)
exten => s,n,WaitExten
exten => 2,1,BackGround(demo-moreinfo)
exten => 2,n,Goto(s,instruct)
exten => 3,1,Set(LANGUAGE()=fr)
exten => 3,n,Goto(s,restart)
exten => 1000,1,Goto(default,s,1)
exten => 1234,1,Playback(transfer,skip)
exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
exten => 1234,n,Goto(default,s,1)
exten => 1235,1,Voicemail(1234,u)
exten => 1236,1,Dial(Console/dsp)
exten => 1236,n,Voicemail(1234,b)
exten => #,1,Playback(demo-thanks)
exten => #,n,Hangup
exten => t,1,Goto(#,1)
exten => i,1,Playback(invalid)
exten => 500,1,Playback(demo-abouttotry)
exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default)
exten => 500,n,Playback(demo-nogo)
exten => 500,n,Goto(s,6)
exten => 600,1,Playback(demo-echotest)
exten => 600,n,Echo
exten => 600,n,Playback(demo-echodone)
exten => 600,n,Goto(s,6)
exten => 76245,1,Macro(page,SIP/Grandstream1)
exten => _7XXX,1,Macro(page,SIP/${EXTEN})
exten => 7999,1,Set(TIMEOUT(absolute)=60)
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
exten => 8500,1,VoicemailMain
exten => 8500,n,Goto(s,6)
[page]
exten => _X.,1,Macro(page,SIP/${EXTEN})
[default]
include => demo
exten => 600,1,Playback(demo-echotest)
exten => 600,2,Echo
exten => 600,3,Playback(demo-echodone)
exten => 600,4,Goto(s,6)
[time]
exten => _X.,30000(time),NoOp(Time: ${EXTEN} ${timezone})
exten => _X.,n,Wait(0.25)
exten => _X.,n,Answer()
exten => _X.,n,Set(FUTURETIME=$[${EPOCH} + 12])
exten => _X.,n,SayUnixTime(${FUTURETIME},Zulu,HNS)
exten => _X.,n,SayPhonetic(z)
exten => _X.,n,SayUnixTime(${FUTURETIME},${timezone},HNS)
exten => _X.,n,Playback(spy-local)
exten => _X.,n,WaitUntil(${FUTURETIME})
exten => _X.,n,Playback(beep)
exten => _X.,n,Return()
[ani]
exten => _X.,40000(ani),NoOp(ANI: ${EXTEN})
exten => _X.,n,Wait(0.25)
exten => _X.,n,Answer()
exten => _X.,n,Playback(vm-from)
exten => _X.,n,SayDigits(${CALLERID(ani)})
exten => _X.,n,Wait(1.25)
exten => _X.,n,SayDigits(${CALLERID(ani)})
exten => _X.,n,Return()
[/more] [more=users.conf][general]
fullname = New User
userbase = 32665
hasvoicemail = yes
vmsecret = 1234
hassip = yes
hasiax = yes
hasmanager = no
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
[Alukardd]
type=friend
secret=superpwd
mailbox=Alukardd
canreinvite=yes
context=default
insecure=port,invite
host=dynamic
nat=yes
username=Alukardd
[32667]
type=friend
secret=secretpassword
mailbox=32667
canreinvite=yes
context=default
insecure=port,invite
host=dynamic
nat=yes
username=Enybody
[/more]
Залогинился через Twinkle и ак своего прова к нему. И пытался позвонить на свой PBX. Хрен там плавал. Сначала ругался, что я не авторизован - на кой хрен для входящих нужна авторизация?! Ну ладно проописал в sip.conf allowguest=yes - не знаю точно хорошо ли это? Это не значит что от меня смогут звонить без контрольно?
Peer к interzet'у норм создается, в логах пишет успех.
Если зонить на 32667@voip.mysite.com то в логах запись WARNING[31585] app_macro.c: No such context 'macro-stdexten' for macro 'stdexten'
, это в логах, а Twinkle получает ответ - 603 Declined. Тоже самое, если попытаться позвонить между клиентами Alukardd <--> 32667.
А если звонить на Alukardd@voip.alukardd.org, то в логах ни чего, а Twinkle пишет - 484 Address Incomplete.
Если буду звонить я со своего куда-то, то вроде как норм идёт... Например, смог позвонить на 100@voip.interzet.ru (Echo test). Ну и на свой 600 тоже норм звонит.
Только что еще удалось прикрутить звонок на семизначные номера:exten => _XXXXXXX,1,Dial(SIP/${EXTEN}@interzet)
exten => _XXXXXXX,n,Hangup(), на мобильные что-то не выходит от прова позвонить (эт я сним еще разберусь)...
Основной вопрос - как позвонить мне?!
Добавлено:
Нашёл затыку с входящими! В users.conf закомментировал строку hasvoicemail=yes.