Cisco 7942G - PJSIP (Not Registering)

Hi everyone,

I have been trying to set up one of my old Cisco 7942G phones (with 8-5-4 firmware) with PJSIP (Asterisk 18.16.0) but have gotten stuck.

The phone is attempting to register but doesn’t get to register (it stops at the 401 Unauthorized leg of registration) - could this be an issue with the phone communicating back to Asterisk to register in some way? While researching from other posts, I did add to my pjsip.conf - force_rport=no and rewrite_contact=no (as below)

pjsip.conf

[6003]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=6003
aors=6003
force_rport=no
rewrite_contact=no

[6003]
type=auth
auth_type=userpass
password=12345678
username=6003

[6003]
type=aor
max_contacts=1

This is what I currently see at the CLI in Asterisk:

<--- Received SIP request (876 bytes) from UDP:192.168.7.204:49351 --->
REGISTER sip:192.168.4.106 SIP/2.0
Via: SIP/2.0/UDP 192.168.7.204:5060;branch=z9hG4bKcde5e467
From: <sip:6003@192.168.4.106>;tag=995a920218a90015368197d2-e5ae3031
To: <sip:6003@192.168.4.106>
Call-ID: 995a9202-18a90015-c7e3822c-917fc80b@192.168.7.204
Max-Forwards: 70
Date: Wed, 16 Dec 2009 09:42:05 GMT
CSeq: 120 REGISTER
User-Agent: Cisco-CP7942G/8.5.3
Contact: <sip:6003@192.168.7.204:5060;transport=udp>;+sip.instance="<urn:uuid:00000000-0000-0000-0000-995
a920218a9>";+u.sip!model.ccm.cisco.com="434"
Supported: replaces,join,norefersub,extended-refer,X-cisco-callinfo,X-cisco-serviceuri,X-cisco-escapecodes,X-cisco-service-control,X-cisco-srtp-fallback,X-cisco-monrec,X-cisco-config,X-cisco-sis-3.0.0,X-cisco-xsi-7.0.1
Content-Length: 0
Reason: SIP;cause=200;text="cisco-alarm:14 Name=SEP995A920218A9 Load=term42.default Last=cm-closed-tcp"
Expires: 1200




<--- Transmitting SIP response (519 bytes) to UDP:192.168.7.204:49351 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.7.204:5060;rport=49351;received=192.168.7.204;branch=z9hG4bKcde5e467
Call-ID: 995a9202-18a90015-c7e3822c-917fc80b@192.168.7.204
From: <sip:6003@192.168.4.106>;tag=995a920218a90015368197d2-e5ae3031
To: <sip:6003@192.168.4.106>;tag=z9hG4bKcde5e467
CSeq: 120 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1675027798/f5e0a4ca4ee7f6dc28d353a1a2fe9284",opaque="193f4b1273154345",algorithm=MD5,qop="auth"
Server: Asterisk PBX 18.16.0
Content-Length:  0

Any thoughts would be greatly appreciated to help troubleshoot.

A failure to proceed after 401 generally means the peer has no password configured.

Hi @david551 - let me double-check the XML file; I am sure there is a password in there, but I’ll check the XML is correctly formatted etc, and try a few different passwords. I believe for the Cisco 7942 the password requirements in the XML file are:

  • Must be at least 4 characters long (up to 32)
  • Can contain letters, numbers, and special characters.
  • Is case sensitive.

It is currently 12345678 for testing.

Is there any way to confirm that an absent password is the cause before moving on to other potential causes?

Only from logs on the Cisco side.

One can exclude that it is not getting the 401, as it would repeat the INVITE if it weren’t seeing responses. (I suppose there could be some weird selective loss of 401’s in the network).

Hi @david551 - i will try to pull the logs from the Cisco phone too to an TFTP server; just looking at it now, the INVITE request does cycle (repeat) after the 401 Unauthorized step about every 20 seconds. Does this indicate that 401 response from Asterisk is not being received/processed by the phone correctly?

I meant REGISTER.

If it didn’t see the response, I’d expect the initial repeat to be after half a second or less, and then double each time.

You’re right, the phone cycles through the register request every second or so trying to register with ‘Register’ > ‘401 Unauthorized’ and then back to ‘Register’. I double checked the XML file and it looks ok, including the password and username.

I pulled the log files (log2 for post-boot logs) and it only indicates this as the very last entry (all others in the log file are I believe expected logs - I can post the entire log if needed).

FS/cache/log2

 401: ERR 03:43:35.110531 JVM: %REG auth failed: ack timer

I am not sure that helps too much as it just says the registration failed within the right amount of time. Do you think this helps better determine a potential issue? Researching more, a thread suggested turning off OPTIONS which I did for the extension with qualify_frequency=0, however, that did not change. I feel the phone is not responding to the 401 challenge perhaps?

That confirms that it received the 401 and is unable to authenticate.

hi @david551 - it is super strange, it suddenly registered. This must have been my own fault by not correctly restarting core each time, however, I am going to work my way back and work out which setting/change actually enables the phone to register successfully with this set up (i’ll post back here in case it helps anyone else).

Thanks again for the support - spend a few hours researching this but learnt a load in the process i guess :slight_smile:

Did you set “force_rport” to “no” but never reload Asterisk?

Ok - I managed to work it back and found I only needed this config in PJSIP.conf

pjsip.conf

[6003]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=6003
aors=6003
force_rport=no

So this post was never really needed :melting_face:

@jcolp - exactly what happened is I ran ‘core restart now’ at the CLI each refresh, however it appears it was not updating although I did not recall seeing any errors on core restart, yesterday I accidentally kicked the power plug and it obviously rebooted, and then registered. That sucks, but it took me on a deeper dive to learn more on Asterisk and Cisco’s sometimes painful world of CUCM phones not intended for Asterisk :expressionless:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.