Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b6bd8071
提交
b6bd8071
authored
8月 23, 2012
作者:
Kapil Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adding "peer_active" flag to check before send any message to megaco stack
上级
917609df
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
0 行删除
+20
-0
media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway.c
+3
-0
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+14
-0
mod_media_gateway.h
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
+3
-0
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway.c
浏览文件 @
b6bd8071
...
@@ -637,6 +637,7 @@ switch_status_t megaco_profile_start(const char *profilename)
...
@@ -637,6 +637,7 @@ switch_status_t megaco_profile_start(const char *profilename)
profile
->
name
=
switch_core_strdup
(
pool
,
profilename
);
profile
->
name
=
switch_core_strdup
(
pool
,
profilename
);
profile
->
next_context_id
++
;
profile
->
next_context_id
++
;
profile
->
inact_tmr
=
0x00
;
profile
->
inact_tmr
=
0x00
;
profile
->
peer_active
=
0x00
;
profile
->
inact_tmr_task_id
=
0x00
;
profile
->
inact_tmr_task_id
=
0x00
;
switch_thread_rwlock_create
(
&
profile
->
rwlock
,
pool
);
switch_thread_rwlock_create
(
&
profile
->
rwlock
,
pool
);
...
@@ -708,6 +709,8 @@ switch_status_t mgco_init_ins_service_change(SuId suId)
...
@@ -708,6 +709,8 @@ switch_status_t mgco_init_ins_service_change(SuId suId)
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
profile
->
peer_active
=
0x01
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"mgco_init_ins_service_change : Initiating terminations service change for profile: %s
\n
"
,
profile
->
name
);
"mgco_init_ins_service_change : Initiating terminations service change for profile: %s
\n
"
,
profile
->
name
);
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
b6bd8071
...
@@ -2479,6 +2479,14 @@ U32 get_txn_id(){
...
@@ -2479,6 +2479,14 @@ U32 get_txn_id(){
return
outgoing_txn_id
;
return
outgoing_txn_id
;
}
}
/*****************************************************************************************************************************/
/*****************************************************************************************************************************/
switch_status_t
mg_is_peer_active
(
megaco_profile_t
*
profile
)
{
if
((
profile
)
&&
(
0x01
==
profile
->
peer_active
)){
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_FALSE
;
}
/*****************************************************************************************************************************/
switch_status_t
mg_send_term_service_change
(
char
*
span_name
,
char
*
chan_number
,
mg_term_states_e
term_state
)
switch_status_t
mg_send_term_service_change
(
char
*
span_name
,
char
*
chan_number
,
mg_term_states_e
term_state
)
{
{
mg_termination_t
*
term
=
NULL
;
mg_termination_t
*
term
=
NULL
;
...
@@ -2493,6 +2501,12 @@ switch_status_t mg_send_term_service_change(char *span_name, char *chan_number,
...
@@ -2493,6 +2501,12 @@ switch_status_t mg_send_term_service_change(char *span_name, char *chan_number,
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
if
(
SWITCH_STATUS_FALSE
==
mg_is_peer_active
(
term
->
profile
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"profile: %s peer not yet enabled..
\n
"
,
term
->
profile
->
name
);
return
SWITCH_STATUS_FALSE
;
}
switch
(
term_state
)
switch
(
term_state
)
{
{
case
MG_TERM_SERVICE_STATE_IN_SERVICE
:
case
MG_TERM_SERVICE_STATE_IN_SERVICE
:
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
浏览文件 @
b6bd8071
...
@@ -205,6 +205,7 @@ struct megaco_profile_s {
...
@@ -205,6 +205,7 @@ struct megaco_profile_s {
char
*
peer_list
[
MG_MAX_PEERS
];
/* MGC Peer ID LIST */
char
*
peer_list
[
MG_MAX_PEERS
];
/* MGC Peer ID LIST */
char
*
codec_prefs
;
char
*
codec_prefs
;
int
inact_tmr
;
/* inactivity timer value */
int
inact_tmr
;
/* inactivity timer value */
int
peer_active
;
/* inactivity timer value */
uint32_t
inact_tmr_task_id
;
/* FS timer scheduler task-id */
uint32_t
inact_tmr_task_id
;
/* FS timer scheduler task-id */
switch_thread_rwlock_t
*
contexts_rwlock
;
switch_thread_rwlock_t
*
contexts_rwlock
;
...
@@ -221,6 +222,8 @@ struct megaco_profile_s {
...
@@ -221,6 +222,8 @@ struct megaco_profile_s {
switch_thread_rwlock_t
*
terminations_rwlock
;
switch_thread_rwlock_t
*
terminations_rwlock
;
};
};
static
inline
const
char
*
megaco_codec_str
(
megaco_codec_t
codec
)
static
inline
const
char
*
megaco_codec_str
(
megaco_codec_t
codec
)
{
{
switch
(
codec
)
{
switch
(
codec
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论