Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
91f210a5
提交
91f210a5
authored
1月 04, 2014
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_rayo CPA - added detector abstraction
上级
e6ec1478
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
616 行增加
和
1 行删除
+616
-1
rayo.conf.xml
conf/rayo/autoload_configs/rayo.conf.xml
+53
-0
Makefile
src/mod/event_handlers/mod_rayo/Makefile
+2
-0
rayo.conf.xml
...ent_handlers/mod_rayo/conf/autoload_configs/rayo.conf.xml
+53
-0
rayo_cpa_detector.c
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c
+435
-0
rayo_cpa_detector.h
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.h
+68
-0
rayo_input_component.c
src/mod/event_handlers/mod_rayo/rayo_input_component.c
+5
-1
没有找到文件。
conf/rayo/autoload_configs/rayo.conf.xml
浏览文件 @
91f210a5
...
@@ -22,6 +22,59 @@
...
@@ -22,6 +22,59 @@
<param
name=
"receivefax-file-prefix"
value=
"/tmp/"
/>
<param
name=
"receivefax-file-prefix"
value=
"/tmp/"
/>
</fax>
</fax>
<!-- Call progress analysis configuration -->
<!-- Define CPA detectors. These are sources for Rayo CPA signal events -->
<!-- Detectors must fire an event that can be translated by mod_rayo into a CPA signal event -->
<cpa>
<!-- map mod_spandsp fax detector to the Rayo CPA events. Fires DETECTED_FAX_* event once and quits. -->
<detector
name=
"mod_spandsp_fax_ced"
>
<start
application=
"spandsp_start_fax_detect"
data=
"event 'Event-Name=CUSTOM,Event-Subclass=DETECTED_FAX_CED' 500 ced"
/>
<stop
application=
"spandsp_stop_fax_detect"
data=
""
/>
<event
class=
"CUSTOM"
subclass=
"DETECTED_FAX_CED"
>
<signal-type
value=
"fax-ced"
/>
</event>
</detector>
<detector
name=
"mod_spandsp_fax_cng"
>
<start
application=
"spandsp_start_fax_detect"
data=
"event 'Event-Name=CUSTOM,Event-Subclass=DETECTED_FAX_CNG' 500"
/>
<stop
application=
"spandsp_stop_fax_detect"
data=
""
/>
<event
class=
"CUSTOM"
subclass=
"DETECTED_FAX_CNG"
>
<signal-type
value=
"fax-cng"
/>
</event>
</detector>
<!-- map mod_spandsp call progress tone detector to Rayo CPA signal events. Fires DETECTED_TONE events until stopped. -->
<detector
name=
"mod_spandsp_tone"
>
<start
application=
"start_tone_detect"
data=
"1"
/>
<stop
application=
"stop_tone_detect"
data=
""
/>
<!-- map tone events to Rayo CPA signal type -->
<event
class=
"CUSTOM"
subclass=
"DETECTED_TONE"
type-header=
"Detected-Tone"
>
<signal-type
header-value=
"SIT"
value=
"sit"
/>
<signal-type
header-value=
"BUSY_TONE"
value=
"busy"
/>
<signal-type
header-value=
"REORDER_TONE"
value=
"congestion"
/>
<signal-type
header-value=
"RING_TONE"
value=
"ring"
/>
</event>
</detector>
<!-- map mod_avmd detector to Rayo CPA beep event. Fires avmd::beep event once. -->
<detector
name=
"mod_avmd"
>
<start
application=
"avmd"
data=
""
/>
<stop
application=
"avmd"
data=
"stop"
/>
<event
class=
"CUSTOM"
subclass=
"avmd::beep"
>
<signal-type
value=
"beep"
/>
</event>
</detector>
<!-- Alternative beep detector using mod_vmd. Fires vmd::beep events until stopped. -->
<!--detector name="mod_vmd">
<start application="vmd" data=""/>
<stop application="vmd" data="stop"/>
<event class="CUSTOM" subclass="vmd::beep">
<signal-type value="beep"/>
</event>
</detector-->
</cpa>
<!-- XMPP server domain -->
<!-- XMPP server domain -->
<domain
name=
"$${rayo_domain_name}"
shared-secret=
"ClueCon"
>
<domain
name=
"$${rayo_domain_name}"
shared-secret=
"ClueCon"
>
<!-- use this instead if you want secure XMPP client to server connections. Put .crt and .key file in freeswitch/certs -->
<!-- use this instead if you want secure XMPP client to server connections. Put .crt and .key file in freeswitch/certs -->
...
...
src/mod/event_handlers/mod_rayo/Makefile
浏览文件 @
91f210a5
...
@@ -10,6 +10,7 @@ LOCAL_OBJS= $(IKS_LA) \
...
@@ -10,6 +10,7 @@ LOCAL_OBJS= $(IKS_LA) \
iks_helpers.o
\
iks_helpers.o
\
nlsml.o
\
nlsml.o
\
rayo_components.o
\
rayo_components.o
\
rayo_cpa_detector.o
\
rayo_elements.o
\
rayo_elements.o
\
rayo_fax_components.o
\
rayo_fax_components.o
\
rayo_input_component.o
\
rayo_input_component.o
\
...
@@ -23,6 +24,7 @@ LOCAL_SOURCES= \
...
@@ -23,6 +24,7 @@ LOCAL_SOURCES= \
iks_helpers.c
\
iks_helpers.c
\
nlsml.c
\
nlsml.c
\
rayo_components.c
\
rayo_components.c
\
rayo_cpa_detector.c
\
rayo_elements.c
\
rayo_elements.c
\
rayo_fax_components.c
\
rayo_fax_components.c
\
rayo_input_component.c
\
rayo_input_component.c
\
...
...
src/mod/event_handlers/mod_rayo/conf/autoload_configs/rayo.conf.xml
浏览文件 @
91f210a5
...
@@ -22,6 +22,59 @@
...
@@ -22,6 +22,59 @@
<param
name=
"receivefax-file-prefix"
value=
"/tmp/"
/>
<param
name=
"receivefax-file-prefix"
value=
"/tmp/"
/>
</fax>
</fax>
<!-- Call progress analysis configuration -->
<!-- Define CPA detectors. These are sources for Rayo CPA signal events -->
<!-- Detectors must fire an event that can be translated by mod_rayo into a CPA signal event -->
<cpa>
<!-- map mod_spandsp fax detector to the Rayo CPA events. Fires DETECTED_FAX_* event once and quits. -->
<detector
name=
"mod_spandsp_fax_ced"
>
<start
application=
"spandsp_start_fax_detect"
data=
"event 'Event-Name=CUSTOM,Event-Subclass=DETECTED_FAX_CED' 500 ced"
/>
<stop
application=
"spandsp_stop_fax_detect"
data=
""
/>
<event
class=
"CUSTOM"
subclass=
"DETECTED_FAX_CED"
>
<signal-type
value=
"fax-ced"
/>
</event>
</detector>
<detector
name=
"mod_spandsp_fax_cng"
>
<start
application=
"spandsp_start_fax_detect"
data=
"event 'Event-Name=CUSTOM,Event-Subclass=DETECTED_FAX_CNG' 500"
/>
<stop
application=
"spandsp_stop_fax_detect"
data=
""
/>
<event
class=
"CUSTOM"
subclass=
"DETECTED_FAX_CNG"
>
<signal-type
value=
"fax-cng"
/>
</event>
</detector>
<!-- map mod_spandsp call progress tone detector to Rayo CPA signal events. Fires DETECTED_TONE events until stopped. -->
<detector
name=
"mod_spandsp_tone"
>
<start
application=
"start_tone_detect"
data=
"1"
/>
<stop
application=
"stop_tone_detect"
data=
""
/>
<!-- map tone events to Rayo CPA signal type -->
<event
class=
"CUSTOM"
subclass=
"DETECTED_TONE"
type-header=
"Detected-Tone"
>
<signal-type
header-value=
"SIT"
value=
"sit"
/>
<signal-type
header-value=
"BUSY_TONE"
value=
"busy"
/>
<signal-type
header-value=
"REORDER_TONE"
value=
"congestion"
/>
<signal-type
header-value=
"RING_TONE"
value=
"ring"
/>
</event>
</detector>
<!-- map mod_avmd detector to Rayo CPA beep event. Fires avmd::beep event once. -->
<detector
name=
"mod_avmd"
>
<start
application=
"avmd"
data=
""
/>
<stop
application=
"avmd"
data=
"stop"
/>
<event
class=
"CUSTOM"
subclass=
"avmd::beep"
>
<signal-type
value=
"beep"
/>
</event>
</detector>
<!-- Alternative beep detector using mod_vmd. Fires vmd::beep events until stopped. -->
<!--detector name="mod_vmd">
<start application="vmd" data=""/>
<stop application="vmd" data="stop"/>
<event class="CUSTOM" subclass="vmd::beep">
<signal-type value="beep"/>
</event>
</detector-->
</cpa>
<!-- XMPP server domain -->
<!-- XMPP server domain -->
<domain
name=
"$${rayo_domain_name}"
shared-secret=
"ClueCon"
>
<domain
name=
"$${rayo_domain_name}"
shared-secret=
"ClueCon"
>
<!-- use this instead if you want secure XMPP client to server connections. Put .crt and .key file in freeswitch/certs -->
<!-- use this instead if you want secure XMPP client to server connections. Put .crt and .key file in freeswitch/certs -->
...
...
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.c
0 → 100644
浏览文件 @
91f210a5
差异被折叠。
点击展开。
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.h
0 → 100644
浏览文件 @
91f210a5
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2014, Grasshopper
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is Grasshopper
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Chris Rienzo <chris.rienzo@grasshopper.com>
*
* rayo_cpa_detector.h -- Rayo call progress analysis
*
*/
#ifndef RAYO_CPA_DETECTOR_H
#define RAYO_CPA_DETECTOR_H
#include <switch.h>
#include "mod_rayo.h"
#define RAYO_CPA_BASE RAYO_BASE "cpa:"
#define RAYO_CPA_NS RAYO_CPA_BASE RAYO_VERSION
#define RAYO_CPA_BEEP_NS RAYO_CPA_BASE "beep:" RAYO_VERSION
#define RAYO_CPA_DTMF_NS RAYO_CPA_BASE "dtmf:" RAYO_VERSION
#define RAYO_CPA_SPEECH_NS RAYO_CPA_BASE "speech:" RAYO_VERSION
#define RAYO_CPA_FAX_CED_NS RAYO_CPA_BASE "fax-ced:" RAYO_VERSION
#define RAYO_CPA_FAX_CNG_NS RAYO_CPA_BASE "fax-cng:" RAYO_VERSION
#define RAYO_CPA_RING_NS RAYO_CPA_BASE "ring:" RAYO_VERSION
#define RAYO_CPA_BUSY_NS RAYO_CPA_BASE "busy:" RAYO_VERSION
#define RAYO_CPA_CONGESTION_NS RAYO_CPA_BASE "congestion:" RAYO_VERSION
#define RAYO_CPA_SIT_NS RAYO_CPA_BASE "sit:" RAYO_VERSION
#define RAYO_CPA_MODEM_NS RAYO_CPA_BASE "modem:" RAYO_VERSION
#define RAYO_CPA_OFFHOOK_NS RAYO_CPA_BASE "offhook:" RAYO_VERSION
extern
switch_status_t
rayo_cpa_detector_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
void
rayo_cpa_detector_shutdown
(
void
);
extern
int
rayo_cpa_detector_start
(
const
char
*
call_uuid
,
const
char
*
signal_ns
,
const
char
**
error_detail
);
extern
void
rayo_cpa_detector_stop
(
const
char
*
call_uuid
,
const
char
*
signal_ns
);
#endif
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet
*/
src/mod/event_handlers/mod_rayo/rayo_input_component.c
浏览文件 @
91f210a5
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
*
*
*/
*/
#include "rayo_components.h"
#include "rayo_components.h"
#include "rayo_cpa_detector.h"
#include "rayo_elements.h"
#include "rayo_elements.h"
#include "srgs.h"
#include "srgs.h"
#include "nlsml.h"
#include "nlsml.h"
...
@@ -760,7 +761,7 @@ switch_status_t rayo_input_component_load(switch_loadable_module_interface_t **m
...
@@ -760,7 +761,7 @@ switch_status_t rayo_input_component_load(switch_loadable_module_interface_t **m
rayo_actor_command_handler_add
(
RAT_CALL_COMPONENT
,
"input"
,
"set:"
RAYO_INPUT_NS
":start-timers"
,
start_timers_call_input_component
);
rayo_actor_command_handler_add
(
RAT_CALL_COMPONENT
,
"input"
,
"set:"
RAYO_INPUT_NS
":start-timers"
,
start_timers_call_input_component
);
switch_event_bind
(
"rayo_input_component"
,
SWITCH_EVENT_DETECTED_SPEECH
,
SWITCH_EVENT_SUBCLASS_ANY
,
on_detected_speech_event
,
NULL
);
switch_event_bind
(
"rayo_input_component"
,
SWITCH_EVENT_DETECTED_SPEECH
,
SWITCH_EVENT_SUBCLASS_ANY
,
on_detected_speech_event
,
NULL
);
return
SWITCH_STATUS_SUCCESS
;
return
rayo_cpa_detector_load
(
module_interface
,
pool
,
config_file
)
;
}
}
/**
/**
...
@@ -771,6 +772,9 @@ switch_status_t rayo_input_component_shutdown(void)
...
@@ -771,6 +772,9 @@ switch_status_t rayo_input_component_shutdown(void)
{
{
srgs_parser_destroy
(
globals
.
parser
);
srgs_parser_destroy
(
globals
.
parser
);
switch_event_unbind_callback
(
on_detected_speech_event
);
switch_event_unbind_callback
(
on_detected_speech_event
);
rayo_cpa_detector_shutdown
();
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论