- added new options "fax_email_from" and "voice_email_from"

git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@175 4ebea2bb-67d4-0310-8558-a5799e421b66
This commit is contained in:
gernot 2003-10-03 13:42:09 +00:00
parent 6939e9c506
commit 3baf754aae
7 changed files with 151 additions and 64 deletions

8
NEWS
View File

@ -1,5 +1,5 @@
0.4.4 (CVS nn):
===============
0.5 (CVS nn):
=============
* scripts: fix a bug in faxIncoming which lead to a non-working
fax reception after automatic switch from voice to fax mode
@ -14,6 +14,10 @@
* Makefiles: moved a "mkdir" from the build ("make") to install stage
("make install") (thx to Steffen Barszus for reporting)
* scripts: added new options "fax_email_from" and "voice_email_from" to
answering_machine.conf and fax.conf (thx to Achim Bohnet for submitting
a patch with this feature!; closes bug #46)
0.4.3 (CVS tag CAPISUITE_043):
==============================

View File

@ -5,7 +5,7 @@
<!ENTITY cs "<application>CapiSuite</application>">
]>
<book lang="de">
<title>CapiSuite 0.4.3</title>
<title>CapiSuite 0.5.cvs</title>
<subtitle><ulink url="http://www.capisuite.de"/></subtitle>
@ -821,12 +821,22 @@ make install</screen>
<varlistentry id="fax_headline">
<term><option>fax_headline="&lt;Ihre Fax-Kopfzeile&gt;"</option></term>
<listitem><para>Fax-Kopfzeile, die beim Versenden eines Fax-Dokuments
verwendet wird. Wo und ob diese Kopfzeile angezeigt wird, hängt von der
verwendet wird. Wo und ob diese Kopfzeile angezeigt wird, hängt von der
Implementierung Ihres CAPI-Treibers ab. Die Kopfzeile sollte eine vernünftige
Länge haben, damit sie auf den oberen Rand einer Seite passt, aber es gibt
keine bestimmte Begrenzung.</para>
keine bestimmte Begrenzung.</para>
<para>Diese Option ist optional. Wenn nichts angegeben wird, wird
standardmäßig keine Kopfzeile verwendet.</para>
standardmäßig keine Kopfzeile verwendet.</para>
</listitem>
</varlistentry>
<varlistentry id="fax_email_from">
<term><option>fax_email_from="&lt;Mailadresse&gt;"</option></term>
<listitem><para>Hier kann die Mailadresse gesetzt werden, die CapiSuite
als Absender bei der Mailzustellung des Faxdokumentes angibt.</para>
<para>Diese Option ist optional. Wenn nichts angegeben wird, wird
standardmäßig der Empfänger auch als Absender verwendet (wenn
also der User gernot ein Fax empfängt, dann ist der Absender und
Empfänger der versandten Mail "gernot".</para>
</listitem>
</varlistentry>
</variablelist></sect4>
@ -849,7 +859,12 @@ make install</screen>
<varlistentry>
<term><option>fax_headline</option></term>
<listitem><para>Benutzerspezifischer Wert für die globale Option
im Abschnitt <option>[GLOBAL]</option> oben</para></listitem>
im Abschnitt <option>[GLOBAL]</option> oben</para></listitem>
</varlistentry>
<varlistentry>
<term><option>fax_email_from</option></term>
<listitem><para>Benutzerspezifischer Wert für die globale Option
im Abschnitt <option>[GLOBAL]</option> oben</para></listitem>
</varlistentry>
<varlistentry id="fax_numbers">
<term><option>fax_numbers="&lt;Nummer1&gt;,&lt;Nummer2&gt;,..."</option></term>
@ -1025,6 +1040,17 @@ make install</screen>
Timeout 5 Sekunden.</para>
</listitem>
</varlistentry>
<varlistentry id="voice_email_from">
<term><option>voice_email_from="&lt;Mailadresse&gt;"</option></term>
<listitem><para>Hier kann die Mailadresse gesetzt werden, die CapiSuite
als Absender bei der Mailzustellung der aufgezeichneten
Sprachnachricht angibt.</para>
<para>Diese Option ist optional. Wenn nichts angegeben wird, wird
standardmäßig der Empfänger auch als Absender verwendet (wenn
also der User gernot eine Sprachnachricht empfängt, dann ist der
Absender und Empfänger der versandten Mail "gernot".</para>
</listitem>
</varlistentry>
</variablelist></sect4>
<sect4 id="options_voice_user"><title>Verfügbare Optionen für die Benutzer-Abschnitte in der Anrufbeantworter-Konfiguration</title>
<variablelist><varlistentry>
@ -1045,6 +1071,11 @@ make install</screen>
<varlistentry>
<term><option>record_silence_timeout</option></term>
<listitem><para>Benutzerspezifischer Wert für die globale Option
im Abschnitt <option>[GLOBAL]</option> oben</para></listitem>
</varlistentry>
<varlistentry>
<term><option>voice_email_from</option></term>
<listitem><para>Benutzerspezifischer Wert für die globale Option
im Abschnitt <option>[GLOBAL]</option> oben</para></listitem>
</varlistentry>
<varlistentry id="voice_numbers">

View File

@ -5,7 +5,7 @@
<!ENTITY cs "<application>CapiSuite</application>">
]>
<book lang="en">
<title>CapiSuite 0.4.3</title>
<title>CapiSuite 0.5.cvs</title>
<subtitle><ulink url="http://www.capisuite.de"/></subtitle>
@ -736,6 +736,14 @@ make install</screen>
<para>This option is optional. If not given, it defaults to an empty headline.</para>
</listitem>
</varlistentry>
<varlistentry id="fax_email_from">
<term><option>fax_email_from="&lt;mailaddress&gt;"</option></term>
<listitem><para>You can set a default originator ("From"-address) for the e-mails CapiSuite sends
here.</para>
<para>This option is optional. If you set this to an empty string, the destinator is used as
originator (i.e. if "gernot" receives a fax, the mail comes from "gernot" to "gernot").</para>
</listitem>
</varlistentry>
</variablelist></sect4>
<sect4 id="options_fax_user"><title>The user sections</title><variablelist>
<varlistentry>
@ -754,6 +762,10 @@ make install</screen>
<term><option>fax_headline</option></term>
<listitem><para>User specific value for the global option <xref linkend="options_fax_global"/> above</para></listitem>
</varlistentry>
<varlistentry>
<term><option>fax_email_from</option></term>
<listitem><para>User specific value for the global option <xref linkend="options_fax_global"/> above</para></listitem>
</varlistentry>
<varlistentry id="fax_numbers">
<term><option>fax_numbers="&lt;number1&gt;,&lt;number2&gt;,..."</option></term>
<listitem><para>A list containing the numbers on which this user wants to receive incoming fax calls.
@ -891,6 +903,15 @@ make install</screen>
<para>This option is optional. If not set, it defaults to 5 seconds.</para>
</listitem>
</varlistentry>
<varlistentry id="voice_email_from">
<term><option>voice_email_from="&lt;mailaddress&gt;"</option></term>
<listitem><para>You can set a default originator ("From"-address) for the e-mails CapiSuite sends
here.</para>
<para>This option is optional. If you set this to an empty string, the destinator is used
as originator (i.e. if "gernot" receives a voice call, the mail comes from "gernot" to
"gernot").</para>
</listitem>
</varlistentry>
</variablelist></sect4>
<sect4 id="options_voice_user"><title>The user sections</title><variablelist>
<varlistentry>
@ -909,6 +930,10 @@ make install</screen>
<term><option>record_silence_timeout</option></term>
<listitem><para>User specific value for the global option <xref linkend="options_voice_global"/> above</para></listitem>
</varlistentry>
<varlistentry>
<term><option>voice_email_from</option></term>
<listitem><para>User specific value for the global option <xref linkend="options_voice_global"/> above</para></listitem>
</varlistentry>
<varlistentry id="voice_numbers">
<term><option>voice_numbers="&lt;number1&gt;,&lt;number2&gt;,..."</option></term>
<listitem><para>A list containing the numbers on which this user wants to receive incoming voice calls.

View File

@ -1,4 +1,4 @@
# $Id: answering_machine.confin,v 1.5 2003/04/10 21:29:51 gernot Exp $
# $Id: answering_machine.confin,v 1.6 2003/10/03 13:42:09 gernot Exp $
#
# This is the configuration file for the answering machine scripts distributed
# with CapiSuite
@ -80,6 +80,11 @@ record_length="60"
# finished by the answering machine
record_silence_timeout="5"
# voice_email_from (optional, default voice message addressee) [New in 0.5]
# When voice messages are send by e-mail this address is used in the 'From:'
# header field.
voice_email_from="capisuite daemon <root>"
###############################################################################
############################# user settings ###################################
###############################################################################
@ -89,7 +94,8 @@ record_silence_timeout="5"
#
# Each user section can override the following default options given above:
#
# voice_delay, announcement, record_length, record_silence_timeout
# voice_delay, announcement, record_length, record_silence_timeout,
# voice_email_from
#
# Additionally, the following options are possible:
#

View File

@ -1,4 +1,4 @@
# $Id: fax.confin,v 1.8 2003/06/19 14:56:20 gernot Exp $
# $Id: fax.confin,v 1.9 2003/10/03 13:42:09 gernot Exp $
#
# This is the fax configuration file for the scripts distributed with CapiSuite
#
@ -108,6 +108,12 @@ fax_stationID="+49 000 0000"
#
fax_headline="Sent by CapiSuite (www.CapiSuite.de)"
# fax_email_from (optional, default fax addressee) [New in 0.5]
# When a received fax is distributed by e-mail this address
# used in the 'From:' header field. Ditto from success/failed fax e-mail
# messages.
fax_email_from="capisuite daemon <root>"
###############################################################################
############################# user settings ###################################
###############################################################################
@ -117,7 +123,7 @@ fax_headline="Sent by CapiSuite (www.CapiSuite.de)"
#
# Each user section can override the following default options given above:
#
# outgoing_MSN, outgoing_timeout, fax_stationID, fax_headline
# outgoing_MSN, outgoing_timeout, fax_stationID, fax_headline, fax_email_from
#
# Additionally, the following options are possible:
#

View File

@ -2,7 +2,7 @@
# ---------------------------------------------
# copyright : (C) 2002 by Gernot Hillier
# email : gernot@hillier.de
# version : $Revision: 1.9 $
# version : $Revision: 1.10 $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -92,6 +92,9 @@ def idle(capi):
mailaddress=cs_helpers.getOption(config,user,"fax_email","")
if (mailaddress==""):
mailaddress=user
fromaddress=cs_helpers.getOption(config,user,"fax_email_from","")
if (fromaddress==""):
fromaddress=user
capisuite.log("job "+job_fax+" from "+user+" to "+dialstring+" initiated",1)
result,resultB3 = sendfax(capi,sendq+job_fax,outgoing_nr,dialstring,user,config)
@ -106,7 +109,7 @@ def idle(capi):
+"\nNeeded tries: "+str(tries) \
+("\nLast result: 0x%x/0x%x" % (result,resultB3)) \
+"\n\nIt was moved to file://"+done+user+"-"+job_fax
cs_helpers.sendSimpleMail(user,mailaddress,
cs_helpers.sendSimpleMail(fromaddress,mailaddress,
"Fax to "+addressee+" ("+dialstring+") sent successfully.",
mailtext)
else:
@ -130,7 +133,7 @@ def idle(capi):
+"\nFilename: "+job_fax+"\nTries: "+str(tries) \
+"\nLast result: 0x%x/0x%x" % (result,resultB3) \
+"\n\nIt was moved to file://"+failed+user+"-"+job_fax
cs_helpers.sendSimpleMail(user,mailaddress,
cs_helpers.sendSimpleMail(fromaddress,mailaddress,
"Fax to "+addressee+" ("+dialstring+") FAILED.",
mailtext)
@ -163,6 +166,9 @@ def movejob(job,olddir,newdir,user):
# History:
#
# $Log: idle.py,v $
# Revision 1.10 2003/10/03 13:42:09 gernot
# - added new options "fax_email_from" and "voice_email_from"
#
# Revision 1.9 2003/09/21 12:34:37 gernot
# - add 0x349f to list of normal results
#

View File

@ -2,7 +2,7 @@
# ----------------------------------------------------
# copyright : (C) 2002 by Gernot Hillier
# email : gernot@hillier.de
# version : $Revision: 1.11 $
# version : $Revision: 1.12 $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -142,6 +142,9 @@ def faxIncoming(call,call_from,call_to,curr_user,config,already_connected):
os.chmod(filename[:-3]+"txt",0600)
os.chown(filename[:-3]+"txt",userdata[2],userdata[3])
fromaddress=cs_helpers.getOption(config,curr_user,"fax_email_from","")
if (fromaddress==""):
fromaddress=curr_user
mailaddress=cs_helpers.getOption(config,curr_user,"fax_email","")
if (mailaddress==""):
mailaddress=curr_user
@ -158,7 +161,7 @@ def faxIncoming(call,call_from,call_to,curr_user,config,already_connected):
+str(faxInfo[4])
mailText+="\n\nSee attached file.\nThe original file was saved to file://"+filename \
+" on host \""+os.uname()[1]+"\""
cs_helpers.sendMIMEMail(curr_user, mailaddress, "Fax received from "+call_from+" to "+call_to,
cs_helpers.sendMIMEMail(fromaddress, mailaddress, "Fax received from "+call_from+" to "+call_to,
faxFormat, mailText, filename)
# @brief called by callIncoming when an incoming voice call is received
@ -247,11 +250,14 @@ def voiceIncoming(call,call_from,call_to,curr_user,config):
os.chmod(filename[:-2]+"txt",0600)
os.chown(filename[:-2]+"txt",userdata[2],userdata[3])
fromaddress=cs_helpers.getOption(config,curr_user,"voice_email_from","")
if (fromaddress==""):
fromaddress=curr_user
mailaddress=cs_helpers.getOption(config,curr_user,"voice_email","")
if (mailaddress==""):
mailaddress=curr_user
if (action=="mailandsave"):
cs_helpers.sendMIMEMail(curr_user, mailaddress, "Voice call received from "+call_from+" to "+call_to, "la",
cs_helpers.sendMIMEMail(fromaddress, mailaddress, "Voice call received from "+call_from+" to "+call_to, "la",
"You got a voice call from "+call_from+" to "+call_to+"\nDate: "+time.ctime()+"\n\n"
+"See attached file.\nThe original file was saved to file://"+filename+"\n\n", filename)
@ -413,6 +419,9 @@ def newAnnouncement(call,userdir,curr_user,config):
# History:
#
# $Log: incoming.py,v $
# Revision 1.12 2003/10/03 13:42:09 gernot
# - added new options "fax_email_from" and "voice_email_from"
#
# Revision 1.11 2003/08/24 12:47:50 gernot
# - faxIncoming tried to reconnect when it was called after a switch from
# voice to fax mode, which lead to a call abort. Thx to Harald Jansen &