Project

General

Profile

Baikal with Granstream Phones

Added by Chris Dickens almost 4 years ago

Hi Jörg,

This looks like a very nice tool. I'm using it with my Grandstream GXP2170 phones to pull contacts from a CardDAV server (Baikal). L2CPBG is running on Debian 10 (Buster). It seems to be exactly what I wanted! Lookups on incoming and outgoing calls are working properly, however, directory searches from the contacts phonebook of the phone aren't. I'm not sure if it is something wrong with my configuration or a bug, but reading the output of the program, I'm leaning toward the latter (in this example I'm searching in the phone for "CHR", which is myself):

2020-06-09 20:02:06.76 debug:l2cpbg:ldapSearch: prepare()
2020-06-09 20:02:06.76 info: [3f3528ee] Search request #9 from '192.168.5.100:59312::2'
2020-06-09 20:02:06.76 debug:l2cpbg:ldapSearch: [3f3528ee] authorize()
2020-06-09 20:02:06.76 debug:l2cpbg:ldapSearch: [3f3528ee] checkDn()
2020-06-09 20:02:06.76 debug:l2cpbg:ldapSearch: [3f3528ee] prepareFilters(), req.filter = (|(|(cn=*CHR*)(sn=*CHR*)(givenname=*CHR*)(company=*CHR*))(|(homephone=*CHR*)(telephonenumber=*CHR*)(mobile=*CHR*))), req.filter.type = or, req.scope = 'sub'
{"name":"ldapjs","component":"client","hostname":"DebianWeb1","pid":38948,"level":50,"msg":"192.168.5.100:59312::2 uncaught exception: TypeError: Cannot read property 'toLowerCase' of undefined\n at Object.M [as getDavByLdap] (/snapshot/l2cpbg/dist/config.js:0:0)\n at e.filter.filters.e.filter.filters.filter.r (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at Array.filter (<anonymous>)\n at ae (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at te (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at re (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at Server.ee (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at /snapshot/l2cpbg/node_modules/ldapjs/lib/server.js:425:40\n at Parser.<anonymous> (/snapshot/l2cpbg/node_modules/ldapjs/lib/server.js:438:8)\n at Parser.emit (events.js:182:13)","time":"2020-06-10T02:02:06.766Z","v":0}

I've attached phone configuration as well as output from Wireshark. If there aren't any problems with the configuration of my phone, feel free to share it in your readme file. I wound up having to turn on "Exact Name Search" on my phone before any of the lookups would work. This may have something to do with the contacts phonebook searches failing as well. Let me know if you need any more information!

Thanks,

Chris Dickens


Replies (13)

RE: Baikal with Granstream Phones - Added by Tobias Lotz almost 4 years ago

Hi,

I like the tool as well. I got a similar error message for directory searches with my new snomD335 (10.1.42.14):

2020-06-11 12:08:43.28 info: [9330ed5c] Search request #86 from '192.168.10.35:44533::3'
{"name":"ldapjs","component":"client","hostname":"peanut","pid":1056,"level":50,"msg":"192.168.10.35:44533::3 uncaught exception: TypeError: Cannot read property 'toLowerCase' of undefined\n at Object.M [as getDavByLdap] (/snapshot/l2cpbg/dist/config.js:0:0)\n at e.filter.filters.e.filter.filters.filter.r (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at Array.filter (<anonymous>)\n at ae (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at te (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at re (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at Server.ee (/snapshot/l2cpbg/dist/ldapSearch.js:0:0)\n at /snapshot/l2cpbg/node_modules/ldapjs/lib/server.js:425:40\n at Parser.<anonymous> (/snapshot/l2cpbg/node_modules/ldapjs/lib/server.js:438:8)\n at Parser.emit (events.js:182:13)","time":"2020-06-11T10:08:43.284Z","v":0}

l2cpbg-linux-x64 is running on Ubuntu 20.04 and my cardDAV server is Nextcloud 18.0.6.

Same searches with snomD315 (8.9.3.80) and snom300 (8.7.5.35) work fine. At least the manual directory searches. Lookups on incoming and outgoing calls do not work.

Viele Grüße
Tobias

RE: Baikal with Granstream Phones - Added by Jörg Ebeling almost 4 years ago

Hi Chris and Tobias!

Glad to hear that L2CPBG might be useful for you. To pitty that it look like you found a new bug (beside the ones I found during the last months ;-) )

However, Chris's error report is quite detailed and Tobias's error look to be the same. Should be reproducable and fixable.

Will try to fix it during the next one or two weeks. So please be patient.

BTW: I haven't got an information mail about your new posts from this forum here (that's why I respond that late). Did you received ones?

RE: Baikal with Granstream Phones - Added by Tobias Lotz almost 4 years ago

Hi Jörg,

no, I didn't get a notification either.

Good to hear, that it is a fixable bug and even better that you are planning to fix it.

RE: Baikal with Granstream Phones - Added by Jörg Ebeling over 3 years ago

Hi Chris and Tobias.

The issue was a little bit more complex. The Grantstream phone does multiple/cascaded LDAP filter requests, which haven't been handled the right way be me.
But due to Chris's quite detailed error report I was able to reproduce the case.

The new version 0.7.1 just got uploaded and can be downloaded

Needless to say that I'm very curious if and how it's working ;-)

RE: Baikal with Granstream Phones - Added by Tobias Lotz over 3 years ago

Hi Jörg,

thanks for the update.

A brief test showed, that lookups on incoming and outgoing calls work now as expected.

My snomD335 can now access the LDAP directory and I can browse through it. Manual searches unfortunately still don't work on this phone.

Logfile says:
"Unconfigured ldap attribute 'jpegphoto' requested. Add a [ldap.map.jpegphoto] mapping to the config!"

Do you have a suggestion or idea what the correct mapping could be (NextCloud cardDAV server)?

Besides that everything works fine at the moment.

VG
Tobias

RE: Baikal with Granstream Phones - Added by Jörg Ebeling over 3 years ago

Hi Tobias,

quite cool ... we're moving forward ;-)

Do I'm right that you tested with the newest 0.8.0 version?

Regarding the ldap mapping:
Photo transmission isn't tested in no way at the moment, but I'm interested in! Unfortunately I don't have a phone with photo support over ldap. To be more precise, before your message, I thought no phone support photo transmission over LDAP :-)
However, do you have any option within Snom's LDAP- Config page regarding a foto? If so, disable it.
The phone's that I know about, show exactly what kind of attributes and what kind of search filter get send to LDAP. I guess there's something configured with a "jpegphoto" string in your phone. Simply remove it.

In worst case, you should be able to configure a dead ldap mapping in l2cpbgs config like:

...
# Somewhere in your l2cpbg's config file:
[ldap.map.jpegphoto]
dav = UNKNOWNPHOTO
...

RE: Baikal with Granstream Phones - Added by Tobias Lotz over 3 years ago

Hi Jörg,

yes, I tested 0.8.0.

My D335 doesn't present any options to configure photos over ldap. I went through the snom wiki (https://service.snom.com/display/wiki/LDAP+Directory) but couldn't find anything there either. Not even a mentioning of the feature. My brief google research didn't produce any helpful links either.

Tried your suggested dead ldap mapping hack as well but the result stays the same. Manual searches are not matched to my contacts.

Instead of the previous error message l2cpbg now says:
2020-07-22 15:15:41.69 info: [bb31bd08] Search request #4 from '192.168.10.35:34762::3'
2020-07-22 15:15:41.70 verbose: [bb31bd08] Selected 0 phonebook entries

If you want to support photo support in the future I am happy to test drive it.

RE: Baikal with Granstream Phones - Added by Jörg Ebeling over 3 years ago

Hi Tobias,

at first, please set your console logging to debug in the hope to get some more useful messages:

[log]
  conslevel = debug   ; Console log level. Might be one of silly, debug, verbose, info, warn or error

and restart l2cpbg.

In addition, are you able to copy the "LDAP name & number filter" as well as the attributes from the phone? Or make a screenshot of your settings?

RE: Baikal with Granstream Phones - Added by Jörg Ebeling over 3 years ago

Hi Tobias,

one more remark. I checked your mentioned wiki... which sound a little bit complicated or confusion to me.

For simplicity, please give one of the two "LDAP name filter" entries a try:
This should normally work for name lookups:

(|(cn=%)(sn=%)(givenName=%)(company=%))

But maybe Snom needs "Partial Lookup = on" (Firmware > v10.1.27.0) and this name "LDAP name filter":

(|(cn=*%*)(sn=*%*)(givenName=*%*)(company=*%*))

Hope one of this two get us a step forward.

RE: Baikal with Granstream Phones - Added by Tobias Lotz over 3 years ago

Hi Jörg,

(|(cn=*%*)(sn=*%*)(givenName=*%*)(company=*%*)) did the trick!

I can manually search as expected now. Thank you!

RE: Baikal with Granstream Phones - Added by Jörg Ebeling over 3 years ago

Hi Tobias,

quite cool!! Thanks a lot for the feedback.

To get some more entries into my "Compatibility list", may I ask if:

  1. your other Snom's (300, D315, ???) also work now as expected (Directory listing, Name & Number search as well as Reverse Lookup)?
  2. if you have more than 500 CardDav records (with any kind of telephone number) in your CardDav/Nextcloud, how much approx.?

RE: Baikal with Granstream Phones - Added by Tobias Lotz over 3 years ago

Hi Jörg,

I am glad to give feedback. I looked for a very long time for a solution to be able to access a CardDAV server via my Snom phones. Really a pitty that CardDAV still seems like a fringe or niche solution. Even though there aren't any alternatives for non-business use cases. At least iPhone-CardDAV-implementation works fairly well and now my Snoms are covered as well.

Regarding your questions:
1. all three Snoms (300, D315 & D335) work as expected (Directory listing, Name & Number search as well as Reverse Lookup) now.
2. I've just around 100 CardDAV records

RE: Baikal with Granstream Phones - Added by Jörg Ebeling over 3 years ago

Tobias,

nice to hear that it's useful now to you.

Thanks a lot for your feedback and the specs.

    (1-13/13)
    Go to top