Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4c4a7b74
提交
4c4a7b74
authored
7月 17, 2012
作者:
Kapil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adding MEGACO Media Descriptors prints
上级
6acde3a8
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
129 行增加
和
2 行删除
+129
-2
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+129
-2
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
4c4a7b74
...
@@ -38,13 +38,27 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
...
@@ -38,13 +38,27 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
MgMgcoTermId
*
termId
;
MgMgcoTermId
*
termId
;
MgMgcoTermIdLst
*
termLst
;
MgMgcoTermIdLst
*
termLst
;
int
err_code
;
int
err_code
;
int
i
;
int
j
;
int
fmtCnt
;
MgMgcoAmmReq
*
cmd
=
&
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
cmd
.
u
.
add
;
MgMgcoAmmReq
*
cmd
=
&
inc_cmd
->
u
.
mgCmdInd
[
0
]
->
cmd
.
u
.
add
;
U32
txn_id
=
inc_cmd
->
transId
.
val
;
U32
txn_id
=
inc_cmd
->
transId
.
val
;
MgMgcoLocalDesc
*
local
;
MgMgcoRemoteDesc
*
remote
;
MgMgcoLclCtlDesc
*
locCtl
;
CmSdpInfo
*
sdp
;
MgMgcoLocalParm
*
lclParm
;
MgMgcoTermStateDesc
*
tstate
;
CmSdpMedFmtRtpList
*
fmt_list
;
MgMgcoTermStateParm
*
tsp
;
TknU8
*
fmt
;
CmSdpMedProtoFmts
*
format
;
/********************************************************************/
/********************************************************************/
ctxtId
=
&
inc_cmd
->
contextId
;
ctxtId
=
&
inc_cmd
->
contextId
;
termLst
=
mg_get_term_id_list
(
inc_cmd
);
termLst
=
mg_get_term_id_list
(
inc_cmd
);
termId
=
termLst
->
terms
[
0
];
termId
=
termLst
->
terms
[
0
];
/* For Matt - termId->name.lcl.val - to get the termination id name */
/********************************************************************/
/********************************************************************/
/* Validating ADD request *******************************************/
/* Validating ADD request *******************************************/
...
@@ -76,11 +90,12 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
...
@@ -76,11 +90,12 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
/* TODO - Matt */
/* TODO - Matt */
/* allocate rtp term and associated the same to context */
/* allocate rtp term and associated the same to context */
/********************************************************************/
}
else
{
/* Physical termination */
/* TODO - Matt - associate physical termination to context */
}
}
/********************************************************************/
/********************************************************************/
for
(
descId
=
0
;
descId
<
cmd
->
dl
.
num
.
val
;
descId
++
)
{
for
(
descId
=
0
;
descId
<
cmd
->
dl
.
num
.
val
;
descId
++
)
{
switch
(
cmd
->
dl
.
descs
[
descId
]
->
type
.
val
)
{
switch
(
cmd
->
dl
.
descs
[
descId
]
->
type
.
val
)
{
case
MGT_MEDIADESC
:
case
MGT_MEDIADESC
:
...
@@ -92,22 +107,126 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
...
@@ -92,22 +107,126 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
case
MGT_MEDIAPAR_LOCAL
:
case
MGT_MEDIAPAR_LOCAL
:
{
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_LOCAL"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_LOCAL"
);
/* Matt - check local descriptor processing */
local
=
&
mediaPar
->
u
.
local
;
sdp
=
local
->
sdp
.
info
[
0
];
for
(
i
=
0
;
i
<
sdp
->
mediaDescSet
.
numComp
.
val
;
i
++
)
{
/* sdp formats */
for
(
j
=
0
;
j
<
sdp
->
mediaDescSet
.
mediaDesc
[
i
]
->
field
.
par
.
numProtFmts
.
val
;
j
++
)
{
format
=
sdp
->
mediaDescSet
.
mediaDesc
[
i
]
->
field
.
par
.
pflst
[
j
];
/* Matt - format has field for T38 also */
if
((
format
->
protType
.
pres
!=
NOTPRSNT
)
&&
(
format
->
protType
.
val
==
CM_SDP_MEDIA_PROTO_RTP
))
{
/* protocol type RTP */
fmt_list
=
&
format
->
u
.
rtp
;
/* print format */
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
);
}
}
}
}
break
;
break
;
}
}
case
MGT_MEDIAPAR_REMOTE
:
case
MGT_MEDIAPAR_REMOTE
:
{
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_REMOTE"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_REMOTE"
);
/* Matt - check remote descriptor processing */
remote
=
&
mediaPar
->
u
.
remote
;
sdp
=
remote
->
sdp
.
info
[
0
];
/* for Matt - same like local descriptor */
break
;
break
;
}
}
case
MGT_MEDIAPAR_LOCCTL
:
case
MGT_MEDIAPAR_LOCCTL
:
{
{
/* Matt - check Local Control descriptor processing */
locCtl
=
&
mediaPar
->
u
.
locCtl
;
for
(
i
=
0
;
i
<
locCtl
->
num
.
val
;
i
++
){
lclParm
=
locCtl
->
parms
[
i
];
if
(
PRSNT_NODEF
==
lclParm
->
type
.
pres
){
switch
(
lclParm
->
type
.
val
)
{
case
MGT_LCLCTL_MODE
:
{
/* Mode Property */
printf
(
"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
);
break
;
}
case
MGT_LCLCTL_RESGRP
:
{
/* Reserve group */
printf
(
"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
"
);
break
;
}
default:
printf
(
"Invalid local control descriptor type[%d]
\n
"
,
lclParm
->
type
.
val
);
break
;
}
}
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_LOCCTL"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_LOCCTL"
);
break
;
break
;
}
}
case
MGT_MEDIAPAR_TERMST
:
case
MGT_MEDIAPAR_TERMST
:
{
{
/* Matt - apply termination state descriptor */
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_TERMST"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"MGT_MEDIAPAR_TERMST"
);
tstate
=
&
mediaPar
->
u
.
tstate
;
for
(
i
=
0
;
i
<
tstate
->
numComp
.
val
;
i
++
)
{
/* Matt to see how to apply below descriptors to a termination */
tsp
=
tstate
->
trmStPar
[
i
];
if
(
PRSNT_NODEF
==
tsp
->
type
.
pres
)
{
switch
(
tsp
->
type
.
val
)
{
case
MGT_TERMST_PROPLST
:
{
/* Matt to see how to apply properties to a termination */
/* Properties of a termination */
printf
(
"MGT_TERMST_PROPLST:
\n
"
);
break
;
}
case
MGT_TERMST_EVTBUFCTL
:
{
/* Event /buffer Control Properties */
printf
(
" 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
);
break
;
}
default:
printf
(
"Invalid termination state descriptor type[%d]
\n
"
,
tsp
->
type
.
val
);
break
;
}
}
}
break
;
break
;
}
}
case
MGT_MEDIAPAR_STRPAR
:
case
MGT_MEDIAPAR_STRPAR
:
...
@@ -141,6 +260,14 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
...
@@ -141,6 +260,14 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
}
}
}
}
/* 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 */
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
error:
error:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论