Trouble registering Asterisk to Nettel (Provider)

Hi.

I have a virtual machine hosted at Azure, running ubuntu server 12.04.

I bought the book “Asterisk: The definitive guide”,
and followed every step configuring the installation.

IAX2 is working fine, so is internal calls, but when I try to add an external SIP provider, something (doesn’t) happen(s).

My sip.conf:

[general]
allowguest=no                   ; disable unauthenticated calls
allowoverlap=no
srvlookup=yes                   ; disable DNS SRV record lookup on outbound calls
                                ; (unless you have a reliable DNS connection,
                                ; in which case yes)
transport=udp
tcpenable=no

udpbindaddr=0.0.0.0:5060
nat=force_rport,comedia

externip=external.ip.of.the.vm
localnet=100.85.42.84/255.255.254.0

register => user:pass@proxy.nettel.dk

[nettel]
type = friend
host = sip.nettel.dk
username = user
secret = pass
canreinvite=no
insecure = invite,port
dtmfmode = rfc2833
context = PubCall
allow=all
nat=force_rport,comedia

SIP error:

Registration for 'username@proxy.nettel.dk' timed out, trying again

SIP debug error:

Trying to put 'REGISTER si' onto UDP socket destined for 194.192.15.56:5060
SIP TIMER: Rescheduling retransmission #14 (2) REGISTER - 2
** SIP timers: Rescheduling retransmission 3 to 2000 ms (t1 500 ms (Retrans id #14)) 
Trying to put 'REGISTER si' onto UDP socket destined for 194.192.15.56:5060
[Aug  2 11:38:57] Retransmitting #2 (NAT) to 194.192.15.56:5060:
REGISTER sip:proxy.nettel.dk SIP/2.0
Via: SIP/2.0/UDP external.ip.of.the.VM:5060;branch=z9hG4bK44a86fc3;rport
Max-Forwards: 70
From: <sip:username@proxy.nettel.dk>;tag=as3f4cb742
To: <sip:username@proxy.nettel.dk>
Call-ID: 2011330c19ffe2bd6b28c5902ac64d07@100.85.42.84
CSeq: 107 REGISTER
User-Agent: Asterisk PBX SVN-branch-11-r395033
Expires: 120
Contact: <sip:s@external.ip.of.the.VM:5060>
Content-Length: 0

I have configured these endpoints in the VM:

And iptables -L:

iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

I’m at a loss. The register requests I’m sending are timing out, and I cannot seem to spot any errors in the configuration.

I suspect you have a NATed environment, but you have none of the standard NAT options (nat= is for certain NAT hacks, not for normal NAT use). You also seem to have most of the usual sub-optimal settings that seem to get copied from cookbook settings.

Note that VMs are likely to give poor audio when used in production, and, with cloud machines, you don’t have enough control to compensate for this.