phracturedblue / asterisk_mbox_server Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
I'm unable to install this using python 3.6.2, and it appears to be because in your README.rst, you're using the "greater than or equal to" symbol, and it's not ASCII. I'm thinking there was maybe a change in the default encoding when moving to 3.6.2. I'm going to attempt to install manually, but thought i'd report this.
Collecting asterisk_mbox_server
Using cached asterisk_mbox_server-0.4.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-k41gfz9e/asterisk-mbox-server/setup.py", line 30, in
long_description=open('README.rst').read(),
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 306: ordinal not in range(128)
Hello,
I attempted to set this up today and found that if one of the hard-coded watch directories in the mailbox doesn't exist, the script aborts rather ungracefully.
[root@freepbx1 ~]# sudo -u asterisk /usr/local/bin/asterisk_mbox_server -v --cfg /etc/asterisk/asterisk_mbox.ini
DEBUG:inotify.adapters:Inotify handle is (7).
DEBUG:root:Watching Directory: /var/spool/asterisk/voicemail/default/101/INBOX
DEBUG:inotify.adapters:Adding watch: [b'/var/spool/asterisk/voicemail/default/101/INBOX']
DEBUG:inotify.adapters:Added watch (1): [b'/var/spool/asterisk/voicemail/default/101/INBOX']
DEBUG:root:Watching Directory: /var/spool/asterisk/voicemail/default/101/Old
DEBUG:inotify.adapters:Adding watch: [b'/var/spool/asterisk/voicemail/default/101/Old']
Traceback (most recent call last):
File "/usr/local/bin/asterisk_mbox_server", line 3, in
main()
File "/usr/lib/python3.6/site-packages/asterisk_mbox_server/init.py", line 330, in main
{'GOOGLE_KEY': opts['google_key']})
File "/usr/lib/python3.6/site-packages/asterisk_mbox_server/init.py", line 178, in init
self.inot.add_watch(directory.encode('utf-8'))
File "/usr/lib/python3.6/site-packages/inotify/adapters.py", line 67, in add_watch
wd = inotify.calls.inotify_add_watch(self.__inotify_fd, path, mask)
File "/usr/lib/python3.6/site-packages/inotify/calls.py", line 35, in _check_nonnegative
(result,))
inotify.calls.InotifyError: Call failed (should not be -1): (-1) ERRNO=(0)
DEBUG:inotify.adapters:Cleaning-up inotify.
[root@freepbx1 ~]#
In my case the directories Old and Urgent did not exist, so creating them allowed the script to start up.
[root@freepbx1 ~]# ll /var/spool/asterisk/voicemail/default/101
total 0
drwxrwxr-x 2 asterisk asterisk 6 Aug 26 13:14 INBOX
drwxrwxr-x 2 asterisk asterisk 6 Aug 26 13:14 tmp
[root@freepbx1 ~]# sudo -u asterisk mkdir /var/spool/asterisk/voicemail/default/101/Urgent
[root@freepbx1 ~]# sudo -u asterisk mkdir /var/spool/asterisk/voicemail/default/101/Old
[root@freepbx1 ~]# sudo -u asterisk /usr/local/bin/asterisk_mbox_server -v --cfg /etc/asterisk/asterisk_mbox.ini
DEBUG:inotify.adapters:Inotify handle is (7).
DEBUG:root:Watching Directory: /var/spool/asterisk/voicemail/default/101/INBOX
DEBUG:inotify.adapters:Adding watch: [b'/var/spool/asterisk/voicemail/default/101/INBOX']
DEBUG:inotify.adapters:Added watch (1): [b'/var/spool/asterisk/voicemail/default/101/INBOX']
DEBUG:root:Watching Directory: /var/spool/asterisk/voicemail/default/101/Old
DEBUG:inotify.adapters:Adding watch: [b'/var/spool/asterisk/voicemail/default/101/Old']
DEBUG:inotify.adapters:Added watch (2): [b'/var/spool/asterisk/voicemail/default/101/Old']
DEBUG:root:Watching Directory: /var/spool/asterisk/voicemail/default/101/Urgent
DEBUG:inotify.adapters:Adding watch: [b'/var/spool/asterisk/voicemail/default/101/Urgent']
DEBUG:inotify.adapters:Added watch (3): [b'/var/spool/asterisk/voicemail/default/101/Urgent']
DEBUG:root:Reading: /var/spool/asterisk/voicemail/default/101/INBOX
DEBUG:root:Reading: /var/spool/asterisk/voicemail/default/101/Old
DEBUG:root:Reading: /var/spool/asterisk/voicemail/default/101/Urgent
just starting with this..
installed per instructions here: https://www.home-assistant.io/docs/asterisk_mbox/
so haven't even installed the client on hass yet.
seems like something related to the cache file. i set the cache_file to a fully qualified path to a file owned by asterisk. that file is empty. and when i start the server from the shell, i get the following errors:
File "/usr/local/bin/asterisk-mbox-server", line 9, in <module>
load_entry_point('asterisk-mbox-server==0.5.2', 'console_scripts', 'asterisk-mbox-server')()
File "/usr/local/lib/python3.4/dist-packages/asterisk_mbox_server/__init__.py", line 300, in main
AsteriskMboxServer().loop()
File "/usr/local/lib/python3.4/dist-packages/asterisk_mbox_server/__init__.py", line 170, in __init__
{'GOOGLE_KEY': self._opts['google_key']})
File "/usr/local/lib/python3.4/dist-packages/asterisk_mbox_server/mbox.py", line 39, in __init__
self.cache = pickle.load(infile)
EOFError: Ran out of input
if instead of the file being empty, it's set to some text - i get this error instead:
File "/usr/local/bin/asterisk-mbox-server", line 9, in <module>
load_entry_point('asterisk-mbox-server==0.5.2', 'console_scripts', 'asterisk-mbox-server')()
File "/usr/local/lib/python3.4/dist-packages/asterisk_mbox_server/__init__.py", line 300, in main
AsteriskMboxServer().loop()
File "/usr/local/lib/python3.4/dist-packages/asterisk_mbox_server/__init__.py", line 170, in __init__
{'GOOGLE_KEY': self._opts['google_key']})
File "/usr/local/lib/python3.4/dist-packages/asterisk_mbox_server/mbox.py", line 39, in __init__
self.cache = pickle.load(infile)
_pickle.UnpicklingError: invalid load key, 'H'.
"H" happens to be the first character of the file.
i'm at a loss on what to look for. i already had an API key to google's speech recognition service (it's the older free one for personal/developers - the key is only 39 characters - vs the newer cloud speech api. not sure if that matters).
there are some existing voice mails in my asterisk voice mail account.
any suggestion/thought as to what i may be doing wrong?
system is python 3.4.2, debian jessie.
I access HASS normally by entering my FQDN which (via dynamic DNS) points to port 443 on machine running HASS. That machine also runs a reverse proxy with nginx and port 80 redirects to 443. The mailbox listing shows up fine, but audio doesn't play. no error generated in HASS.
If, instead i access HASS through the local IP:8123 - it works fine.
Not sure if this would be an issue of port 80 vs 443 or the reverse proxy itself. the symptoms are a bit browser specific - Chrome just displays a portion of an audio control and the screen is dimmed. Firefox has more of the audio controls displayed with a dimmed screen. Safari shows the audio controls with "error" displayed & dimmed screen.
Can't get a API key for Google Speech API, seems deprecated in favour of the new Cloud Speech-to-Text API.
Any chance this will be updated to use the new API?
If there are a large number of records in the CDR database, the server will use massive amounts of memory and eventually get an OOM kill from systemd. I got it working by stripping most of the records out of my CDR database, but I'm thinking there should be a better way of handling this that doesn't use so much memory (but I haven't had time to look at the code yet).
Initially, due to having a really old server and a lot of spam calls and older SIP connection attempts, there were over 2M records in my CDR database.
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.