com.skype.tutorial.step7
Class Tutorial_7

java.lang.Object
  extended by com.skype.tutorial.step7.Tutorial_7

public class Tutorial_7
extends java.lang.Object

Getting Started With SkypeKit: Tutorial Application, Step 7. In Step 6, we wrote a SkypeKit dialer that took a Skype Name from a command-line argument and initiated a voice call. In this step, we will initiate a conference with at least two other parties. This example illustrates a simple SkypeKit-based program that:

  1. Takes a Skype Name, password, some arbitrary number of call targets, and/or an optional AppToken path name as command-line arguments
  2. Initiates login for that user
  3. Waits until the login process is complete
  4. Creates a new Conversation object.
  5. Creates a String array containing the Skype Names of our call targets
  6. Assign the String array to our conference by invoking Conversation.AddConsumers
  7. Obtains a resultant list of Participant references
  8. Loops through the list of Participants (that will include this user) and rings each one except ourselves
  9. Initiates logout when any of the parties ends the call or the call cannot be connected to any party
  10. Waits until logout is complete
  11. Cleans up and exits

Since:
1.0
Author:
Andrea Drane (ported/refactored from existing C++ tutorial code)

Field Summary
static int ACCOUNT_NAME_IDX
          Index of the account name in the command line argument list.
static int ACCOUNT_PWORD_IDX
          Index of the account password in the command line argument list.
static java.lang.String APPTOKEN_OPT_KEY
          Key introducing/identifying the pathname of an AppToken file among the optional command line arguments.
static int FIRST_TGT_ARG_IDX
          Index of the first (required) call target argument in the command line argument list.
static java.lang.String MY_CLASS_TAG
          Info/Debug console output message prefix/identifier tag.
private static AppToken myAppToken
           
private static java.lang.String[] myCallTargets
          Call target names.
private static MySession mySession
           
private static Tutorial_7 myTutorial
          "Extraneous" instance of this tutorial so we can invoke our business logic method from main(String[]) without having to declare it as being "static".
static int OPT_ARG_CNT
          Number of optional arguments in the command line argument list.
static int REQ_ARG_CNT
          Number of required arguments in the command line argument list.
 
Constructor Summary
Tutorial_7()
           
 
Method Summary
(package private)  void doMakeConferenceCall(MySession mySession, java.lang.String[] myCallTargets)
          Conference with at least two other participants.
static boolean isRinging(com.skype.api.Participant participant)
          Dynamically determine if a particular participant's "phone" is ringing.
static void main(java.lang.String[] args)
          Main loop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MY_CLASS_TAG

public static final java.lang.String MY_CLASS_TAG
Info/Debug console output message prefix/identifier tag. Corresponds to class name.

Since:
1.0
See Also:
Constant Field Values

ACCOUNT_NAME_IDX

public static final int ACCOUNT_NAME_IDX
Index of the account name in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

ACCOUNT_PWORD_IDX

public static final int ACCOUNT_PWORD_IDX
Index of the account password in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

FIRST_TGT_ARG_IDX

public static final int FIRST_TGT_ARG_IDX
Index of the first (required) call target argument in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

REQ_ARG_CNT

public static final int REQ_ARG_CNT
Number of required arguments in the command line argument list. This includes the minimum of two call targets (Skype Names).

Since:
1.0
See Also:
Constant Field Values

APPTOKEN_OPT_KEY

public static final java.lang.String APPTOKEN_OPT_KEY
Key introducing/identifying the pathname of an AppToken file among the optional command line arguments.

Any optional AppToken path name must be prefixed with this key string to distinguish it from any call target.

For example:

       Tutorial_7 myAccountName myAccountPword callTgt1 callTgt2 ... -atk:/MyHome/MyCredentials
   

Since:
1.0
See Also:
Constant Field Values

OPT_ARG_CNT

public static final int OPT_ARG_CNT
Number of optional arguments in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

myCallTargets

private static java.lang.String[] myCallTargets
Call target names.

Let the transformation of the accumulated call targets determine the actual size of the array (which must be at least two). com.skype.api.Conversation.addConsumers (and similar methods that accept a list of identities) appear to assume that each slot contains a valid identity, since empty slots cause a NullPointerException!

Since:
1.0

myAppToken

private static AppToken myAppToken

mySession

private static MySession mySession

myTutorial

private static Tutorial_7 myTutorial
"Extraneous" instance of this tutorial so we can invoke our business logic method from main(String[]) without having to declare it as being "static".

Since:
1.0
Constructor Detail

Tutorial_7

public Tutorial_7()
Method Detail

main

public static void main(java.lang.String[] args)
Main loop.

Parameters:
args -
  1. Name of the target Skype account.
  2. Password for the target Skype account.
  3. Skype Names of people to conference in.
  4. Optional arguments (in any order):
    • Some number additional Skype Names of people to conference in
    • Optional pathname of a text file containing an AppToken string (preceded by APPTOKEN_OPT_KEY).
Since:
1.0

doMakeConferenceCall

void doMakeConferenceCall(MySession mySession,
                          java.lang.String[] myCallTargets)
Conference with at least two other participants.
  1. Obtain the list of available playback and recording devices.
  2. Set the current devices (input, output, notification) to the first device in their respective list, and display their names.
  3. Create a conference conversation.
  4. Add each of the specified call targets (Skype Names) to the conversation as consumers.
  5. Obtain the resultant list of conversation participants, which will include the conference creator.
  6. Attempt to call each participant except the conference creator, and wait for them to answer.
  7. Wait until the call finishes.

Parameters:
mySession - Populated session object
myCallTargets - The Skype Names of the people to conference with.
Since:
1.0

isRinging

public static boolean isRinging(com.skype.api.Participant participant)
Dynamically determine if a particular participant's "phone" is ringing.

Parameters:
participant - The target participant.
Returns:
  • true: participant's phone is ringing
  • false: participant's phone is not ringing
Since:
1.0