Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
73f50185
提交
73f50185
authored
12月 18, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opts
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@6867
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
b181a754
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
33 行增加
和
20 行删除
+33
-20
switch_ivr.c
src/switch_ivr.c
+3
-1
switch_ivr_originate.c
src/switch_ivr_originate.c
+1
-1
switch_ivr_play_say.c
src/switch_ivr_play_say.c
+19
-8
switch_rtp.c
src/switch_rtp.c
+10
-10
没有找到文件。
src/switch_ivr.c
浏览文件 @
73f50185
...
...
@@ -1146,7 +1146,9 @@ SWITCH_DECLARE(void *) switch_ivr_digit_stream_parser_feed(switch_ivr_digit_stre
}
*
dst
=
digit
;
}
else
{
stream
->
digits
=
realloc
(
stream
->
digits
,
len
+
2
);
char
*
tmp
=
realloc
(
stream
->
digits
,
len
+
2
);
switch_assert
(
tmp
);
stream
->
digits
=
tmp
;
*
(
stream
->
digits
+
(
len
++
))
=
digit
;
*
(
stream
->
digits
+
len
)
=
'\0'
;
stream
->
last_digit_time
=
switch_time_now
()
/
1000
;
...
...
src/switch_ivr_originate.c
浏览文件 @
73f50185
...
...
@@ -233,7 +233,7 @@ static int teletone_handler(teletone_generation_session_t * ts, teletone_tone_ma
return
0
;
}
#define MAX_PEERS
256
#define MAX_PEERS
128
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_originate
(
switch_core_session_t
*
session
,
switch_core_session_t
**
bleg
,
switch_call_cause_t
*
cause
,
...
...
src/switch_ivr_play_say.c
浏览文件 @
73f50185
...
...
@@ -663,7 +663,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_play_file
(
switch_core_session_t
*
session
,
switch_file_handle_t
*
fh
,
const
char
*
file
,
switch_input_args_t
*
args
)
{
switch_channel_t
*
channel
;
int16_t
abuf
[
FILE_STARTSAMPLES
]
;
int16_t
*
abuf
;
char
dtmf
[
128
];
uint32_t
interval
=
0
,
samples
=
0
,
framelen
,
sample_start
=
0
;
uint32_t
ilen
=
0
;
...
...
@@ -686,6 +686,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
const
char
*
timer_name
;
const
char
*
prebuf
;
switch_zmalloc
(
abuf
,
FILE_STARTSAMPLES
);
channel
=
switch_core_session_get_channel
(
session
);
switch_assert
(
channel
!=
NULL
);
...
...
@@ -694,7 +696,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
if
(
!
file
)
{
return
SWITCH_STATUS_FALSE
;
status
=
SWITCH_STATUS_FALSE
;
goto
end
;
}
if
(
!
prefix
)
{
...
...
@@ -741,7 +744,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
read_codec
->
implementation
->
actual_samples_per_second
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_reset
(
session
);
return
SWITCH_STATUS_NOTFOUND
;
status
=
SWITCH_STATUS_NOTFOUND
;
goto
end
;
}
if
(
switch_test_flag
(
fh
,
SWITCH_FILE_NATIVE
))
{
asis
=
1
;
...
...
@@ -749,7 +753,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
write_frame
.
data
=
abuf
;
write_frame
.
buflen
=
sizeof
(
abuf
)
;
write_frame
.
buflen
=
FILE_STARTSAMPLES
;
if
(
sample_start
>
0
)
{
uint32_t
pos
=
0
;
...
...
@@ -806,7 +810,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
switch_core_file_close
(
fh
);
switch_core_session_reset
(
session
);
return
SWITCH_STATUS_GENERR
;
status
=
SWITCH_STATUS_GENERR
;
goto
end
;
}
}
...
...
@@ -831,7 +836,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
"Raw Codec Activation Failed %s@%uhz %u channels %dms
\n
"
,
codec_name
,
fh
->
samplerate
,
fh
->
channels
,
interval
);
switch_core_file_close
(
fh
);
switch_core_session_reset
(
session
);
return
SWITCH_STATUS_GENERR
;
status
=
SWITCH_STATUS_GENERR
;
goto
end
;
}
samples
=
codec
.
implementation
->
samples_per_frame
;
framelen
=
codec
.
implementation
->
bytes_per_frame
;
...
...
@@ -847,7 +853,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
switch_core_codec_destroy
(
&
codec
);
switch_core_file_close
(
fh
);
switch_core_session_reset
(
session
);
return
SWITCH_STATUS_GENERR
;
status
=
SWITCH_STATUS_GENERR
;
goto
end
;
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"setup timer success %u bytes per %d ms!
\n
"
,
len
,
interval
);
}
...
...
@@ -926,7 +933,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
olen
=
asis
?
framelen
:
ilen
;
do_speed
=
0
;
}
else
{
olen
=
sizeof
(
abuf
)
;
olen
=
FILE_STARTSAMPLES
;
if
(
!
asis
)
{
olen
/=
2
;
}
...
...
@@ -1085,6 +1092,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
switch_core_timer_destroy
(
&
timer
);
}
end
:
free
(
abuf
);
switch_core_session_reset
(
session
);
return
status
;
}
...
...
src/switch_rtp.c
浏览文件 @
73f50185
...
...
@@ -171,6 +171,7 @@ struct switch_rtp {
stfu_instance_t
*
jb
;
uint32_t
max_missed_packets
;
uint32_t
missed_count
;
rtp_msg_t
write_msg
;
};
static
int
global_init
=
0
;
...
...
@@ -1645,7 +1646,6 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
uint32_t
datalen
,
uint8_t
m
,
switch_payload_t
payload
,
uint32_t
ts
,
uint16_t
mseq
,
uint32_t
ssrc
,
switch_frame_flag_t
*
flags
)
{
rtp_msg_t
send_msg
=
{
{
0
}
};
switch_size_t
bytes
;
if
(
!
switch_rtp_ready
(
rtp_session
))
{
...
...
@@ -1660,13 +1660,13 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
return
-
1
;
}
send
_msg
=
rtp_session
->
send_msg
;
send
_msg
.
header
.
seq
=
htons
(
mseq
);
send
_msg
.
header
.
ts
=
htonl
(
ts
);
send
_msg
.
header
.
ssrc
=
htonl
(
ssrc
);
send
_msg
.
header
.
pt
=
payload
;
send
_msg
.
header
.
m
=
m
?
1
:
0
;
memcpy
(
send
_msg
.
body
,
data
,
datalen
);
rtp_session
->
write
_msg
=
rtp_session
->
send_msg
;
rtp_session
->
write
_msg
.
header
.
seq
=
htons
(
mseq
);
rtp_session
->
write
_msg
.
header
.
ts
=
htonl
(
ts
);
rtp_session
->
write
_msg
.
header
.
ssrc
=
htonl
(
ssrc
);
rtp_session
->
write
_msg
.
header
.
pt
=
payload
;
rtp_session
->
write
_msg
.
header
.
m
=
m
?
1
:
0
;
memcpy
(
rtp_session
->
write
_msg
.
body
,
data
,
datalen
);
bytes
=
rtp_header_len
+
datalen
;
...
...
@@ -1675,7 +1675,7 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
int
sbytes
=
(
int
)
bytes
;
err_status_t
stat
;
stat
=
srtp_protect
(
rtp_session
->
send_ctx
,
&
send
_msg
.
header
,
&
sbytes
);
stat
=
srtp_protect
(
rtp_session
->
send_ctx
,
&
rtp_session
->
write
_msg
.
header
,
&
sbytes
);
if
(
stat
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"error: srtp protection failed with code %d
\n
"
,
stat
);
}
...
...
@@ -1683,7 +1683,7 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
bytes
=
sbytes
;
}
if
(
switch_socket_sendto
(
rtp_session
->
sock
,
rtp_session
->
remote_addr
,
0
,
(
void
*
)
&
send
_msg
,
&
bytes
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_socket_sendto
(
rtp_session
->
sock
,
rtp_session
->
remote_addr
,
0
,
(
void
*
)
&
rtp_session
->
write
_msg
,
&
bytes
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
-
1
;
}
return
(
int
)
bytes
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论