Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
24627a7a
提交
24627a7a
authored
4月 27, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1279
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
31e31566
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
101 行增加
和
95 行删除
+101
-95
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+101
-94
switch_core.c
src/switch_core.c
+0
-1
没有找到文件。
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
24627a7a
...
...
@@ -55,7 +55,8 @@ typedef enum {
TFLAG_VAD_OUT
=
(
1
<<
12
),
TFLAG_VAD
=
(
1
<<
13
),
TFLAG_DO_CAND
=
(
1
<<
14
),
TFLAG_DO_DESC
=
(
1
<<
15
)
TFLAG_DO_DESC
=
(
1
<<
15
),
TFLAG_LANADDR
=
(
1
<<
16
)
}
TFLAGS
;
typedef
enum
{
...
...
@@ -143,27 +144,27 @@ struct rfc2833_digit {
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_dialplan
,
globals
.
dialplan
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_codec_string
,
globals
.
codec_string
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_codec_rates_string
,
globals
.
codec_rates_string
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_codec_string
,
globals
.
codec_string
)
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_codec_rates_string
,
globals
.
codec_rates_string
)
static
switch_status
channel_on_init
(
switch_core_session
*
session
);
static
switch_status
channel_on_hangup
(
switch_core_session
*
session
);
static
switch_status
channel_on_ring
(
switch_core_session
*
session
);
static
switch_status
channel_on_loopback
(
switch_core_session
*
session
);
static
switch_status
channel_on_transmit
(
switch_core_session
*
session
);
static
switch_status
channel_outgoing_channel
(
switch_core_session
*
session
,
switch_caller_profile
*
outbound_profile
,
static
switch_status
channel_on_init
(
switch_core_session
*
session
);
static
switch_status
channel_on_hangup
(
switch_core_session
*
session
);
static
switch_status
channel_on_ring
(
switch_core_session
*
session
);
static
switch_status
channel_on_loopback
(
switch_core_session
*
session
);
static
switch_status
channel_on_transmit
(
switch_core_session
*
session
);
static
switch_status
channel_outgoing_channel
(
switch_core_session
*
session
,
switch_caller_profile
*
outbound_profile
,
switch_core_session
**
new_session
,
switch_memory_pool
*
pool
);
static
switch_status
channel_read_frame
(
switch_core_session
*
session
,
switch_frame
**
frame
,
int
timeout
,
static
switch_status
channel_read_frame
(
switch_core_session
*
session
,
switch_frame
**
frame
,
int
timeout
,
switch_io_flag
flags
,
int
stream_id
);
static
switch_status
channel_write_frame
(
switch_core_session
*
session
,
switch_frame
*
frame
,
int
timeout
,
static
switch_status
channel_write_frame
(
switch_core_session
*
session
,
switch_frame
*
frame
,
int
timeout
,
switch_io_flag
flags
,
int
stream_id
);
static
switch_status
channel_kill_channel
(
switch_core_session
*
session
,
int
sig
);
static
ldl_status
handle_signalling
(
ldl_handle_t
*
handle
,
ldl_session_t
*
dlsession
,
ldl_signal_t
signal
,
char
*
msg
);
static
ldl_status
handle_response
(
ldl_handle_t
*
handle
,
char
*
id
);
static
switch_status
load_config
(
void
);
static
switch_status
channel_kill_channel
(
switch_core_session
*
session
,
int
sig
);
static
ldl_status
handle_signalling
(
ldl_handle_t
*
handle
,
ldl_session_t
*
dlsession
,
ldl_signal_t
signal
,
char
*
msg
);
static
ldl_status
handle_response
(
ldl_handle_t
*
handle
,
char
*
id
);
static
switch_status
load_config
(
void
);
static
void
dl_logger
(
char
*
file
,
const
char
*
func
,
int
line
,
int
level
,
char
*
fmt
,
...)
static
void
dl_logger
(
char
*
file
,
const
char
*
func
,
int
line
,
int
level
,
char
*
fmt
,
...)
{
va_list
ap
;
char
data
[
1024
];
...
...
@@ -330,6 +331,10 @@ static int do_candidates(struct private_object *tech_pvt, int force)
switch_stun_random_string
(
tech_pvt
->
local_user
,
16
,
NULL
);
switch_stun_random_string
(
tech_pvt
->
local_pass
,
16
,
NULL
);
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_LANADDR
))
{
advip
=
tech_pvt
->
profile
->
ip
;
}
cand
[
0
].
port
=
tech_pvt
->
local_port
;
cand
[
0
].
address
=
advip
;
...
...
@@ -538,9 +543,9 @@ static void negotiate_thread_launch(switch_core_session *session)
/*
State methods they get called when the state changes to the specific state
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
State methods they get called when the state changes to the specific state
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
*/
static
switch_status
channel_on_init
(
switch_core_session
*
session
)
{
...
...
@@ -1000,7 +1005,7 @@ static const switch_loadable_module_interface channel_module_interface = {
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/
static
switch_status
channel_outgoing_channel
(
switch_core_session
*
session
,
switch_caller_profile
*
outbound_profile
,
switch_core_session
**
new_session
,
switch_memory_pool
*
pool
)
...
...
@@ -1277,7 +1282,6 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
switch_core_session
*
session
=
NULL
;
switch_channel
*
channel
=
NULL
;
struct
private_object
*
tech_pvt
=
NULL
;
char
*
advip
;
assert
(
dlsession
!=
NULL
);
assert
(
handle
!=
NULL
);
...
...
@@ -1352,8 +1356,6 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
}
}
advip
=
profile
->
extip
?
profile
->
extip
:
profile
->
ip
;
switch
(
signal
)
{
case
LDL_SIGNAL_NONE
:
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"ERROR
\n
"
);
...
...
@@ -1443,9 +1445,11 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%u candidates
\n
"
,
len
);
for
(
x
=
0
;
x
<
len
;
x
++
)
{
uint8_t
lanaddr
=
strncasecmp
(
candidates
[
x
].
address
,
profile
->
lanaddr
,
strlen
(
profile
->
lanaddr
))
?
0
:
1
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"candidates %s:%d
\n
"
,
candidates
[
x
].
address
,
candidates
[
x
].
port
);
if
(
!
strcasecmp
(
candidates
[
x
].
protocol
,
"udp"
)
&&
(
!
strcasecmp
(
candidates
[
x
].
type
,
"local"
)
||
!
strcasecmp
(
candidates
[
x
].
type
,
"stun"
))
&&
((
profile
->
lanaddr
&&
!
strncasecmp
(
candidates
[
x
].
address
,
profile
->
lanaddr
,
strlen
(
profile
->
lanaddr
))
)
||
((
profile
->
lanaddr
&&
lanaddr
)
||
(
strncasecmp
(
candidates
[
x
].
address
,
"10."
,
3
)
&&
strncasecmp
(
candidates
[
x
].
address
,
"192.168."
,
8
)
&&
strncasecmp
(
candidates
[
x
].
address
,
"127."
,
4
)
&&
...
...
@@ -1464,6 +1468,9 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
memset
(
payloads
,
0
,
sizeof
(
payloads
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Acceptable Candidate %s:%d
\n
"
,
candidates
[
x
].
address
,
candidates
[
x
].
port
);
if
(
lanaddr
)
{
switch_set_flag
(
tech_pvt
,
TFLAG_LANADDR
);
}
if
(
!
tech_pvt
->
num_codecs
)
{
get_codecs
(
tech_pvt
);
...
...
src/switch_core.c
浏览文件 @
24627a7a
...
...
@@ -1818,7 +1818,6 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
const
switch_state_handler_table
*
driver_state_handler
=
NULL
;
const
switch_state_handler_table
*
application_state_handler
=
NULL
;
/*
Life of the channel. you have channel and pool in your session
everywhere you go you use the session to malloc with
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论