@@ -133,7 +133,7 @@ public static boolean isApiSupported(Context context) {
133133 }
134134
135135 /**
136- * Returns true if the system supports SIP-based VoIP .
136+ * Returns true if the system supports SIP-based VOIP API .
137137 */
138138 public static boolean isVoipSupported (Context context ) {
139139 return context .getPackageManager ().hasSystemFeature (
@@ -305,12 +305,17 @@ public boolean isRegistered(String localProfileUri) throws SipException {
305305 * @param timeout the timeout value in seconds. Default value (defined by
306306 * SIP protocol) is used if {@code timeout} is zero or negative.
307307 * @return a {@link SipAudioCall} object
308- * @throws SipException if calling the SIP service results in an error
308+ * @throws SipException if calling the SIP service results in an error or
309+ * VOIP API is not supported by the device
309310 * @see SipAudioCall.Listener#onError
311+ * @see #isVoipSupported
310312 */
311313 public SipAudioCall makeAudioCall (SipProfile localProfile ,
312314 SipProfile peerProfile , SipAudioCall .Listener listener , int timeout )
313315 throws SipException {
316+ if (!isVoipSupported (mContext )) {
317+ throw new SipException ("VOIP API is not supported" );
318+ }
314319 SipAudioCall call = new SipAudioCall (mContext , localProfile );
315320 call .setListener (listener );
316321 SipSession s = createSipSession (localProfile , null );
@@ -332,12 +337,17 @@ public SipAudioCall makeAudioCall(SipProfile localProfile,
332337 * @param timeout the timeout value in seconds. Default value (defined by
333338 * SIP protocol) is used if {@code timeout} is zero or negative.
334339 * @return a {@link SipAudioCall} object
335- * @throws SipException if calling the SIP service results in an error
340+ * @throws SipException if calling the SIP service results in an error or
341+ * VOIP API is not supported by the device
336342 * @see SipAudioCall.Listener#onError
343+ * @see #isVoipSupported
337344 */
338345 public SipAudioCall makeAudioCall (String localProfileUri ,
339346 String peerProfileUri , SipAudioCall .Listener listener , int timeout )
340347 throws SipException {
348+ if (!isVoipSupported (mContext )) {
349+ throw new SipException ("VOIP API is not supported" );
350+ }
341351 try {
342352 return makeAudioCall (
343353 new SipProfile .Builder (localProfileUri ).build (),
0 commit comments