Module Skype :: Class Participant

Class Participant

source code

     object --+        
              |        
skypekit.Cached --+    
                  |    
    skypekit.Object --+
                      |
                     Participant

Conversation participant class. Instances of this class represent contacts when in the context of conversations. Amongst others, this class has a Ring method for requesting live status with the target contact. This class also holds typing indicator property and access rights for the contact in context of public conversations.

Instance Methods
 
_sk_init_(self, object_id, transport)
actual constructor
source code
 
__str__(self)
str(x)
source code
 
OnPropertyChange(self, property_name)
notifies from a property change
source code
 
CanSetRankTo(self, rank)
Checks whether the current user can set this Participant's conversation privileges to the specified RANK.
source code
 
SetRankTo(self, rank)
Sets Participant's conversation privileges to the given RANK
source code
 
Ring(self, identity_to_use='', video_call=False, nrof_redials=0, redial_period=0, auto_start_vm=False, origin='')
Initiates live conversation attempt with Participant.
source code
 
RingIt(self)
Rings this participant, using P_LIVE_IDENTITY property if set.
source code
 
SetLiveIdentityToUse(self, identity_to_use='')
Sets LIVE_IDENTITY property, an alternate identity to use when ringing, such as a PSTN.
source code
 
GetVideo(self)
Retrieves a reference to the Video object that corresponds to the Participant.
source code
 
Hangup(self)
Removes this participant from the current live session.
source code
 
Retire(self)
Forcibly removes this participant from conversation.
source code
 
OnIncomingDTMF(self, dtmf)
This event gets fired on receiving a DTMF signal sent by Participant.
source code

Inherited from skypekit.Object: multiget

Inherited from skypekit.Cached: __copy__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Static Methods
 
propid(propname)
convert a property name to the enum of the property
source code

Inherited from skypekit.Cached: __new__, sk_exists

Class Variables
  event_handlers = {1: '_sk_on_incoming_dtmf'}
  propid2label = {930: 'convo_id', 931: 'identity', 932: 'rank',...
  module_id = 19
  RANK = {1: 'CREATOR', 2: 'ADMIN', 3: 'SPEAKER', 4: 'WRITER', 5...
Recognized values for the P_RANK property.
  TEXT_STATUS = {0: 'TEXT_UNKNOWN', 1: 'TEXT_NA', 2: 'READING', ...
Recognized values for the P_TEXT_STATUS property.
  VOICE_STATUS = {0: 'VOICE_UNKNOWN', 1: 'VOICE_NA', 2: 'VOICE_A...
Recognized values for the P_VOICE_STATUS property.
  VIDEO_STATUS = {0: 'VIDEO_UNKNOWN', 1: 'VIDEO_NA', 2: 'VIDEO_A...
Recognized values for the P_VIDEO_STATUS property.
  DTMF = {0: 'DTMF_0', 1: 'DTMF_1', 2: 'DTMF_2', 3: 'DTMF_3', 4:...
DTMF_0
  P_CONVO_ID = 930
  P_IDENTITY = 931
  P_RANK = 932
  P_REQUESTED_RANK = 933
  P_TEXT_STATUS = 934
  P_VOICE_STATUS = 935
  P_VIDEO_STATUS = 936
  P_LIVE_IDENTITY = 943
  P_LIVE_PRICE_FOR_ME = 938
  P_LIVE_FWD_IDENTITIES = 948
  P_LIVE_START_TIMESTAMP = 939
  P_SOUND_LEVEL = 941
  P_DEBUGINFO = 942
  P_LAST_VOICE_ERROR = 947
  P_QUALITY_PROBLEMS = 949
  P_LIVE_TYPE = 950
  P_LIVE_COUNTRY = 951
  P_TRANSFERRED_BY = 952
  P_TRANSFERRED_TO = 953
  P_ADDER = 954

Inherited from skypekit.Object: rwlock

Instance Variables

Inherited from skypekit.Object: properties

Properties
  convo_id
[ALL] ID of corresponding conversation.
  identity
[ALL] skypename OR pstn_number OR namespace:identity
  rank
[ALL] Participant::RANK
  requested_rank
Not set (should be: requested Participant::RANK, higher than the current one)
  text_status
[ALL] the typing indicator
  voice_status
[ALL] voice status
  video_status
[ALL] video status
  live_identity
[ALL] identity that was used to establish current live session with that participant (can be different from participant identity)
  live_price_for_me
[OTHERS] 'price_per_minute_float currency' - eg '0.01 EUR'.
  live_fwd_identities
[OTHERS] list of identities where the live session is being forwarded (if they are disclosed), space separated
  live_start_timestamp
[ALL] time of joining the live session
  sound_level
[ALL] current 'loudness' level when SPEAKING (0..10)
  debuginfo
[OTHERS] call (audio and video) debug info
  last_voice_error
[OTHERS]
  quality_problems
[ALL] space separated tokens values: CPU_INUSE CPU_SLOW CPU_HIGH HIGH_ECHO HIGH_NOISE MUTED_INPUT LOW_INPUT MUTED_INPUT_ACTIVITY FW_STRONG FW_BAD NOT_UDP CALL_BW_LOW RECORD_ERROR + values in video debug info
  live_type
[ALL] participant type during livesession as specified in IDENTITYTYPE
  live_country
[OTHERS] participant livesession country code - used for emergency calls only atm
  transferred_by
[OTHERS] Transferor identity (transferee side)
  transferred_to
[OTHERS] Identity of recipient of transfer (transferor side, caller side)
  adder
[ALL] Identity of the user who added this participant to the conversation, type: Sid::String

Inherited from object: __class__

Method Details

_sk_init_(self, object_id, transport)

source code 

actual constructor

Overrides: skypekit.Object._sk_init_

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

CanSetRankTo(self, rank)

source code 

Checks whether the current user can set this Participant's conversation privileges to the specified RANK. This enables you to gray out or disable in your UI all the unavailable options for Participant::SetRankTo method.

Arguments:

  • rank - Participant::RANK value to check for.

Return values:

  • result - Returns true if local user can set participant's rank to the value given in rank argument.

SetRankTo(self, rank)

source code 

Sets Participant's conversation privileges to the given RANK

Arguments:

  • rank - Target Participant::RANK value.

Ring(self, identity_to_use='', video_call=False, nrof_redials=0, redial_period=0, auto_start_vm=False, origin='')

source code 

Initiates live conversation attempt with Participant.

Arguments:

  • identity_to_use - Ring an alternate identity, such as a PSTN number.
  • video_call - Enable video.
  • nrof_redials - Unused.
  • redial_period - Unused.
  • auto_start_vm - Unused. On dialog, if falling on VM, greeting and recording will be automatically started.
  • origin - When call is initiated from web link, must contain the URI that was used

SetLiveIdentityToUse(self, identity_to_use='')

source code 

Sets LIVE_IDENTITY property, an alternate identity to use when ringing, such as a PSTN.

Arguments:

  • identity_to_use - Empty string will reset it to default, i.e IDENTITY property value

GetVideo(self)

source code 

Retrieves a reference to the Video object that corresponds to the Participant. It can be either local video - you can check if this participant's name (P_IDENTITY property) matches the name of the currently logged in account (P_SKYPENAME property) or incoming video from a remote participant.

Note that for GetVideo to be successful, the video has to be available for that participant. This can be checked for by examining Participant VIDEO_STATUS property - once it becomes VIDEO_AVAILABLE - you can use GetVideo to obtain the Video object.

Return values:

  • video - Returns reference to a constructed video object.

Hangup(self)

source code 

Removes this participant from the current live session. Note that this does not remove the participant from conversation (for this, use Participant::Retire). It only removes participant from live state.

Retire(self)

source code 

Forcibly removes this participant from conversation. This method is for removing other people from conversations (for example: as administrative punishment for flooding conversation with spam messages). For local user to leave a conversation, use Conversation::RetireFrom instead.

OnIncomingDTMF(self, dtmf)

source code 

This event gets fired on receiving a DTMF signal sent by Participant. Note that this event will only fire if the Participant is also using a Skype client. Skype audio library does not monitor incoming voice streams for dial tones. DTMF events are propagated to remote participants via data channel. Incoming DTMF tones transmitted from, for example, mobile phones, will not cause this event to fire. In case of incoming DTMF signals from Skype clients, DTMF tones are also inserted into the audio stream. You don't have to inject those into local audio playback yourself.

Return values:

  • dtmf - Returns Participant::DTMF value.

Class Variable Details

propid2label

Value:
{930: 'convo_id',
 931: 'identity',
 932: 'rank',
 933: 'requested_rank',
 934: 'text_status',
 935: 'voice_status',
 936: 'video_status',
 938: 'live_price_for_me',
...

RANK

Recognized values for the P_RANK property. The P_RANK controls participant's privileges in the conversation. See Participant::CanSetRankTo and Participant::SetRankTo methods.

  • CREATOR - Creator of the chat. There can be only one participant with this type per conversation. Other participants cannot be promoted to Creator rank.
  • ADMIN - Participant who has administrator privileges
  • SPEAKER - Participant who can speak and write
  • WRITER - Participant who can write but not speak
  • SPECTATOR - Participant who can read but not write/speak
  • APPLICANT - Participant who is applying to join the conversation. Member cannot be demoted to applicants once they have been accepted.
  • RETIRED - Participant who has eft or has been kicked from the conversation
  • OUTLAW - Participant who has been banned from the chat
Value:
{1: 'CREATOR',
 2: 'ADMIN',
 3: 'SPEAKER',
 4: 'WRITER',
 5: 'SPECTATOR',
 6: 'APPLICANT',
 7: 'RETIRED',
 8: 'OUTLAW',
...

TEXT_STATUS

Recognized values for the P_TEXT_STATUS property. The P_TEXT_STATUS property has two uses. Firstly, you can use it to implement typing indicators in your UI, to notify the local user that an incoming chat message from this Participant is imminent.

To set the P_TEXT_STATUS value, so that remote client UIs can display the local user's typing indicator in their UI, use Conversation::SetMyTextStatusTo method.

Transmission of P_TEXT_STATUS updates to remote participants of conversations is controlled via SETUPKEY_DISABLE_CHAT_ACTIVITY_INDICATION setup key.

Secondly, the TEXT_NA value enables you to detect participants who are running clients with no chat capability.

  • TEXT_UNKNOWN - Fallback state in case the text status is not (yet) deternmined.
  • TEXT_NA - Text status is not applicable as the participant is using a Skype client that does not support chat (for example: voice-only USB phones).
  • READING - Participant is currently not typing.
  • WRITING - Participant is currently typing.
  • WRITING_AS_ANGRY - This state should be set when following two conditions are true:
  • interval between keypresses are less than 20 ms;
  • at least one of the keys adjacent to current key are pressed down.
    • WRITING_AS_CAT - The "Cat on keyboard detection" algorthm in Skype is implemented in the UI level, and as such is not present in the SkypeKit API. Should you wish to implement similar algorthm in your own UI, you can get the basic logic from the PawSense FAQ - http://www.bitboost.com/pawsense/pawsense-faq.html
Value:
{0: 'TEXT_UNKNOWN',
 1: 'TEXT_NA',
 2: 'READING',
 3: 'WRITING',
 4: 'WRITING_AS_ANGRY',
 5: 'WRITING_AS_CAT',
 'READING': 2,
 'TEXT_NA': 1,
...

VOICE_STATUS

Recognized values for the P_VOICE_STATUS property.

  • VOICE_UNKNOWN - Participant voice status is not (yet) determined.
  • VOICE_NA - Participant is using a Skype client with no audio capability.
  • VOICE_AVAILABLE - Participant is using a Skype client that supports audio.
  • VOICE_CONNECTING - Participant is in process of joining current live session. This is a transitional state.
  • RINGING - Participant has been invited to join the live session but has not yet accepted.
  • EARLY_MEDIA - Participant is in process of joining current live session. This is another transitional state.
  • LISTENING - Participant has joined the current live session but is currently not transmitting audio.
  • SPEAKING - Participant has joined the current live session and is transmitting audio. The UI can either use this state to display appropriate "speaking" notification, or alternatively use Participant::P_SOUND_LEVEL if you want your speaking indicator to also reflect audio volume coming from the Participant.
  • VOICE_ON_HOLD - Participant has joined the current live session but the audio is currently on hold.
  • VOICE_STOPPED - Participant will be placed in this state for some seconds after live session has finished. This is another transitional state.
Value:
{0: 'VOICE_UNKNOWN',
 1: 'VOICE_NA',
 2: 'VOICE_AVAILABLE',
 3: 'VOICE_CONNECTING',
 4: 'RINGING',
 5: 'EARLY_MEDIA',
 6: 'LISTENING',
 7: 'SPEAKING',
...

VIDEO_STATUS

Recognized values for the P_VIDEO_STATUS property. This property applies to Participant's video send capability, not capability to receive video.

  • VIDEO_UNKNOWN - Video status is not (yet) determined.
  • VIDEO_NA - Indicates that this Participant does not have video available..
  • VIDEO_AVAILABLE - Indicates that video is available for this participant. When the Participant::P_VIDEO_STATUS obtains this state, it is possible to retrieve the Video object, using Participant::GetVideo method. Further operations, such as starting or stopping the video send/receive will then go through the Video object.
  • VIDEO_CONNECTING - Transitional state indicating that the Participant is attempting to initiate video send.
  • STREAMING - Indicates that the participant is currently sending video.
  • VIDEO_ON_HOLD - Indicates that the participant video send is currently paused.
Value:
{0: 'VIDEO_UNKNOWN',
 1: 'VIDEO_NA',
 2: 'VIDEO_AVAILABLE',
 3: 'VIDEO_CONNECTING',
 4: 'STREAMING',
 5: 'VIDEO_ON_HOLD',
 'STREAMING': 4,
 'VIDEO_AVAILABLE': 2,
...

DTMF

  • DTMF_0
  • DTMF_1
  • DTMF_2
  • DTMF_3
  • DTMF_4
  • DTMF_5
  • DTMF_6
  • DTMF_7
  • DTMF_8
  • DTMF_9
  • DTMF_STAR
  • DTMF_POUND
Value:
{0: 'DTMF_0',
 1: 'DTMF_1',
 2: 'DTMF_2',
 3: 'DTMF_3',
 4: 'DTMF_4',
 5: 'DTMF_5',
 6: 'DTMF_6',
 7: 'DTMF_7',
...

Property Details

convo_id

[ALL] ID of corresponding conversation. Here and below, [ALL] tag indicates that the property has meaning and is set in context of all participants in the conversation. [OTHERS] tag has meaning only for participants who are not the local user.

Get Method:
_sk_get_convo_id(self) - [ALL] ID of corresponding conversation.

identity

[ALL] skypename OR pstn_number OR namespace:identity

Get Method:
_sk_get_identity(self) - [ALL] skypename OR pstn_number OR namespace:identity

rank

[ALL] Participant::RANK

Get Method:
_sk_get_rank(self) - [ALL] Participant::RANK

requested_rank

Not set (should be: requested Participant::RANK, higher than the current one)

Get Method:
_sk_get_requested_rank(self) - Not set (should be: requested Participant::RANK, higher than the current one)

text_status

[ALL] the typing indicator

Get Method:
_sk_get_text_status(self) - [ALL] the typing indicator

voice_status

[ALL] voice status

Get Method:
_sk_get_voice_status(self) - [ALL] voice status

video_status

[ALL] video status

Get Method:
_sk_get_video_status(self) - [ALL] video status

live_identity

[ALL] identity that was used to establish current live session with that participant (can be different from participant identity)

Get Method:
_sk_get_live_identity(self) - [ALL] identity that was used to establish current live session with that participant (can be different from participant identity)

live_price_for_me

[OTHERS] 'price_per_minute_float currency' - eg '0.01 EUR'. Note that this property obtains value only after the participant goes into live state. It cannot be used to display call rates before the call starts.

Get Method:
_sk_get_live_price_for_me(self) - [OTHERS] 'price_per_minute_float currency' - eg '0.01 EUR'.

live_fwd_identities

[OTHERS] list of identities where the live session is being forwarded (if they are disclosed), space separated

Get Method:
_sk_get_live_fwd_identities(self) - [OTHERS] list of identities where the live session is being forwarded (if they are disclosed), space separated

live_start_timestamp

[ALL] time of joining the live session

Get Method:
_sk_get_live_start_timestamp(self) - [ALL] time of joining the live session

sound_level

[ALL] current 'loudness' level when SPEAKING (0..10)

Get Method:
_sk_get_sound_level(self) - [ALL] current 'loudness' level when SPEAKING (0..10)

debuginfo

[OTHERS] call (audio and video) debug info

Get Method:
_sk_get_debuginfo(self) - [OTHERS] call (audio and video) debug info

last_voice_error

[OTHERS]

Get Method:
_sk_get_last_voice_error(self) - [OTHERS]

quality_problems

[ALL] space separated tokens values: CPU_INUSE CPU_SLOW CPU_HIGH HIGH_ECHO HIGH_NOISE MUTED_INPUT LOW_INPUT MUTED_INPUT_ACTIVITY FW_STRONG FW_BAD NOT_UDP CALL_BW_LOW RECORD_ERROR + values in video debug info

Get Method:
_sk_get_quality_problems(self) - [ALL] space separated tokens values: CPU_INUSE CPU_SLOW CPU_HIGH HIGH_ECHO HIGH_NOISE MUTED_INPUT LOW_INPUT MUTED_INPUT_ACTIVITY FW_STRONG FW_BAD NOT_UDP CALL_BW_LOW RECORD_ERROR + values in video debug info

live_type

[ALL] participant type during livesession as specified in IDENTITYTYPE

Get Method:
_sk_get_live_type(self) - [ALL] participant type during livesession as specified in IDENTITYTYPE

live_country

[OTHERS] participant livesession country code - used for emergency calls only atm

Get Method:
_sk_get_live_country(self) - [OTHERS] participant livesession country code - used for emergency calls only atm

transferred_by

[OTHERS] Transferor identity (transferee side)

Get Method:
_sk_get_transferred_by(self) - [OTHERS] Transferor identity (transferee side)

transferred_to

[OTHERS] Identity of recipient of transfer (transferor side, caller side)

Get Method:
_sk_get_transferred_to(self) - [OTHERS] Identity of recipient of transfer (transferor side, caller side)

adder

[ALL] Identity of the user who added this participant to the conversation, type: Sid::String

Get Method:
_sk_get_adder(self) - [ALL] Identity of the user who added this participant to the conversation, type: Sid::String