Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4c7b7c46
提交
4c7b7c46
authored
4月 06, 2012
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gsmopen: finished cleaning from alsa
上级
40a1fd8e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
0 行增加
和
65 行删除
+0
-65
gsmopen.h
src/mod/endpoints/mod_gsmopen/gsmopen.h
+0
-29
mod_gsmopen.cpp
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
+0
-36
没有找到文件。
src/mod/endpoints/mod_gsmopen/gsmopen.h
浏览文件 @
4c7b7c46
...
@@ -67,9 +67,6 @@
...
@@ -67,9 +67,6 @@
#endif //GIOVA48
#endif //GIOVA48
#define SAMPLERATE_GSMOPEN 8000
#define SAMPLERATE_GSMOPEN 8000
#ifndef NO_ALSA
#define GSMOPEN_ALSA
#endif // NO_ALSA
#include <switch.h>
#include <switch.h>
#include <switch_version.h>
#include <switch_version.h>
#ifndef WIN32
#ifndef WIN32
...
@@ -79,11 +76,6 @@
...
@@ -79,11 +76,6 @@
#endif //WIN32
#endif //WIN32
//#include <libteletone.h>
//#include <libteletone.h>
#ifdef GSMOPEN_ALSA
#define ALSA_PCM_NEW_HW_PARAMS_API
#define ALSA_PCM_NEW_SW_PARAMS_API
#include <alsa/asoundlib.h>
#endif
/* GSMOPEN_ALSA */
//#include "celliax_spandsp.h"
//#include "celliax_spandsp.h"
#ifndef WIN32
#ifndef WIN32
...
@@ -450,19 +442,6 @@ struct private_object {
...
@@ -450,19 +442,6 @@ struct private_object {
struct
timeval
ringtime
;
struct
timeval
ringtime
;
ciapa_t
*
owner
;
ciapa_t
*
owner
;
#ifdef GSMOPEN_ALSA
snd_pcm_t
*
alsac
;
/*!< \brief handle of the ALSA capture audio device */
snd_pcm_t
*
alsap
;
/*!< \brief handle of the ALSA playback audio device */
char
alsacname
[
50
];
/*!< \brief name of the ALSA capture audio device */
char
alsapname
[
50
];
/*!< \brief name of the ALSA playback audio device */
int
alsa_period_size
;
/*!< \brief ALSA period_size, in byte */
int
alsa_periods_in_buffer
;
/*!< \brief how many periods in ALSA buffer, to calculate buffer_size */
unsigned
long
int
alsa_buffer_size
;
/*!< \brief ALSA buffer_size, in byte */
int
alsawrite_filled
;
int
alsa_capture_is_mono
;
int
alsa_play_is_mono
;
struct
pollfd
pfd
;
#endif // GSMOPEN_ALSA
time_t
audio_play_reset_timestamp
;
time_t
audio_play_reset_timestamp
;
int
audio_play_reset_period
;
int
audio_play_reset_period
;
...
@@ -608,14 +587,6 @@ int gsmopen_serial_call(private_t *tech_pvt, char *dstr);
...
@@ -608,14 +587,6 @@ int gsmopen_serial_call(private_t *tech_pvt, char *dstr);
int
gsmopen_serial_call_AT
(
private_t
*
tech_pvt
,
char
*
dstr
);
int
gsmopen_serial_call_AT
(
private_t
*
tech_pvt
,
char
*
dstr
);
int
gsmopen_sendsms
(
private_t
*
tech_pvt
,
char
*
dest
,
char
*
text
);
int
gsmopen_sendsms
(
private_t
*
tech_pvt
,
char
*
dest
,
char
*
text
);
#ifdef GSMOPEN_ALSA
int
alsa_init
(
private_t
*
tech_pvt
);
int
alsa_shutdown
(
private_t
*
tech_pvt
);
snd_pcm_t
*
alsa_open_dev
(
private_t
*
tech_pvt
,
snd_pcm_stream_t
stream
);
int
alsa_write
(
private_t
*
tech_pvt
,
short
*
data
,
int
datalen
);
int
alsa_read
(
private_t
*
tech_pvt
,
short
*
data
,
int
datalen
);
#endif
/* GSMOPEN_ALSA */
void
gsmopen_store_boost
(
char
*
s
,
double
*
boost
);
void
gsmopen_store_boost
(
char
*
s
,
double
*
boost
);
int
gsmopen_sound_boost
(
void
*
data
,
int
samples_num
,
double
boost
);
int
gsmopen_sound_boost
(
void
*
data
,
int
samples_num
,
double
boost
);
...
...
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp
浏览文件 @
4c7b7c46
...
@@ -878,7 +878,6 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
...
@@ -878,7 +878,6 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
//sent = frame->datalen;
//sent = frame->datalen;
//ERRORA("PLAY \n", GSMOPEN_P_LOG);
//ERRORA("PLAY \n", GSMOPEN_P_LOG);
//snd_pcm_writei(tech_pvt->alsap, (short *) frame->data, (int) (frame->datalen / 2));
gsmopen_sound_boost
(
frame
->
data
,
frame
->
samples
,
tech_pvt
->
playback_boost
);
gsmopen_sound_boost
(
frame
->
data
,
frame
->
samples
,
tech_pvt
->
playback_boost
);
sent
=
tech_pvt
->
serialPort_serial_audio
->
Write
((
char
*
)
frame
->
data
,
(
int
)
(
frame
->
datalen
));
sent
=
tech_pvt
->
serialPort_serial_audio
->
Write
((
char
*
)
frame
->
data
,
(
int
)
(
frame
->
datalen
));
...
@@ -1243,18 +1242,12 @@ static switch_status_t load_config(int reload_type)
...
@@ -1243,18 +1242,12 @@ static switch_status_t load_config(int reload_type)
const
char
*
at_indicator_callsetupoutgoing_string
=
"CIEV: 6;2"
;
const
char
*
at_indicator_callsetupoutgoing_string
=
"CIEV: 6;2"
;
const
char
*
at_indicator_callsetupremoteringing_string
=
"CIEV: 6;3"
;
const
char
*
at_indicator_callsetupremoteringing_string
=
"CIEV: 6;3"
;
//const char *sms_receiving_program = "/usr/local/bin/ciapalo";
//const char *sms_receiving_program = "/usr/local/bin/ciapalo";
const
char
*
alsacname
=
"plughw:1"
;
const
char
*
alsapname
=
"plughw:1"
;
const
char
*
at_early_audio
=
"0"
;
const
char
*
at_early_audio
=
"0"
;
const
char
*
at_after_preinit_pause
=
"500000"
;
const
char
*
at_after_preinit_pause
=
"500000"
;
const
char
*
at_initial_pause
=
"500000"
;
const
char
*
at_initial_pause
=
"500000"
;
const
char
*
at_has_clcc
=
"0"
;
const
char
*
at_has_clcc
=
"0"
;
const
char
*
at_has_ecam
=
"0"
;
const
char
*
at_has_ecam
=
"0"
;
const
char
*
alsa_period_size
=
"160"
;
const
char
*
alsa_periods_in_buffer
=
"4"
;
const
char
*
gsmopen_sound_rate
=
"8000"
;
const
char
*
gsmopen_sound_rate
=
"8000"
;
const
char
*
alsa_play_is_mono
=
"1"
;
const
char
*
alsa_capture_is_mono
=
"1"
;
const
char
*
capture_boost
=
"0"
;
const
char
*
capture_boost
=
"0"
;
const
char
*
playback_boost
=
"0"
;
const
char
*
playback_boost
=
"0"
;
const
char
*
no_sound
=
"0"
;
const
char
*
no_sound
=
"0"
;
...
@@ -1402,10 +1395,6 @@ static switch_status_t load_config(int reload_type)
...
@@ -1402,10 +1395,6 @@ static switch_status_t load_config(int reload_type)
at_indicator_callsetupremoteringing_string
=
val
;
at_indicator_callsetupremoteringing_string
=
val
;
//} else if (!strcasecmp(var, "sms_receiving_program")) {
//} else if (!strcasecmp(var, "sms_receiving_program")) {
//sms_receiving_program = val;
//sms_receiving_program = val;
}
else
if
(
!
strcasecmp
(
var
,
"alsacname"
))
{
alsacname
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"alsapname"
))
{
alsapname
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"portaudiocindex"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"portaudiocindex"
))
{
portaudiocindex
=
val
;
portaudiocindex
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"portaudiopindex"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"portaudiopindex"
))
{
...
@@ -1424,16 +1413,8 @@ static switch_status_t load_config(int reload_type)
...
@@ -1424,16 +1413,8 @@ static switch_status_t load_config(int reload_type)
at_has_clcc
=
val
;
at_has_clcc
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"at_has_ecam"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"at_has_ecam"
))
{
at_has_ecam
=
val
;
at_has_ecam
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"alsa_period_size"
))
{
alsa_period_size
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"alsa_periods_in_buffer"
))
{
alsa_periods_in_buffer
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"gsmopen_sound_rate"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"gsmopen_sound_rate"
))
{
gsmopen_sound_rate
=
val
;
gsmopen_sound_rate
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"alsa_play_is_mono"
))
{
alsa_play_is_mono
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"alsa_capture_is_mono"
))
{
alsa_capture_is_mono
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"capture_boost"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"capture_boost"
))
{
capture_boost
=
val
;
capture_boost
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"playback_boost"
))
{
}
else
if
(
!
strcasecmp
(
var
,
"playback_boost"
))
{
...
@@ -1490,27 +1471,10 @@ static switch_status_t load_config(int reload_type)
...
@@ -1490,27 +1471,10 @@ static switch_status_t load_config(int reload_type)
ERRORA
(
"interface param 'at_has_ecam' MUST be a number, now at_has_ecam='%s'
\n
"
,
GSMOPEN_P_LOG
,
at_has_ecam
);
ERRORA
(
"interface param 'at_has_ecam' MUST be a number, now at_has_ecam='%s'
\n
"
,
GSMOPEN_P_LOG
,
at_has_ecam
);
continue
;
continue
;
}
}
if
(
!
switch_is_number
(
alsa_period_size
))
{
ERRORA
(
"interface param 'alsa_period_size' MUST be a number, now alsa_period_size='%s'
\n
"
,
GSMOPEN_P_LOG
,
alsa_period_size
);
continue
;
}
if
(
!
switch_is_number
(
alsa_periods_in_buffer
))
{
ERRORA
(
"interface param 'alsa_periods_in_buffer' MUST be a number, now alsa_periods_in_buffer='%s'
\n
"
,
GSMOPEN_P_LOG
,
alsa_periods_in_buffer
);
continue
;
}
if
(
!
switch_is_number
(
gsmopen_sound_rate
))
{
if
(
!
switch_is_number
(
gsmopen_sound_rate
))
{
ERRORA
(
"interface param 'gsmopen_sound_rate' MUST be a number, now gsmopen_sound_rate='%s'
\n
"
,
GSMOPEN_P_LOG
,
gsmopen_sound_rate
);
ERRORA
(
"interface param 'gsmopen_sound_rate' MUST be a number, now gsmopen_sound_rate='%s'
\n
"
,
GSMOPEN_P_LOG
,
gsmopen_sound_rate
);
continue
;
continue
;
}
}
if
(
!
switch_is_number
(
alsa_play_is_mono
))
{
ERRORA
(
"interface param 'alsa_play_is_mono' MUST be a number, now alsa_play_is_mono='%s'
\n
"
,
GSMOPEN_P_LOG
,
alsa_play_is_mono
);
continue
;
}
if
(
!
switch_is_number
(
alsa_capture_is_mono
))
{
ERRORA
(
"interface param 'alsa_capture_is_mono' MUST be a number, now alsa_capture_is_mono='%s'
\n
"
,
GSMOPEN_P_LOG
,
alsa_capture_is_mono
);
continue
;
}
if
(
!
switch_is_number
(
capture_boost
))
{
if
(
!
switch_is_number
(
capture_boost
))
{
ERRORA
(
"interface param 'capture_boost' MUST be a number, now capture_boost='%s'
\n
"
,
GSMOPEN_P_LOG
,
capture_boost
);
ERRORA
(
"interface param 'capture_boost' MUST be a number, now capture_boost='%s'
\n
"
,
GSMOPEN_P_LOG
,
capture_boost
);
continue
;
continue
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论