From 6e07170c334a042d1fe0d684659affff9b792ccd Mon Sep 17 00:00:00 2001 From: gernot Date: Wed, 31 Dec 2003 15:16:31 +0000 Subject: [PATCH] include recorded msg length and host name were file is stored in sent mail (closes bug #6, thx to Achim Bohnet and Thomas Niesel for the feature requests) git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@200 4ebea2bb-67d4-0310-8558-a5799e421b66 --- ChangeLog | 5 +++++ scripts/incoming.py | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbbd2ed..13f7a52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-12-31 Gernot Hillier + * scripts/incoming.py (voiceIncoming): include recorded msg length + and host name were file is stored in sent mail (closes bug #6, + thx to Achim Bohnet and Thomas Niesel for the feature requests) + 2003-12-31 Gernot Hillier * scripts/cs_helpers.pyin (sendMIMEMail): use 16 bit ouput when converting sound files from la to wav. Thx to Holger Krull for diff --git a/scripts/incoming.py b/scripts/incoming.py index 3b85a59..2dbf918 100644 --- a/scripts/incoming.py +++ b/scripts/incoming.py @@ -2,7 +2,7 @@ # ---------------------------------------------------- # copyright : (C) 2002 by Gernot Hillier # email : gernot@hillier.de -# version : $Revision: 1.14 $ +# version : $Revision: 1.15 $ # # 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 @@ -160,7 +160,7 @@ def faxIncoming(call,call_from,call_to,curr_user,config,already_connected): +(faxInfo[2] and "hiRes" or "loRes")+(faxInfo[3] and "color" or "")+"\nPages: " \ +str(faxInfo[4]) mailText+="\n\nSee attached file.\nThe original file was saved to file://"+filename \ - +" on host \""+os.uname()[1]+"\"" + +" on host \""+os.uname()[1]+"\"." cs_helpers.sendMIMEMail(fromaddress, mailaddress, "Fax received from "+call_from+" to "+call_to, faxFormat, mailText, filename) @@ -212,7 +212,7 @@ def voiceIncoming(call,call_from,call_to,curr_user,config): capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"beep.la"),1) length=cs_helpers.getOption(config,curr_user,"record_length","60") silence_timeout=cs_helpers.getOption(config,curr_user,"record_silence_timeout","5") - capisuite.audio_receive(call,filename,int(length), int(silence_timeout),1) + msg_length=capisuite.audio_receive(call,filename,int(length), int(silence_timeout),1) dtmf_list=capisuite.read_DTMF(call,0) if (dtmf_list=="X"): @@ -257,10 +257,13 @@ def voiceIncoming(call,call_from,call_to,curr_user,config): if (mailaddress==""): mailaddress=curr_user if (action=="mailandsave"): - 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) - + mailText="You got a voice call from "+call_from+" to " \ + +call_to+"\nDate: "+time.ctime()+"\nLength: " \ + +str(msg_length)+" s\n\nSee attached file.\n" \ + +"The original file was saved to file://"+filename \ + +" on host \""+os.uname()[1]+"\".\n\n" + subject="Voice call received from "+call_from+" to "+call_to + cs_helpers.sendMIMEMail(fromaddress,mailaddress,subject,"la",mailText,filename) # @brief remote inquiry function (uses german wave snippets!) #