Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-client-android
Commits
08545aec
Commit
08545aec
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#17013: Move in SipCall logic to prevent action occuring in wrong state
parent
6c25a1e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/savoirfairelinux/sflphone/client/CallActivity.java
+3
-15
3 additions, 15 deletions
src/com/savoirfairelinux/sflphone/client/CallActivity.java
src/com/savoirfairelinux/sflphone/client/SipCall.java
+39
-10
39 additions, 10 deletions
src/com/savoirfairelinux/sflphone/client/SipCall.java
with
42 additions
and
25 deletions
src/com/savoirfairelinux/sflphone/client/CallActivity.java
+
3
−
15
View file @
08545aec
...
...
@@ -129,26 +129,14 @@ public class CallActivity extends Activity implements OnClickListener
mCall
.
notifyServiceAnswer
(
service
);
break
;
case
R
.
id
.
buttonhangup
:
if
((
mCall
.
getCallStateInt
()
==
SipCall
.
CALL_STATE_NONE
)
||
(
mCall
.
getCallStateInt
()
==
SipCall
.
CALL_STATE_CURRENT
)
||
(
mCall
.
getCallStateInt
()
==
SipCall
.
CALL_STATE_HOLD
))
{
mCall
.
notifyServiceHangup
(
service
);
if
(
mCall
.
notifyServiceHangup
(
service
))
finish
();
}
else
if
(
mCall
.
getCallStateInt
()
==
SipCall
.
CALL_STATE_RINGING
)
{
mCall
.
notifyServiceRefuse
(
service
);
finish
();
}
break
;
case
R
.
id
.
buttonhold
:
if
(
mCall
.
getCallStateInt
()
==
SipCall
.
CALL_STATE_CURRENT
)
{
mCall
.
notifyServiceHold
(
service
);
}
mCall
.
notifyServiceHold
(
service
);
break
;
case
R
.
id
.
buttonunhold
:
if
(
mCall
.
getCallStateInt
()
==
SipCall
.
CALL_STATE_HOLD
)
{
mCall
.
notifyServiceUnhold
(
service
);
}
mCall
.
notifyServiceUnhold
(
service
);
break
;
default
:
Log
.
e
(
TAG
,
"Invalid button clicked"
);
...
...
This diff is collapsed.
Click to expand it.
src/com/savoirfairelinux/sflphone/client/SipCall.java
+
39
−
10
View file @
08545aec
...
...
@@ -299,12 +299,12 @@ public class SipCall
}
public
void
notifyServiceAnswer
(
ISipService
service
)
public
boolean
notifyServiceAnswer
(
ISipService
service
)
{
int
callState
=
getCallStateInt
();
if
((
callState
!=
CALL_STATE_RINGING
)
&&
(
callState
!=
CALL_STATE_NONE
))
{
return
;
return
false
;
}
try
{
...
...
@@ -312,6 +312,8 @@ public class SipCall
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
return
true
;
}
/**
...
...
@@ -331,40 +333,67 @@ public class SipCall
/**
* Perform hangup action and send request to the service
*/
public
void
notifyServiceHangup
(
ISipService
service
)
public
boolean
notifyServiceHangup
(
ISipService
service
)
{
try
{
service
.
hangUp
(
mCallInfo
.
mCallID
);
if
((
getCallStateInt
()
==
SipCall
.
CALL_STATE_NONE
)
||
(
getCallStateInt
()
==
SipCall
.
CALL_STATE_CURRENT
)
||
(
getCallStateInt
()
==
SipCall
.
CALL_STATE_HOLD
))
{
service
.
hangUp
(
mCallInfo
.
mCallID
);
return
true
;
}
else
if
(
getCallStateInt
()
==
SipCall
.
CALL_STATE_RINGING
)
{
service
.
refuse
(
mCallInfo
.
mCallID
);
return
true
;
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
return
false
;
}
public
void
notifyServiceRefuse
(
ISipService
service
)
public
boolean
notifyServiceRefuse
(
ISipService
service
)
{
try
{
service
.
refuse
(
mCallInfo
.
mCallID
);
if
(
getCallStateInt
()
==
SipCall
.
CALL_STATE_RINGING
)
{
service
.
refuse
(
mCallInfo
.
mCallID
);
return
true
;
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
return
false
;
}
public
void
notifyServiceHold
(
ISipService
service
)
public
boolean
notifyServiceHold
(
ISipService
service
)
{
try
{
service
.
hold
(
mCallInfo
.
mCallID
);
if
(
getCallStateInt
()
==
SipCall
.
CALL_STATE_CURRENT
)
{
service
.
hold
(
mCallInfo
.
mCallID
);
return
true
;
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
return
false
;
}
public
void
notifyServiceUnhold
(
ISipService
service
)
public
boolean
notifyServiceUnhold
(
ISipService
service
)
{
try
{
service
.
unhold
(
mCallInfo
.
mCallID
);
if
(
getCallStateInt
()
==
SipCall
.
CALL_STATE_HOLD
)
{
service
.
unhold
(
mCallInfo
.
mCallID
);
return
true
;
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
return
false
;
}
public
void
addToConference
()
...
...
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