Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
bc2fc3fa
提交
bc2fc3fa
authored
7月 15, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@9040
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
266a5639
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
57 行增加
和
46 行删除
+57
-46
python.conf.xml
conf/autoload_configs/python.conf.xml
+6
-0
switch_core.h
src/include/switch_core.h
+2
-0
switch_core_codec.c
src/switch_core_codec.c
+40
-32
switch_core_session.c
src/switch_core_session.c
+2
-0
switch_ivr_async.c
src/switch_ivr_async.c
+0
-1
switch_ivr_originate.c
src/switch_ivr_originate.c
+6
-11
switch_ivr_play_say.c
src/switch_ivr_play_say.c
+1
-2
没有找到文件。
conf/autoload_configs/python.conf.xml
0 → 100644
浏览文件 @
bc2fc3fa
<configuration
name=
"python.conf"
description=
"PYTHON Configuration"
>
<settings>
<!--<param name="xml-handler-script" value="dp"/>-->
<!--<param name="xml-handler-bindings" value="dialplan"/>-->
</settings>
</configuration>
src/include/switch_core.h
浏览文件 @
bc2fc3fa
...
@@ -1122,6 +1122,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
...
@@ -1122,6 +1122,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
*/
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_set_read_codec
(
_In_
switch_core_session_t
*
session
,
switch_codec_t
*
codec
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_set_read_codec
(
_In_
switch_core_session_t
*
session
,
switch_codec_t
*
codec
);
SWITCH_DECLARE
(
void
)
switch_core_session_unset_read_codec
(
_In_
switch_core_session_t
*
session
);
/*!
/*!
\brief Retrieve the read codec from a given session
\brief Retrieve the read codec from a given session
\param session session to retrieve from
\param session session to retrieve from
...
...
src/switch_core_codec.c
浏览文件 @
bc2fc3fa
...
@@ -42,6 +42,11 @@ SWITCH_DECLARE(uint32_t) switch_core_codec_next_id(void)
...
@@ -42,6 +42,11 @@ SWITCH_DECLARE(uint32_t) switch_core_codec_next_id(void)
return
CODEC_ID
++
;
return
CODEC_ID
++
;
}
}
SWITCH_DECLARE
(
void
)
switch_core_session_unset_read_codec
(
switch_core_session_t
*
session
)
{
session
->
real_read_codec
=
session
->
read_codec
=
NULL
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_set_read_codec
(
switch_core_session_t
*
session
,
switch_codec_t
*
codec
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_set_read_codec
(
switch_core_session_t
*
session
,
switch_codec_t
*
codec
)
{
{
...
@@ -49,52 +54,55 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_read_codec(switch_core_s
...
@@ -49,52 +54,55 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_read_codec(switch_core_s
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
char
tmp
[
30
];
char
tmp
[
30
];
if
(
!
codec
||
!
codec
->
implementation
)
{
if
(
codec
&&
!
codec
->
implementation
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot set ININITILIZED codec!
\n
"
);
return
SWITCH_STATUS_FALSE
;
}
if
(
!
codec
||
codec
==
session
->
real_read_codec
)
{
if
(
session
->
real_read_codec
)
{
if
(
session
->
real_read_codec
)
{
session
->
read_codec
=
session
->
real_read_codec
;
session
->
read_codec
=
session
->
real_read_codec
;
session
->
real_read_codec
=
NULL
;
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot set NULL codec!
\n
"
);
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
}
else
if
(
session
->
read_codec
)
{
}
else
if
(
codec
)
{
if
(
session
->
real_read_codec
)
{
if
(
session
->
read_codec
!=
session
->
real_read_codec
)
{
if
(
codec
==
session
->
real_read_codec
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot double-set codec!
\n
"
);
session
->
read_codec
=
codec
;
return
SWITCH_STATUS_FALSE
;
session
->
real_read_codec
=
NULL
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot double-set codec!
\n
"
);
return
SWITCH_STATUS_FALSE
;
}
}
else
{
session
->
real_read_codec
=
session
->
read_codec
;
session
->
read_codec
=
codec
;
}
}
}
else
{
session
->
read_codec
=
codec
;
session
->
read_codec
=
codec
;
}
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CODEC
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
!
session
->
real_read_codec
)
{
switch_channel_event_set_data
(
session
->
channel
,
event
);
session
->
real_read_codec
=
session
->
read_codec
;
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"channel-read-codec-name"
,
"%s"
,
session
->
read_codec
->
implementation
->
iananame
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"channel-read-codec-rate"
,
"%d"
,
session
->
read_codec
->
implementation
->
actual_samples_per_second
);
if
(
session
->
read_codec
->
implementation
->
actual_samples_per_second
!=
session
->
read_codec
->
implementation
->
samples_per_second
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"channel-reported-read-codec-rate"
,
"%d"
,
session
->
read_codec
->
implementation
->
samples_per_second
);
}
}
switch_event_fire
(
&
event
);
}
}
switch_channel_set_variable
(
channel
,
"read_codec"
,
session
->
read_codec
->
implementation
->
iananame
);
if
(
session
->
read_codec
&&
session
->
read_codec
->
implementation
)
{
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%d"
,
session
->
read_codec
->
implementation
->
actual_samples_per_second
);
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CODEC
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_set_variable
(
channel
,
"read_rate"
,
tmp
);
switch_channel_event_set_data
(
session
->
channel
,
event
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"channel-read-codec-name"
,
"%s"
,
session
->
read_codec
->
implementation
->
iananame
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"channel-read-codec-rate"
,
"%d"
,
session
->
read_codec
->
implementation
->
actual_samples_per_second
);
if
(
session
->
read_codec
->
implementation
->
actual_samples_per_second
!=
session
->
read_codec
->
implementation
->
samples_per_second
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"channel-reported-read-codec-rate"
,
"%d"
,
session
->
read_codec
->
implementation
->
samples_per_second
);
}
switch_event_fire
(
&
event
);
}
switch_channel_set_variable
(
channel
,
"read_codec"
,
session
->
read_codec
->
implementation
->
iananame
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%d"
,
session
->
read_codec
->
implementation
->
actual_samples_per_second
);
switch_channel_set_variable
(
channel
,
"read_rate"
,
tmp
);
session
->
raw_read_frame
.
codec
=
session
->
read_codec
;
session
->
raw_write_frame
.
codec
=
session
->
read_codec
;
session
->
enc_read_frame
.
codec
=
session
->
read_codec
;
session
->
enc_write_frame
.
codec
=
session
->
read_codec
;
return
SWITCH_STATUS_SUCCESS
;
session
->
raw_read_frame
.
codec
=
session
->
read_codec
;
session
->
raw_write_frame
.
codec
=
session
->
read_codec
;
session
->
enc_read_frame
.
codec
=
session
->
read_codec
;
session
->
enc_write_frame
.
codec
=
session
->
read_codec
;
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_FALSE
;
}
}
SWITCH_DECLARE
(
switch_codec_t
*
)
switch_core_session_get_effective_read_codec
(
switch_core_session_t
*
session
)
SWITCH_DECLARE
(
switch_codec_t
*
)
switch_core_session_get_effective_read_codec
(
switch_core_session_t
*
session
)
...
...
src/switch_core_session.c
浏览文件 @
bc2fc3fa
...
@@ -666,6 +666,8 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, s
...
@@ -666,6 +666,8 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, s
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_size_t
has
;
switch_size_t
has
;
switch_core_session_set_read_codec
(
session
,
NULL
);
/* clear resamplers */
/* clear resamplers */
switch_mutex_lock
(
session
->
resample_mutex
);
switch_mutex_lock
(
session
->
resample_mutex
);
switch_resample_destroy
(
&
session
->
read_resampler
);
switch_resample_destroy
(
&
session
->
read_resampler
);
...
...
src/switch_ivr_async.c
浏览文件 @
bc2fc3fa
...
@@ -732,7 +732,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
...
@@ -732,7 +732,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
switch_core_session_rwunlock
(
tsession
);
switch_core_session_rwunlock
(
tsession
);
status
=
SWITCH_STATUS_SUCCESS
;
status
=
SWITCH_STATUS_SUCCESS
;
switch_core_session_set_read_codec
(
session
,
read_codec
);
switch_core_session_reset
(
session
,
SWITCH_TRUE
);
switch_core_session_reset
(
session
,
SWITCH_TRUE
);
}
}
...
...
src/switch_ivr_originate.c
浏览文件 @
bc2fc3fa
...
@@ -444,11 +444,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t
...
@@ -444,11 +444,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t
switch_buffer_destroy
(
&
ringback
.
audio_buffer
);
switch_buffer_destroy
(
&
ringback
.
audio_buffer
);
}
}
if
(
!
pass
&&
write_codec
.
implementation
)
{
switch_core_session_reset
(
session
,
SWITCH_TRUE
);
if
(
read_codec
&&
!
ringback
.
asis
)
{
switch_core_session_set_read_codec
(
session
,
read_codec
);
if
(
write_codec
.
implementation
)
{
switch_core_session_reset
(
session
,
SWITCH_TRUE
);
}
switch_core_codec_destroy
(
&
write_codec
);
switch_core_codec_destroy
(
&
write_codec
);
}
}
...
@@ -1403,15 +1401,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -1403,15 +1401,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
switch_buffer_destroy
(
&
ringback
.
audio_buffer
);
switch_buffer_destroy
(
&
ringback
.
audio_buffer
);
}
}
if
(
!
pass
&&
write_codec
.
implementation
)
{
switch_core_session_reset
(
session
,
SWITCH_FALSE
);
if
(
read_codec
&&
!
ringback
.
asis
)
{
switch_core_session_set_read_codec
(
session
,
read_codec
);
if
(
write_codec
.
implementation
)
{
switch_core_session_reset
(
session
,
SWITCH_FALSE
);
}
switch_core_codec_destroy
(
&
write_codec
);
switch_core_codec_destroy
(
&
write_codec
);
}
}
for
(
i
=
0
;
i
<
and_argc
;
i
++
)
{
for
(
i
=
0
;
i
<
and_argc
;
i
++
)
{
if
(
!
peer_channels
[
i
])
{
if
(
!
peer_channels
[
i
])
{
continue
;
continue
;
...
...
src/switch_ivr_play_say.c
浏览文件 @
bc2fc3fa
...
@@ -567,7 +567,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
...
@@ -567,7 +567,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
}
}
}
}
switch_core_session_set_read_codec
(
session
,
read_codec
);
switch_core_file_close
(
fh
);
switch_core_file_close
(
fh
);
switch_core_session_reset
(
session
,
SWITCH_TRUE
);
switch_core_session_reset
(
session
,
SWITCH_TRUE
);
return
status
;
return
status
;
...
@@ -1316,7 +1315,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_silence(switch_core_session_
...
@@ -1316,7 +1315,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_silence(switch_core_session_
}
}
}
}
switch_core_session_
set_read_codec
(
session
,
NULL
);
switch_core_session_
reset
(
session
,
SWITCH_FALSE
);
switch_core_codec_destroy
(
&
raw_codec
);
switch_core_codec_destroy
(
&
raw_codec
);
end
:
end
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论