`

DP: ChanSpy 的客製 - Asterisk监听

 
阅读更多

 

內容表格
  1. 1. 方式一:
  2. 2. 方式二:
  3. 3. 方法三:
  4. 4. 參考連結

SpyChan 用於第三者監聽兩方的通話,一般多用於 Call Center 系統。

設計一個 feature code 779 & 778 ,用於啟動/關閉分機的監聽功能。

[app-chanspy]
;include => app-chanspy-custom
;exten => 779,1,Authenticate(1234)
;exten => 779,n,Read(SPYNUM,extension)
;exten => 779,n,ChanSpy(SIP/${SPYNUM},q)
exten => 779,1,Authenticate(4567)
exten => 779,n,Goto(chanspy-ext,s,1)
; end of [app-chanspy]

[app-chanspy]
;include => app-chanspy-custom
exten => 778,1,Authenticate(4544)
exten => 778,n,Macro(user-callerid,)
exten => 778,n,Answer
exten => 778,n,Wait(1)
exten => 778,n,ChanSpy()
exten => 778,n,Hangup
; end of [app-chanspy]

[chanspy-ext]
exten => s,1,Background(extension)
exten => s,n,WaitExten(5)
exten => i,1,Playback(invalid)
exten => i,2,Goto(s,1)
exten => t,1,Playback(invalid)
exten => t,2,Goto(s,1)
exten => 111,1,ChanSpy(SIP/${EXTEN})

SPYGROUP 的運用

方式一:

7791 -> 分機開啟被監聽功能
7792 -> 分機關閉被監聽功能

[ext-local-custom]
exten => s,1,Set(GROUP=${DB(spygrp/${CALLERID(number)}))
exten => s,n,GotoIf($[${ISNULL(${GROUP})}]?:continue)
exten => s,n,NoOp(SPYGROUP is <${GROUP}> for ext.${CALLERID})
exten => s,n,Set(SPYGROUP=${GROUP})
exten => s,n(continue),NoOP(Ignore SPYGROUP...)
[app-chanspy-set-on]
exten => 7791,1,Answer
exten => 7791,n,Wait(1)
exten => 7791,n,Macro(user-callerid,)
exten => 7791,n,Set(DB(spygrp/${AMPUSER})=spyon)
exten => 7791,n,Playback(activated)
exten => 7791,n,Hangup
[app-chanspy-set-off]
exten => 7792,1,Answer
exten => 7792,n,Wait(1)
exten => 7792,n,Macro(user-callerid,)
exten => 7792,n,DBDel(spygrp/${AMPUSER})
exten => 7792,n,Playback(de-activated)
exten => 7792,n,Hangup

方式二:

用於所有 Inbound Call,若目的分機為 110-160 時,啟用監聽功能。
注意 Set(__SPYGROUP=spygrp),兩個底線的用法。

使用 override 方式修改 [macro-dial] 在 extensions.conf

[macro-dial]
exten => s,1,NoOp("------------ Set SPYGROUP -------------")
exten => s,n,Set(TOEXT=${ARG3})
;exten => s,n,Set(TOEXT="150")
; Spy activate to ext.110-160
;exten => s,n,GotoIf($[ $["x${LEN(${TOEXT})}"="x3"] & $["x${TOEXT:0:1}"="x1"] & $[${TOEXT:1:1}<=6] ]?spy:nospy)
exten => s,n,GotoIf($[ $["x${LEN(${TOEXT})}"="x3"] & $[${TOEXT:0:3}<=201] & $[${TOEXT:0:3}>110] ]?spy:continue)
exten => s,n(spy),Set(__SPYGROUP=spygrp)
exten => s,n(continue),NoOp("--------- Nothing --------")
exten => s,n,GotoIf($["${MOHCLASS}" = ""]?dial)
exten => s,n,SetMusicOnHold(${MOHCLASS})
exten => s,n(dial),AGI(dialparties.agi)
exten => s,n,NoOp(Returned from dialparties with no extensions to call and DIALSTATUS: ${DIALSTATUS})
...

方法三:

使用資料庫的方式來管理所有分機的 SPYGroup,非常實用,方便與其他系統作整合。 
官方網站:http://code.google.com/p/spygroup/

參考連結



Asterisk cmd ChanSpy

ChanSpy

Synopsis

Listen in on a call. Useful in a call center to monitor agents on the phone.

Description

See bug 3836

This adds the ability to spy on any bridged call, this includes VoIP only calls where ZapScan/ZapBarge couldn't this can.

Chanspy([<chanprefix>][,<options>])

Valid 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'. ChanSpy only records to a .raw file.
- v([value]): Adjust the initial volume in the range from -4 to 4. A negative value refers to a quieter setting.

Since 1.4:
- 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.

Since 1.6:
- 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.

If <chanprefix> is specified, only channel names *beginning* with that string will be scanned.
('all' or an empty string are also both valid <chanprefix>)

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>
(e.g. run ChanSpy(Agent) and dial 1234# while spying to jump to channel Agent/1234)

Update: Asterisk 1.4 includes a 'whisper' feature as part of ChanSpy(): A third party may speak to only one of the two parties of a bridged call.

Attention

  • Up to and including Asterisk 1.4.17 ChanSpy can cause a crash/segfault if used together with Monitor or MixMonitor at the same time. 1.4.18 is supposed to attack this issue by using "audiohooks" that replaces the current ChanSpy approach.

Example

exten => 556,1,ChanSpy(scan)

Note:

ChanSpy will not work if you are Record()-ing the spied channel; unless you add transmit_silence_during_record=yes to the options section in /etc/asterisk/asterisk.conf


See also

分享到:
评论

相关推荐

    certified-asterisk-11.6-current.tar

    标题 "certified-asterisk-11.6-current.tar" 提供了关于此压缩包的基本信息,它包含了一个经过认证的Asterisk版本11.6的当前构建。Asterisk是一个开源的IP电话系统软件,它允许用户创建VoIP(Voice over Internet ...

    CIN-CC-Asterisk-TG WEB管理系统使用手册

    ### CIN-CC-Asterisk-TG WEB管理系统详解 #### 系统简介 CIN-CC-Asterisk-TG WEB管理系统是一款专为呼叫中心设计的综合管理平台,旨在为企业用户提供高效便捷的通信解决方案。该系统面向多种网络环境,包括PSTN...

    Asterisk-Admin-Guide-12

    《Asterisk-Admin-Guide-12》是一本专为Asterisk 12版本编写的管理指南,旨在帮助用户全面掌握该版本的各项功能与配置方法。本书由Asterisk开发团队编写,内容详尽实用。 #### 二、新特性介绍 在Asterisk 12中,...

    medium-clone-project

    asterisk: 模板引擎:PUG :eight-spoked_asterisk: RDBMS = PostgreSQL :eight-spoked_asterisk: ORM =续集 指示 克隆存储库。 从根目录运行npm install以安装所有依赖项。 运行npm start来启动应用程序。 在...

    asterisk--moh-opsound-wav-2.03.tar

    这个“asterisk-moh-opsound-wav-2.03.tar”压缩包是专门为Asterisk设计的,用于在Ubuntu系统环境中构建通信应用程序的声音资源。以下是关于Asterisk、Ubuntu系统、以及该压缩包中的具体知识点: 1. **Asterisk核心...

    Asterisk AMI 接口代码

    在给定的压缩包文件中,我们看到包含了一个名为"asterisk-java"的子文件,这可能是一个Java库,专门用于与Asterisk AMI进行通信。 Asterisk AMI接口基于TCP/IP协议,通常默认运行在5038端口上。它使用文本协议,每...

    SIP协议讲座-Asterisk.ppt

    讲座-Asterisk

    asterisk配置文件列表及常用指令

    ### Asterisk配置文件列表及常用指令解析 #### 一、配置文件详解 ##### asterisk.conf - **描述**: 主配置文件,主要作用是通知Asterisk环境目录的位置,并包含了其他所有配置文件所在的目录路径。 - **重要性**: ...

    通过asterisk-java操作asterisk

    Asterisk-java通过实现这个接口,允许开发者使用Java语言进行操作,例如登录到AMI服务器、监听事件、发送命令等。 1. **登录到Asterisk Manager**:使用Asterisk-java,你可以创建一个`ManagerConnection`对象,...

    geo-asterisk:在 3d 空间中创建 2d 星号类型的形状

    var geoAsterisk = require ( 'geo-asterisk' ) ; // geo will be a Object will two properties: // positions - the vertices // cells - the indices to draw the asterisk var geo = geoAsterisk ( { cellSize...

    install_centos7-Asterisk.rar_asterisk_voip

    【标题】"install_centos7-Asterisk.rar_asterisk_voip" 指的是在 CentOS 7 操作系统上安装和配置 Asterisk 电话交换系统的教程,重点关注 VoIP 技术。Asterisk 是一个开源的 PBX(Private Branch Exchange)软件,...

    slack-asterisk:用于将 slack 与 Asterisk 集成的 PHP 脚本

    复制此脚本或检出此 git repo 到您的 Asterisk 服务器,位于 /usr/src/slack-asterisk 等文件夹下 用法:php notify.php channelname event arg1 arg2 etc Channel names should not include the # Valid events...

    Qt-Asterisk-Desktop:用于Asterisk PBX系统的Qt桌面应用程序

    **Qt-Asterisk-Desktop: Asterisk PBX系统的Qt桌面应用详解** Qt-Asterisk-Desktop是一个基于Qt库开发的桌面应用程序,专为Asterisk Private Branch eXchange (PBX)系统设计。Asterisk是一款开源的IP电话系统,能够...

    asterisk16版本安装包

    - **下载源码**:获取到asterisk-16.19.0的压缩包并解压。 - **配置**:运行`./configure`脚本来检查系统环境并生成Makefile。 - **编译**:执行`make`命令编译源代码。 - **安装**:使用`sudo make install`将...

    asterisk-core-sounds-en-gsm-1.4.21.tar.gz

    《Asterisk核心语音资源: Asterisk-Core-Sounds-En-GSM-1.4.21详解》 在IT行业中,尤其是通信系统开发领域,Asterisk是一个不可忽视的名字。Asterisk是一款开源的PBX(Private Branch eXchange)系统,它允许用户...

    :eight-spoked_asterisk:React Native 的纯原生加载器指标:eight-spoked_asterisk:

    React Native Loader Kit 如果你喜欢这个项目,请给我一个 :star: 来鼓励我。 Happy hacking 目录安装使用列表动画演示安装使用npm:$ npm install react-native-loader-kit --save 使用yarn:$ yarn add react-...

    asterisk-ami-connector:适用于NodeJS的Asterisk AMI连接器(ES2015)

    $ npm i asterisk-ami-connector NodeJS版本 支持&gt;=4.0.0 用法 具有承诺的基本示例。 const connector = require ( 'asterisk-ami-connector' ) ( { reconnect : true } ) ; connector . connect ( 'login' , '...

    asterisk-java-master.zip_asterisk

    1. **API接口**:Asterisk-java提供了一系列的Java类和接口,如ManagerConnection用于建立和管理与Asterisk Manager Interface的连接,ManagerEventListener用于监听Asterisk服务器的事件,Channel类则用于操作通话...

    MonAst :: The Asterisk Monitor-开源

    MonAst可以帮助管理员创建、管理这些会议,邀请参与者,甚至监听或静音参会者。 5. **反向AJAX技术**:MonAst采用反向AJAX(也称为Comet)技术,使得页面无需刷新就能实时更新信息,提高了用户体验,同时也减轻了...

Global site tag (gtag.js) - Google Analytics