Делал как в FAQ на sipnet.ru
Вот конфиги:
sip.conf:
| Код: |
| [101] context=office type=friend username=101 secret=101 host=dynamic mailbox=101 [102] context=office type=friend username=102 secret=102 host=dynamic mailbox=102 [103] context=office type=friend username=103 secret=103 host=dynamic mailbox=103 register=>3158108:sip_pwd@212.53.35.219/3158108 [sipnetout] context=office provider = trunkstyle = customvoip type=friend secret=sip_pwd username=3158108 trunkname = sipnet callerid = hasexten = no hassip = yes hasiax = no registeriax = registersip = yes ; если не нужно принимать входящие вызовы, то можно поставить No host=sipnet.ru dialformat = ${EXTEN:1} ;port=5060 fromuser=3158108 fromdomain=sipnet.ru disallow=all allow=g729 canreinvite=nonat nat=no dtmfmode=info insecure=invite |
extension.conf:
| Код: |
| [office] exten=> *8X.,1,Dial(SIP/{exten}@sipnetout) exten => 102, 1, Macro(stdexten,102,SIP/102) |
Что набираете с телефона, что видно в консоле?
_________________
SuSE 10.1 / Asterisk-trunk / Celeron 1000 / chan_misdn (HFC)
Linksys PAP2T / SPA941 / SPA3102 / SPA2102
хотя включил core set verbose 10
звоню по номеру: 878214722222
где 8 - префикс заданный в конфиге, 82147 - код города, 22222 - существующий номер в этом городе
звоню через x-lite, после набора номера он говорит: "Call failed: Not found"
_________________
Intel Celeron 1063.96-MHz / 128Mb / 20GB
FreeBSD 6.2-RELEASE-p7 || Asterisk 1.4.11
Service Unavailable в x-lite при звонке с номера 101
в логе * вот что:
| Код: |
| -- Executing [878214722222@office:1] Dial("SIP/101-0874b000", "SIP/sipnetout/78214722222") in new stack -- Couldn't call sipnetout/78214722222 == Everyone is busy/congested at this time (0:0/0/0) == Auto fallthrough, channel 'SIP/101-0874b000' status is 'CHANUNAVAIL' |
_________________
Intel Celeron 1063.96-MHz / 128Mb / 20GB
FreeBSD 6.2-RELEASE-p7 || Asterisk 1.4.11
register=>3158108:sip_pwd@212.53.35.219/3158108
должна быть в секции [global]
Теперь все корректно регистрируется на сипнете и исходящие звонки проходят
Можно тему закрупить для того чтоб не спрашивали больше )
Или подправить ее под мануал
_________________
Intel Celeron 1063.96-MHz / 128Mb / 20GB
FreeBSD 6.2-RELEASE-p7 || Asterisk 1.4.11
CLI>sip show registry
и выхлоп сюда.
У тебя в sipnetout строчка
dialformat = ${EXTEN:1}
я её не заметил. Это означает отрезать из набранного номера первую цифру. А она уже отрезается в
exten=> _8X.,1,Dial(SIP/sipnetout/${EXTEN:1})
так что измени там или там, а то в sipnetout уходит несуществующий номер 8214722222.
Корень проблемы:
Asterisk находится за натом провайдера, проброс портов сделать невозможно, плюс к этому адрес провайдера динамический, меняется при каждом поднятии моей PPPoE сессии.
мой sip.conf
;
; SIP Configuration for Asterisk
;
[general]
context=default ; Default context for incoming calls
port=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=192.168.1.5 ; 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
useragent=Asterisk PBX ; Allows you to change the user agent string
[203] ;planet-156
type=friend
host=dynamic
username=203
secret=dron
nat=no
dtmfmode=rfc2833
context=internal
callerid="*******"
allow=gsm
allow=ulaw
allow=alaw
[sipnetout]
context= internal
provider =
trunkstyle = customvoip
type=friend
secret= пароль
username= 3162981
trunkname = sipnet
callerid =
hasexten = no
hassip = yes
hasiax = no
registeriax = no
registersip = yes ; если не нужно принимать входящие вызовы, то можно поставить No
host=sipnet.ru
dialformat = ${EXTEN:1}
fromuser= 3162981
fromdomain=sipnet.ru
disallow=all
allow=g729
canreinvite=nonat
nat=no
dtmfmode=info
insecure=invite
Кусок из extension.conf
[internal]
exten => 203,1, Macro(stdexten,203,SIP/200)
exten => user1, 1, Goto(203|1)
exten=> _8X.,1,Dial(SIP/sipnetout/${EXTEN})
набираю 8495 3871500-Приконектится к сипнету не удается.
sip debug
идут повторы
Retransmitting #3 (no NAT) to 212.53.35.219:5060:
INVITE sip:84953871500@sipnet.ru SIP/2.0
Via: SIP/2.0/UDP 192.168.1.5:5060;branch=z9hG4bK1293cc36;rport
From: "blabla" ;tag=as4328b2bd
To:
Contact:
Call-ID: 56c64ee22307a2e80c9baa0f11cdcd68@sipnet.ru
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Mon, 17 Sep 2007 06:37:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 179
v=0
o=root 2368 2368 IN IP4 192.168.1.5
s=session
c=IN IP4 192.168.1.5
t=0 0
m=audio 11722 RTP/AVP 18
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=silenceSupp:off - - -
Кто знает что в конфиге не так?
Например:
register=>sip_id:sip_pwd@212.53.35.219/sip_id
должна быть в секции [global]
_________________
Intel Celeron 1063.96-MHz / 128Mb / 20GB
FreeBSD 6.2-RELEASE-p7 || Asterisk 1.4.11
[general]
context=default ; Default context for incoming calls
port=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=192.168.1.5 ; 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
useragent=Asterisk PBX ; Allows you to change the user agent string
register=>3162981:пароль@sipnet.ru/3162981
После чего выхлоп в логи:
Sep 17 12:57:30 NOTICE[2467]: chan_sip.c:5429 sip_reg_timeout: -- Registration for '3162981@sipnet.ru' timed out, trying again (Attempt #1)
и долбит повторы
asterisk*CLI> sip show registry
Host Username Refresh State
sipnet.ru:5060 3162981 120 Request Sent
то есть регится пытается но увы.
может в секции глобал както надо указать что астериск за натом и т.п.?
| dron0 писал(а): |
| может в секции глобал както надо указать что астериск за натом и т.п.? |
Это ты праильна заметил!
| Код: |
| nat=yes canreinvite=no |
_________________
Успехов!
nat=yes
canreinvite=no
регистрация так и не проходит
asterisk*CLI> sip show registry
Host Username Refresh State
sipnet.ru:5060 3162981 120 Request Sent
то
tcpdump host 212.53.35.219
и ответы сюда, если не сможешь разобраться.
64 bytes from sipnet.ru (212.53.35.219): icmp_seq=1 ttl=249 time=87.5 ms
64 bytes from sipnet.ru (212.53.35.219): icmp_seq=2 ttl=249 time=39.5 ms
64 bytes from sipnet.ru (212.53.35.219): icmp_seq=3 ttl=249 time=38.7 ms
TcpDump :
11:29:55.641204 IP (tos 0x0, ttl 64, id 45221, offset 0, flags [none], proto: UDP (17), length: 410) 192.168.1.5.sip > sipnet.ru.sip: SIP, length: 382
REGISTER sip:sipnet.ru SIP/2.0
Via: SIP/2.0/UDP 192\000\000\000\000\031\000\000\000host 212.53.35.219\000\000\031\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!\000\000\000\000,\031\010\3007\366\267\340\261\367\267\000\000\000\000\000,\031\010\3007\366\267\340\261\367\267\021\000\000\000\276\270\336\267\000\000\000\000\000\000\000\000\021\000\000\000\276\270\336\267\320i\312\267\020\000\000\000\021\003\000\000\330\036_\233\230\362>\235\030\357*\236\2109\367\236\030X\204\237\010m\330\240(\026\000\241@\246 sipnet.ru.sip: SIP, length: 382
REGISTER sip:sipnet.ru SIP/2.0
Via: SIP/2.0/UDP 192\000\000\000\000\031\000\000\000host 212.53.35.219\000\000\031\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!\000\000\000\000,\031\010\3007\366\267\340\261\367\267\000\000\000\000\000,\031\010\3007\366\267\340\261\367\267\021\000\000\000\276\270\336\267\000\000\000\000\000\000\000\000\021\000\000\000\276\270\336\267\320i\312\267\020\000\000\000\021\003\000\000\330\036_\233\230\362>\235\030\357*\236\2109\367\236\030X\204\237\010m\330\240(\026\000\241@\246
Точнее не абонентам Skype а просто через Skype как например через SIPNET тоесть на любые номера.
ps: за такие "внятные" заголовки тем буду наказывать
_________________
«Choose a job you love, and you will never have to work a day in your life» — Confucius