alexanderharm / node-carddav2phone Goto Github PK
View Code? Open in Web Editor NEWA CardDAV to IP phones converter for Node.js (AVM FRITZ!Box, Snom XCAP, Yealink)
License: MIT License
A CardDAV to IP phones converter for Node.js (AVM FRITZ!Box, Snom XCAP, Yealink)
License: MIT License
I get warnings and syntax errors when running ./carddav2phone.sh
root@v7:~/weg/node-carddav2phone# ./carddav2phone.sh
Bereits aktuell.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@sindresorhus/[email protected]',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@szmarczak/[email protected]',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>= 14.17' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>= 14.17' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.14' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>= 14' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
added 87 packages in 1s
12 packages are looking for funding
run `npm fund` for details
file:///root/weg/node-carddav2phone/node_modules/got/dist/source/create.js:48
const handler = defaults.handlers[iteration++] ?? lastHandler;
^
SyntaxError: Unexpected token '?'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
Likely with dist/index.js
root@v7:~/weg/node-carddav2phone# node dist/index.js
file:///root/weg/node-carddav2phone/node_modules/got/dist/source/core/options.js:291
const initHooks = options.hooks?.init;
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
root@v7:~/weg/node-carddav2phone# node dist/index.js
file:///root/weg/node-carddav2phone/node_modules/got/dist/source/create.js:48
const handler = defaults.handlers[iteration++] ?? lastHandler;
^
SyntaxError: Unexpected token '?'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
OS: debian 11 bullseye with distributions own node/npm etc.
Could you please help me a bit, I am not able to install your application on my Diskstation.
I think a little guide could also help others.
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?
After filling the config with my parameters and running the script I get the following error:
`node-carddav2phone/dist/index.js:1
import { settings } from './utils.js';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)`
How can I solve it?
Hi there!
I tried to get my Baikal Webdav Contacts into a Yealink Phone. I encountered an invalid credentials error, after starting carddav2phone.sh.
The Webdav-Server access.log showed node-fetch 403.
The solution was to change authentication type in Baikal from Digest to Basic.
Is it possible to achieve compatibility with Auth Digest?
A quick google search brought me to https://github.com/devfans/digest-fetch - maybe this is a way to solve this?
Regard
Hi there,
your script seems to be exactly what I'm looking for but I can't seem to get it to work. I created my own settings.json, entered all the credentials etc., the webroot and dir (the folder does exist) but for some reason, the structure and files are not being created. I get a TypeError on first run but when I run it again it seems to work normally and a .json file that holds all the contacts from my CardDAV server (Nextcloud) is being created correctly, just not the xcap files for the webserver. What am I doing wrong?
Output of first run:
`CardDAV: creating clients
nextcloud_xxxxxxxxxxxxxxxxxxxxxxxxxx: updates available
CardDAV: updates available
Fritz!Box: start
LDAP: start
Fritz!Box: attempting login
Fritz!Box: authenticate
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at __values (/root/gitstuff/node-carddav2phone/dist/ldap.js:14:72)
at ldapProcessCards (/root/gitstuff/node-carddav2phone/dist/ldap.js:83:46)
at _loop_1 (/root/gitstuff/node-carddav2phone/dist/ldap.js:40:24)
at ldapHandler (/root/gitstuff/node-carddav2phone/dist/ldap.js:45:9)
at phoneHandlers (/root/gitstuff/node-carddav2phone/dist/index.js:21:46)
at /root/gitstuff/node-carddav2phone/dist/index.js:37:16
at invokeCallback (/root/gitstuff/node-carddav2phone/node_modules/es6-promise/dist/es6-promise.js:408:15)
at publish (/root/gitstuff/node-carddav2phone/node_modules/es6-promise/dist/es6-promise.js:391:7)
at flush (/root/gitstuff/node-carddav2phone/node_modules/es6-promise/dist/es6-promise.js:128:5)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Fritz!Box: login successful
Fritz!Box: trying to update
Fritz!Box: update successful`
Output of second run:
`Already checked for updates today.
CardDAV: creating clients
nextcloud_xxxxxxxxxxxxxxxxxxxxxxxxxxx: no updates
CardDAV: no updates available`
Webroot is "/var/www/html/" and dir is "phone" but in /var/www/html/phone there are absolutely NO files.
i used the updated version of ur script and it runs trough without any problems, but after i upload the new cfg to my snom as u desrcibed i get the following error in the log files:
9/2/2023 12:25:40 [NOTICE] PHN: XCAPclient: new etag from server: "63f11f53-2fab7" 19/2/2023 12:25:40 [NOTICE] PHN: XCAPclient: Retrieving directory failed with error-code 4242 and message:
that i what i change in the config
xcap_tbook_sync_interval!: 7200 xcap_server_name!: 172.16.20.19 xcap_server_port!: 80 xcap_directory_auid!: /snom/ xcap_dir_doc_name!: snom_xcap_private.xml xcap_via_tls!: off
i use an nginx webserver and used the webroot /var/www and dir "snom" so my files are found under: http://[172.16.20.19/snom/users/[email protected]/snom_xcap_private.xml
i can open that xml without any problem outside of an snom:)
Hey,
i installed that scrip on a fresh debian 11 with npm and nginx installed, git cloned ur repo and run npm i.
i configured ur settings.json so that only one webdav account is in it and snom xcap.
when i do the first run i get the following error:
TypeError: awesome_phonenumber_1.default is not a constructor TypeError: awesome_phonenumber_1.default is not a constructor at utilNumberConvert (/root/node-carddav2phone/dist/utils.js:95:23) at utilParseVcard (/root/node-carddav2phone/dist/utils.js:217:26) at snomXcapProcessCards (/root/node-carddav2phone/dist/snom.js:118:58) at _loop_1 (/root/node-carddav2phone/dist/snom.js:71:24) at snomXcapHandler (/root/node-carddav2phone/dist/snom.js:76:9) at snomHandler (/root/node-carddav2phone/dist/snom.js:54:27) at phoneHandlers (/root/node-carddav2phone/dist/index.js:25:46) at /root/node-carddav2phone/dist/index.js:37:16 at invokeCallback (/root/node-carddav2phone/node_modules/es6-promise/dist/es6-promise.js:408:15) at publish (/root/node-carddav2phone/node_modules/es6-promise/dist/es6-promise.js:391:7)
Hi,
I'm looking for a script that read an openLDAP server and export the data (Name and phone number) to a CardDav Server.
Your script can do this ?
Thank you !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.