I am moving my office to my house, but having a crazy problem with the desk phones. The Asterisk server and phones used to be on the same network, and the Asterisk server had a public IP configured.
I moved my desks and phones last week and have spent several days trying to figure this out to no avail, even though I have discovered some interesting info along the way.
Basic Network details:
Incoming
Comcast business with 5 static IP addresses
=> Linksys Router Provides DHCP and Wireless
=> Zoiper on cell using Wireless with local DHCP IP
=> Snom 821 Desk phone with local DHCP IP
=> Snom 821 Desk phone with public static IP
First let me share what IS working. I use Zoiper on my phone, which is connected using WiFi. I have no problems here. Nothing had to be configured on my Linksys router for NAT, no STUN, just configure Zoiper and use.
The desk phone registers just fine with the PJSIP server, I can accept incoming calls, quality is good, I can both receive and transmit sound. This works with both the phone using a static IP and the one using the private ip.
Here is the settings in the pjsip.conf, it is the same for extension 15 & 16:
[10]
type = aor
max_contacts = 1
[10]
type = auth
username = 10
password = secret
[10]
type = endpoint
context = Local
disallow = all
allow = ulaw
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
timers = no
direct_media = yes
auth = 10
outbound_auth = 10
aors = 10
callerid= Alan <4805551234>
What I can’t do is dial out using the desk phone. I have some tcpdump info, as well as the pjsip logger to review. In comparing the info from tcpdump between the Zoiper on my cell that is working to the desk phone that is not, is that on Zoiper, it has transport=udp
as part of it’s INVITE. On one phone it has user=phone
, on the other I omitted it. It didn’t seem to have any effect either way.
In the pjsip.conf file, I have mirrored all configuration options for the extension that is for my cell to the desk phone.
Here is the tcpdump info for when I am attempting a call:
First the Zoiper that works:
18:20:33.733598 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP: INVITE sip:8003913000@64.72.21.22:5060;transport=UDP SIP/2.0
18:20:33.734205 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 401 Unauthorized
18:20:33.792564 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP: ACK sip:8003913000@64.72.21.22:5060;transport=UDP SIP/2.0
18:20:33.792626 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP: INVITE sip:8003913000@64.72.21.22:5060;transport=UDP SIP/2.0
18:20:33.794642 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 100 Trying
18:20:33.815424 IP 64.72.21.22.5060 > 67.231.12.81.5060: SIP: INVITE sip:8003913000@67.231.12.81 SIP/2.0
18:20:33.866299 IP 67.231.12.81.5060 > 64.72.21.22.5060: SIP: SIP/2.0 100 Trying
18:20:35.185891 IP 67.231.12.81.5060 > 64.72.21.22.5060: SIP: SIP/2.0 183 Session Progress
18:20:35.187099 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 183 Session Progress
18:20:35.187319 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 183 Session Progress
18:20:35.430856 IP 67.231.12.81.5060 > 64.72.21.22.5060: SIP: SIP/2.0 183 Session Progress
18:20:35.431346 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 183 Session Progress
18:20:35.431453 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 183 Session Progress
18:20:35.478666 IP 67.231.12.81.5060 > 64.72.21.22.5060: SIP: SIP/2.0 200 OK
18:20:35.479157 IP 64.72.21.22.5060 > 67.231.12.81.5060: SIP: ACK sip:8003913000@67.231.12.81:5060 SIP/2.0
18:20:35.479910 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 200 OK
18:20:35.542026 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP: ACK sip:64.72.21.22:5060 SIP/2.0
18:20:39.455636 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP: BYE sip:64.72.21.22:5060 SIP/2.0
18:20:39.455992 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 200 OK
18:20:39.457129 IP 64.72.21.22.5060 > 67.231.12.81.5060: SIP: BYE sip:8003913000@67.231.12.81:5060 SIP/2.0
18:20:39.508307 IP 67.231.12.81.5060 > 64.72.21.22.5060: SIP: SIP/2.0 200 OK
18:20:41.866940 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP: SUBSCRIBE sip:8015157771@64.72.21.22:5060;transport=UDP SIP/2.0
18:20:41.867575 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 401 Unauthorized
18:20:41.938183 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP: SUBSCRIBE sip:8015157771@64.72.21.22:5060;transport=UDP SIP/2.0
18:20:41.938811 IP 64.72.21.22.5060 > 23.3.56.7.60405: SIP: SIP/2.0 404 Not Found
Now for the deskphone:
18:21:46.446730 IP 23.3.56.7.60405 > 64.72.21.22.5060: SIP
18:21:46.570940 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:21:46.571432 IP 64.72.21.22.5060 > 23.3.56.7.5060: SIP: SIP/2.0 401 Unauthorized
18:21:46.629948 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: ACK sip:14805934027@64.72.21.22 SIP/2.0
18:21:46.636861 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:21:47.142678 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:21:48.153278 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:21:50.163946 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:21:54.174574 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:21:58.184566 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:22:02.195431 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:22:06.204297 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:22:10.214745 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: INVITE sip:14805934027@64.72.21.22 SIP/2.0
18:22:11.330534 IP 23.3.56.7.5060 > 64.72.21.22.5060: SIP: CANCEL sip:14805934027@64.72.21.22 SIP/2.0
When I look at the pjsip logger info when making a call, I also noticed a difference,
Zoiper:
<--- Received SIP request (925 bytes) from UDP:23.3.56.7:60405 --->
INVITE sip:8003913000@64.72.21.22:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.1.182:60405;branch=z9hG4bK-524287-1---dd39fc5e2667d79c;rport
Max-Forwards: 70
Contact: <sip:16@192.168.1.182:60405;transport=UDP>
To: <sip:8003913000@64.72.21.22:5060>
From: <sip:16@64.72.21.22:5060;transport=UDP>;tag=b79e0844
Call-ID: kNKbVyKuQP8bNdbBbsk8pg..
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rv2.10.12.3-mod
Allow-Events: presence, kpml, talk
Content-Length: 340
v=0
o=Zoiper 1614273358699 1 IN IP4 192.168.1.182
s=Z
c=IN IP4 192.168.1.182
t=0 0
m=audio 36602 RTP/AVP 106 9 98 101 0 8 3
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<--- Transmitting SIP response (507 bytes) to UDP:23.3.56.7:60405 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.182:60405;rport=60405;received=23.3.56.7;branch=z9hG4bK-524287-1---dd39fc5e2667d79c
Call-ID: kNKbVyKuQP8bNdbBbsk8pg..
From: <sip:16@64.72.21.22>;tag=b79e0844
To: <sip:8003913000@64.72.21.22>;tag=z9hG4bK-524287-1---dd39fc5e2667d79c
CSeq: 1 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1614273359/8a0e67038cd4f078f860187c0538805a",opaque="421bd93616120666",algorithm=md5,qop="auth"
Server: Asterisk PBX 16.9.0
Content-Length: 0
<--- Received SIP request (373 bytes) from UDP:23.3.56.7:60405 --->
ACK sip:8003913000@64.72.21.22:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.1.182:60405;branch=z9hG4bK-524287-1---dd39fc5e2667d79c;rport
Max-Forwards: 70
To: <sip:8003913000@64.72.21.22>;tag=z9hG4bK-524287-1---dd39fc5e2667d79c
From: <sip:16@64.72.21.22:5060;transport=UDP>;tag=b79e0844
Call-ID: kNKbVyKuQP8bNdbBbsk8pg..
CSeq: 1 ACK
Content-Length: 0
<--- Received SIP request (1232 bytes) from UDP:23.3.56.7:60405 --->
INVITE sip:8003913000@64.72.21.22:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.1.182:60405;branch=z9hG4bK-524287-1---62c149a6902ff419;rport
Max-Forwards: 70
Contact: <sip:16@192.168.1.182:60405;transport=UDP>
To: <sip:8003913000@64.72.21.22:5060>
From: <sip:16@64.72.21.22:5060;transport=UDP>;tag=b79e0844
Call-ID: kNKbVyKuQP8bNdbBbsk8pg..
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rv2.10.12.3-mod
Authorization: Digest username="16",realm="asterisk",nonce="1614273359/8a0e67038cd4f078f860187c0538805a",uri="sip:8003913000@64.72.21.22:5060;transport=UDP",response="951b8cde7aa8367315c1a5da08ff3cd0",cnonce="7732096f51d58bf67118f100456ef9ec",nc=00000001,qop=auth,algorithm=md5,opaque="421bd93616120666"
Allow-Events: presence, kpml, talk
Content-Length: 340
v=0
o=Zoiper 1614273358699 1 IN IP4 192.168.1.182
s=Z
c=IN IP4 192.168.1.182
t=0 0
m=audio 36602 RTP/AVP 106 9 98 101 0 8 3
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
== Setting global variable 'SIPDOMAIN' to '64.72.21.22'
<--- Transmitting SIP response (315 bytes) to UDP:23.3.56.7:60405 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.182:60405;rport=60405;received=23.3.56.7;branch=z9hG4bK-524287-1---62c149a6902ff419
Call-ID: kNKbVyKuQP8bNdbBbsk8pg..
From: <sip:16@64.72.21.22>;tag=b79e0844
To: <sip:8003913000@64.72.21.22>
CSeq: 2 INVITE
Server: Asterisk PBX 16.9.0
Content-Length: 0
-- Executing [8003913000@Local:1] Verbose("PJSIP/16-00000002", "1, "User Alan dialed an invalid number."") in new stack
"User Alan dialed an invalid number."
-- Executing [8003913000@Local:2] Set("PJSIP/16-00000002", "CDR_PROP(disable)=1") in new stack
-- Executing [8003913000@Local:3] Goto("PJSIP/16-00000002", "Internal-Main,8003913000,1") in new stack
-- Goto (Internal-Main,8003913000,1)
-- Executing [8003913000@Internal-Main:1] Verbose("PJSIP/16-00000002", "1, "Didn't match any restricted numbers, proceeding with outbound dial."") in new stack
"Didn't match any restricted numbers, proceeding with outbound dial."
-- Executing [8003913000@Internal-Main:2] DumpChan("PJSIP/16-00000002", "1") in new stack
So other than the INVITE having the transport=udp
, I noticed the diffence in the Via:
where it uses the local IP address. The local address is referenced again in the next block: o=Zoiper 1614273358699 1 IN IP4 192.168.1.182
Now compare that to this
Desk Phone using DHCP IP of 192.168.1.101:
<--- Received SIP request (1261 bytes) from UDP:23.3.56.7:5060 --->
INVITE sip:18003913000@64.72.21.22;user=phone SIP/2.0
Via: SIP/2.0/UDP 23.3.56.7:5060;branch=z9hG4bK-htgggdywbwpp;rport
From: "Desk Phone" <sip:15@64.72.21.22>;tag=szzoni7fu2
To: <sip:18003913000@64.72.21.22;user=phone>
Call-ID: 5670263cb301-fcyzyzuhp6pp
CSeq: 1 INVITE
Max-Forwards: 70
Contact: <sip:15@23.3.56.7:5060;line=62f7rhtb;ob>;reg-id=1
X-Serialnumber: 0004134533FE
P-Key-Flags: resolution="31x13", keys="4"
User-Agent: snom821/8.4.18
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, 100rel, replaces, from-change
Session-Expires: 3600;refresher=uas
Min-SE: 90
Content-Type: application/sdp
Content-Length: 473
v=0
o=root 1998623302 1998623302 IN IP4 23.3.56.7
s=call
c=IN IP4 23.3.56.7
t=0 0
m=audio 59878 RTP/AVP 0 8 9 99 3 18 4 101
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:GeD0mIATu2QMa/k/JsMi0tz2NrzKB3RNJm1yczsv
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:9 g722/8000
a=rtpmap:99 g726-32/8000
a=rtpmap:3 gsm/8000
a=rtpmap:18 g729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 g723/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
<--- Transmitting SIP response (505 bytes) to UDP:23.3.56.7:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 23.3.56.7:5060;rport=5060;received=23.3.56.7;branch=z9hG4bK-htgggdywbwpp
Call-ID: 5670263cb301-fcyzyzuhp6pp
From: "Desk Phone" <sip:15@64.72.21.22>;tag=szzoni7fu2
To: <sip:18003913000@64.72.21.22;user=phone>;tag=z9hG4bK-htgggdywbwpp
CSeq: 1 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1614275167/3adae92a15d5201e833d3ee10bfbe2c0",opaque="471e2666681c411d",algorithm=md5,qop="auth"
Server: Asterisk PBX 16.9.0
Content-Length: 0
<--- Received SIP request (408 bytes) from UDP:23.3.56.7:5060 --->
ACK sip:18003913000@64.72.21.22;user=phone SIP/2.0
Via: SIP/2.0/UDP 23.3.56.7:5060;branch=z9hG4bK-htgggdywbwpp;rport
From: "Desk Phone" <sip:15@64.72.21.22>;tag=szzoni7fu2
To: <sip:18003913000@64.72.21.22;user=phone>;tag=z9hG4bK-htgggdywbwpp
Call-ID: 5670263cb301-fcyzyzuhp6pp
CSeq: 1 ACK
Max-Forwards: 70
Contact: <sip:15@23.3.56.7:5060;line=62f7rhtb;ob>;reg-id=1
Content-Length: 0
<--- Received SIP request (384 bytes) from UDP:23.3.56.7:5060 --->
CANCEL sip:18003913000@64.72.21.22;user=phone SIP/2.0
Via: SIP/2.0/UDP 23.3.56.7:5060;branch=z9hG4bK-9eeeotd398u9;rport
From: "Desk Phone" <sip:15@64.72.21.22>;tag=szzoni7fu2
To: <sip:18003913000@64.72.21.22;user=phone>
Call-ID: 5670263cb301-fcyzyzuhp6pp
CSeq: 2 CANCEL
Max-Forwards: 70
Reason: SIP;cause=487;text="Request terminated by user"
Content-Length: 0
As you can see, the Via
and the o=
have the gateway IP, which is the public IP of the Linksys router, rather than getting translated back to the local IP.
When I do pjsip show aors
I get this:
Aor: <Aor...> <MaxContact> Contact: <Aor/ContactUri............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================
Aor: 15 5 Contact: 15/sip:15@23.3.56.7:5060;line=dte8vxiv;ob 9c2401d87d NonQual nan
Aor: 16 5 Contact: 16/sip:16@23.3.56.7:60405;rinstance=ff78e3 553ad95fd5 NonQual nan
16 is the Zoiper, 15 is the Desk phone. Not sure the difference between rinstance
and line
, I don’t see anything in the docs for rinstance
.
I have hit my limit, I just don’t know what else to try to be able to call out using the desk phones. I have looked in every part of the Snom configuration, but at this point, I don’t know if it is a problem there, or in the pjsip.conf file.