alexanderharm / node-carddav2phone

A CardDAV to IP phones converter for Node.js (AVM FRITZ!Box, Snom XCAP, Yealink)
MIT License
10 stars 1 forks source link

XCAP for Snom #2

Closed mokkin closed 1 year ago

mokkin commented 3 years ago

Thanks for the script by now! It is already working yet downloading the vcards to a .json file.

Do you know a tutorial for importing them to snom phones?

alexanderharm commented 3 years ago

Hi, not sure I understand you correctly. The script works like this:

Let me know what you are trying to achieve in detail and then I can add to the script and/or extend the manual.

mokkin commented 3 years ago

Thanks for your quick reply!

I'm trying to sync my snom phone with several CardDAV phonebooks shard by Nextcloud and a proprietary provider. The goal is to display the caller Name.

I have a web server for this job, but unfortunately I have no idea about XCAP and how to sync the json file to the phone. Do you have any hints there for me?

alexanderharm commented 3 years ago

Yeah, XCAP is a bit messy. I will update the read me to give some guidance.

alexanderharm commented 3 years ago

I updated the README. Does that help?

mokkin commented 3 years ago

FIrst of all: Thank you very much! Your updated README has helped me to understand how XCAP sync is working. :+1: I have all settings correctly. Even downloading and uploading the 'settings.cfg' is not necessary, because you can set all settings by HTTP requests via browser or command line: http://wiki.snom.com/FAQ/Can_I_set_single_phone_settings_via_HTTP_requests

Unfortunately I'm running into a new issue: The phone display is telling me that the addressbook ist too big: grafik

Here they say the size is limited to 2.000 entries (snom760): http://wiki.snom.com/FAQ/Which_types_of_internal_or_external_phone_directories_are_supported_by_snom_phones But in the same wiki page two steps below there is an option for XML directories with unlimited entries. As we already have an XML, shouldn't it be easy to link the phone directly to the xml file on the web server?

alexanderharm commented 3 years ago

OK, never ran into that limitation. I can add the XML file allright since it is very similar to Yealink's. There is also a script to be found here https://www.3cx.com/community/threads/custom-phonebook-for-snom-devices-including-all-numbers.66804/ that does this. But probably not from CardDAV. I will have a look at the format they use (on snom's site it is one entry per number which I find "outdated")

alexanderharm commented 3 years ago

I updated the script to generate snom tbook which doesn't help you further because it is also limited...

The problem with the XML file is, that there is only one number per entry. How do you suggest I should name them?

John Doe - Home
John Doe - Mobile
John Doe - Work
John Doe - Work 2

?

mokkin commented 3 years ago

one entry per number which I find "outdated"

I find this too, but indeed you are right:

grafik

<tbook e="2">
<item context="active" type="none" fav="false" mod="true" index="1">
<number>1237987</number>
<number_type>business</number_type>
<first_name>john</first_name>
<birthday>00.00.99</birthday>
</item>
<item context="active" type="none" fav="false" mod="true" index="2">
<number>654374854</number>
<number_type>home</number_type>
<first_name>john</first_name>
<birthday>00.00.99</birthday>
</item>
</tbook>

Other than SIP they offer only mobile, home and work.

So I would follow your suggests, but without work 2 as there is only work. If there is more than one work number, maybe a second entry for the contact should be created?!

alexanderharm commented 3 years ago

This is actually tbook, so as well limited by 2000 entries. The XML-phonebook would come from a web server and cannot be edited on the phone. What if you have two numbers of the same type?

mokkin commented 3 years ago

You are right. But I think the scheme is similar with only one item per entry.

What if you have two numbers of the same type?

If there is more than one work number, maybe a second entry for the contact should be created?!

Unfortunately I am not a xml expert...

alexanderharm commented 3 years ago

Append a running number or not...?

mokkin commented 3 years ago

yes, could be...

alexanderharm commented 3 years ago

OK, I opened a case with snom to inquire about the best way forward to provide a central directory with more than 2.000 entries (seems huge to me). Can you try and configure Yealink? It has the same format as the snom IPPhoneDirectory but features several numbers per entry. Maybe it works on snom as well...