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
6b8d1df8
Commit
6b8d1df8
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#16852: Add on_new_call_created signal handler
parent
817dc506
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/SFLPhoneHome.java
+78
-50
78 additions, 50 deletions
src/com/savoirfairelinux/sflphone/client/SFLPhoneHome.java
src/com/savoirfairelinux/sflphone/service/CallManagerCallBack.java
+5
-0
5 additions, 0 deletions
...avoirfairelinux/sflphone/service/CallManagerCallBack.java
with
83 additions
and
50 deletions
src/com/savoirfairelinux/sflphone/client/SFLPhoneHome.java
+
78
−
50
View file @
6b8d1df8
...
...
@@ -68,6 +68,7 @@ import android.widget.TextView;
import
com.savoirfairelinux.sflphone.R
;
import
com.savoirfairelinux.sflphone.service.ISipService
;
import
com.savoirfairelinux.sflphone.service.SipService
;
import
com.savoirfairelinux.sflphone.utils.AccountList
;
import
java.util.HashMap
;
...
...
@@ -89,6 +90,7 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
CallElementList
mCallElementList
;
private
boolean
mBound
=
false
;
private
ISipService
service
;
public
AccountList
mAccountList
=
new
AccountList
();
/**
* The {@link ViewPager} that will host the section contents.
...
...
@@ -395,64 +397,19 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
@Override
public
void
onClick
(
View
view
)
{
Log
.
i
(
"SFLPhoneHome"
,
"onClic from SFLPhoneHome"
);
Log
.
i
(
TAG
,
"onClic from SFLPhoneHome"
);
buttonService
=
(
Button
)
findViewById
(
R
.
id
.
buttonService
);
try
{
switch
(
view
.
getId
())
{
case
R
.
id
.
buttonCall
:
TextView
textView
=
(
TextView
)
findViewById
(
R
.
id
.
editAccountID
);
String
accountID
=
textView
.
getText
().
toString
();
EditText
editText
;
Random
random
=
new
Random
();
if
(
incomingCallID
!=
""
)
{
buttonCall
.
clearAnimation
();
service
.
accept
(
incomingCallID
);
callID
=
incomingCallID
;
incomingCallID
=
""
;
callOnGoing
=
true
;
buttonCall
.
setEnabled
(
false
);
buttonHangup
.
setEnabled
(
true
);
}
else
{
if
(
callOnGoing
==
false
)
{
editText
=
(
EditText
)
findViewById
(
R
.
id
.
editTo
);
String
to
=
editText
.
getText
().
toString
();
if
(
to
==
null
)
{
Log
.
e
(
TAG
,
"to string is "
+
to
);
break
;
}
callID
=
Integer
.
toString
(
random
.
nextInt
());
Log
.
d
(
TAG
,
"service.placeCall("
+
accountID
+
", "
+
callID
+
", "
+
to
+
");"
);
service
.
placeCall
(
accountID
,
callID
,
to
);
callOnGoing
=
true
;
buttonCall
.
setEnabled
(
false
);
buttonHangup
.
setEnabled
(
true
);
}
}
Log
.
i
(
TAG
,
"Processing new call action"
);
processingNewCallAction
();
break
;
case
R
.
id
.
buttonHangUp
:
if
(
incomingCallID
!=
""
)
{
buttonCall
.
clearAnimation
();
Log
.
d
(
TAG
,
"service.refuse("
+
incomingCallID
+
");"
);
service
.
refuse
(
incomingCallID
);
incomingCallID
=
""
;
buttonCall
.
setEnabled
(
true
);
buttonHangup
.
setEnabled
(
true
);
}
else
{
if
(
callOnGoing
==
true
)
{
Log
.
d
(
TAG
,
"service.hangUp("
+
callID
+
");"
);
service
.
hangUp
(
callID
);
callOnGoing
=
false
;
buttonCall
.
setEnabled
(
true
);
buttonHangup
.
setEnabled
(
false
);
}
}
buttonCall
.
setImageResource
(
R
.
drawable
.
ic_call
);
Log
.
i
(
TAG
,
"Processing hangup action"
);
processingHangUpAction
();
break
;
case
R
.
id
.
buttonInit
:
Log
.
i
(
TAG
,
"R.id.buttonInit"
);
...
...
@@ -479,4 +436,75 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
}
public
void
processingNewCallAction
()
{
Log
.
d
(
TAG
,
"ProcessingNewCallAction()"
);
TextView
textView
=
(
TextView
)
findViewById
(
R
.
id
.
editAccountID
);
String
accountID
=
mAccountList
.
currentAccountID
;
// String accountID = textView.getText().toString();
// buttonCall.setImageResource(R.drawable.ic_call);
EditText
editText
;
Random
random
=
new
Random
();
try
{
if
(
incomingCallID
!=
""
)
{
Log
.
d
(
TAG
,
"Incoming Call Branch"
);
buttonCall
.
clearAnimation
();
service
.
accept
(
incomingCallID
);
callID
=
incomingCallID
;
incomingCallID
=
""
;
callOnGoing
=
true
;
buttonCall
.
setEnabled
(
false
);
buttonHangup
.
setEnabled
(
true
);
}
else
{
//if (callOnGoing == false) {
Log
.
d
(
TAG
,
"Outgoing Call Branch"
);
editText
=
(
EditText
)
findViewById
(
R
.
id
.
editTo
);
String
to
=
"147"
;
// editText.getText().toString();
Log
.
d
(
TAG
,
"to string is "
+
to
);
if
(
to
==
null
)
{
Log
.
e
(
TAG
,
"to string is "
+
to
);
return
;
}
callID
=
Integer
.
toString
(
random
.
nextInt
());
Log
.
d
(
TAG
,
"service.placeCall("
+
accountID
+
", "
+
callID
+
", "
+
to
+
");"
);
service
.
placeCall
(
accountID
,
callID
,
to
);
callOnGoing
=
true
;
buttonCall
.
setEnabled
(
false
);
buttonHangup
.
setEnabled
(
true
);
//}
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
}
public
void
processingHangUpAction
()
{
try
{
if
(
incomingCallID
!=
""
)
{
buttonCall
.
clearAnimation
();
Log
.
d
(
TAG
,
"service.refuse("
+
incomingCallID
+
");"
);
service
.
refuse
(
incomingCallID
);
incomingCallID
=
""
;
buttonCall
.
setEnabled
(
true
);
buttonHangup
.
setEnabled
(
true
);
}
else
{
if
(
callOnGoing
==
true
)
{
Log
.
d
(
TAG
,
"service.hangUp("
+
callID
+
");"
);
service
.
hangUp
(
callID
);
callOnGoing
=
false
;
buttonCall
.
setEnabled
(
true
);
buttonHangup
.
setEnabled
(
false
);
}
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
buttonCall
.
setImageResource
(
R
.
drawable
.
ic_call
);
}
}
This diff is collapsed.
Click to expand it.
src/com/savoirfairelinux/sflphone/service/CallManagerCallBack.java
+
5
−
0
View file @
6b8d1df8
...
...
@@ -6,6 +6,11 @@ public class CallManagerCallBack extends Callback {
private
static
final
String
TAG
=
"CallManagerCallBack"
;
@Override
public
void
on_new_call_created
(
String
accountID
,
String
callID
,
String
to
)
{
Log
.
d
(
TAG
,
"on_new_call_created("
+
accountID
+
", "
+
callID
+
", "
+
to
+
")"
);
}
@Override
public
void
on_incoming_call
(
String
accountID
,
String
callID
,
String
from
)
{
Log
.
d
(
TAG
,
"on_incoming_call("
+
accountID
+
", "
+
callID
+
", "
+
from
+
")"
);
...
...
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