Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
65400642
提交
65400642
authored
5月 31, 2010
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rework of new mod_spandsp to have functions broken up into different c files
上级
b46958fb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
2960 行增加
和
2644 行删除
+2960
-2644
Makefile.am
src/mod/applications/mod_spandsp/Makefile.am
+1
-1
mod_spandsp.2008.vcproj
src/mod/applications/mod_spandsp/mod_spandsp.2008.vcproj
+16
-0
mod_spandsp.c
src/mod/applications/mod_spandsp/mod_spandsp.c
+36
-2643
mod_spandsp.h
src/mod/applications/mod_spandsp/mod_spandsp.h
+64
-0
mod_spandsp_codecs.c
src/mod/applications/mod_spandsp/mod_spandsp_codecs.c
+962
-0
mod_spandsp_dsp.c
src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
+138
-0
mod_spandsp_fax.c
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
+1743
-0
没有找到文件。
src/mod/applications/mod_spandsp/Makefile.am
浏览文件 @
65400642
...
...
@@ -10,7 +10,7 @@ SPANDSP_BUILDDIR=$(switch_builddir)/libs/spandsp
SPANDSP_LA
=
$(SPANDSP_BUILDDIR)
/src/libspandsp.la
mod_LTLIBRARIES
=
mod_spandsp.la
mod_spandsp_la_SOURCES
=
mod_spandsp.c udptl.c
mod_spandsp_la_SOURCES
=
mod_spandsp.c udptl.c
mod_spandsp_fax.c mod_spandsp_dsp.c mod_spandsp_codecs.c
mod_spandsp_la_CFLAGS
=
$(AM_CFLAGS)
-I
$(SPANDSP_DIR)
/src
-I
$(TIFF_DIR)
/libtiff
-I
$(SPANDSP_BUILDDIR)
/src
-I
$(TIFF_BUILDDIR)
/libtiff
-I
.
mod_spandsp_la_LIBADD
=
$(switch_builddir)
/libfreeswitch.la
$(SPANDSP_LA)
$(TIFF_LA)
mod_spandsp_la_LDFLAGS
=
-avoid-version
-module
-no-undefined
-shared
-ljpeg
...
...
src/mod/applications/mod_spandsp/mod_spandsp.2008.vcproj
浏览文件 @
65400642
...
...
@@ -285,6 +285,22 @@
RelativePath=
".\mod_spandsp.c"
>
</File>
<File
RelativePath=
".\mod_spandsp.h"
>
</File>
<File
RelativePath=
".\mod_spandsp_fax.c"
>
</File>
<File
RelativePath=
".\mod_spandsp_dsp.c"
>
</File>
<File
RelativePath=
".\mod_spandsp_codecs.c"
>
</File>
<File
RelativePath=
".\udptl.c"
>
...
...
src/mod/applications/mod_spandsp/mod_spandsp.c
浏览文件 @
65400642
差异被折叠。
点击展开。
src/mod/applications/mod_spandsp/mod_spandsp.h
0 → 100644
浏览文件 @
65400642
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2010, Anthony Minessale II <anthm@freeswitch.org>
*
* 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 FreeSWITCH mod_spandsp.
*
* The Initial Developer of the Original Code is
* Massimo Cetra <devel@navynet.it>
*
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Brian West <brian@freeswitch.org>
* Anthony Minessale II <anthm@freeswitch.org>
* Steve Underwood <steveu@coppice.org>
* Antonio Gallo <agx@linux.it>
* mod_spandsp.h -- applications provided by SpanDSP
*
*/
#include <switch.h>
#ifdef WIN32
#define FAX_INVALID_SOCKET INVALID_HANDLE_VALUE
typedef
HANDLE
zap_socket_t
;
#else
#define FAX_INVALID_SOCKET -1
typedef
int
zap_socket_t
;
#endif
#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES
#include <spandsp.h>
typedef
enum
{
FUNCTION_TX
,
FUNCTION_RX
,
FUNCTION_GW
}
mod_spandsp_fax_application_mode_t
;
void
mod_spandsp_fax_shutdown
(
void
);
void
mod_spandsp_fax_load
(
switch_memory_pool_t
*
pool
);
void
mod_spandsp_fax_event_handler
(
switch_event_t
*
event
);
void
mod_spandsp_fax_process_fax
(
switch_core_session_t
*
session
,
const
char
*
data
,
mod_spandsp_fax_application_mode_t
app_mode
);
switch_bool_t
t38_gateway_start
(
switch_core_session_t
*
session
,
const
char
*
app
,
const
char
*
data
);
switch_status_t
spandsp_stop_inband_dtmf_session
(
switch_core_session_t
*
session
);
switch_status_t
spandsp_inband_dtmf_session
(
switch_core_session_t
*
session
);
switch_status_t
mod_spandsp_codecs_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
);
src/mod/applications/mod_spandsp/mod_spandsp_codecs.c
0 → 100644
浏览文件 @
65400642
差异被折叠。
点击展开。
src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
0 → 100644
浏览文件 @
65400642
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2010, Anthony Minessale II <anthm@freeswitch.org>
*
* 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 FreeSWITCH mod_spandsp.
*
* The Initial Developer of the Original Code is
* Massimo Cetra <devel@navynet.it>
*
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Brian West <brian@freeswitch.org>
* Anthony Minessale II <anthm@freeswitch.org>
* Steve Underwood <steveu@coppice.org>
* Antonio Gallo <agx@linux.it>
* mod_spandsp_dsp.c -- dsp applications provided by SpanDSP
*
*/
#include "mod_spandsp.h"
typedef
struct
{
switch_core_session_t
*
session
;
dtmf_rx_state_t
*
dtmf_detect
;
}
switch_inband_dtmf_t
;
static
switch_bool_t
inband_dtmf_callback
(
switch_media_bug_t
*
bug
,
void
*
user_data
,
switch_abc_type_t
type
)
{
switch_inband_dtmf_t
*
pvt
=
(
switch_inband_dtmf_t
*
)
user_data
;
switch_frame_t
*
frame
=
NULL
;
char
digit_str
[
80
];
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
pvt
->
session
);
switch
(
type
)
{
case
SWITCH_ABC_TYPE_INIT
:
pvt
->
dtmf_detect
=
dtmf_rx_init
(
NULL
,
NULL
,
NULL
);
break
;
case
SWITCH_ABC_TYPE_CLOSE
:
if
(
pvt
->
dtmf_detect
)
{
dtmf_rx_free
(
pvt
->
dtmf_detect
);
}
break
;
case
SWITCH_ABC_TYPE_READ_REPLACE
:
if
((
frame
=
switch_core_media_bug_get_read_replace_frame
(
bug
)))
{
dtmf_rx
(
pvt
->
dtmf_detect
,
frame
->
data
,
frame
->
samples
);
dtmf_rx_get
(
pvt
->
dtmf_detect
,
digit_str
,
sizeof
(
digit_str
));
if
(
digit_str
[
0
])
{
char
*
p
=
digit_str
;
while
(
p
&&
*
p
)
{
switch_dtmf_t
dtmf
;
dtmf
.
digit
=
*
p
;
dtmf
.
duration
=
switch_core_default_dtmf_duration
(
0
);
switch_channel_queue_dtmf
(
channel
,
&
dtmf
);
p
++
;
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
switch_core_media_bug_get_session
(
bug
)),
SWITCH_LOG_DEBUG
,
"DTMF DETECTED: [%s]
\n
"
,
digit_str
);
}
switch_core_media_bug_set_read_replace_frame
(
bug
,
frame
);
}
break
;
case
SWITCH_ABC_TYPE_WRITE
:
default:
break
;
}
return
SWITCH_TRUE
;
}
switch_status_t
spandsp_stop_inband_dtmf_session
(
switch_core_session_t
*
session
)
{
switch_media_bug_t
*
bug
;
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
if
((
bug
=
switch_channel_get_private
(
channel
,
"dtmf"
)))
{
switch_channel_set_private
(
channel
,
"dtmf"
,
NULL
);
switch_core_media_bug_remove
(
session
,
&
bug
);
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_FALSE
;
}
switch_status_t
spandsp_inband_dtmf_session
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_media_bug_t
*
bug
;
switch_status_t
status
;
switch_inband_dtmf_t
*
pvt
;
switch_codec_implementation_t
read_impl
=
{
0
};
switch_core_session_get_read_impl
(
session
,
&
read_impl
);
if
(
!
(
pvt
=
switch_core_session_alloc
(
session
,
sizeof
(
*
pvt
))))
{
return
SWITCH_STATUS_MEMERR
;
}
pvt
->
session
=
session
;
if
(
switch_channel_pre_answer
(
channel
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
}
if
((
status
=
switch_core_media_bug_add
(
session
,
"spandsp_dtmf_detect"
,
NULL
,
inband_dtmf_callback
,
pvt
,
0
,
SMBF_READ_REPLACE
,
&
bug
))
!=
SWITCH_STATUS_SUCCESS
)
{
return
status
;
}
switch_channel_set_private
(
channel
,
"dtmf"
,
bug
);
return
SWITCH_STATUS_SUCCESS
;
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:nil
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
0 → 100644
浏览文件 @
65400642
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论