本文整理汇总了Python中sylk.applications.xmppgateway.logger.log.msg函数的典型用法代码示例。如果您正苦于以下问题:Python msg函数的具体用法?Python msg怎么用?Python msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了msg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _NH_X2SPresenceHandlerDidEnd
def _NH_X2SPresenceHandlerDidEnd(self, notification):
handler = notification.sender
self.x2s_presence_subscriptions.pop((handler.xmpp_identity.uri, handler.sip_identity.uri), None)
notification.center.remove_observer(self, sender=handler)
if XMPPGatewayConfig.log_presence:
log.msg('Presence flow 0x%x ended %s --> %s' % (id(handler), format_uri(handler.xmpp_identity.uri, 'xmpp'), format_uri(handler.sip_identity.uri, 'sip')))
log.msg('%d SIP --> XMPP and %d XMPP --> SIP presence flows are active' % (len(self.s2x_presence_subscriptions.keys()), len(self.x2s_presence_subscriptions.keys())))
开发者ID:madhawa,项目名称:sylkserver,代码行数:7,代码来源:__init__.py
示例2: _NH_SIPSessionDidFail
def _NH_SIPSessionDidFail(self, notification):
log.msg("SIP session %s failed" % self.sip_session.call_id)
notification.center.remove_observer(self, sender=self.sip_session)
notification.center.remove_observer(self, sender=self.msrp_stream)
self.sip_session = None
self.msrp_stream = None
self.end()
开发者ID:madhawa,项目名称:sylkserver,代码行数:7,代码来源:im.py
示例3: _NH_X2SMucInvitationHandlerDidFail
def _NH_X2SMucInvitationHandlerDidFail(self, notification):
handler = notification.sender
sender_uri = handler.sender.uri
muc_uri = handler.recipient.uri
participant_uri = handler.participant.uri
log.msg('%s could not add %s to multiparty chat %s: %s' % (format_uri(sender_uri, 'xmpp'), format_uri(participant_uri), format_uri(muc_uri, 'sip'), notification.data.failure))
del self.x2s_muc_add_participant_handlers[(muc_uri, participant_uri)]
notification.center.remove_observer(self, sender=handler)
开发者ID:madhawa,项目名称:sylkserver,代码行数:8,代码来源:__init__.py
示例4: _NH_ChatSessionDidStart
def _NH_ChatSessionDidStart(self, notification):
handler = notification.sender
log.msg("Chat session established sip:%s <--> xmpp:%s" % (handler.sip_identity.uri, handler.xmpp_identity.uri))
for k, v in self.pending_sessions.items():
if v is handler:
del self.pending_sessions[k]
break
self.chat_sessions.add(handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:8,代码来源:__init__.py
示例5: _NH_S2XMucInvitationHandlerDidFail
def _NH_S2XMucInvitationHandlerDidFail(self, notification):
handler = notification.sender
muc_uri = handler.sender.uri
inviter_uri = handler.inviter.uri
recipient_uri = handler.recipient.uri
log.msg('%s could not add %s to multiparty chat %s: %s' % (format_uri(inviter_uri, 'sip'), format_uri(recipient_uri, 'xmpp'), format_uri(muc_uri, 'sip'), str(notification.data.failure)))
del self.s2x_muc_add_participant_handlers[(muc_uri, recipient_uri)]
notification.center.remove_observer(self, sender=handler)
开发者ID:madhawa,项目名称:sylkserver,代码行数:8,代码来源:__init__.py
示例6: _NH_SIPIncomingSubscriptionDidEnd
def _NH_SIPIncomingSubscriptionDidEnd(self, notification):
subscription = notification.sender
notification.center.remove_observer(self, sender=subscription)
self._sip_subscriptions.remove(subscription)
if XMPPGatewayConfig.log_presence:
log.msg('SIP subscription from %s to %s removed from presence flow 0x%x (%d subs)' % (format_uri(self.sip_identity.uri, 'sip'), format_uri(self.xmpp_identity.uri, 'xmpp'), id(self), len(self._sip_subscriptions)))
if not self._sip_subscriptions:
self.end()
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:8,代码来源:presence.py
示例7: incoming_media_session
def incoming_media_session(self, session):
if session.remote_identity.uri.host not in self.xmpp_manager.domains | self.xmpp_manager.muc_domains:
log.msg("Session rejected: From domain is not a local XMPP domain")
session.reject(403)
return
handler = MediaSessionHandler.new_from_sip_session(session)
if handler is not None:
NotificationCenter().add_observer(self, sender=handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:9,代码来源:__init__.py
示例8: _NH_X2SMucInvitationHandlerDidStart
def _NH_X2SMucInvitationHandlerDidStart(self, notification):
handler = notification.sender
sender_uri = handler.sender.uri
muc_uri = handler.recipient.uri
participant_uri = handler.participant.uri
log.msg(
"%s invited %s to multiparty chat %s"
% (format_uri(sender_uri, "xmpp"), format_uri(participant_uri), format_uri(muc_uri, "sip"))
)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:9,代码来源:__init__.py
示例9: _NH_S2XMucInvitationHandlerDidStart
def _NH_S2XMucInvitationHandlerDidStart(self, notification):
handler = notification.sender
muc_uri = handler.sender.uri
inviter_uri = handler.inviter.uri
recipient_uri = handler.recipient.uri
log.msg(
"%s invited %s to multiparty chat %s"
% (format_uri(inviter_uri, "sip"), format_uri(recipient_uri, "xmpp"), format_uri(muc_uri, "sip"))
)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:9,代码来源:__init__.py
示例10: _NH_SIPIncomingSubscriptionDidTimeout
def _NH_SIPIncomingSubscriptionDidTimeout(self, notification):
if XMPPGatewayConfig.log_presence:
log.msg(
"SIP subscription from %s to %s timed out for presence flow 0x%x (%d subs)"
% (
format_uri(self.sip_identity.uri, "sip"),
format_uri(self.xmpp_identity.uri, "xmpp"),
id(self),
len(self._sip_subscriptions),
)
)
开发者ID:madhawa,项目名称:sylkserver,代码行数:11,代码来源:presence.py
示例11: _NH_SIPIncomingSubscriptionGotUnsubscribe
def _NH_SIPIncomingSubscriptionGotUnsubscribe(self, notification):
if XMPPGatewayConfig.log_presence:
log.msg(
"SIP subscription from %s to %s was terminated by user for presence flow 1x%x (%d subs)"
% (
format_uri(self.sip_identity.uri, "sip"),
format_uri(self.xmpp_identity.uri, "xmpp"),
id(self),
len(self._sip_subscriptions),
)
)
开发者ID:madhawa,项目名称:sylkserver,代码行数:11,代码来源:presence.py
示例12: _NH_S2XMucInvitationHandlerDidEnd
def _NH_S2XMucInvitationHandlerDidEnd(self, notification):
handler = notification.sender
muc_uri = handler.sender.uri
inviter_uri = handler.inviter.uri
recipient_uri = handler.recipient.uri
log.msg(
"%s added %s to multiparty chat %s"
% (format_uri(inviter_uri, "sip"), format_uri(recipient_uri, "xmpp"), format_uri(muc_uri, "sip"))
)
del self.s2x_muc_add_participant_handlers[(muc_uri, recipient_uri)]
notification.center.remove_observer(self, sender=handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:11,代码来源:__init__.py
示例13: _NH_ChatSessionDidFail
def _NH_ChatSessionDidFail(self, notification):
handler = notification.sender
uris = None
for k, v in self.pending_sessions.items():
if v is handler:
uris = k
del self.pending_sessions[k]
break
sip_uri, xmpp_uri = uris
log.msg("Chat session failed sip:%s <--> xmpp:%s (%s)" % (sip_uri, xmpp_uri, notification.data.reason))
notification.center.remove_observer(self, sender=handler)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:11,代码来源:__init__.py
示例14: _NH_SIPIncomingSubscriptionNotifyDidFail
def _NH_SIPIncomingSubscriptionNotifyDidFail(self, notification):
if XMPPGatewayConfig.log_presence:
log.msg(
"Sending SIP NOTIFY failed from %s to %s for presence flow 0x%x: %s (%s)"
% (
format_uri(self.xmpp_identity.uri, "xmpp"),
format_uri(self.sip_identity.uri, "sip"),
id(self),
notification.data.code,
notification.data.reason,
)
)
开发者ID:madhawa,项目名称:sylkserver,代码行数:12,代码来源:presence.py
示例15: _NH_XMPPSubscriptionGotNotify
def _NH_XMPPSubscriptionGotNotify(self, notification):
stanza = notification.data.presence
self._stanza_cache[stanza.sender.uri] = stanza
stanza.timestamp = ISOTimestamp.now() # TODO: mirror the one in the stanza, if present
pidf_doc = self._build_pidf()
if XMPPGatewayConfig.log_presence:
log.msg('XMPP notification from %s to %s for presence flow 0x%x' % (format_uri(self.xmpp_identity.uri, 'xmpp'), format_uri(self.sip_identity.uri, 'sip'), id(self)))
for subscription in self._sip_subscriptions:
try:
subscription.push_content(pidf.PIDFDocument.content_type, pidf_doc)
except SIPCoreError, e:
if XMPPGatewayConfig.log_presence:
log.msg('Failed to send SIP NOTIFY from %s to %s for presence flow 0x%x: %s' % (format_uri(self.xmpp_identity.uri, 'xmpp'), format_uri(self.sip_identity.uri, 'sip'), id(self), e))
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:13,代码来源:presence.py
示例16: _NH_X2SPresenceHandlerDidStart
def _NH_X2SPresenceHandlerDidStart(self, notification):
handler = notification.sender
if XMPPGatewayConfig.log_presence:
log.msg(
"Presence flow 0x%x established %s --> %s"
% (
id(handler),
format_uri(handler.xmpp_identity.uri, "xmpp"),
format_uri(handler.sip_identity.uri, "sip"),
)
)
log.msg(
"%d SIP --> XMPP and %d XMPP --> SIP presence flows are active"
% (len(self.s2x_presence_subscriptions.keys()), len(self.x2s_presence_subscriptions.keys()))
)
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:15,代码来源:__init__.py
示例17: add_sip_subscription
def add_sip_subscription(self, subscription):
# If s subscription is received after the handle has ended but before
# S2XPresenceHandlerDidEnd has been processed we need to ignore it and wait for a retransmission
# which we will handle by creating a new S2XPresenceHandler
if self.ended:
return
self._sip_subscriptions.append(subscription)
NotificationCenter().add_observer(self, sender=subscription)
if self._xmpp_subscription.state == 'active':
pidf_doc = self._pidf
content_type = pidf.PIDFDocument.content_type if pidf_doc is not None else None
subscription.accept(content_type, pidf_doc)
else:
subscription.accept_pending()
if XMPPGatewayConfig.log_presence:
log.msg('SIP subscription from %s to %s added to presence flow 0x%x (%d subs)' % (format_uri(self.sip_identity.uri, 'sip'), format_uri(self.xmpp_identity.uri, 'xmpp'), id(self), len(self._sip_subscriptions)))
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:16,代码来源:presence.py
示例18: start
def start(self):
self.stopped = False
xmpp_logger.start()
config = XMPPGatewayConfig
if config.trace_xmpp and xmpp_logger._xmpptrace_filename is not None:
log.msg('Logging XMPP trace to file "%s"' % xmpp_logger._xmpptrace_filename)
self._s2s_listener = reactor.listenTCP(config.local_port, self._s2s_factory, interface=config.local_ip)
listen_address = self._s2s_listener.getHost()
log.msg("XMPP listener started on %s:%d" % (listen_address.host, listen_address.port))
self.chat_session_manager.start()
self.muc_session_manager.start()
self.subscription_manager.start()
self.jingle_session_manager.start()
notification_center = NotificationCenter()
notification_center.add_observer(self, sender=self._internal_component)
notification_center.add_observer(self, sender=self._muc_component)
self._internal_component.startService()
self._muc_component.startService()
开发者ID:LScarpinati,项目名称:sylkserver,代码行数:18,代码来源:__init__.py
示例19: _NH_JingleSessionDidStart
def _NH_JingleSessionDidStart(self, notification):
log.msg("Jingle session %s started" % notification.sender.id)
if self.jingle_session.direction == 'incoming':
# Both sessions have been accepted now
self.started = True
try:
audio_stream = next(stream for stream in self.jingle_session.streams if stream.type=='audio')
except StopIteration:
pass
else:
self._audio_bidge.add(audio_stream)
else:
# Time to accept the Jingle session and bridge them together
try:
audio_stream = next(stream for stream in self.jingle_session.streams if stream.type=='audio')
except StopIteration:
pass
else:
self._audio_bidge.add(audio_stream)
self.sip_session.accept(self.sip_session.proposed_streams)
开发者ID:AGProjects,项目名称:sylkserver,代码行数:20,代码来源:media.py
示例20: _NH_SIPSessionDidStart
def _NH_SIPSessionDidStart(self, notification):
log.msg("SIP session %s started" % self.sip_session.call_id)
if self.sip_session.direction == 'outgoing':
# Time to accept the Jingle session and bridge them together
try:
audio_stream = next(stream for stream in self.sip_session.streams if stream.type=='audio')
except StopIteration:
pass
else:
self._audio_bidge.add(audio_stream)
self.jingle_session.accept(self.jingle_session.proposed_streams, is_focus=self.sip_session.remote_focus)
else:
# Both sessions have been accepted now
self.started = True
try:
audio_stream = next(stream for stream in self.sip_session.streams if stream.type=='audio')
except StopIteration:
pass
else:
self._audio_bidge.add(audio_stream)
开发者ID:AGProjects,项目名称:sylkserver,代码行数:20,代码来源:media.py
注:本文中的sylk.applications.xmppgateway.logger.log.msg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论