|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.java.sip.communicator.plugin.scphone.SCPhoneActivator
public class SCPhoneActivator
The responsability of the scphone plugin is to manage interactivity with an usb phone by linking it to sc. It gives to the user the ability to make and answer calls from a usb phone device, without using the sc GUI or headphones.
Field Summary | |
---|---|
private BundleContext |
bundleContext
|
private net.java.sip.communicator.service.callhistory.CallHistoryService |
callHS
used to retrive passsed and/or missed calls |
private java.util.Hashtable |
contactList
Hastable mapping a user address to the Contact representing that user |
private net.java.sip.communicator.service.protocol.Call |
currentCall
call currently runing on the phone |
private java.util.Hashtable |
histCall
Hastable mapping a call ids to a CallParticipantRecord |
private int |
histCallCount
number of callrecord to retrieve when needed |
private net.java.sip.communicator.util.Logger |
logger
|
private SCPhone |
phone
The SCPhone object that communicate with the phone device |
private java.util.Vector |
ppsVector
A vector of ProtocolProviderServices which supports OperationSetBasicTelephony |
private net.java.sip.communicator.service.protocol.ProtocolProviderService |
primaryProtocolProvider
We use this protocol provider for issue calls when there is not a default protocol provider. |
private java.lang.String |
usernameList
A String containing, comma separated userfriendly username of contacts |
Constructor Summary | |
---|---|
SCPhoneActivator()
|
Method Summary | |
---|---|
void |
callEnded(net.java.sip.communicator.service.protocol.event.CallEvent event)
CallListener implementation for callEnded |
private java.lang.StringBuffer |
getUsernamesList(net.java.sip.communicator.service.protocol.ContactGroup cg)
compute a comma separated string list of contacts's usernames in a specified group. |
private void |
handleProviderAdded(net.java.sip.communicator.service.protocol.ProtocolProviderService provider)
Used to attach the phone manager to existing or just registered protocol provider. |
private void |
handleProviderRemoved(net.java.sip.communicator.service.protocol.ProtocolProviderService provider)
Removes the specified provider from the list of currently known providers and ignores all the calls made by it |
private void |
hangup()
to terminate a call |
void |
incomingCallReceived(net.java.sip.communicator.service.protocol.event.CallEvent event)
CallListener implementation for incomingCallReceived |
private void |
makeCall(java.lang.String user)
make a call using appropriate protocol provider. |
void |
outgoingCallCreated(net.java.sip.communicator.service.protocol.event.CallEvent event)
CallListener implementation for outgoingCallCreated |
void |
participantAddressChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
CallParticipantListener implementation for participantAddressChanged |
void |
participantDisplayNameChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
CallParticipantListener implementation for participantDisplayNameChanged |
void |
participantImageChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
CallParticipantListener implementation for participantAddressChanged |
void |
participantStateChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
CallParticipantListener implementation for participantStateChanged |
void |
participantTransportAddressChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
CallParticipantListener implementation for participantStateChanged |
void |
phoneCommandReceived(SCPhoneMessageEvent event)
Implementation of SCPhoneListener's method, called when a message is recived from the phone. |
void |
phoneCommandSent(SCPhoneMessageEvent event)
Implementation of SCPhoneListener's method, called when a message has been sent to the phone |
void |
serviceChanged(ServiceEvent serviceEvent)
When new protocol provider is registered we check if it supports BasicTelephony and if so add a listener to it |
void |
start(BundleContext bc)
Start the usb phone plugin |
void |
statusChanged(SCPhoneStatusEvent event)
Implementation of SCPhoneListener's method, called when the phone become available |
void |
stop(BundleContext bc)
Stop the usb phone plugin by "closing" the connexion with the phone device |
private void |
takeCall()
Answer an incoming call. |
private void |
updateContactList()
setup the contactlist |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private SCPhone phone
SCPhone
object that communicate with the phone device
private BundleContext bundleContext
private net.java.sip.communicator.util.Logger logger
private java.util.Vector ppsVector
private net.java.sip.communicator.service.protocol.Call currentCall
private java.util.Hashtable contactList
private java.lang.String usernameList
private net.java.sip.communicator.service.callhistory.CallHistoryService callHS
private int histCallCount
private java.util.Hashtable histCall
private net.java.sip.communicator.service.protocol.ProtocolProviderService primaryProtocolProvider
primaryProtocolProvider
is arbitrarily choosed among available protocol provider.
Constructor Detail |
---|
public SCPhoneActivator()
Method Detail |
---|
public void start(BundleContext bc) throws java.lang.Exception
bc
- BundleContext
java.lang.Exception
public void stop(BundleContext bc) throws java.lang.Exception
bc
- BundleContext
java.lang.Exception
private java.lang.StringBuffer getUsernamesList(net.java.sip.communicator.service.protocol.ContactGroup cg)
group
- the group from which we want to retrieve contacts
private void updateContactList()
public void callEnded(net.java.sip.communicator.service.protocol.event.CallEvent event)
callEnded
in interface net.java.sip.communicator.service.protocol.event.CallListener
event
- CallEventpublic void incomingCallReceived(net.java.sip.communicator.service.protocol.event.CallEvent event)
incomingCallReceived
in interface net.java.sip.communicator.service.protocol.event.CallListener
event
- CallEventpublic void outgoingCallCreated(net.java.sip.communicator.service.protocol.event.CallEvent event)
outgoingCallCreated
in interface net.java.sip.communicator.service.protocol.event.CallListener
event
- CallEventpublic void participantAddressChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
participantAddressChanged
in interface net.java.sip.communicator.service.protocol.event.CallParticipantListener
event
- CallParticipantChangeEventpublic void participantDisplayNameChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
participantDisplayNameChanged
in interface net.java.sip.communicator.service.protocol.event.CallParticipantListener
event
- CallParticipantChangeEventpublic void participantImageChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
participantImageChanged
in interface net.java.sip.communicator.service.protocol.event.CallParticipantListener
event
- CallParticipantChangeEventpublic void participantStateChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
participantStateChanged
in interface net.java.sip.communicator.service.protocol.event.CallParticipantListener
event
- CallParticipantChangeEventpublic void participantTransportAddressChanged(net.java.sip.communicator.service.protocol.event.CallParticipantChangeEvent event)
participantTransportAddressChanged
in interface net.java.sip.communicator.service.protocol.event.CallParticipantListener
event
- CallParticipantChangeEventprivate void makeCall(java.lang.String user)
user
- to callprimaryProtocolProvider
private void takeCall()
private void hangup()
c
- call to endprivate void handleProviderAdded(net.java.sip.communicator.service.protocol.ProtocolProviderService provider)
provider
- ProtocolProviderServiceprivate void handleProviderRemoved(net.java.sip.communicator.service.protocol.ProtocolProviderService provider)
provider
- the ProtocolProviderService that has been unregistered.public void serviceChanged(ServiceEvent serviceEvent)
serviceEvent
- ServiceEventpublic void phoneCommandReceived(SCPhoneMessageEvent event)
phoneCommandReceived
in interface SCPhoneListener
event
- SCPhoneMessageEvent.public void phoneCommandSent(SCPhoneMessageEvent event)
phoneCommandSent
in interface SCPhoneListener
event
- SCPhoneMessageEvent.public void statusChanged(SCPhoneStatusEvent event)
statusChanged
in interface SCPhoneListener
event
- SCPhoneStatusEvent.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |