Coder Social home page Coder Social logo

asterisk_mbox_server's People

Contributors

phracturedblue avatar scottbender avatar thundergreen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

asterisk_mbox_server's Issues

Cannot install on python 3.6.2

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)

Missing watch directory causes ungraceful abort

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

server pickle related error

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.

Audio doesn't work if accessing HASS via reverse proxy

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.

Google Speech API deprecated.

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?

High memory usage

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.