Doesn't even try to register on trunk

Hello,

I’m using asterisk 1.8.10.1 on a openWrt router.

If I comment out the register statement on sip.conf/general, the phones register.

If I activate the register statement, asterisk stops replying to the phone REGISTER packets, as I can see from capture with tcpdump on the lan side, and doesn’t even try to register on the provider.

On the wan side, I can only see two packets: one OPTIONS from asterisk, and a FORBIDDEN reply from the provider, which proves, I think, it has nothing to do with firewall/nat.

The providers registers successfully an ST780WL router with ATA with these parameters:
Proxy Address: proxy.voip.sapo.pt
Proxy port: 5070
Registrar Adress: voip.sapo.pt
Registrar port: 5060
SIP URL: +351302000000
Username: +351302000000
Password: mypass

So, there’s nothing wrong with the provider.

[code]sip.conf:
[general]
context=unauthenticated ; default context for incoming calls
allowguest=no ; disable unauthenticated calls
srvlookup=yes ; enabled DNS SRV record lookup on outbound calls
udpbindaddr=0.0.0.0 ; listen for UDP requests on all interfaces
tcpenable=no ; disable TCP support
tcpbindaddr=0.0.0.0
bindport=5060
defaultuser=+351302000000
useragent=Max PBX
sipdebug=yes
nat=yes
register => +351302000000@voip.sapo.pt:mypass:+351302000000@proxy.voip.sapo.pt:5070

[sapo-voip-saida]
type=peer
host=proxy.voip.sapo.pt
insecure=port,invite
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
outboundproxy=proxy.voip.sapo.pt
fromuser=+351302000000
registername=+351302000000
authname=+351302000000
port=5070
fromdomain=voip.sapo.pt
qualify=yes
canreinvite=no
context=external-saida
registertimeout=20
remotesecret=mypass
defaultuser=+351302000000@voip.sapo.pt

[sapo-voip-entrada]
type=user
host=proxy.voip.sapo.pt
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
port=5070
realm=voip.sapo.pt
canreinvite=no
context=external-entrada
registertimeout=20
remotesecret=mypass
defaultuser=+351302000000@voip.sapo.pt

office-phone
type=friend
context=LocalSets
host=dynamic
nat=no
secret=myphonepass
dtmfmode=auto
disallow=all
allow=ulaw
allow=alaw

ATAFXS1
[/code]

Thanks in advance for any help.
Rgds
jssilva

Did you use the wireshark to capture it in real time and see what is happening ?

Thank you for replying.

Yes, indirectly. I used tcpdump to capture udp traffic ports 5004-5080 on OpenWrt (can’t run wireshark) and then watched the capture file with wireshark.

What happens is an OPTIONS packet from asterisk to trunk 5070, which replies FORBIDDEN, as I said before. Later I commented out qualify=1 and this stopped.

Then the log, with debug turned on:

NOTICE[6912]: chan_sip.c:13058 sip_register: -- Re-registration for +351302000000@proxy.voip.sapo.pt > doing dnsmgr_lookup for 'proxy.voip.sapo.pt'

So on DNS port 53 I can see asterisk asking for the address of proxy.voip.sapo.pt (trunk) and the DNS server replying with the correct address. Then asterisk just sits quietly and does nothing else, no messages al all.

Any directions to try, please?
Rgds
jss