C.20. ChanSpy()

Einen Channel belauschen.
ChanSpy([Channelpräfix[,Optionen]])
Erlaubt es, das Gespräch auf beliebigen Kanälen mitzuhören. (ChanSpy() ist also nicht wie ZapBarge() bzw. ZapScan() an Zap-Kanäle gebunden.) Für das Verständnis einiger Optionen ist zu beachten, dass diese Applikation einzelne Kanäle abhört, aber nicht Gespräche im eigentlichen Sinne (mindestens 2 Teilnehmer), obwohl Sie natürlich das ein- und ausgehende Audio auf dem abgehörten Channel hören können. Bitte achten Sie jedoch die Persönlichkeitsrechte anderer! Falls Sie Gespräche unaufgefordert und ohne Wissen der Teilnehmer mithören, machen Sie sich strafbar.
Wenn Channelpräfix angegeben ist, stehen nur Kanäle, die mit diesem String beginnen, zur Auswahl.
Optionen (auch in Kombination):
b
(bridged) Auswahl nur auf verbundene Kanäle beschränken.
g(grp)
(group) Auswahl auf Kanäle beschränken, auf denen grp in der durch Doppelpunkt (:) getrennten Liste ${SPYGROUP} (Channel-Variable) enthalten ist.
q
(quiet) Keine Piep-Töne beim Umschalten von Kanälen spielen und Channel-Name nicht ankündigen.
r([Name])
(record) Die Sitzung in einer Datei im Verzeichnis /var/spool/asterisk/monitor/ aufzeichnen. Der Default-Basis-Dateiname (also ohne Endung) ist chanspy.
v[(Wert)]
(volume) Die anfängliche Lautstärkeeinstellung von -4 (leise) bis 4 (laut) verändern.
w
(whisper) Flüster-Modus aktivieren. Damit kann der lauschende Channel mit dem belauschten sprechen, wobei dies nur der belauschte Channel hört, nicht dessen Gesprächspartner. (Diese Option ist seit Asterisk 1.4 verfügbar.)
W
(private whisper) Privater Flüster-Modus. Wie w, aber der lauschende Channel kann den belauschten nicht hören. (Ob das sinnvoll ist?)
Während des Abhörens können folgende Tastenbefehle gegeben werden:
#
Schaltet durch die Lautstärkeeinstellung (-4 bis 4).
*
Schaltet zu einem anderen Channel.
...#
Eine Reihe von Ziffern, abgeschlossen durch #, wird an Channelpräfix angehängt. Wenn Sie z. B. ChanSpy(Agent) ausführen und 1234# eingeben, werden Sie auf dem Channel Agent/1234 lauschen.
; Agenten belauschen:
exten => 123,1,ChanSpy(Agent)
exten => 123,n,Hangup()

; Beispiel für die Option g:
; auf Anrufen auf 0... SPYGROUP 10005 setzen:
exten => _0.,1,Set(SPYGROUP=10005)
;...
; Kanäle der SPYGROUP 10005 belauschen:
exten => 123,1,ChanSpy(,g(10005))
exten => 123,n,Hangup()
Asterisk-Versionen:
————————| 1.2 |————————| 1.4 |————————| 1.6 |————————
Interner Hilfetext zu dieser Applikation in Asterisk 1.4:
  -= Info about application 'ChanSpy' =-

[Synopsis]
Listen to a channel, and optionally whisper into it

[Description]
  ChanSpy([chanprefix][|options]): This application is used to listen to the
audio from an Asterisk channel. This includes the audio coming in and
out of the channel being spied on. If the 'chanprefix' parameter is specified,
only channels beginning with this string will be spied upon.
  While spying, the following actions may be performed:
    - Dialing # cycles the volume level.
    - Dialing * will stop spying and look for another channel to spy on.
    - Dialing a series of digits followed by # builds a channel name to append
      to 'chanprefix'. For example, executing ChanSpy(Agent) and then dialing
      the digits '1234#' while spying will begin spying on the channel
      'Agent/1234'.
  Options:
    b             - Only spy on channels involved in a bridged call.
    g(grp)        - Match only channels where their ${SPYGROUP} variable is set to
                    contain 'grp' in an optional : delimited list.
    q             - Don't play a beep when beginning to spy on a channel, or speak the
                    selected channel name.
    r[(basename)] - Record the session to the monitor spool directory. An
                    optional base for the filename may be specified. The
                    default is 'chanspy'.
    v([value])    - Adjust the initial volume in the range from -4 to 4. A
                    negative value refers to a quieter setting.
    w             - Enable 'whisper' mode, so the spying channel can talk to
                    the spied-on channel.
    W             - Enable 'private whisper' mode, so the spying channel can
                    talk to the spied-on channel but cannot listen to that
                    channel.
Differenz des internen Hilfetexts von Asterisk 1.2 zu 1.4:
--- in Asterisk 1.2
+++ in Asterisk 1.4
@@ -1,27 +1,33 @@
     -= Info about application 'ChanSpy' =-

   [Synopsis]
-  Listen to the audio of an active channel
+  Listen to a channel, and optionally whisper into it

   [Description]
     ChanSpy([chanprefix][|options]): This application is used to listen to the
-  audio from an active Asterisk channel. This includes the audio coming in and
+  audio from an Asterisk channel. This includes the audio coming in and
   out of the channel being spied on. If the 'chanprefix' parameter is specified,
   only channels beginning with this string will be spied upon.
-    While Spying, the following actions may be performed:
+    While spying, the following actions may be performed:
       - Dialing # cycles the volume level.
       - Dialing * will stop spying and look for another channel to spy on.
       - Dialing a series of digits followed by # builds a channel name to append
         to 'chanprefix'. For example, executing ChanSpy(Agent) and then dialing
-        the digits '1234#' while spying will begin spying on the channel,
+        the digits '1234#' while spying will begin spying on the channel
         'Agent/1234'.
     Options:
-      b - Only spy on channels involved in a bridged call.
-      g(grp) - Match only channels where their ${SPYGROUP} variable is set to
-               'grp'.
-      q - Don't play a beep when beginning to spy on a channel.
+      b             - Only spy on channels involved in a bridged call.
+      g(grp)        - Match only channels where their ${SPYGROUP} variable is set to
+                      contain 'grp' in an optional : delimited list.
+      q             - Don't play a beep when beginning to spy on a channel, or speak the
+                      selected channel name.
       r[(basename)] - Record the session to the monitor spool directory. An
                       optional base for the filename may be specified. The
                       default is 'chanspy'.
-      v([value]) - Adjust the initial volume in the range from -4 to 4. A
-                   negative value refers to a quieter setting.
+      v([value])    - Adjust the initial volume in the range from -4 to 4. A
+                      negative value refers to a quieter setting.
+      w             - Enable 'whisper' mode, so the spying channel can talk to
+                      the spied-on channel.
+      W             - Enable 'private whisper' mode, so the spying channel can
+                      talk to the spied-on channel but cannot listen to that
+                      channel.
Differenz des internen Hilfetexts von Asterisk 1.4 zu 1.6:
--- in Asterisk 1.4
+++ in Asterisk 1.6
@@ -4,7 +4,7 @@
   Listen to a channel, and optionally whisper into it

   [Description]
-    ChanSpy([chanprefix][|options]): This application is used to listen to the
+    ChanSpy([chanprefix][,options]): This application is used to listen to the
   audio from an Asterisk channel. This includes the audio coming in and
   out of the channel being spied on. If the 'chanprefix' parameter is specified,
   only channels beginning with this string will be spied upon.
@@ -14,20 +14,54 @@
       - Dialing a series of digits followed by # builds a channel name to append
         to 'chanprefix'. For example, executing ChanSpy(Agent) and then dialing
         the digits '1234#' while spying will begin spying on the channel
-        'Agent/1234'.
+        'Agent/1234'. Note that this feature will be overriden if the 'd' option
+         is used
+    Note: The X option supersedes the three features above in that if a valid
+          single digit extension exists in the correct context ChanSpy will
+          exit to it. This also disables choosing a channel based on 'chanprefix'
+          and a digit sequence.
     Options:
-      b             - Only spy on channels involved in a bridged call.
-      g(grp)        - Match only channels where their ${SPYGROUP} variable is set to
-                      contain 'grp' in an optional : delimited list.
-      q             - Don't play a beep when beginning to spy on a channel, or speak the
-                      selected channel name.
-      r[(basename)] - Record the session to the monitor spool directory. An
-                      optional base for the filename may be specified. The
-                      default is 'chanspy'.
-      v([value])    - Adjust the initial volume in the range from -4 to 4. A
-                      negative value refers to a quieter setting.
-      w             - Enable 'whisper' mode, so the spying channel can talk to
-                      the spied-on channel.
-      W             - Enable 'private whisper' mode, so the spying channel can
-                      talk to the spied-on channel but cannot listen to that
-                      channel.
+      b                      - Only spy on channels involved in a bridged call.
+      B                      - Instead of whispering on a single channel barge in on both
+                               channels involved in the call.
+      d                      - Override the typical numeric DTMF functionality and instead
+                               use DTMF to switch between spy modes.
+                                       4 = spy mode
+                                       5 = whisper mode
+                                       6 = barge mode
+      g(grp)                 - Only spy on channels in which one or more of the groups
+                               listed in 'grp' matches one or more groups from the
+                               SPYGROUP variable set on the channel to be spied upon.
+                               Note that both 'grp' and SPYGROUP can contain either a
+                               single group or a colon-delimited list of groups, such
+                               as 'sales:support:accounting'.
+      n([mailbox][@context]) - Say the name of the person being spied on if that person has recorded
+                               his/her name. If a context is specified, then that voicemail context will
+                               be searched when retrieving the name, otherwise the "default" context
+                               will be searched. If no mailbox is specified, then the channel name will
+                               be used when searching for the name (i.e. if SIP/1000 is the channel being
+                               spied on and no mailbox is specified, then "1000" will be used when searching
+                               for the name).
+      q                      - Don't play a beep when beginning to spy on a channel, or speak the
+                               selected channel name.
+      r[(basename)]          - Record the session to the monitor spool directory. An
+                               optional base for the filename may be specified. The
+                               default is 'chanspy'.
+      s                      - Skip the playback of the channel type (i.e. SIP, IAX, etc) when
+                               speaking the selected channel name.
+      v([value])             - Adjust the initial volume in the range from -4 to 4. A
+                               negative value refers to a quieter setting.
+      w                      - Enable 'whisper' mode, so the spying channel can talk to
+                               the spied-on channel.
+      W                      - Enable 'private whisper' mode, so the spying channel can
+                               talk to the spied-on channel but cannot listen to that
+                               channel.
+      o                      - Only listen to audio coming from this channel.
+      X                      - Allow the user to exit ChanSpy to a valid single digit
+                               numeric extension in the current context or the context
+                               specified by the SPY_EXIT_CONTEXT channel variable. The
+                               name of the last channel that was spied on will be stored
+                               in the SPY_CHANNEL variable.
+      e(ext)                 - Enable 'enforced' mode, so the spying channel can
+                               only monitor extensions whose name is in the 'ext' :
+                               delimited list.