def queue_fax(self, to_fax_number, filepath, caller_id=None, sender_email=None, account_code=None):
    'Queue fax for sending'
    to_fax_number = SRFax.verify_fax_numbers(to_fax_number)
    fax_type = ('BROADCAST' if (len(to_fax_number) > 1) else 'SINGLE')
    to_fax_number = '|'.join(to_fax_number)
    try:
        if isinstance(filepath, basestring):
            filepath = [filepath]
    except NameError:
        if isinstance(filepath, str):
            filepath = [filepath]
    if (not isinstance(filepath, list)):
        raise TypeError('filepath not properly defined')
    if (len(filepath) > 5):
        raise Exception('More than 5 files defined in filepath')
    params = {'access_id': self.access_id, 'access_pwd': self.access_pwd, 'sCallerID': (caller_id or self.caller_id), 'sSenderEmail': (sender_email or self.sender_email), 'sFaxType': fax_type, 'sToFaxNumber': to_fax_number, 'sAccountCode': (account_code or self.account_code or '')}
    SRFax.verify_parameters(params)
    for i in range(len(filepath)):
        path = filepath[i]
        basename = os.path.basename(path)
        if (not isinstance(basename, str)):
            basename = basename.decode('utf-8')
        params[('sFileName_%d' % (i + 1))] = basename
        content = SRFax.get_file_content(path)
        if (not isinstance(content, str)):
            content = content.decode()
        params[('sFileContent_%d' % (i + 1))] = content
    return self.process_request('Queue_Fax', params)
Queue fax for sending
def queue_fax(self, to_fax_number, filepath, caller_id=None, sender_email=None, account_code=None):
    
    to_fax_number = SRFax.verify_fax_numbers(to_fax_number)
    fax_type = ('BROADCAST' if (len(to_fax_number) > 1) else 'SINGLE')
    to_fax_number = '|'.join(to_fax_number)
    try:
        if isinstance(filepath, basestring):
            filepath = [filepath]
    except NameError:
        if isinstance(filepath, str):
            filepath = [filepath]
    if (not isinstance(filepath, list)):
        raise TypeError('filepath not properly defined')
    if (len(filepath) > 5):
        raise Exception('More than 5 files defined in filepath')
    params = {'access_id': self.access_id, 'access_pwd': self.access_pwd, 'sCallerID': (caller_id or self.caller_id), 'sSenderEmail': (sender_email or self.sender_email), 'sFaxType': fax_type, 'sToFaxNumber': to_fax_number, 'sAccountCode': (account_code or self.account_code or )}
    SRFax.verify_parameters(params)
    for i in range(len(filepath)):
        path = filepath[i]
        basename = os.path.basename(path)
        if (not isinstance(basename, str)):
            basename = basename.decode('utf-8')
        params[('sFileName_%d' % (i + 1))] = basename
        content = SRFax.get_file_content(path)
        if (not isinstance(content, str)):
            content = content.decode()
        params[('sFileContent_%d' % (i + 1))] = content
    return self.process_request('Queue_Fax', params)