show_notice('%s Encrypted message %s to %s failed on %s: %s (%d)'%(datetime.now().replace(microsecond=0),message.id,self.remote_uri,serverorclient,notification.data.reason.decode(),notification.data.code))
else:
show_notice('%s Message %s to %s failed on %s: %s (%d)'%(datetime.now().replace(microsecond=0),message.id,self.remote_uri,serverorclient,notification.data.reason.decode()ifisinstance(notification.data.reason,bytes)elsenotification.data.reason,notification.data.code))
self.question=Question("Incoming file transfer for %s from '%s', do you want to accept? (a)ccept/(r)eject"%(os.path.basename(self.filename),identity),'ari',bold=True)
show_notice('More than one account exists which matches %s: %s'%(self.options.account,', '.join(sorted(account.idforaccountinpossible_accounts))),bold=False)
self.stop()
return
eliflen(possible_accounts)==0:
show_notice('No enabled account which matches %s was found. Available and enabled accounts: %s'%(self.options.account,', '.join(sorted(account.idforaccountinaccount_manager.get_accounts()ifaccount.enabled))),bold=False)
lines=['%s Registered contact "%s" of %s at %s:%d;transport=%s for %d seconds'%(now,contact_header.uri,account.id,registrar.address,registrar.port,registrar.transport,expires)]
iflen(contact_header_list)>1:
lines.append('%s Other registered contacts of %s:'%(now,account.id))
lines.extend('%s%s of %s for %s seconds'%(now,str(other_contact_header.uri),account.id,other_contact_header.expires)forother_contact_headerincontact_header_listifother_contact_header.uri!=notification.data.contact_header.uri)
ifaccount.contact.public_gruuisnotNone:
lines.append('%s Public GRUU: %s'%(now,account.contact.public_gruu))
show_notice('%s Failed to register contact for %s: %s (retrying in %.2f seconds)'%(datetime.now().replace(microsecond=0),account.id,notification.data.error,notification.data.retry_after))
show_notice('More than one account exists which matches %s: %s'%(new_account,', '.join(sorted(account.idforaccountinpossible_accounts))),bold=False)
eliflen(possible_accounts)==0:
show_notice('No enabled account which matches %s was found. Available and enabled accounts: %s'%(self.options.account,', '.join(sorted(possible_accounts))),bold=False)
parser.add_option('-a','--account',type='string',dest='account',help='The account name to use for any outgoing traffic. If not supplied, the default account will be used.',metavar='NAME')
parser.add_option('-c','--config-directory',type='string',dest='config_directory',help='The configuration directory to use. This overrides the default location.')
parser.add_option('-s','--trace-sip',action='store_true',dest='trace_sip',default=False,help='Dump the raw contents of incoming and outgoing SIP messages.')
parser.add_option('-m','--trace-msrp',action='store_true',dest='trace_msrp',default=False,help='Dump msrp logging information and the raw contents of incoming and outgoing MSRP messages.')
parser.add_option('-n','--trace-notifications',action='store_true',dest='trace_notifications',default=False,help='Print all notifications (disabled by default).')
parser.add_option('-S','--disable-sound',action='store_true',dest='disable_sound',default=False,help='Disables initializing the sound card.')
parser.set_default('auto_answer_interval',None)
parser.add_option('--auto-answer',action='callback',callback=parse_handle_call_option,callback_args=('auto_answer_interval',),help='Interval after which to answer an incoming session (disabled by default). If the option is specified but the interval is not, it defaults to 0 (accept the session as soon as it starts ringing).',metavar='[INTERVAL]')
parser.set_default('auto_hangup_interval',None)
parser.add_option('--auto-hangup',action='callback',callback=parse_handle_call_option,callback_args=('auto_hangup_interval',),help='Interval after which to hang up an established session (disabled by default). If the option is specified but the interval is not, it defaults to 0 (hangup the session as soon as it connects).',metavar='[INTERVAL]')