def connect_faxG3(self, faxStationID, faxHeadline, delay=0): """ Accept an incoming call and connect with fax (analog, group 3) service. This will accept an incoming call and choose fax group 3 as service, so you can use the fax commands (like fax_receive()) with this connection. After this command has finished, the call is connected successfully. It's also possible to accept a call with some delay. This is useful if eg. you want to have to fetch a call with your phone before your computer answers it. faxStationID: the station ID to use (string) faxHeadline: the fax headline to use (string) delay: delay in seconds _before_ connection will be established (default: 0=immediate connect) Returns a FaxInfo instance. """ faxInfo = _capisuite.connect_faxG3(self._handle, faxStationID, faxHeadline, delay) log('faxinfo: %s' % repr(faxInfo), 3) if not faxInfo: return FaxInfo() return FaxInfo(*faxInfo)
def log(self, message, level): """ Log a connection dependent message. This function writes a message to the CapiSuite log. As all messages written with it are prefixed with the current call reference, you should use it for connection-dependant messages (e.g. information about handling *this* call). If you want to log messages of general nature not associated with a certain call (e.g. problem in reading configuration files), please use core.log instead. message: the log message to be written level: parameter for CapiSuite log_level used (0=vital .. 3=debug info) """ _capisuite.log(message, level, self._handle)
def fax_receive(self, filename): """ Receive a fax in a fax mode connection. This command receives an analog fax (fax group 3). It starts the reception and waits for the end of the connection. So it should be the last command before disconnect(). The connction must be in fax mode (use capi.call_faxG3() or call.switch_to_faxG3()), otherwise an exception will be caused. The created file will be saved in the Structured Fax File (SFF) format. filename: where to save the received fax. """ faxInfo = _capisuite.fax_receive(self._handle, filename) log('faxinfo: %s' % repr(faxInfo), 3) if not faxInfo: return FaxInfo() return FaxInfo(*faxInfo)
def switch_to_faxG3(self, faxStationID, faxHeadline): """ Switch a connection from voice mode to fax mode. This will switch from voice mode to fax group 3 after you have connected, so you can use the fax commands afterwards. Attention: Not all ISDN cards or CAPI driver support this command. faxStationID: the station ID to use (string) faxHeadline: the fax headline to use (string) Returns a FaxInfo instance. """ faxInfo = _capisuite.switch_to_faxG3(self._handle, faxStationID, faxHeadline) self.service = SERVICE_FAXG3 log('faxinfo: %s' % repr(faxInfo), 3) if not faxInfo: return FaxInfo() return FaxInfo(*faxInfo)