Compare commits

..

No commits in common. "dfe3543777ee29390601afc131538990c3f42998" and "9e6e294491fda23218bdbd9fad3fae3606887abf" have entirely different histories.

3 changed files with 19 additions and 28 deletions

View File

@ -26,6 +26,22 @@ if env_voicebox is None:
if env_tmp is None: if env_tmp is None:
env_tmp = "/tmp" env_tmp = "/tmp"
def fritzab2matrix():
### CHECK AND GET MESSAGES FROM FRITZBOX ###
############################################
## Connect to the FritzBox in the LAN
# We don't use tls because the self-signed cert of the box leads to a malfunction in urllib later on.
fc = FritzConnection(address=env_ip, user=env_user, password=env_pass, use_tls=False)
## Get info about messages from the main answering machine
message_list = fc.call_action("X_AVM-DE_TAM1", "GetMessageList", NewIndex=0)
message_list_url = message_list['NewURL']
# Build the url to download the message via smb # Build the url to download the message via smb
def build_download_url(mid, tam=0): def build_download_url(mid, tam=0):
@ -47,25 +63,6 @@ def get_message_list(url):
messages = xmltodict.parse(doc) messages = xmltodict.parse(doc)
return messages return messages
def fritzab2matrix():
### CHECK AND GET MESSAGES FROM FRITZBOX ###
############################################
## Connect to the FritzBox in the LAN
# We don't use tls because the self-signed cert of the box leads to a malfunction in urllib later on.
fc = FritzConnection(address=env_ip, user=env_user, password=env_pass, use_tls=False)
## Get info about messages from the main answering machine
message_list = fc.call_action("X_AVM-DE_TAM1", "GetMessageList", NewIndex=0)
message_list_url = message_list['NewURL']
l = get_message_list(message_list_url) l = get_message_list(message_list_url)
if l['Root'] == None or l['Root']['Message'] == None: if l['Root'] == None or l['Root']['Message'] == None:
return False return False

View File

@ -1,5 +0,0 @@
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import fritzab2matrix

View File

@ -1 +0,0 @@
from .context import fritzab2matrix