changeset ea637f2d4192 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=ea637f2d4192
description: workaround for psi, little fixes...
diffstat:
src/common/jingle.py | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diffs (76 lines):
diff -r b986fe5b2cf7 -r ea637f2d4192 src/common/jingle.py
--- a/src/common/jingle.py Sat Sep 26 23:07:09 2009 +0200
+++ b/src/common/jingle.py Sun Sep 27 22:56:09 2009 +0200
@@ -119,7 +119,7 @@
'security-info': [self.__defaultCB], #TODO
'session-accept': [self.__sessionAcceptCB,
self.__contentAcceptCB,
self.__broadcastCB, self.__defaultCB],
- 'session-info': [self.__sessionInfoCB,
self.__broadcastCB],
+ 'session-info': [self.__sessionInfoCB,
self.__broadcastCB, self.__defaultCB],
'session-initiate': [self.__sessionInitiateCB,
self.__broadcastCB,
self.__defaultCB],
'session-terminate': [self.__sessionTerminateCB,
self.__broadcastAllCB,
@@ -359,6 +359,7 @@
raise xmpp.NodeProcessed
def __sessionInfoCB(self, stanza, jingle, error, action):
+ #TODO: ringing, active, (un)hold, (un)mute
payload = jingle.getPayload()
if len(payload) > 0:
self.__send_error(stanza, 'feature-not-implemented',
'unsupported-info')
@@ -668,6 +669,7 @@
#self.creator = None
#self.name = None
self.accepted = False
+ self.sent = False
self.candidates = [] # Local transport candidates
self.senders = 'both' #FIXME
@@ -697,7 +699,7 @@
def is_ready(self):
#print '[%s] %s, %s' % (self.media, self.candidates_ready,
# self.p2psession.get_property('codecs-ready'))
- return (self.accepted and self.candidates_ready
+ return (self.accepted and self.candidates_ready and not
self.sent
and self.p2psession.get_property('codecs-ready'))
def stanzaCB(self, stanza, content, error, action):
@@ -792,6 +794,8 @@
''' Add our things to session-initiate stanza. '''
self._fillContent(content)
+ self.sent = True
+
if self.candidates and self.candidates[0].username and \
self.candidates[0].password:
attrs = {'ufrag': self.candidates[0].username,
@@ -843,6 +847,9 @@
self.p2psession =
self.conference.new_session(self.farsight_media)
participant =
self.conference.new_participant(self.session.peerjid)
+ #FIXME: Consider a workaround, here...
+ # pidgin and telepathy-gabble don't follow the XEP, and it
won't work
+ # due to bad controlling-mode
params = {'controlling-mode': self.session.weinitiate,#
'debug': False}
'stun-ip': '69.0.208.27', 'debug': False}
@@ -968,12 +975,15 @@
JingleRTPContent.setup_stream(self)
# Configure SPEEX
- #FIXME: codec ID is an important thing for psi (and pidgin?)
- # So, if it doesn't work with pidgin or psi, LOOK AT THIS
+ # Workaround for psi (not needed since rev
+ # 147aedcea39b43402fe64c533d1866a25449888a):
+ # place 16kHz before 8kHz, as buggy psi versions will take in
+ # account only the first codec
+
codecs = [farsight.Codec(farsight.CODEC_ID_ANY, 'SPEEX',
- farsight.MEDIA_TYPE_AUDIO, 8000),
+ farsight.MEDIA_TYPE_AUDIO, 16000),
farsight.Codec(farsight.CODEC_ID_ANY, 'SPEEX',
- farsight.MEDIA_TYPE_AUDIO, 16000)]
+ farsight.MEDIA_TYPE_AUDIO, 8000)]
self.p2psession.set_codec_preferences(codecs)
# the local parts
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits