Play a dialing audio when initiating a call.

cusax-fix
Yana Stamcheva 16 years ago
parent 0eca31a94f
commit 75444a5871

Binary file not shown.

@ -15,8 +15,8 @@ DIAL_EIGHT=resources/sounds/eight_8.wav
DIAL_NINE=resources/sounds/nine_9.wav
DIAL_DIEZ=resources/sounds/one_1.wav
DIAL_STAR=resources/sounds/one_1.wav
BUSY=resources/sounds/busy.wav
DIAL=resources/sounds/dial.wav
CALL_SECURITY_ON=resources/sounds/zrtpSecure.wav
CALL_SECURITY_ERROR=resources/sounds/zrtpAlert.wav

@ -767,6 +767,7 @@ public void run()
*/
private static void stopAllSounds()
{
NotificationManager.stopSound(NotificationManager.DIALING);
NotificationManager.stopSound(NotificationManager.BUSY_CALL);
NotificationManager.stopSound(NotificationManager.INCOMING_CALL);
NotificationManager.stopSound(NotificationManager.OUTGOING_CALL);

@ -69,6 +69,19 @@ public void peerStateChanged(CallPeerChangeEvent evt)
String newStateString = sourcePeer.getState().getStateString();
// Play the dialing audio when in connecting and initiating call state.
// Stop the dialing audio when we enter any other state.
if (newState == CallPeerState.INITIATING_CALL
|| newState == CallPeerState.CONNECTING)
{
NotificationManager
.fireNotification(NotificationManager.DIALING);
}
else
{
NotificationManager.stopSound(NotificationManager.DIALING);
}
if (newState == CallPeerState.ALERTING_REMOTE_SIDE)
{
NotificationManager

@ -21,6 +21,8 @@ public class NotificationManager
public static final String BUSY_CALL = "BusyCall";
public static final String DIALING = "Dialing";
public static final String PROACTIVE_NOTIFICATION = "ProactiveNotification";
public static final String SECURITY_MESSAGE = "SecurityMessage";
@ -90,6 +92,16 @@ public static void registerGuiNotifications()
NotificationService.ACTION_SOUND,
busyCallSoundHandler);
// Register dial notifications.
SoundNotificationHandler dialSoundHandler
= notificationService
.createSoundNotificationHandler(SoundProperties.DIALING, 0);
notificationService.registerDefaultNotificationForEvent(
DIALING,
NotificationService.ACTION_SOUND,
dialSoundHandler);
// Register proactive notifications.
notificationService.registerDefaultNotificationForEvent(
PROACTIVE_NOTIFICATION,

@ -50,6 +50,8 @@ public final class SoundProperties
public static final String BUSY;
public static final String DIALING;
public static final String CALL_SECURITY_ON;
public static final String CALL_SECURITY_ERROR;
@ -84,6 +86,7 @@ public final class SoundProperties
DIAL_DIEZ = resources.getSoundPath("DIAL_DIEZ");
DIAL_STAR = resources.getSoundPath("DIAL_STAR");
BUSY = resources.getSoundPath("BUSY");
DIALING = resources.getSoundPath("DIAL");
CALL_SECURITY_ON = resources.getSoundPath("CALL_SECURITY_ON");
CALL_SECURITY_ERROR = resources.getSoundPath("CALL_SECURITY_ERROR");
}

Loading…
Cancel
Save