Asterisk SIP registration basics

Ive just set up an asterisk system (Asterisk 11.7.0~dfsg-1ubuntu1) with 3 voip handsets. I can make internal calls, I can call external POTS and external VOIP numbers. I cant accept incoming calls.

All is not lost, Ive made a msitake somewhere!

I have attempted to register with my SIP, but show registry is empty. I know the credentials are correct and the service works because my ATA works just fine if I use those credentials. If I call my SIP from a POTS, it rings if my ATA is up, or goes straight to voicemail if not (confirming it isnt registered in asterisk)

In trying to diagnose this problem, Im making some assumptions. Unless there’s a better way, can someone see where Im assuming wrong please?

Im assuming:

  1. The register command goes in sip [general] like: register=>09xxxxx:xxxxxx@sip10.mynetfone.com.au/09xxxxx or register=>09xxxxx:xxxxxx@sip10.mynetfone.com.au or register=>09xxxxx:xxxxxx@sip10.mynetfone.com.au:5060 (all have the same results)
  2. To see details of registration attempts I use SIP SET DEBUG IP xxx.xxx.xxx.xxx where xxx is the ip address of the sip which I get from sip show peers.
  3. To force a registration I SIP RELOAD
  4. In my debug trace I would expect to see the word “register” or similar when an attempt is made. There I might see the problem. In fact, commenting or uncommenting the register statements makes no apparent difference at all to the debug trace.

In fact what happens is I see traces on SIP RELOAD, but not mentioning registration. I see a response SIP/2.0 480 Temporarily Unavailable if my ATA isnt connected, and SIP/2.0 200 OK if it is. However, either way asterisk is still not registered, so no incoming calls are detected.

So is asterisk even attempting to register? Why I dont see that nor why it fails?
Is the 0200 I see just establishing peer contact, and nothing is happening with the register command?
Or something completely different :slight_smile:

For completeness, here are the traces I refer to, taken using sip set sebug ip (so you see the entire trace resuling from SIP RELOAD).

Trace when my ATA is registered

Reloading SIP
Reliably Transmitting (NAT) to 125.213.160.82:5060:
OPTIONS sip:sip10.mynetfone.com.au SIP/2.0
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK2c31c56a;rport
Max-Forwards: 70
From: “asterisk” sip:09xxxxxx@192.168.4.80;tag=as392b3b19
To: sip:sip10.mynetfone.com.au
Contact: sip:09xxxxxx@192.168.4.80:5060
Call-ID: 0b9187103b5fbb91719218c91f0feb40@192.168.4.80:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Date: Thu, 23 Mar 2017 00:24:35 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

---
<--- SIP read from UDP:125.213.160.82:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK2c31c56a;rport=5060;received=xxx.xxx.xxx.xxx
Contact: <sip:sip10.mynetfone.com.au@125.213.160.82:5060>
To: <sip:sip10.mynetfone.com.au>;tag=25f7eefa-co11605-INS002
From: "asterisk"<sip:09xxxxxx@192.168.4.80>;tag=as392b3b19
Call-ID: 0b9187103b5fbb91719218c91f0feb40@192.168.4.80:5060
CSeq: 102 OPTIONS
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, INFO, SUBSCRIBE, NOTIFY, REGISTER
User-Agent: ENSR3.0.6
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '0b9187103b5fbb91719218c91f0feb40@192.168.4.80:5060' Method: OPTIONS
Reliably Transmitting (NAT) to 125.213.160.82:5060:
OPTIONS sip:sip10.mynetfone.com.au SIP/2.0
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK75eeb84f;rport
Max-Forwards: 70
From: "asterisk" <sip:09xxxxxx@192.168.4.80>;tag=as5c69315f
To: <sip:sip10.mynetfone.com.au>
Contact: <sip:09xxxxxx@192.168.4.80:5060>
Call-ID: 02daf8a63018712c75ae212f0926681c@192.168.4.80:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Date: Thu, 23 Mar 2017 00:24:35 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
---
<--- SIP read from UDP:125.213.160.82:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK75eeb84f;rport=5060;received=xxx.xxx.xxx.xxx
Contact: <sip:sip10.mynetfone.com.au@125.213.160.82:5060>
To: <sip:sip10.mynetfone.com.au>;tag=2de7bfd3-co12132-INS002
From: "asterisk"<sip:09xxxxxx@192.168.4.80>;tag=as5c69315f
Call-ID: 02daf8a63018712c75ae212f0926681c@192.168.4.80:5060
CSeq: 102 OPTIONS
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, INFO, SUBSCRIBE, NOTIFY, REGISTER
User-Agent: ENSR3.0.6
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '02daf8a63018712c75ae212f0926681c@192.168.4.80:5060' Method: OPTIONS

and a trace when it isnt

Reliably Transmitting (NAT) to 125.213.160.82:5060:
OPTIONS sip:sip10.mynetfone.com.au SIP/2.0
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK0c943252;rport
Max-Forwards: 70
From: "asterisk" <sip:09xxxxxx@192.168.4.80>;tag=as4c32dabb
To: <sip:sip10.mynetfone.com.au>
Contact: <sip:09xxxxxx@192.168.4.80:5060>
Call-ID: 0207764a374441196062c2f76cefaa1f@192.168.4.80:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Date: Thu, 23 Mar 2017 01:02:09 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:125.213.160.82:5060 --->
SIP/2.0 480 Temporarily Unavailable
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK34730893;rport=5060;received=xxx.xxx.xxx.xxx
To: <sip:sip10.mynetfone.com.au>
From: "asterisk"<sip:09xxxxxx@192.168.4.80>;tag=as73c10220
Call-ID: 02f255d22b91d5e35d852565428a029c@192.168.4.80:5060
CSeq: 102 OPTIONS
User-Agent: ENSR3.0.66.54-IS2
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '02f255d22b91d5e35d852565428a029c@192.168.4.80:5060' Method: OPTIONS

<--- SIP read from UDP:125.213.160.82:5060 --->
SIP/2.0 480 Temporarily Unavailable
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK0c943252;rport=5060;received=xxx.xxx.xxx.xxx
To: <sip:sip10.mynetfone.com.au>
From: "asterisk"<sip:09xxxxxx@192.168.4.80>;tag=as4c32dabb
Call-ID: 0207764a374441196062c2f76cefaa1f@192.168.4.80:5060
CSeq: 102 OPTIONS
User-Agent: ENSR3.0.66.54-IS2
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '0207764a374441196062c2f76cefaa1f@192.168.4.80:5060' Method: OPTIONS
Reliably Transmitting (NAT) to 125.213.160.82:5060:
OPTIONS sip:sip10.mynetfone.com.au SIP/2.0
Via: SIP/2.0/UDP 192.168.4.80:5060;branch=z9hG4bK2d3fe688;rport
Max-Forwards: 70
From: "asterisk" <sip:09xxxxxx@192.168.4.80>;tag=as76df5332
To: <sip:sip10.mynetfone.com.au>
Contact: <sip:09xxxxxx@192.168.4.80:5060>
Call-ID: 7f8fa5e342e4bd83093564d17637f4b7@192.168.4.80:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Date: Thu, 23 Mar 2017 01:03:09 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:125.213.160.82:5060 --->


> and SIP SHOW REGISTRY 

> Host                                    dnsmgr Username       Refresh State                Reg.Time                 
> 0 SIP registrations.