2 контекста провайдера - для входящих и для исходящих
Всем привет!
Руководствуясь комментарием в sip.conf:
; Tip 2: Use separate type=peer and type=user sections for SIP providers
; (instead of type=friend) if you have calls in both directions
решил разделить спинет на 2 контекста - для входящих и для исходящих звонков.
Вот что получается:
register => myusername:mypassword@sipnet_in
[sipnet_in]
type=user
context=fromsipnet
host=sipnet.ru
[sipnet_out]
type=peer
context=tosipnet
host=sipnet.ru
insecure=very
username=myusername
secret=mypassword
fromuser=myusername
fromdomain=sipnet.ru
Мой адрес: 212.188.26.2
sipnet.ru: 212.53.35.219
При такой конфигурации регистрации не происходит:
Jul 8 13:06:39 NOTICE[5426]: chan_sip.c:5372 sip_reg_timeout: -- Registration for 'myusername@sipnet_in' timed out, trying again (Attempt #1)
Jul 8 13:06:39 WARNING[5426]: chan_sip.c:1980 create_addr: No such host: sipnet_in
Destroying call '39d5696137e7f97d61e9935d4dcd732b@212.188.26.2'
Jul 8 13:06:39 WARNING[5426]: chan_sip.c:5455 transmit_register: Probably a DNS error for registration to myusername@sipnet_in, trying REGISTER again (after 20 seconds)
Меняем type=user в [sipnet_in] на type=peer и получаем вот такую картину:
Jul 8 13:09:32 NOTICE[5426]: chan_sip.c:5372 sip_reg_timeout: -- Registration for 'myusername@sipnet_in' timed out, trying again (Attempt #1)
REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 212.53.35.219:5060:
REGISTER sip:sipnet_in SIP/2.0
Via: SIP/2.0/UDP 212.188.26.2:5060;branch=z9hG4bK2a80ea33;rport
From: <sip:myusername@sipnet.ru>;tag=as076a0bce
To: <sip:myusername@sipnet.ru>
Call-ID: 3aa2dc1d2803fbc234b083833d726cf3@212.188.26.2
CSeq: 104 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Expires: 120
Contact: <sip:s@212.188.26.2>
Event: registration
Content-Length: 0
---
<-- SIP read from 212.53.35.219:5060:
SIP/2.0 500 failed to route the address
Via: SIP/2.0/UDP 212.188.26.2:5060;branch=z9hG4bK2a80ea33;rport=5060
From: <sip:myusername@sipnet.ru>;tag=as076a0bce
To: <sip:myusername@sipnet.ru>;tag=E392D316AAEDC05C
Call-ID: 3aa2dc1d2803fbc234b083833d726cf3@212.188.26.2
CSeq: 104 REGISTER
Server: CommuniGatePro/5.0.9
Content-Length: 0
--- (8 headers 0 lines)---
-- Got SIP response 500 "failed to route the address" back from 212.53.35.219
Destroying call '3aa2dc1d2803fbc234b083833d726cf3@212.188.26.2'
В чем грабли?
|