raise RuntimeError("unknown account %s. Available accounts: %s" % (self.account_name, ', '.join(account.id for account in account_manager.iter_accounts())))
elif not self.account.enabled:
raise RuntimeError("account %s is not enabled" % self.account.id)
+ elif self.account == BonjourAccount():
+ raise RuntimeError("cannot use bonjour account for presence subscription")
+ elif not self.account.presence.enabled:
+ raise RuntimeError("presence is not enabled for account %s" % self.account.id)
if ('%s/%s' % (notification.data.content_type, notification.data.content_subtype)) in ('multipart/related', 'application/rlmi+xml', 'application/pidf+xml'):
description = "This script will SUBSCRIBE to the presence event published by the specified SIP target assuming it is a resource list handled by a RLS server. The RLS server will then SUBSCRIBE in behalf of the account, collect NOTIFYs with the presence information of the recipients and provide periodically aggregated NOTIFYs back to the subscriber. If a target address is not specified, it will subscribe to the address 'username-buddies@domain.com', where username and domain are taken from the account's SIP address. It will then interprete PIDF bodies contained in NOTIFYs and display their meaning. The program will un-SUBSCRIBE and quit when CTRL+D is pressed."
parser.add_option("-a", "--account-name", type="string", dest="account_name", help="The name of the account to use.")
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 (disabled by default).")