Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
85dfa042
提交
85dfa042
authored
8月 15, 2012
作者:
Kapil Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
issue fixes
上级
9ef68f1b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
36 行增加
和
32 行删除
+36
-32
media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway.c
+5
-2
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+26
-30
media_gateway_packages.c
src/mod/endpoints/mod_media_gateway/media_gateway_packages.c
+5
-0
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway.c
浏览文件 @
85dfa042
...
...
@@ -413,6 +413,7 @@ switch_status_t megaco_context_is_term_present(mg_context_t *ctx, mg_termination
switch_status_t
megaco_context_add_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_assert
(
ctx
!=
NULL
);
switch_assert
(
term
!=
NULL
);
...
...
@@ -434,12 +435,14 @@ switch_status_t megaco_context_add_termination(mg_context_t *ctx, mg_termination
if
(
ctx
->
terminations
[
0
]
&&
ctx
->
terminations
[
1
])
{
if
(
zstr
(
ctx
->
terminations
[
0
]
->
uuid
))
{
megaco_activate_termination
(
ctx
->
terminations
[
0
]);
status
=
megaco_activate_termination
(
ctx
->
terminations
[
0
]);
}
if
(
zstr
(
ctx
->
terminations
[
1
]
->
uuid
))
{
megaco_activate_termination
(
ctx
->
terminations
[
1
]);
status
=
megaco_activate_termination
(
ctx
->
terminations
[
1
]);
}
if
(
SWITCH_STATUS_SUCCESS
!=
status
)
return
status
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Bridging: %s (%s) <> %s (%s)
\n
"
,
ctx
->
terminations
[
0
]
->
name
,
ctx
->
terminations
[
0
]
->
uuid
,
ctx
->
terminations
[
1
]
->
name
,
ctx
->
terminations
[
1
]
->
uuid
);
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
85dfa042
...
...
@@ -729,20 +729,9 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
mg_print_t38_attributes
(
term
);
/* TODO - locally assigned SDP must be the part of termination...which we can use to fill responses*/
/********************************************************************/
/* Matt - to provide the response SDP structure which needs to fill in ADD command response */
/* Matt - to indicate if there is any failure while processing add message */
/* Kapil - to return error if there is any failure based on Matt's indication */
/* Kapil - to fill the response structure and call the response API to send ADD response */
/*************************************************************************************************************************/
/* sample resp code -- begin */
/* resp code -- begin */
{
MgMgcoCommand
rsp
;
int
ret
=
0x00
;
...
...
@@ -1050,6 +1039,13 @@ error:
sng_mgco_send_err
(
mg_profile
->
idx
,
mgErr
);
}
mg_free_cmd
(
inc_cmd
);
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
" ADD Request failed..releasing context/termination(if allocated)
\n
"
);
if
(
mg_ctxt
){
megaco_release_context
(
mg_ctxt
);
}
if
(
term
){
megaco_termination_destroy
(
term
);
}
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -1127,8 +1123,6 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
/* check if we have ito packg request */
mg_is_ito_pkg_req
(
mg_profile
,
inc_cmd
);
/* TODO */
/********************************************************************/
}
else
if
(
MGT_TERMID_OTHER
==
termId
->
type
.
val
){
/********************************************************************/
...
...
@@ -1194,7 +1188,6 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
if
(
term
->
mg_error_code
&&
(
*
term
->
mg_error_code
==
MGT_MGCP_RSP_CODE_INCONSISTENT_LCL_OPT
)){
mg_util_set_err_string
(
&
errTxt
,
" Unsupported Codec "
);
err_code
=
MGT_MGCP_RSP_CODE_INCONSISTENT_LCL_OPT
;
/* TODO delete RTP termination */
goto
error
;
}
...
...
@@ -1219,21 +1212,15 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
/* SDP updated to termination */
megaco_activate_termination
(
term
);
if
(
SWITCH_STATUS_SUCCESS
!=
megaco_activate_termination
(
term
))
{
mg_util_set_err_string
(
&
errTxt
,
" Resource Failure "
);
err_code
=
MGT_MGCO_RSP_CODE_RSRC_ERROR
;
goto
error
;
}
}
/* TODO - copy inc descriptor...not sure if we need to do this.. */
/********************************************************************/
/* Matt - to provide the response SDP structure which needs to fill in Modify command response */
/* Matt - to indicate if there is any failure while processing add message */
/* Kapil - to return error if there is any failure based on Matt's indication */
/* Kapil - to fill the response structure and call the response API to send Modify response */
response:
{
/* send response */
...
...
@@ -1272,9 +1259,10 @@ response:
#endif
/*mg_fill_mgco_termid(termId, (char*)"term1",&req->u.mgCmdRsp[0]->memCp);*/
if
((
MG_TERM_RTP
==
term
->
type
)
&&
((
NOTPRSNT
!=
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
cmd
.
u
.
mod
.
dl
.
num
.
pres
)
&&
(
0
!=
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
cmd
.
u
.
mod
.
dl
.
num
.
val
)))
{
if
((
MGT_TERMID_ROOT
!=
termId
->
type
.
val
)
&&
(
term
&&
(
MG_TERM_RTP
==
term
->
type
)
&&
((
NOTPRSNT
!=
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
cmd
.
u
.
mod
.
dl
.
num
.
pres
)
&&
(
0
!=
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
cmd
.
u
.
mod
.
dl
.
num
.
val
))))
{
/* Whatever Media descriptor we have received, we can copy that and then
* whatever we want we can modify the fields */
/* Kapil - TODO - will see if there is any problem of coping the
...
...
@@ -1335,6 +1323,14 @@ error:
sng_mgco_send_err
(
mg_profile
->
idx
,
mgErr
);
}
mg_free_cmd
(
inc_cmd
);
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_ERROR
,
" Modify Request failed..releasing context/termination
\n
"
);
if
(
mg_ctxt
){
megaco_release_context
(
mg_ctxt
);
}
if
(
term
){
megaco_termination_destroy
(
term
);
}
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -3030,7 +3026,7 @@ switch_status_t mg_send_notify(megaco_profile_t* mg_profile, const char* term_n
request
.
transId
.
val
=
get_txn_id
();
request
.
contextId
.
type
.
pres
=
PRSNT_NODEF
;
if
(
term
->
context
){
if
(
term
&&
term
->
context
){
printf
(
"Temrination is in context, adding context-id[%d]
\n
"
,
term
->
context
->
context_id
);
request
.
contextId
.
type
.
val
=
MGT_CXTID_OTHER
;
request
.
contextId
.
val
.
pres
=
PRSNT_NODEF
;
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_packages.c
浏览文件 @
85dfa042
...
...
@@ -138,6 +138,11 @@ MgPackage_t mg_pkg_list [] =
1
,
/* Version 1 */
"ipfax"
,
/* Package name */
},
{
/* INDEX : 26 */
MGT_PKG_FAX
,
1
,
/* Version 1 */
"fax"
,
/* Package name */
},
/* Add more packages */
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论