192. WaitForSilence()

Wartet auf eine festgelegte Dauer von Stille.

WaitForSilence(Dauer[,Wiederholungen[,Timeout]])

Wartet auf Dauer Millisekunden Stille. Mit der Angabe von Wiederholungen wird auf so viele Auftreten von Stille gewartet, sonst auf das einmalige Auftreten. Nach maximal Timeout Sekunden wird abgebrochen, wenn dieser Parameter angegeben ist.

; auf 2 Vorkommen von Stille von jeweils 500 ms warten:
exten => 123,1,Answer()
exten => 123,n,WaitForSilence(500,2)
exten => 123,n,Playback(endlich-sind-sie-mal-still)

Asterisk-Versionen: 

————————| 1.2 |————————| 1.4 |————————| 1.6 |————————

Interner Hilfetext zu dieser Applikation in Asterisk 1.4: 

  -= Info about application 'WaitForSilence' =-

[Synopsis]
Waits for a specified amount of silence

[Description]
  WaitForSilence(silencerequired[|iterations][|timeout])
Wait for Silence: Waits for up to 'silencerequired'
milliseconds of silence, 'iterations' times or once if omitted.
An optional timeout specified the number of seconds to return
after, even if we do not receive the specified amount of silence.
Use 'timeout' with caution, as it may defeat the purpose of this
application, which is to wait indefinitely until silence is detected
on the line.  This is particularly useful for reverse-911-type
call broadcast applications where you need to wait for an answering
machine to complete its spiel before playing a message.
The timeout parameter is specified only to avoid an infinite loop in
cases where silence is never achieved.  Typically you will want to
include two or more calls to WaitForSilence when dealing with an answering
machine; first waiting for the spiel to finish, then waiting for the beep, etc.

Examples:
  - WaitForSilence(500|2) will wait for 1/2 second of silence, twice
  - WaitForSilence(1000) will wait for 1 second of silence, once
  - WaitForSilence(300|3|10) will wait for 300ms silence, 3 times,
     and returns after 10 sec, even if silence is not detected

Sets the channel variable WAITSTATUS with to one of these values:
SILENCE - if exited with silence detected
TIMEOUT - if exited without silence detected after timeout

Differenz des internen Hilfetexts von Asterisk 1.2 zu 1.4: 

--- in Asterisk 1.2
+++ in Asterisk 1.4
@@ -4,8 +4,27 @@
   Waits for a specified amount of silence

   [Description]
-    WaitForSilence(x[|y]) Wait for Silence: Waits for up to 'x'
-  milliseconds of silence, 'y' times or 1 if omitted
-  Set the channel variable WAITSTATUS with to one of these values:SILENCE - if silence of x ms was detectedTIMEOUT - if silence of x ms was not detected.Examples:
+    WaitForSilence(silencerequired[|iterations][|timeout])
+  Wait for Silence: Waits for up to 'silencerequired'
+  milliseconds of silence, 'iterations' times or once if omitted.
+  An optional timeout specified the number of seconds to return
+  after, even if we do not receive the specified amount of silence.
+  Use 'timeout' with caution, as it may defeat the purpose of this
+  application, which is to wait indefinitely until silence is detected
+  on the line.  This is particularly useful for reverse-911-type
+  call broadcast applications where you need to wait for an answering
+  machine to complete its spiel before playing a message.
+  The timeout parameter is specified only to avoid an infinite loop in
+  cases where silence is never achieved.  Typically you will want to
+  include two or more calls to WaitForSilence when dealing with an answering
+  machine; first waiting for the spiel to finish, then waiting for the beep, etc.
+
+  Examples:
     - WaitForSilence(500|2) will wait for 1/2 second of silence, twice
     - WaitForSilence(1000) will wait for 1 second of silence, once
+    - WaitForSilence(300|3|10) will wait for 300ms silence, 3 times,
+       and returns after 10 sec, even if silence is not detected
+
+  Sets the channel variable WAITSTATUS with to one of these values:
+  SILENCE - if exited with silence detected
+  TIMEOUT - if exited without silence detected after timeout

Differenz des internen Hilfetexts von Asterisk 1.4 zu 1.6: 

--- in Asterisk 1.4
+++ in Asterisk 1.6
@@ -4,7 +4,7 @@
   Waits for a specified amount of silence

   [Description]
-    WaitForSilence(silencerequired[|iterations][|timeout])
+    WaitForSilence(silencerequired[,iterations][,timeout]):
   Wait for Silence: Waits for up to 'silencerequired'
   milliseconds of silence, 'iterations' times or once if omitted.
   An optional timeout specified the number of seconds to return
@@ -20,9 +20,9 @@
   machine; first waiting for the spiel to finish, then waiting for the beep, etc.

   Examples:
-    - WaitForSilence(500|2) will wait for 1/2 second of silence, twice
+    - WaitForSilence(500,2) will wait for 1/2 second of silence, twice
     - WaitForSilence(1000) will wait for 1 second of silence, once
-    - WaitForSilence(300|3|10) will wait for 300ms silence, 3 times,
+    - WaitForSilence(300,3,10) will wait for 300ms silence, 3 times,
        and returns after 10 sec, even if silence is not detected

   Sets the channel variable WAITSTATUS with to one of these values:

Siehe auch. Abschnitt 190, „WaitForNoise()


AMOOCON 2010

Noch kein Ticket? Dann wird es Zeit. Nur noch wenige Tage.

Twitter

Flattr

Das gedruckte Buch

Werbung