3737import java .util .Map ;
3838
3939/**
40- * Class that handles an Internet audio call over SIP. {@link SipManager}
41- * facilitates instantiating a {@code SipAudioCall} object for making/receiving
42- * calls. See {@link SipManager#makeAudioCall} and
43- * {@link SipManager#takeAudioCall}.
40+ * Handles an Internet audio call over SIP. You can instantiate this class with {@link SipManager},
41+ * using {@link SipManager#makeAudioCall makeAudioCall()} and {@link SipManager#takeAudioCall
42+ * takeAudioCall()}.
4443 *
45- * <p>Requires permissions to use this class:
44+ * <p class="note"><strong>Note:</strong> Using this class require the
4645 * {@link android.Manifest.permission#INTERNET} and
47- * {@link android.Manifest.permission#USE_SIP}.
48- * <br/>Requires permissions to {@link #startAudio}:
46+ * {@link android.Manifest.permission#USE_SIP} permissions.<br/><br/>In addition, {@link
47+ * #startAudio} requires the
4948 * {@link android.Manifest.permission#RECORD_AUDIO},
50- * {@link android.Manifest.permission#ACCESS_WIFI_STATE} and
51- * {@link android.Manifest.permission#WAKE_LOCK}.
52- * <br/>Requires permissions to {@link # setSpeakerMode}:
53- * {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS}.
49+ * {@link android.Manifest.permission#ACCESS_WIFI_STATE}, and
50+ * {@link android.Manifest.permission#WAKE_LOCK} permissions; and {@link #setSpeakerMode
51+ * setSpeakerMode()} requires the
52+ * {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS} permission.</p>
5453 */
5554public class SipAudioCall {
5655 private static final String TAG = SipAudioCall .class .getSimpleName ();
5756 private static final boolean RELEASE_SOCKET = true ;
5857 private static final boolean DONT_RELEASE_SOCKET = false ;
5958 private static final int SESSION_TIMEOUT = 5 ; // in seconds
6059
61- /** Listener class for all event callbacks. */
60+ /** Listener for events relating to a SIP call, such as when a call is being
61+ * recieved ("on ringing") or a call is outgoing ("on calling").
62+ * <p>Many of these events are also received by {@link SipSession.Listener}.</p>
63+ */
6264 public static class Listener {
6365 /**
6466 * Called when the call object is ready to make another call.
@@ -199,7 +201,7 @@ public SipAudioCall(Context context, SipProfile localProfile) {
199201
200202 /**
201203 * Sets the listener to listen to the audio call events. The method calls
202- * {@code setListener(listener, false)}.
204+ * {@link #setListener setListener(listener, false)}.
203205 *
204206 * @param listener to listen to the audio call events of this object
205207 * @see #setListener(Listener, boolean)
@@ -537,14 +539,14 @@ public void attachCall(SipSession session, String sessionDescription)
537539 /**
538540 * Initiates an audio call to the specified profile. The attempt will be
539541 * timed out if the call is not established within {@code timeout} seconds
540- * and {@code Listener. onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
542+ * and {@link Listener#onError onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
541543 * will be called.
542544 *
543545 * @param peerProfile the SIP profile to make the call to
544546 * @param sipSession the {@link SipSession} for carrying out the call
545547 * @param timeout the timeout value in seconds. Default value (defined by
546548 * SIP protocol) is used if {@code timeout} is zero or negative.
547- * @see Listener. onError
549+ * @see Listener# onError
548550 * @throws SipException if the SIP service fails to create a session for the
549551 * call
550552 */
@@ -582,12 +584,12 @@ public void endCall() throws SipException {
582584 * Puts a call on hold. When succeeds, {@link Listener#onCallHeld} is
583585 * called. The attempt will be timed out if the call is not established
584586 * within {@code timeout} seconds and
585- * {@code Listener. onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
587+ * {@link Listener#onError onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
586588 * will be called.
587589 *
588590 * @param timeout the timeout value in seconds. Default value (defined by
589591 * SIP protocol) is used if {@code timeout} is zero or negative.
590- * @see Listener. onError
592+ * @see Listener# onError
591593 * @throws SipException if the SIP service fails to hold the call
592594 */
593595 public void holdCall (int timeout ) throws SipException {
@@ -604,12 +606,12 @@ public void holdCall(int timeout) throws SipException {
604606 /**
605607 * Answers a call. The attempt will be timed out if the call is not
606608 * established within {@code timeout} seconds and
607- * {@code Listener. onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
609+ * {@link Listener#onError onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
608610 * will be called.
609611 *
610612 * @param timeout the timeout value in seconds. Default value (defined by
611613 * SIP protocol) is used if {@code timeout} is zero or negative.
612- * @see Listener. onError
614+ * @see Listener# onError
613615 * @throws SipException if the SIP service fails to answer the call
614616 */
615617 public void answerCall (int timeout ) throws SipException {
@@ -628,12 +630,12 @@ public void answerCall(int timeout) throws SipException {
628630 * Continues a call that's on hold. When succeeds,
629631 * {@link Listener#onCallEstablished} is called. The attempt will be timed
630632 * out if the call is not established within {@code timeout} seconds and
631- * {@code Listener. onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
633+ * {@link Listener#onError onError(SipAudioCall, SipErrorCode.TIME_OUT, String)}
632634 * will be called.
633635 *
634636 * @param timeout the timeout value in seconds. Default value (defined by
635637 * SIP protocol) is used if {@code timeout} is zero or negative.
636- * @see Listener. onError
638+ * @see Listener# onError
637639 * @throws SipException if the SIP service fails to unhold the call
638640 */
639641 public void continueCall (int timeout ) throws SipException {
@@ -786,8 +788,8 @@ public boolean isMuted() {
786788
787789 /**
788790 * Puts the device to speaker mode.
789- * <p> Requires permission:
790- * {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS}.
791+ * <p class="note"><strong>Note:</strong> Requires the
792+ * {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS} permission.</p>
791793 */
792794 public void setSpeakerMode (boolean speakerMode ) {
793795 synchronized (this ) {
@@ -797,20 +799,21 @@ public void setSpeakerMode(boolean speakerMode) {
797799 }
798800
799801 /**
800- * Sends a DTMF code. According to RFC2833, event 0--9 maps to decimal
802+ * Sends a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2883</a>,
803+ * event 0--9 maps to decimal
801804 * value 0--9, '*' to 10, '#' to 11, event 'A'--'D' to 12--15, and event
802805 * flash to 16. Currently, event flash is not supported.
803806 *
804807 * @param code the DTMF code to send. Value 0 to 15 (inclusive) are valid
805808 * inputs.
806- * @see http://tools.ietf.org/html/rfc2833
807809 */
808810 public void sendDtmf (int code ) {
809811 sendDtmf (code , null );
810812 }
811813
812814 /**
813- * Sends a DTMF code. According to RFC2833, event 0--9 maps to decimal
815+ * Sends a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2883</a>,
816+ * event 0--9 maps to decimal
814817 * value 0--9, '*' to 10, '#' to 11, event 'A'--'D' to 12--15, and event
815818 * flash to 16. Currently, event flash is not supported.
816819 *
@@ -888,10 +891,10 @@ public void setAudioGroup(AudioGroup group) {
888891 /**
889892 * Starts the audio for the established call. This method should be called
890893 * after {@link Listener#onCallEstablished} is called.
891- * <p> Requires permission:
894+ * <p class="note"><strong>Note:</strong> Requires the
892895 * {@link android.Manifest.permission#RECORD_AUDIO},
893896 * {@link android.Manifest.permission#ACCESS_WIFI_STATE} and
894- * {@link android.Manifest.permission#WAKE_LOCK}.
897+ * {@link android.Manifest.permission#WAKE_LOCK} permissions.</p>
895898 */
896899 public void startAudio () {
897900 try {
0 commit comments