SIP Extension does not register

I just installed FreePBX from the DISTRO. So I am running Asterisk 11 and FreePBX 4.211…supposedly a perfect install :wink:

I am using the wiki to help me set up the sip service and my extensions.

http://wiki.freepbx.org/display/FD/FreePBX+Distro+First+Steps+After+Installation

I am having an issue registering ZOIPHER as a SIP phone.

PORT TESTING

In my router I have the following ports open.
UDP port 5060
UDP port 10001-20000

I am able to test that port 5060 I open using nmap.

 me$ sudo nmap -sU -p 5060 xxx.xxx.xxx.xxx

Starting Nmap 6.25 ( http://nmap.org ) at 2013-07-29 15:33 MDT
Nmap scan report for S0106c8fb2648e151.cg.xxxxxxx.net (xx.xx.xx.xx)
Host is up (0.0092s latency).
PORT     STATE         SERVICE
5060/udp open|filtered sip

SIP CONFIGURATION

Using the extensions application I created a new “Generic SIP Device” and entered ONLY the following:
USER EXTENSION: 4124071888
DISPLAY NAME: My Name
SECRET: {my password}

I left everything else the same.

ZOIPHER SETUP

In Zoipher I set up the following:

  Domain:  sip.xxxxxxx.ca
  USER: 4124071888
  Password: {my password}
  Auth.name:  4124071888

When I look at the SIP DEBUG INFORMATION I see the following:

[code]
<------------>
[2013-07-29 20:34:45] VERBOSE[1847] chan_sip.c: Scheduling destruction of SIP dialog ‘Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.’ in 32000 ms (Method: REGISTER)
[2013-07-29 20:34:45] VERBOSE[1847] chan_sip.c:
<— SIP read from UDP:xx.xx.xx.xxx:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.12:5060;branch=z9hG4bK-d8754z-c1f8f3a4c5f899b2-1—d8754z-;received=xx.xx.xx.xxx
From: sip:[email protected];transport=UDP;tag=540d447d
To: sip:[email protected];transport=UDP;tag=as0a3d8d96
Call-ID: Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.
CSeq: 13 REGISTER
Server: FPBX-2.11.0(11.4.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="4a4c3e83"
Content-Length: 0

<------------->
[2013-07-29 20:34:45] VERBOSE[1847] chan_sip.c: — (11 headers 0 lines) —
[2013-07-29 20:34:47] VERBOSE[1847] chan_sip.c:
<— SIP read from UDP:xx.xx.xx.xxx:61001 —>
REGISTER sip:sip.xxxxxxxx.ca;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.1.12:5060;branch=z9hG4bK-d8754z-c1f8f3a4c5f899b2-1—d8754z-
Max-Forwards: 70
Contact: sip:[email protected]:5060;rinstance=639d905d79a80545;transport=UDP
To: sip:[email protected];transport=UDP
From: sip:[email protected];transport=UDP;tag=540d447d
Call-ID: Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.
CSeq: 13 REGISTER
Expires: 3600
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, X-cisco-serviceuri
User-Agent: Zoiper Communicator 2.04.10164 rev.10204
Allow-Events: presence, kpml
Content-Length: 0

<------------->
[2013-07-29 20:34:47] VERBOSE[1847] chan_sip.c: — (14 headers 0 lines) —
[2013-07-29 20:34:47] VERBOSE[1847] chan_sip.c: Sending to 70.72.57.143:5060 (no NAT)
[2013-07-29 20:34:47] VERBOSE[1847] chan_sip.c:
<— Transmitting (no NAT) to xx.xx.xx.xxx:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP xx.xx.xx.xxx:5060;branch=z9hG4bK-d8754z-c1f8f3a4c5f899b2-1—d8754z-;received=xx.xx.xx.xxx
From: sip:[email protected];transport=UDP;tag=540d447d
To: sip:[email protected];transport=UDP;tag=as0a3d8d96
Call-ID: Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.
CSeq: 13 REGISTER
Server: FPBX-2.11.0(11.4.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="4a4c3e83"
Content-Length: 0

<------------>
[2013-07-29 20:34:47] VERBOSE[1847] chan_sip.c: Scheduling destruction of SIP dialog ‘Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.’ in 32000 ms (Method: REGISTER)
[2013-07-29 20:34:47] VERBOSE[1847] chan_sip.c:
<— SIP read from UDP:xx.xx.xx.xxx:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.12:5060;branch=z9hG4bK-d8754z-c1f8f3a4c5f899b2-1—d8754z-;received=xx.xx.xx.xxx
From: sip:[email protected];transport=UDP;tag=540d447d
To: sip:[email protected];transport=UDP;tag=as0a3d8d96
Call-ID: Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.
CSeq: 13 REGISTER
Server: FPBX-2.11.0(11.4.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="4a4c3e83"
Content-Length: 0

<------------->
[2013-07-29 20:34:47] VERBOSE[1847] chan_sip.c: — (11 headers 0 lines) —
[2013-07-29 20:34:51] VERBOSE[1847] chan_sip.c:
<— SIP read from UDP:xx.xx.xx.xxx:61001 —>
REGISTER sip:sip.xxxxxxxx.ca;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.1.12:5060;branch=z9hG4bK-d8754z-c1f8f3a4c5f899b2-1—d8754z-
Max-Forwards: 70
Contact: sip:[email protected]:5060;rinstance=639d905d79a80545;transport=UDP
To: sip:[email protected];transport=UDP
From: sip:[email protected];transport=UDP;tag=540d447d
Call-ID: Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.
CSeq: 13 REGISTER
Expires: 3600
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, X-cisco-serviceuri
User-Agent: Zoiper Communicator 2.04.10164 rev.10204
Allow-Events: presence, kpml
Content-Length: 0

<------------->
[2013-07-29 20:34:51] VERBOSE[1847] chan_sip.c: — (14 headers 0 lines) —
[2013-07-29 20:34:51] VERBOSE[1847] chan_sip.c: Sending to 70.72.57.143:5060 (no NAT)
[2013-07-29 20:34:51] VERBOSE[1847] chan_sip.c:
<— Transmitting (no NAT) to xx.xx.xx.xxx:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.12:5060;branch=z9hG4bK-d8754z-c1f8f3a4c5f899b2-1—d8754z-;received=xx.xx.xx.xxx
From: sip:[email protected];transport=UDP;tag=540d447d
To: sip:[email protected];transport=UDP;tag=as0a3d8d96
Call-ID: Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.
CSeq: 13 REGISTER
Server: FPBX-2.11.0(11.4.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="4a4c3e83"
Content-Length: 0

<------------>
[2013-07-29 20:34:51] VERBOSE[1847] chan_sip.c: Scheduling destruction of SIP dialog ‘Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.’ in 32000 ms (Method: REGISTER)
[2013-07-29 20:34:51] VERBOSE[1847] chan_sip.c:
<— SIP read from UDP:xx.xx.xx.xxx:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.12:5060;branch=z9hG4bK-d8754z-c1f8f3a4c5f899b2-1—d8754z-;received=xx.xx.xx.xxx
From: sip:[email protected];transport=UDP;tag=540d447d
To: sip:[email protected];transport=UDP;tag=as0a3d8d96
Call-ID: Y2VmNTNkOWVhNmEzZWZhZjExZTYwOTdlZDg0OTA2ZDg.
CSeq: 13 REGISTER
Server: FPBX-2.11.0(11.4.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="4a4c3e83"
Content-Length: 0
[/code/

You have to point your endpoint back to your server. I assume the xxxxxxxxx.ca you put in the domain is the address of your service provider. Your endpoint doesn’t care about that. It needs to know the address of the server that is running asterisk…

I have set up my domain provider to point to my server. sip.xxxxx.ca is the domain name. As you can tell Asterisk is able to see the request. This is clear as I am able to generate a SIP debug log.

The log states that the request is unauthorized. I am not sure why this is happening. I am using the correct user (4124071888) and the correct password.

I just doublechecked to make sure the endpoint is registering locally. I changed the domain on ZOIPHER to point to my local IP address (192.168.1.118) and it was able to register.

I checked the following:

192.168.1.188:5060 -> this worked
192.168.1.188 -> this worked as well
external IP address 70.22.34.123 (Not my real external ip address) -> did not work

My computer is operating within the local network but when I attempt to register using the external address i am not able to register.

Why is this the case? Do I need to set something to make this work?

If you are inside the network why would you want to register from the public IP?

This would require you to loop back through your own NAT.

Most routers don’t know how to make a U-turn anyway.

If the issue is one of DNS-resolution in your softphone just add a local DNS entry in your network for the LAN-IP. You don’t have to be authoritative for a domain to do that.

i am using FReePBX now, but last week I was just suing Asterisk 11 and in the SIP.conf file i had a line added to allow me to register phones within my network as well as outside my network.

externhost= sip.xxxxxx.ca:15000

this line in the SIP told Asterisk that the external IP address.

How can I do this with FreePBX.

exterhost is your external IP that is written in to the SIP packets.

That entry is in sip settings module.

You still didn’t tell me why you want a client on the LAN to access the WAN interface?

I have an Iphone that connects to the FreePBX. I want to register it once and be able to make phone calls when I am in the office (LAN) and when I am outside the office(WAN).

In FREEPBX under Settings->Asterisk SIP Settings there is the following:

External IP; {my external IP address}
Local Networks: 192.168.1.0

This is set to recognize the external I address. I noticed that when I register the phone outside of the network (WAN) sometimes the phone will work when I bring it into the LAN.

Any idea how I can have the Iphone work in the WAN and the LAN?

Thanks,

Spindler