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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
6b8d1df8
Commit
6b8d1df8
authored
Oct 23, 2012
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#16852: Add on_new_call_created signal handler
parent
817dc506
No related branches found
No related tags found
No related merge requests found
Changes
2
Show 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;
...
@@ -68,6 +68,7 @@ import android.widget.TextView;
import
com.savoirfairelinux.sflphone.R
;
import
com.savoirfairelinux.sflphone.R
;
import
com.savoirfairelinux.sflphone.service.ISipService
;
import
com.savoirfairelinux.sflphone.service.ISipService
;
import
com.savoirfairelinux.sflphone.service.SipService
;
import
com.savoirfairelinux.sflphone.service.SipService
;
import
com.savoirfairelinux.sflphone.utils.AccountList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -89,6 +90,7 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
...
@@ -89,6 +90,7 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
CallElementList
mCallElementList
;
CallElementList
mCallElementList
;
private
boolean
mBound
=
false
;
private
boolean
mBound
=
false
;
private
ISipService
service
;
private
ISipService
service
;
public
AccountList
mAccountList
=
new
AccountList
();
/**
/**
* The {@link ViewPager} that will host the section contents.
* The {@link ViewPager} that will host the section contents.
...
@@ -395,19 +397,59 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
...
@@ -395,19 +397,59 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
@Override
@Override
public
void
onClick
(
View
view
)
public
void
onClick
(
View
view
)
{
{
Log
.
i
(
"SFLPhoneHome"
,
"onClic from SFLPhoneHome"
);
Log
.
i
(
TAG
,
"onClic from SFLPhoneHome"
);
buttonService
=
(
Button
)
findViewById
(
R
.
id
.
buttonService
);
buttonService
=
(
Button
)
findViewById
(
R
.
id
.
buttonService
);
try
{
try
{
switch
(
view
.
getId
())
{
switch
(
view
.
getId
())
{
case
R
.
id
.
buttonCall
:
case
R
.
id
.
buttonCall
:
Log
.
i
(
TAG
,
"Processing new call action"
);
processingNewCallAction
();
break
;
case
R
.
id
.
buttonHangUp
:
Log
.
i
(
TAG
,
"Processing hangup action"
);
processingHangUpAction
();
break
;
case
R
.
id
.
buttonInit
:
Log
.
i
(
TAG
,
"R.id.buttonInit"
);
// String audioPlugin = service.getCurrentAudioOutputPlugin();
HashMap
<
String
,
String
>
map
=
(
HashMap
<
String
,
String
>)
service
.
getAccountDetails
(
"Account:1345153770"
);
break
;
case
R
.
id
.
buttonService
:
if
(!
serviceIsOn
)
{
startService
(
new
Intent
(
this
,
SipService
.
class
));
serviceIsOn
=
true
;
buttonService
.
setText
(
"disable Service"
);
}
else
{
stopService
(
new
Intent
(
this
,
SipService
.
class
));
serviceIsOn
=
false
;
buttonService
.
setText
(
"enable Service"
);
}
break
;
default
:
Log
.
w
(
TAG
,
"unknown button "
+
view
.
getId
());
break
;
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
}
public
void
processingNewCallAction
()
{
Log
.
d
(
TAG
,
"ProcessingNewCallAction()"
);
TextView
textView
=
(
TextView
)
findViewById
(
R
.
id
.
editAccountID
);
TextView
textView
=
(
TextView
)
findViewById
(
R
.
id
.
editAccountID
);
String
accountID
=
textView
.
getText
().
toString
();
String
accountID
=
mAccountList
.
currentAccountID
;
// String accountID = textView.getText().toString();
// buttonCall.setImageResource(R.drawable.ic_call);
EditText
editText
;
EditText
editText
;
Random
random
=
new
Random
();
Random
random
=
new
Random
();
try
{
if
(
incomingCallID
!=
""
)
{
if
(
incomingCallID
!=
""
)
{
Log
.
d
(
TAG
,
"Incoming Call Branch"
);
buttonCall
.
clearAnimation
();
buttonCall
.
clearAnimation
();
service
.
accept
(
incomingCallID
);
service
.
accept
(
incomingCallID
);
callID
=
incomingCallID
;
callID
=
incomingCallID
;
...
@@ -416,12 +458,14 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
...
@@ -416,12 +458,14 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
buttonCall
.
setEnabled
(
false
);
buttonCall
.
setEnabled
(
false
);
buttonHangup
.
setEnabled
(
true
);
buttonHangup
.
setEnabled
(
true
);
}
else
{
}
else
{
if
(
callOnGoing
==
false
)
{
//if (callOnGoing == false) {
Log
.
d
(
TAG
,
"Outgoing Call Branch"
);
editText
=
(
EditText
)
findViewById
(
R
.
id
.
editTo
);
editText
=
(
EditText
)
findViewById
(
R
.
id
.
editTo
);
String
to
=
editText
.
getText
().
toString
();
String
to
=
"147"
;
// editText.getText().toString();
Log
.
d
(
TAG
,
"to string is "
+
to
);
if
(
to
==
null
)
{
if
(
to
==
null
)
{
Log
.
e
(
TAG
,
"to string is "
+
to
);
Log
.
e
(
TAG
,
"to string is "
+
to
);
break
;
return
;
}
}
callID
=
Integer
.
toString
(
random
.
nextInt
());
callID
=
Integer
.
toString
(
random
.
nextInt
());
...
@@ -431,10 +475,16 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
...
@@ -431,10 +475,16 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
callOnGoing
=
true
;
callOnGoing
=
true
;
buttonCall
.
setEnabled
(
false
);
buttonCall
.
setEnabled
(
false
);
buttonHangup
.
setEnabled
(
true
);
buttonHangup
.
setEnabled
(
true
);
//}
}
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
e
);
}
}
}
}
break
;
case
R
.
id
.
buttonHangUp
:
public
void
processingHangUpAction
()
{
try
{
if
(
incomingCallID
!=
""
)
{
if
(
incomingCallID
!=
""
)
{
buttonCall
.
clearAnimation
();
buttonCall
.
clearAnimation
();
Log
.
d
(
TAG
,
"service.refuse("
+
incomingCallID
+
");"
);
Log
.
d
(
TAG
,
"service.refuse("
+
incomingCallID
+
");"
);
...
@@ -451,32 +501,10 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
...
@@ -451,32 +501,10 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
buttonHangup
.
setEnabled
(
false
);
buttonHangup
.
setEnabled
(
false
);
}
}
}
}
buttonCall
.
setImageResource
(
R
.
drawable
.
ic_call
);
break
;
case
R
.
id
.
buttonInit
:
Log
.
i
(
TAG
,
"R.id.buttonInit"
);
// String audioPlugin = service.getCurrentAudioOutputPlugin();
HashMap
<
String
,
String
>
map
=
(
HashMap
<
String
,
String
>)
service
.
getAccountDetails
(
"Account:1345153770"
);
break
;
case
R
.
id
.
buttonService
:
if
(!
serviceIsOn
)
{
startService
(
new
Intent
(
this
,
SipService
.
class
));
serviceIsOn
=
true
;
buttonService
.
setText
(
"disable Service"
);
}
else
{
stopService
(
new
Intent
(
this
,
SipService
.
class
));
serviceIsOn
=
false
;
buttonService
.
setText
(
"enable Service"
);
}
break
;
default
:
Log
.
w
(
TAG
,
"unknown button "
+
view
.
getId
());
break
;
}
}
catch
(
RemoteException
e
)
{
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"Cannot call service method"
,
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 {
...
@@ -6,6 +6,11 @@ public class CallManagerCallBack extends Callback {
private
static
final
String
TAG
=
"CallManagerCallBack"
;
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
@Override
public
void
on_incoming_call
(
String
accountID
,
String
callID
,
String
from
)
{
public
void
on_incoming_call
(
String
accountID
,
String
callID
,
String
from
)
{
Log
.
d
(
TAG
,
"on_incoming_call("
+
accountID
+
", "
+
callID
+
", "
+
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
sign in
to comment