Cisco 7940 registration problem RESOLVED

(Brendan) #6

I threw this into pjsip.endpoint_custom.conf;


Now I can see the phone sending REGISTER’s but there seems to be no reply (using ngrep port 5060 to watch).

(Brendan) #7

This is what I get now. Added the force_rport option and recreated the extension (it wasn’t showing up in the chan_pjsip peers list, so thought that going back and forth between stacks had stuffed it up)…

U ->
REGISTER sip: SIP/2.0.
Via: SIP/2.0/UDP;branch=z9hG4bK505b3494.
From: <sip:233@>;tag=001469a7180c0011603d4433-6cef1ff3.
To: <sip:233@>.
Call-ID: 001469a7-180c0002-58faebd6-05b99917@
Max-Forwards: 70.
Date: Wed, 22 Jul 2015 00:41:48 GMT.
User-Agent: Cisco-CP7940G/8.0.
Contact: <sip:233@;user=phone;transport=udp>;+sip.instance="<urn:uuid:00000000-0000-0000-0000-001469a7180c>";+u.sip!"8".
Content-Length: 0.
Expires: 120.

I -> 3:3
....E..:)...@................&..REGISTER sip: SIP/2.0.
Via: SIP/2.0/UDP;branch=z9hG4bK505b3494.
From: <sip:233@>;tag=001469a7180c0011603d4433-6cef1ff3.
To: <sip:233@>.
Call-ID: 001469a7-180c0002-58faebd6-05b99917@
Max-Forwards: 70.
Date: Wed, 22 Jul 2015 00:41:48 GMT.
User-Agent: Cisco-CP7940G/8.0.
Contact: <sip:233@;user=phone;transport=udp>;+sip.instance="<urn:uuid:00000000-0000-0000-0000-001469a7180c>";+u.sip!"8".

Weird that the second packet is cut off? Not sure about that …

(Brendan) #8

Okay I’ve found the problem to the solution…

pjsip.endpoint_custom.conf isn’t being included properly, or I have the syntax in that file wrong.

I added force_rport=no under [233] in pjsip.endpoint.conf and reloaded only Asterisk. It worked!

My pjsip.endpoint_custom.conf looks simply like this;


But this setting takes no effect. What am I doing wrong with the custom file?

(Lorne Gaetz) #9

In the custom file try using this syntax:


(Brendan) #10

That didn’t work either. Seeing as though I have found the solution for why the 7940’s aren’t registering, I’ve started a new ticket to address why the custom file isn’t working - Pjsip.endpoint_custom.conf Not Working RESOLVED

(Lorne Gaetz) #11

It doesn’t work, but it should (imo). I have filed a bug report with additional details here:


I’ve wasted days in the past trying to get a 7940 to register with pjsip and I was only able to get registration with chan_sip. I also went down the ‘force_rport=no’ rabbit hole and it went nowhere. The ports in SIPDefault.cnf are right at the top of the file labelled: proxy1_port:, proxy_emergency_port, proxy_backup_port: etc. I changed all mine to 5061 as indicated in the extensions module, rebooted the phones and they’re working now.

(Wekpas) #13

Your not alone having same issue with the Cisco 7941/7961 phones. Tried to change firmware to sip from sccp and some got stuck to the point where I put it down to see clearly from another pov. I have nine phones total 6-7941g,3-7961g and I want to scream.

(Brendan) #14

This has now been fixed in core v12.0.39 as per

Add the force_rport=no config to pjsip.endpoint_custom_post.conf file.

I can confirm that my 7940’s are working well with PJSIP.

(Brendan) #15

Seems that I was slightly premature with claiming this was resolved …

When a phone sends anything to the PBX, the PBX will reply on port 5060 (instead of the random high source port the phone sent on) - so force_rport=no seems to be working in that respect.

Eg. Phone sends REGISTER on 52799, PBX replies with 401 UNAUTHORIZED on 5060 --> working as required.

However, when I try to ring another endpoint, the PBX sends INVITES to that endpoint on it’s random high port -
Eg. PhoneA sends INVITE:52799, PBX replies 100 TRYING : 5060, then 180 RINGING:5060
PBX then sends to PhoneB INVITE:52465, and repeats forever because PhoneB only wants to receive on 5060.
PhoneA hears ringing, hangs up and sends 487 Request Terminated, the PBX will reply 200 OK on 5060.

It seems that whenever Asterisk replies to anything, it won’t use the source port. If Asterisk generates something new, it will try sending that on the random high source port. How can I get Asterisk to send new requests on port 5060?

(Brendan) #16

Bah … I changed Rewrite Contact to NO, reloaded FreepBX and made no difference. Rebooted the phones so they re-registered and now it seems to be working properly. Also, each endpoint is now showing it’s contact address as port 5060.

(Ryan Petersen) #17

I’ve just installed a fresh version - FreePBX Framework is 12.0.70 and this issue referenced in bug FREEPBX-9810 seems to be back. If I put the below in pjsip.endpoint_custom.conf and reload it does not function. If I edit the FreePBX generated file, pjsip.endpoint.conf and add force_rport=no to the extension the phone registers and all is well.


(Lorne Gaetz) #18

Try pjsip.endpoint_custom_post.conf instead.

(Ryan Petersen) #19

pjsip.endpoint_custom_post.conf did not exist, created and added the same info with no luck.

(Ryan Petersen) #20

So I see in the issue ticket the resolution was to add an include in pjsip.conf for pjsip.endpoint_custom_post.conf at the end of the file, it is not present. When I add the include statement back and setup the pjsip.endpoint_custom_post.conf file this everything works! Obviously until FreePBX overrides the pjsip.conf file. I’m now more convinced the original bug was somehow reintroduced…

(Al Reilly) #21

Where is this SIPDefault.cnf file located ??


the SIPDefault.cnf file resides in a tftp folder of your own choice, you could have it on the freepbx machine or on another server. The SIPDefault.cnf file is not part of freepbx, it’s a seperate file that the cisco phone needs to boot up. On the cisco phone settings (buttons on the rhs) there’s an option to specify the ip address of the machine that has the SIPDefault.cnf file.

(Al Reilly) #23

Neuronetv, so if it is not there, I would need to create the file? I got two 7975 IP phones from a friend who “gave up” on getting them working and I am now trying to get them working on my freepbx and I must say they are picky :frowning:


yeah you’d need to create your own, but here:
is a bog-standard SIPDefault.cnf file that you can modify to suit your own system. Get it quickly because it will be deleted from my server soon.

(Al Reilly) #25

Thanks Neuronetv, I have downloaded the file.