PJSIP: CLIR with anonymous from (Snom phones)


#1

I’m currently migrating from chan_sip to PJSIP and I want to support making anonymous calls.
in chan_sip, I solved this by setting the “anonymous” feature at the endpoints natively. For some clients, this resulted in just adding the SIP header “Privacy:id” which I could just add to the new call when creating the outbound call via my SIP provider.

My Snom 370 devices have a slight different behaviour when setting anonymous calling: they set “From:” header to anonymous, which results in the fact that PSJIP isn’t able to match the phone to an endpoint:

 Request 'INVITE' from '"Anonymous" <sip:anonymous@anonymous.invalid>' failed for '192.168....  - No matching endpoint found

In chan_sip this worked well, it looks like chan_sip went through active peers and found the right phone:

Found peer 'snom17' for 'anonymous' from 192.168....

I think the easiest way would be to bind the endpoint to the IP address, right?
But would it be possible to let PJSIP look for the SIP "Contact: "-header? While From is set to anymous, via "Contact: ", the snom still provides all information.


#2

There is no current support for using a registered contact for locating an endpoint, sorry. We also don’t support using the Contact to locate an endpoint either. The only way currently is not have it do Anonymous on the client side.


#3

So even matching the endpoint by its IP address wouldn’t work then?


#4

If it’s a static IP address you can.


#5

OK, thanks.
But isn’t it supposed to be:

[myphone]
type=wizard
identify/match=192.168. …
[…]

? Because this doesn’t help.


#6

I don’t use the wizard format of doing things so I can’t comment on that. @gjoseph may be able to.


#7

The wizard only creates identify objects if accepts_registrations=no. In that case, it uses the remote_hosts parameter to set the match but you can override that with identify/match=... as you’ve done. If accepts_registrations=yes, providing identify/match=... doesn’t do anything because there’s no identify object to add it to. You can however simply add a separate identify object to pjsip.conf directly that points to the endpoint defined with the wizard.


#8

Thanks a lot, adding the identify object explicitly to pjsip.conf does the trick.