Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
99e04bf1
提交
99e04bf1
authored
8月 08, 2012
作者:
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug prints modification
上级
16692837
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
33 行增加
和
26 行删除
+33
-26
media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway.c
+0
-3
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+33
-21
media_gateway_xml.c
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
+0
-1
mod_media_gateway.h
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
+0
-1
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway.c
浏览文件 @
99e04bf1
...
...
@@ -222,7 +222,6 @@ mg_termination_t *megaco_choose_termination(megaco_profile_t *profile, const cha
term
->
pool
=
pool
;
term
->
type
=
termtype
;
term
->
active_events
=
NULL
;
term
->
mg_ctxt
=
NULL
;
term
->
profile
=
profile
;
switch_set_flag
(
term
,
MGT_ALLOCATED
);
...
...
@@ -335,8 +334,6 @@ void megaco_termination_destroy(mg_termination_t *term)
term
->
active_events
=
NULL
;
}
term
->
mg_ctxt
=
NULL
;
switch_clear_flag
(
term
,
MGT_ALLOCATED
);
switch_clear_flag
(
term
,
MGT_ACTIVE
);
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
99e04bf1
...
...
@@ -347,7 +347,7 @@ switch_status_t mg_prc_descriptors(megaco_profile_t* mg_profile, MgMgcoCommand *
for
(
fmtCnt
=
0
;
fmtCnt
<
fmt_list
->
num
.
val
;
fmtCnt
++
){
fmt
=
&
fmt_list
->
fmts
[
i
]
->
val
;
if
(
fmt
->
pres
==
NOTPRSNT
)
continue
;
printf
(
"Format [%d]
\n
"
,
fmt
->
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Format [%d]
\n
"
,
fmt
->
val
);
}
}
}
...
...
@@ -381,30 +381,30 @@ switch_status_t mg_prc_descriptors(megaco_profile_t* mg_profile, MgMgcoCommand *
case
MGT_LCLCTL_MODE
:
{
/* Mode Property */
printf
(
"MGT_LCLCTL_MODE - Mode value [%d]
\n
"
,
lclParm
->
u
.
mode
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_LCLCTL_MODE - Mode value [%d]
\n
"
,
lclParm
->
u
.
mode
.
val
);
break
;
}
case
MGT_LCLCTL_RESVAL
:
{
/* Reserve Value */
printf
(
"MGT_LCLCTL_RESVAL: Reserve Value[%d]
\n
"
,
lclParm
->
u
.
resVal
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_LCLCTL_RESVAL: Reserve Value[%d]
\n
"
,
lclParm
->
u
.
resVal
.
val
);
break
;
}
case
MGT_LCLCTL_RESGRP
:
{
/* Reserve group */
printf
(
"MGT_LCLCTL_RESGRP: Reserve Group[%d]
\n
"
,
lclParm
->
u
.
resGrp
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_LCLCTL_RESGRP: Reserve Group[%d]
\n
"
,
lclParm
->
u
.
resGrp
.
val
);
break
;
}
case
MGT_LCLCTL_PROPPARM
:
{
/* Properties (of a termination) */
/* Matt - See how we can apply this to a termination */
printf
(
"MGT_LCLCTL_PROPPARM:
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_LCLCTL_PROPPARM:
\n
"
);
break
;
}
default:
printf
(
"Invalid local control descriptor type[%d]
\n
"
,
lclParm
->
type
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Invalid local control descriptor type[%d]
\n
"
,
lclParm
->
type
.
val
);
break
;
}
}
...
...
@@ -429,23 +429,23 @@ switch_status_t mg_prc_descriptors(megaco_profile_t* mg_profile, MgMgcoCommand *
{
/* Matt to see how to apply properties to a termination */
/* Properties of a termination */
printf
(
"MGT_TERMST_PROPLST:
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_TERMST_PROPLST:
\n
"
);
break
;
}
case
MGT_TERMST_EVTBUFCTL
:
{
/* Event /buffer Control Properties */
printf
(
" MGT_TERMST_EVTBUFCTL: value[%d]
\n
"
,
tsp
->
u
.
evtBufCtl
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
" MGT_TERMST_EVTBUFCTL: value[%d]
\n
"
,
tsp
->
u
.
evtBufCtl
.
val
);
break
;
}
case
MGT_TERMST_SVCST
:
{
/* Service State Properties */
printf
(
" MGT_TERMST_SVCST: value[%d]
\n
"
,
tsp
->
u
.
svcState
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
" MGT_TERMST_SVCST: value[%d]
\n
"
,
tsp
->
u
.
svcState
.
val
);
break
;
}
default:
printf
(
"Invalid termination state descriptor type[%d]
\n
"
,
tsp
->
type
.
val
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Invalid termination state descriptor type[%d]
\n
"
,
tsp
->
type
.
val
);
break
;
}
}
...
...
@@ -630,6 +630,7 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
mg_ctxt
=
megaco_choose_context
(
mg_profile
);
if
(
NULL
==
mg_ctxt
){
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
" megaco_choose_context failed
\n
"
);
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
...
...
@@ -646,6 +647,13 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
memcpy
(
new_ctxtId
,
&
inc_cmd
->
contextId
,
sizeof
(
MgMgcoContextId
));
mg_ctxt
=
megaco_get_context
(
mg_profile
,
inc_cmd
->
contextId
.
val
.
val
);
if
(
NULL
==
mg_ctxt
){
#ifdef BIT_64
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
" megaco_get_context failed for context-id[%d]
\n
"
,
inc_cmd
->
contextId
.
val
.
val
);
#else
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
" megaco_get_context failed for context-id[%ld]
\n
"
,
inc_cmd
->
contextId
.
val
.
val
);
#endif
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
...
...
@@ -660,15 +668,12 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
term
=
megaco_choose_termination
(
mg_profile
,
mg_profile
->
rtp_termination_id_prefix
);
if
(
NULL
==
term
){
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
" megaco_choose_termination failed
\n
"
);
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
}
if
(
!
term
->
mg_ctxt
){
term
->
mg_ctxt
=
mg_ctxt
;
}
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_INFO
,
" Allocated Termination[%p] with term name[%s]
\n
"
,
(
void
*
)
term
,
term
->
name
);
is_rtp
=
0x01
;
...
...
@@ -678,26 +683,33 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
term
=
megaco_find_termination
(
mg_profile
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
if
(
NULL
==
term
){
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
" megaco_find_termination failed for term-id[%s]
\n
"
,(
char
*
)
termId
->
name
.
lcl
.
val
);
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
}
if
(
!
term
->
mg_ctxt
){
term
->
mg_ctxt
=
mg_ctxt
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_INFO
,
" Termination[%s] already in context..rejecting ADD
\n
"
,
term
->
name
);
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_INFO
,
" Allocated Termination[%p] with term name[%s]
\n
"
,
(
void
*
)
term
,
term
->
name
);
}
/********************************************************************/
/* check if termination already is in call */
if
(
term
->
context
){
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_INFO
,
" Termination[%p : %s] "
"already in context[%p -%d]..rejecting ADD
\n
"
,
(
void
*
)
term
,
term
->
name
,
(
void
*
)
term
->
context
,
term
->
context
->
context_id
);
mg_util_set_err_string
(
&
errTxt
,
" Term already is in call "
);
err_code
=
MGT_MGCO_RSP_CODE_DUP_TERM_CTXT
;
goto
error
;
}
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_INFO
,
" Allocated Termination[%p] with term name[%s]
\n
"
,
(
void
*
)
term
,
term
->
name
);
}
/********************************************************************/
/* associate physical termination to context */
if
(
SWITCH_STATUS_FALSE
==
megaco_context_add_termination
(
mg_ctxt
,
term
)){
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
"megaco_context_add_termination failed
\n
"
);
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
浏览文件 @
99e04bf1
...
...
@@ -210,7 +210,6 @@ void mg_create_tdm_term(megaco_profile_t *profile, const char *tech, const char
term
->
pool
=
pool
;
term
->
type
=
MG_TERM_TDM
;
term
->
profile
=
profile
;
term
->
mg_ctxt
=
NULL
;
term
->
tech
=
switch_core_strdup
(
pool
,
tech
);
term
->
active_events
=
NULL
;
term
->
name
=
switch_core_sprintf
(
pool
,
"%s%d"
,
prefix
,
chan_num
);
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
浏览文件 @
99e04bf1
...
...
@@ -113,7 +113,6 @@ struct mg_termination_s {
megaco_profile_t
*
profile
;
/*!< Parent MG profile */
MgMgcoReqEvtDesc
*
active_events
;
/* !< active megaco events */
mg_termination_t
*
next
;
/*!< List for physical terminations */
mg_context_t
*
mg_ctxt
;
int
*
mg_error_code
;
/* MEGACO error code */
uint32_t
flags
;
const
char
*
tech
;
/* Endpoint controlling the TDM interface - only FreeTDM tested so far */
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论