Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
ee8047eb
提交
ee8047eb
authored
7月 26, 2012
作者:
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changes on test box
上级
f57825f1
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
271 行增加
和
231 行删除
+271
-231
media_gateway_cmd_handler.c
...d/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
+11
-13
media_gateway_stack.h
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
+8
-1
media_gateway_utils.c
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
+232
-207
mod_media_gateway.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
+2
-2
mod_media_gateway.h
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
+1
-0
rtp.c
src/mod/endpoints/mod_sofia/rtp.c
+14
-5
switch_channel.c
src/switch_channel.c
+2
-2
switch_rtp.c
src/switch_rtp.c
+1
-1
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
浏览文件 @
ee8047eb
...
...
@@ -301,6 +301,8 @@ switch_status_t mg_prc_descriptors(megaco_profile_t* mg_profile, MgMgcoCommand *
}
}
mgco_handle_sdp
(
&
local
->
sdp
,
term
,
MG_SDP_LOCAL
);
break
;
}
...
...
@@ -311,6 +313,7 @@ switch_status_t mg_prc_descriptors(megaco_profile_t* mg_profile, MgMgcoCommand *
remote
=
&
mediaPar
->
u
.
remote
;
sdp
=
remote
->
sdp
.
info
[
0
];
/* for Matt - same like local descriptor */
mgco_handle_sdp
(
&
remote
->
sdp
,
term
,
MG_SDP_REMOTE
);
break
;
}
...
...
@@ -403,12 +406,12 @@ switch_status_t mg_prc_descriptors(megaco_profile_t* mg_profile, MgMgcoCommand *
if
(
mgStream
->
sl
.
remote
.
pres
.
pres
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Got remote stream media description:
\n
"
);
mgco_
print_sdp
(
&
mgStream
->
sl
.
remote
.
sdp
);
mgco_
handle_sdp
(
&
mgStream
->
sl
.
remote
.
sdp
,
term
,
MG_SDP_LOCAL
);
}
if
(
mgStream
->
sl
.
local
.
pres
.
pres
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Got local stream media description:
\n
"
);
mgco_
print_sdp
(
&
mgStream
->
sl
.
local
.
sdp
);
mgco_
handle_sdp
(
&
mgStream
->
sl
.
local
.
sdp
,
term
,
MG_SDP_REMOTE
);
}
break
;
...
...
@@ -567,11 +570,8 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
is_rtp
=
0x01
;
/* TODO - Matt */
/* allocate rtp term and associated the same to context */
/********************************************************************/
/********************************************************************/
}
else
{
/* Physical termination */
printf
(
"termId->name.lcl.val[%s]
\n
"
,
termId
->
name
.
lcl
.
val
);
term
=
megaco_find_termination
(
mg_profile
,
(
char
*
)
termId
->
name
.
lcl
.
val
);
if
(
NULL
==
term
){
...
...
@@ -581,9 +581,6 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
}
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_INFO
,
" Allocated Termination[%p] with term name[%s]
\n
"
,
(
void
*
)
term
,
term
->
name
);
/* get physical termination */
}
/********************************************************************/
/* associate physical termination to context */
...
...
@@ -694,8 +691,6 @@ switch_status_t handle_mg_add_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *i
switch_split
(
dup
,
'.'
,
ipAddress
);
printf
(
"ipAddress[0]=%s, ipAddress[1]=%s, ipAddress[2]=%s,ipAddress[3]=%s
\n
"
,
ipAddress
[
0
],
ipAddress
[
1
],
ipAddress
[
2
],
ipAddress
[
3
]);
/* Most probably we need to add local descriptor */
/* allocating mem for local descriptor */
...
...
@@ -918,8 +913,8 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
MgMgcoInd
*
mgErr
;
MgMgcoTermId
*
termId
;
MgMgcoTermIdLst
*
termLst
;
mg_termination_t
*
term
=
NULL
;
switch_status_t
ret
;
mg_termination_t
*
term
=
NULL
;
switch_status_t
ret
;
int
err_code
;
/*MgMgcoAmmReq *cmd = &inc_cmd->u.mgCmdInd[0]->cmd.u.mod;*/
U32
txn_id
=
inc_cmd
->
transId
.
val
;
...
...
@@ -1033,6 +1028,9 @@ switch_status_t handle_mg_modify_cmd(megaco_profile_t* mg_profile, MgMgcoCommand
ret
=
mg_prc_descriptors
(
mg_profile
,
inc_cmd
,
term
);
/* SDP updated to termination */
megaco_activate_termination
(
term
);
}
/********************************************************************/
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
浏览文件 @
ee8047eb
...
...
@@ -15,6 +15,13 @@
#define MG_INACTIVITY_TMR_RESOLUTION 100
/* mit in ito package is experessed in 10ms steps */
typedef
enum
{
MG_SDP_NONE
,
MG_SDP_LOCAL
,
MG_SDP_REMOTE
,
}
mgco_sdp_types_e
;
typedef
enum
{
SNG_MG_TPT_NONE
,
SNG_MG_TPT_UDP
,
...
...
@@ -151,7 +158,7 @@ int sng_mgco_mg_get_status(int elemId, MgMngmt* cfm, megaco_profile_t* mg_cfg, m
switch_status_t
mg_is_ito_pkg_req
(
megaco_profile_t
*
mg_profile
,
MgMgcoCommand
*
cmd
);
switch_status_t
mg_send_end_of_axn
(
SuId
suId
,
MgMgcoTransId
*
transId
,
MgMgcoContextId
*
ctxtId
,
TknU32
*
peerId
);
void
mgco_
print_sdp
(
CmSdpInfoSet
*
sdp
);
void
mgco_
handle_sdp
(
CmSdpInfoSet
*
sdp
,
mg_termination_t
*
term
,
mgco_sdp_types_e
sdp_type
);
void
mg_util_set_ctxt_string
(
MgStr
*
errTxt
,
MgMgcoContextId
*
ctxtId
);
switch_status_t
handle_mg_add_cmd
(
megaco_profile_t
*
mg_profile
,
MgMgcoCommand
*
inc_cmd
,
MgMgcoContextId
*
new_ctxtId
);
switch_status_t
handle_mg_subtract_cmd
(
megaco_profile_t
*
mg_profile
,
MgMgcoCommand
*
inc_cmd
);
...
...
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c
浏览文件 @
ee8047eb
差异被折叠。
点击展开。
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
浏览文件 @
ee8047eb
...
...
@@ -639,7 +639,7 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
MgMgcoNtfyReply
*
ntfy
=
&
cmd
->
u
.
mgCmdCfm
[
0
]
->
u
.
ntfy
;
MgMgcoTermId
*
term
=
NULL
;
char
term_name
[
32
];
memset
(
&
term_name
[
0
],
32
,
0x00
);
memset
(
&
term_name
[
0
],
0x00
,
32
);
strcpy
(
&
term_name
[
0
],
"Invalid"
);
...
...
@@ -685,7 +685,7 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
MgMgcoSvcChgReply
*
svc
=
&
cmd
->
u
.
mgCmdCfm
[
0
]
->
u
.
svc
;
MgMgcoTermId
*
term
=
NULL
;
char
term_name
[
32
];
memset
(
&
term_name
[
0
],
32
,
0x00
);
memset
(
&
term_name
[
0
],
0x00
,
32
);
strcpy
(
&
term_name
[
0
],
"Invalid"
);
...
...
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h
浏览文件 @
ee8047eb
...
...
@@ -231,6 +231,7 @@ mg_context_t *megaco_choose_context(megaco_profile_t *profile);
void
megaco_release_context
(
mg_context_t
*
ctx
);
switch_status_t
megaco_context_sub_termination
(
mg_context_t
*
ctx
,
mg_termination_t
*
term
);
switch_status_t
megaco_context_sub_all_termination
(
mg_context_t
*
ctx
);
switch_status_t
megaco_activate_termination
(
mg_termination_t
*
term
);
mg_termination_t
*
megaco_choose_termination
(
megaco_profile_t
*
profile
,
const
char
*
prefix
);
mg_termination_t
*
megaco_find_termination
(
megaco_profile_t
*
profile
,
const
char
*
name
);
...
...
src/mod/endpoints/mod_sofia/rtp.c
浏览文件 @
ee8047eb
...
...
@@ -315,7 +315,8 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
if
(
!
tech_pvt
->
rtp_session
||
tech_pvt
->
mode
==
RTP_RECVONLY
)
{
if
(
!
tech_pvt
->
rtp_session
||
tech_pvt
->
mode
==
RTP_SENDONLY
)
{
switch_yield
(
20000
);
/* replace by local timer XXX */
goto
cng
;
}
...
...
@@ -338,6 +339,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
cng:
*
frame
=
&
tech_pvt
->
read_frame
;
tech_pvt
->
read_frame
.
codec
=
&
tech_pvt
->
read_codec
;
tech_pvt
->
read_frame
.
flags
|=
SFF_CNG
;
tech_pvt
->
read_frame
.
datalen
=
0
;
...
...
@@ -370,8 +372,11 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
tech_pvt->timestamp_send += samples;
#endif
switch_rtp_write_frame
(
tech_pvt
->
rtp_session
,
frame
);
if
(
tech_pvt
->
mode
==
RTP_RECVONLY
)
{
return
SWITCH_STATUS_SUCCESS
;
}
switch_rtp_write_frame
(
tech_pvt
->
rtp_session
,
frame
);
return
SWITCH_STATUS_SUCCESS
;
}
...
...
@@ -403,7 +408,11 @@ static switch_bool_t compare_var(switch_event_t *event, switch_channel_t *channe
{
const
char
*
chan_val
=
switch_channel_get_variable_dup
(
channel
,
varname
,
SWITCH_FALSE
,
-
1
);
const
char
*
event_val
=
switch_event_get_header
(
event
,
varname
);
if
(
zstr
(
chan_val
)
||
zstr
(
event_val
))
{
return
1
;
}
return
strcasecmp
(
chan_val
,
event_val
);
}
...
...
@@ -418,7 +427,7 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
if
(
compare_var
(
event
,
channel
,
kREMOTEADDR
)
||
compare_var
(
event
,
channel
,
kREMOTEPORT
))
{
char
*
remote_addr
=
switch_event_get_header
(
event
,
kREMOTEADDR
);
char
*
szremote_port
=
switch_event_get_header
(
event
,
kREMOTE
ADDR
);
char
*
szremote_port
=
switch_event_get_header
(
event
,
kREMOTE
PORT
);
switch_port_t
remote_port
=
!
zstr
(
szremote_port
)
?
atoi
(
szremote_port
)
:
0
;
const
char
*
err
;
...
...
src/switch_channel.c
浏览文件 @
ee8047eb
...
...
@@ -4154,8 +4154,8 @@ SWITCH_DECLARE(const char *) switch_channel_get_partner_uuid(switch_channel_t *c
{
const
char
*
uuid
=
NULL
;
if
(
!
(
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
)))
{
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE
);
if
(
!
(
uuid
=
switch_channel_get_variable
_dup
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
,
SWITCH_FALSE
,
-
1
)))
{
uuid
=
switch_channel_get_variable
_dup
(
channel
,
SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE
,
SWITCH_FALSE
,
-
1
);
}
return
uuid
;
...
...
src/switch_rtp.c
浏览文件 @
ee8047eb
...
...
@@ -2165,7 +2165,7 @@ SWITCH_DECLARE(uint8_t) switch_rtp_ready(switch_rtp_t *rtp_session)
}
switch_mutex_lock
(
rtp_session
->
flag_mutex
);
ret
=
(
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_IO
)
&&
rtp_session
->
sock_input
&&
rtp_session
->
sock_output
&&
rtp_session
->
remote_addr
ret
=
(
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_IO
)
&&
rtp_session
->
sock_input
/* && rtp_session->sock_output && rtp_session->remote_addr */
&&
rtp_session
->
ready
==
2
)
?
1
:
0
;
switch_mutex_unlock
(
rtp_session
->
flag_mutex
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论