PJSIP cant register phone


I have ran into an issue in which I cant seem to trouble shoot my way out of.

We have been using the old chan_sip without issue for a long time now. We have ran across a need to add more then 1 contact to an extension and thus activated both PJsip and Chan_sip drivers.

Chan_sip is still working well.

However, if I try to register a PJ_SIP extension it gives me a 401 error on the phone.

Here is what the log files say.

[2018-02-01 18:50:10] NOTICE[17273] res_pjsip/pjsip_distributor.c: Request ‘REGISTER’ from ‘sip:[email protected]’ failed for ‘XXX.XXX.4.198:45645’ (callid: YcGLSG2BBFUm3DvpdtMnFA…) - No matching endpoint found
[2018-02-01 18:50:10] NOTICE[17273] res_pjsip/pjsip_distributor.c: Request ‘REGISTER’ from ‘sip:[email protected]’ failed for ‘XXX.XXX.XXX.198:45645’ (callid: YcGLSG2BBFUm3DvpdtMnFA…) - Failed to authenticate

This error is throwing me off as in the GUI I clearly see ext 598 with PJSIP as the driver.

I am running freepbx 13

Any feedback on this is much appreciated.

are you using the right port, if you have chan_pjsip AND chan_sip then use the correct port on your 598 extension or it will “do that” generally, use 598:(correctportnumber) it will likely default to 5060 and if that is where the wrong driver is listening, then . . . .

Hi Dicko,

Thanks for the reply!

In this example I am using the zoiper softphone app.

So I am putting domain.com:5160 in the server field like it suggests.

5160 being the pjsip port.

I have tried on a polycom and set the local sip port to 5160 and still no go.

You suggesting that is put the port in the user field?

can you evidence that chan_pjsip is really listening on 5160 and chan_sip on 5060 and {EXTEN} 598 is really a pjsip endpoint? if both zoiper and polycoms both fail against your registration against you server at 5060/5160 and your router appropriately routes such ports to your server without mangling , I would have to check my beliefs , “sip set debug on” or perhaps installing sngrep would help you confirm.

I think your onto something.

I see this failure a few times in the log. Not sure if this is the issue or not.

[2018-02-01 21:48:34] ERROR[14285] res_pjsip_config_wizard.c: Unable to load config file ‘pjsip_wizard.conf’

[2018-02-01 21:48:35] ERROR[14285] res_sorcery_config.c: Could not create an object of type ‘endpoint’ with id ‘598’ from configuration file ‘pjsip.conf’
[2018-02-01 21:48:35] ERROR[14285] res_pjsip_config_wizard.c: Unable to load config file ‘pjsip_wizard.conf’

Perhaps you could go back to the tried and true chan-sip, I’m pretty sure that will work for you.

All of our phones are running Chan_sip happily.

The only reason I want to try to get Pjsip working is because we have some users (management) that have softphones as well as their desk phones and complain that the softphone does not ring, but their deskphone does and vice versa.

Ive read that in pjsip, this issue is fixed with the max contacts.

But, I guess i am just making things harder on myself here. I could just make the softphone a new extension and just set up follow me.

I do thank you for you time though. It is really appreciated.

I will continue to slowly poke away at this and if any I do fixes this, I will be sure to update this post!

Don’t get me wrong, pjsip works very well for extensions, but it needs to be set up precisely as to port, endpoint and authentication.

Any chance your phones are Cisco phones?

I had issues with my Cisco phones after updating to FreePBX 14 (which uses pjsip on port 5060 by default) and had issues with the phones not registering.

There is a workaround by editing one of the configuration files but those edits don’t “stick” so every time you change anything in FreePBX they get over written. I found it was easier to just swap the phones to chan_sip and let things work like they did before.

Depending on what the Cisco phones are, the models that started with a 7 all ended up being recycled , I have some legacy linksys ones that all work fine.

The ones that I had trouble with started with a 7, but I don’t know if there are issues with others.

So Just an update here,

I fired up a little Intel NUC i have sitting around for messing with things and threw a fresh install of Freepbx on it.

PJSIP is working fine along side chan_sip with the NUC. So at this point im going to rule my issue as an issue with my live installation.

When it was first installed on the production server, only chan_sip was selected as the driver. I in turn just tried to simply turned on Both drivers and this is where PJSIP wont work.

When I installed on the NUC I was sure to leave both drivers active from the start and I have no issue.

Since this issue is on a production server and will involve possible downtime to fix, I will worry about trying to tackle this on a future upgrade.

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