Been working on migrating over to Asterisk 13 / FPBX 12, and wanting to control my Cisco endpoints with OSS EPM. Starting with the phones that have support out of the box - the Cisco 7940.
Using a PJSIP extension, I can confirm that the extensions are working via a softphone. When I fire up the Cisco 7940 it has trouble registering. Watching a tcpdump I can see…
Phone sends a REGISTER with no auth details (as normal)
Asterisk replies with 401 UNAUTHORIZED (the REGSITER challenge, normal again)
Then nothing … couple seconds later, the phone sends another REGISTER, with no auth details.
Wondering why these endpoints don’t reply to the 401 with a REGISTER that contains auth details? Is this a firmware thing (using SIP 8.12 that came in OSS EPM)? Is it a configuration thing? Is it a PJSIP thing (I’m having issues serving a config with different ports for one reason or another)?
Would really appreciate anyone’s input if they’ve had this problem before. Our other system, Asterisk 11 doesn’t have this problem. Although, I do all the configs manually on that system, and the only other difference is chan_sip instead of PJSIP.
zirophyz I am only a beginner myself with freepbx and I have 7940’s too, they’re a sod to register with freepbx. What worked for me was changing the extension to the chan_sip driver and select NAT Mode: ‘Yes - force_rport,comedia’ and port 5061. You’ll also have to change the ports in SIPDefault.cnf but it does work. If the extension still doesn’t register delete it and build a new one, making sure you select Generic CHAN SIP Device before you click ‘submit’.
HI neuronetv. Yes this was going to be my next move, I changed my test extension to chan_sip and have been using OSS EPM to configure the phones, however it doesn’t seem like the new ports are taking effect. This I need to look into, I think I only changed ports in the SEP($mac).cnf file, not sure there was anywhere in SIPDefault.cnf that referenced a port. Maybe I will build the config files myself (or rather, just copy them from my working Asterisk 11 install).
It’d be a little disappointing to not be able to use pjsip for these endpoints. As far as I see it, replying to the 401 challenge is a pretty stock standard SIP thing. Are there other methods for authorisation? Maybe allowing my handset /24 subnet to use IP auth? (Though, that isn’t very scalable…)
At the bottom one of the Digium guys says change “force_rport=no” …
In Asterisk 11 / FPBX 2.11 there is a GUI option “nat” under the Extension settings where you can set this. In FPBX 12 there is no such “nat” option, or anything I can find to set no rport, even in the global SIP and PJSIP settings pages.
Do I need to add this option to certain extensions in the extensions_custom.conf file? I’d rather not, if I could help it, and keep as much configuration in the GUI as possible…
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)…
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
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.
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.
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?
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.
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.
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…