--- scripts/incoming.py.orig 2004-11-28 14:35:23.000000000 +0100 +++ scripts/incoming.py 2006-09-22 15:17:28.000000000 +0200 @@ -1,3 +1,4 @@ +# -*- coding: UTF-8 -*- # incoming.py - standard incoming script for capisuite # ---------------------------------------------------- # copyright : (C) 2002 by Gernot Hillier @@ -48,7 +49,7 @@ if config.has_option(u,'fax_numbers'): numbers=config.get(u,'fax_numbers') if (call_to in numbers.split(',') or numbers=="*"): - if (service in (capisuite.SERVICE_FAXG3,capisuite.SERVICE_VOICE)): + if (service in (capisuite.SERVICE_FAXG3,capisuite.SERVICE_VOICE)): curr_user=u curr_service=capisuite.SERVICE_FAXG3 break @@ -133,8 +134,8 @@ if (os.access(filename,os.R_OK)): cs_helpers.writeDescription(filename, - "call_from=\""+call_from+"\"\ncall_to=\""+call_to+"\"\ntime=\"" - +time.ctime()+"\"\ncause=\"0x%x/0x%x\"\n" % (cause,causeB3)) + "call_from=\""+call_from+"\"\ncall_to=\""+call_to+"\"\ntime=\"" + +time.ctime()+"\"\ncause=\"0x%x/0x%x\"\n" % (cause,causeB3)) userdata=pwd.getpwnam(curr_user) os.chmod(filename,0600) os.chown(filename,userdata[2],userdata[3]) @@ -153,8 +154,8 @@ action="saveonly" if (action=="mailandsave"): cs_helpers.sendMIMEMail(fromaddress, mailaddress, "Fax received from "+call_from+" to "+call_to, faxFormat, - "You got a fax 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) + "You got a fax 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) # @brief called by callIncoming when an incoming voice call is received # @@ -234,8 +235,8 @@ if (os.access(filename,os.R_OK)): cs_helpers.writeDescription(filename, - "call_from=\""+call_from+"\"\ncall_to=\""+call_to+"\"\ntime=\"" - +time.ctime()+"\"\ncause=\"0x%x/0x%x\"\n" % (cause,causeB3)) + "call_from=\""+call_from+"\"\ncall_to=\""+call_to+"\"\ntime=\"" + +time.ctime()+"\"\ncause=\"0x%x/0x%x\"\n" % (cause,causeB3)) userdata=pwd.getpwnam(curr_user) os.chmod(filename,0600) os.chown(filename,userdata[2],userdata[3]) @@ -250,8 +251,8 @@ 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) + "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) # @brief remote inquiry function (uses german wave snippets!) @@ -418,7 +419,7 @@ # # Revision 1.9 2003/06/27 07:51:09 gernot # - replaced german umlaut in filename "nachricht-gelscht.la", can cause -# problems on Redhat, thx to Herbert Hübner for reporting +# problems on Redhat, thx to Herbert Hübner for reporting # # Revision 1.8 2003/06/16 10:21:05 gernot # - define filename in any case (thx to Axel Schneck for reporting and --- scripts/idle.py.orig 2004-11-28 14:35:16.000000000 +0100 +++ scripts/idle.py 2006-09-22 15:33:50.000000000 +0200 @@ -1,3 +1,4 @@ +# -*- coding: UTF-8 -*- # idle.py - default script for capisuite # --------------------------------------------- # copyright : (C) 2002 by Gernot Hillier @@ -105,13 +106,13 @@ movejob(job_fax,sendq,done,user) capisuite.log("job "+job_fax+": finished successfully",1) mailtext="Your fax job to "+addressee+" ("+dialstring+") was sent successfully.\n\n" \ - +"Subject: "+subject+"\nFilename: "+job_fax \ - +"\nNeeded tries: "+str(tries) \ - +("\nLast result: 0x%x/0x%x" % (result,resultB3)) \ - +"\n\nIt was moved to file://"+done+user+"-"+job_fax + +"Subject: "+subject+"\nFilename: "+job_fax \ + +"\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(fromaddress,mailaddress, - "Fax to "+addressee+" ("+dialstring+") sent successfully.", - mailtext) + "Fax to "+addressee+" ("+dialstring+") sent successfully.", + mailtext) else: max_tries=int(cs_helpers.getOption(config,"","send_tries","10")) delays=cs_helpers.getOption(config,"","send_delays","60,60,60,300,300,3600,3600,18000,36000").split(",") @@ -123,19 +124,19 @@ starttime=time.time()+next_delay capisuite.log("job "+job_fax+": delayed for "+str(next_delay)+" seconds",2) cs_helpers.writeDescription(sendq+job_fax,"dialstring=\""+dialstring+"\"\n" - +"starttime=\""+time.ctime(starttime)+"\"\ntries=\""+str(tries)+"\"\n" - +"user=\""+user+"\"\naddressee=\""+addressee+"\"\nsubject=\""+subject+"\"\n") + +"starttime=\""+time.ctime(starttime)+"\"\ntries=\""+str(tries)+"\"\n" + +"user=\""+user+"\"\naddressee=\""+addressee+"\"\nsubject=\""+subject+"\"\n") if (tries>=max_tries): movejob(job_fax,sendq,failed,user) capisuite.log("job "+job_fax+": failed finally",1) mailtext="I'm sorry, but your fax job to "+addressee+" ("+dialstring \ - +") failed finally.\n\nSubject: "+subject \ - +"\nFilename: "+job_fax+"\nTries: "+str(tries) \ - +"\nLast result: 0x%x/0x%x" % (result,resultB3) \ - +"\n\nIt was moved to file://"+failed+user+"-"+job_fax + +") failed finally.\n\nSubject: "+subject \ + +"\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(fromaddress,mailaddress, - "Fax to "+addressee+" ("+dialstring+") FAILED.", - mailtext) + "Fax to "+addressee+" ("+dialstring+") FAILED.", + mailtext) fcntl.lockf(lockfile,fcntl.LOCK_UN) lockfile.close() @@ -149,7 +150,7 @@ if (stationID==None): capisuite.error("Warning: fax_stationID for user "+user+" not set") stationID="" - headline=cs_helpers.getOption(config,user,"fax_headline","") + headline=cs_helpers.getOption(config,user,"fax_headline","") (call,result)=capisuite.call_faxG3(capi,controller,outgoing_nr,dialstring,timeout,stationID,headline) if (result!=0): return(result,0)