Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
d7560ed7
Commit
d7560ed7
authored
15 years ago
by
Thibg
Browse files
Options
Downloads
Patches
Plain Diff
My last commit was useless... now terminate the session if the connection fails
parent
a4e019ee
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/jingle.py
+11
-10
11 additions, 10 deletions
src/common/jingle.py
with
11 additions
and
10 deletions
src/common/jingle.py
+
11
−
10
View file @
d7560ed7
...
...
@@ -141,7 +141,7 @@ class JingleSession(object):
'''
reason
=
xmpp
.
Node
(
'
reason
'
)
reason
.
addChild
(
'
decline
'
)
self
.
_
_
session_terminate
(
reason
)
self
.
_session_terminate
(
reason
)
def
end_session
(
self
):
'''
Called when user stops or cancel session in UI.
'''
...
...
@@ -150,7 +150,7 @@ class JingleSession(object):
reason
.
addChild
(
'
success
'
)
else
:
reason
.
addChild
(
'
cancel
'
)
self
.
_
_
session_terminate
(
reason
)
self
.
_session_terminate
(
reason
)
'''
Middle-level functions to manage contents. Handle local content
cache and send change notifications.
'''
...
...
@@ -313,7 +313,7 @@ class JingleSession(object):
if
len
(
self
.
contents
)
==
0
:
reason
=
xmpp
.
Node
(
'
reason
'
)
reason
.
setTag
(
'
success
'
)
#FIXME: Is it the good one?
self
.
_
_
session_terminate
(
reason
)
self
.
_session_terminate
(
reason
)
def
__sessionAcceptCB
(
self
,
stanza
,
jingle
,
error
,
action
):
if
self
.
state
!=
JingleStates
.
pending
:
#FIXME
...
...
@@ -371,7 +371,7 @@ class JingleSession(object):
reason
=
xmpp
.
Node
(
'
reason
'
)
reason
.
setTag
(
'
unsupported-applications
'
)
self
.
__defaultCB
(
stanza
,
jingle
,
error
,
action
)
self
.
_
_
session_terminate
(
reason
)
self
.
_session_terminate
(
reason
)
raise
xmpp
.
NodeProcessed
if
not
transports_ok
:
...
...
@@ -379,7 +379,7 @@ class JingleSession(object):
reason
=
xmpp
.
Node
(
'
reason
'
)
reason
.
setTag
(
'
unsupported-transports
'
)
self
.
__defaultCB
(
stanza
,
jingle
,
error
,
action
)
self
.
_
_
session_terminate
(
reason
)
self
.
_session_terminate
(
reason
)
raise
xmpp
.
NodeProcessed
self
.
state
=
JingleStates
.
pending
...
...
@@ -497,7 +497,7 @@ class JingleSession(object):
jingle
.
addChild
(
node
=
payload
)
self
.
connection
.
connection
.
send
(
stanza
)
def
_
_session_terminate
(
self
,
reason
=
None
):
def
_session_terminate
(
self
,
reason
=
None
):
assert
self
.
state
!=
JingleStates
.
ended
stanza
,
jingle
=
self
.
__make_jingle
(
'
session-terminate
'
)
if
reason
is
not
None
:
...
...
@@ -742,7 +742,11 @@ class JingleRTPContent(JingleContent):
elif
name
==
'
farsight-component-state-changed
'
:
state
=
message
.
structure
[
'
state
'
]
print
message
.
structure
[
'
component
'
],
state
if
state
==
farsight
.
STREAM_STATE_READY
:
if
state
==
farsight
.
STREAM_STATE_FAILED
:
reason
=
xmpp
.
Node
(
'
reason
'
)
reason
.
setTag
(
'
failed-transport
'
)
self
.
session
.
_session_terminate
(
reason
)
elif
state
==
farsight
.
STREAM_STATE_READY
:
self
.
negotiated
=
True
#TODO: farsight.DIRECTION_BOTH only if senders='both'
self
.
p2pstream
.
set_property
(
'
direction
'
,
farsight
.
DIRECTION_BOTH
)
...
...
@@ -948,9 +952,6 @@ class ConnectionJingle(object):
raise
xmpp
.
NodeProcessed
def
addJingleIqCallback
(
self
,
jid
,
id
,
jingle
):
self
.
__iq_responses
[(
jid
,
id
)]
=
jingle
def
startVoIP
(
self
,
jid
):
jingle
=
JingleSession
(
self
,
weinitiate
=
True
,
jid
=
jid
)
self
.
add_jingle
(
jingle
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment