iro/anbieter/sipgate.py
changeset 20 0d7ffb9b2c7f
parent 9 4c5f1cf088f6
child 23 0180b538ed74
equal deleted inserted replaced
19:fcf8489f1c2f 20:0d7ffb9b2c7f
    39         self.user=cp.get(self.section, 'user')
    39         self.user=cp.get(self.section, 'user')
    40         self.password=cp.get(self.section, 'password')
    40         self.password=cp.get(self.section, 'password')
    41 
    41 
    42     def sendSMS(self,sms,recipients):
    42     def sendSMS(self,sms,recipients):
    43         """send SMS with $sms to $recipients"""
    43         """send SMS with $sms to $recipients"""
       
    44         import logging
       
    45         logging.debug('sipgate.sendSMS(%s,%s)'%(sms,  str(recipients)))
    44         args={
    46         args={
    45                 "TOS" : "text",
    47                 "TOS" : "text",
    46                 "Content" : sms.content
    48                 "Content" : sms.content
    47                 }
    49                 }
    48         self.__send(args,recipients)
    50         self.__send(args,recipients)
    49 
    51 
    50     def sendFAX(self,fax,recipients):
    52     def sendFAX(self,fax,recipients):
    51         """send the PDF file $fax  to $recipients"""
    53         """send the PDF file $fax  to $recipients"""
       
    54         import logging
       
    55         logging.debug('sipgate.sendFAX(%s,%s)'%(fax,  str(recipients)))
    52         pdf=open(fax.attachments[0],"rb")
    56         pdf=open(fax.attachments[0],"rb")
    53         args={
    57         args={
    54                 "TOS" : "fax",
    58                 "TOS" : "fax",
    55                 "Content" : base64.encodestring(pdf.read())
    59                 "Content" : base64.encodestring(pdf.read())
    56                 }
    60                 }