def _NH_SelfPresenceSubscriptionGotNotify(self, notification): if notification.data.body and notification.data.content_type == PIDFDocument.content_type: try: pidf_doc = PIDFDocument.parse(notification.data.body) except ParserError: pass else: if pidf_doc.entity.partition('sip:')[2] != self.id: return notification.center.post_notification('SIPAccountGotSelfPresenceState', sender=self, data=NotificationData(pidf=pidf_doc))
def _NH_SelfPresenceSubscriptionGotNotify(self, notification): if notification.data.body and notification.data.content_type == PIDFDocument.content_type: try: pidf_doc = PIDFDocument.parse(notification.data.body) except ParserError: pass else: if pidf_doc.entity.partition('sip:')[2] != self.id: return notification.center.post_notification( 'SIPAccountGotSelfPresenceState', sender=self, data=NotificationData(pidf=pidf_doc))
""" CIPID handling according to RFC4482 This module provides an extension to PIDF to provide additional contact information about a presentity. """ from sipsimple.payloads import XMLAnyURIElement, XMLLocalizedStringElement from sipsimple.payloads.pidf import PIDFDocument, ServiceExtension, PersonExtension, Service, Person __all__ = [ 'namespace', 'Card', 'DisplayName', 'Homepage', 'Icon', 'Map', 'Sound' ] namespace = "urn:ietf:params:xml:ns:pidf:cipid" PIDFDocument.register_namespace(namespace, prefix='c', schema='cipid.xsd') class Card(XMLAnyURIElement, PersonExtension, ServiceExtension): _xml_tag = 'card' _xml_namespace = namespace _xml_document = PIDFDocument Person.register_extension('card', type=Card) Service.register_extension('card', type=Card) class DisplayName(XMLLocalizedStringElement, PersonExtension, ServiceExtension): _xml_tag = 'display-name'
'ExtensionsExtension', 'DeviceCapabilitiesExtension', 'MobilityExtension', # Extensions 'FileTransfer', 'ScreenSharingServer', 'ScreenSharingClient'] from sipsimple.payloads import XMLStringElement, XMLLocalizedStringElement, XMLBooleanElement, XMLElement, XMLEmptyElement from sipsimple.payloads import XMLElementChild, XMLListElement, XMLStringListElement, XMLAttribute, XMLEmptyElementRegistryType from sipsimple.payloads.pidf import PIDFDocument, ServiceExtension, Service, DeviceExtension, Device namespace = "urn:ietf:params:xml:ns:pidf:caps" PIDFDocument.register_namespace(namespace, prefix='caps', schema='caps.xsd') # Marker mixins class EventPackagesExtension(object): pass class PriorityExtension(object): pass class MethodsExtension(object): pass class ExtensionsExtension(object): pass class MobilityExtension(object): pass class DeviceCapabilitiesExtension(object): pass class ServiceCapabilitiesExtension(object): pass class ContentTypeValue(str): def __new__(cls, value):
'StatusIcon', 'TimeOffset', 'UserInput', 'Class'] from lxml import etree from sipsimple.payloads import ValidationError, XMLElementType, XMLEmptyElementRegistryType, XMLAttribute, XMLElementChild, XMLStringChoiceChild from sipsimple.payloads import XMLElement, XMLEmptyElement, XMLStringElement, XMLLocalizedStringElement, XMLStringListElement from sipsimple.payloads.pidf import PIDFDocument, ServiceExtension, PersonExtension, DeviceExtension, Note, NoteMap, NoteList, Service, Person, Device from sipsimple.payloads.datatypes import UnsignedLong, DateTime, ID namespace = 'urn:ietf:params:xml:ns:pidf:rpid' PIDFDocument.register_namespace(namespace, prefix='rpid', schema='rpid.xsd') ## Marker mixins class ActivityElement(object): pass class MoodElement(object): pass class PlaceTypeElement(object): pass class PrivacyElement(object): pass class RelationshipElement(object): pass class ServiceClassElement(object): pass class SphereElement(object): pass ## Attribute value types
# """ CIPID handling according to RFC4482 This module provides an extension to PIDF to provide additional contact information about a presentity. """ from sipsimple.payloads import XMLAnyURIElement, XMLLocalizedStringElement from sipsimple.payloads.pidf import PIDFDocument, ServiceExtension, PersonExtension, Service, Person __all__ = ["namespace", "Card", "DisplayName", "Homepage", "Icon", "Map", "Sound"] namespace = "urn:ietf:params:xml:ns:pidf:cipid" PIDFDocument.register_namespace(namespace, prefix="c", schema="cipid.xsd") class Card(XMLAnyURIElement, PersonExtension, ServiceExtension): _xml_tag = "card" _xml_namespace = namespace _xml_document = PIDFDocument Person.register_extension("card", type=Card) Service.register_extension("card", type=Card) class DisplayName(XMLLocalizedStringElement, PersonExtension, ServiceExtension): _xml_tag = "display-name" _xml_namespace = namespace
'MethodsExtension', 'ExtensionsExtension', 'DeviceCapabilitiesExtension', 'MobilityExtension', # Extensions 'FileTransfer', 'ScreenSharingServer', 'ScreenSharingClient' ] from sipsimple.payloads import XMLStringElement, XMLLocalizedStringElement, XMLBooleanElement, XMLElement, XMLEmptyElement from sipsimple.payloads import XMLElementChild, XMLListElement, XMLStringListElement, XMLAttribute, XMLEmptyElementRegistryType from sipsimple.payloads.pidf import PIDFDocument, ServiceExtension, Service, DeviceExtension, Device namespace = "urn:ietf:params:xml:ns:pidf:caps" PIDFDocument.register_namespace(namespace, prefix='caps', schema='caps.xsd') # Marker mixins class EventPackagesExtension(object): pass class PriorityExtension(object): pass class MethodsExtension(object): pass