citronalco / carddav2asterisk

Tiny Python script that reads all contacts from a CardDAV addressbook and inserts them into Asterisk's CID lookup database
GNU General Public License v3.0
17 stars 4 forks source link

Problems with line 8 #4

Closed ronaldoantoni closed 5 years ago

ronaldoantoni commented 5 years ago

Initially, congratulations on the project! After many hours of research I found it and meets exactly my need if I can execute it properly!   I'm having problems with line 8.

Freepbx usage (CentOS). There is no python-pyst package available to install (which I believe is the cause of the problem). Any suggestion?

citronalco commented 5 years ago

You could try to install the pyst library with pip, the Python Package Installer: pip install pyst If pip is missing: It's in the package python-pip Hope this works!

ronaldoantoni commented 5 years ago

I was able to install and advance a bit (at least I have new errors). I still have problems on line 8, but now the message is as follows:

Traceback (most recent call last):    File "./carddav2asterisk.py", line 8, in      from asterisk import manager ImportError: cannot import name manager

Forgive me for beginner doubts!

citronalco commented 5 years ago

Looks like the installation of pyst did not work. Or installed the Python3 version of that library.

"pip -V" displays the python version it is built for. If it says something with python 3 it's the wrong one: Try if "pip2" (or "pip2.7") exists on your system and use that. In case it's not there I'm pretty sure there's a package in CentOS called python2-pip or python-pip2 that contains it.

ronaldoantoni commented 5 years ago

pip -V returns: pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

Let me tell you some things that may be relevant: I gave up running centos because I had errors in python (I couldn't update versions - I think freepbs depends on it and as it is a production machine I thought it best to leave as it is). I am running the script locally (ubuntu 18.04 installed as windows subsystem).

Any other ideas?

citronalco commented 5 years ago

If you're running Ubuntu it should not be necessary to install anything with pip: All libraries are available as packages: sudo apt-get install python-requests python-vobject python-pyst python-lxml

ronaldoantoni commented 5 years ago

Sorry, I know I'm being tiring, but my mistake persists. The dependencies were already installed, as per print attached. Any other suggestions? erro_carddav

citronalco commented 5 years ago

I'm happy about every person that is interested in the things I've done and can make use of them. Hopefully...

"manager" is part of the pyst library - which you have installed. To be honest I have no clue why Python can't find it, I can only guess. In case you tried to install the libraries with pip before there may be some leftovers in ~/.local/lib/python-2.7 or in /usr/local/lib/python-2.7 you could remove as they could conflict with the packages installed with apt-get.

ronaldoantoni commented 5 years ago

Hello! I ended up having some difficulties and so I left this issue in the background! Now, I resumed the content, but I have another error, below:

Traceback (most recent call last): File "./carddav2asterisk.py", line 73, in sys.exit(main(sys.argv)) File "./carddav2asterisk.py", line 51, in main ami.connect(HOST) File "/usr/lib/python2.7/dist-packages/asterisk/manager.py", line 449, in connect raise ManagerSocketException(errno, reason) asterisk.manager.ManagerSocketException: (111, 'Connection refused')

I have the impression that it is something related to the password, but I checked and everything is right! I thought it was firewall, but even disabling it, the error remains!

ronaldoantoni commented 5 years ago

Thank you! Everything works perfectly. My problem was asterisk manager, which I was able to identify and solve. Thanks again!

citronalco commented 5 years ago

I'm glad to hear that!