Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
377e5a73
提交
377e5a73
authored
8月 24, 2012
作者:
Mathieu Rene
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
closes #5641
上级
b6bd8071
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway.c
+8
-8
没有找到文件。
src/mod/endpoints/mod_media_gateway/media_gateway.c
浏览文件 @
377e5a73
...
@@ -514,11 +514,11 @@ mg_context_t *megaco_get_context(megaco_profile_t *profile, uint32_t context_id)
...
@@ -514,11 +514,11 @@ mg_context_t *megaco_get_context(megaco_profile_t *profile, uint32_t context_id)
if
(
context_id
>
MG_MAX_CONTEXTS
)
{
if
(
context_id
>
MG_MAX_CONTEXTS
)
{
return
NULL
;
return
NULL
;
}
}
switch_thread_rwlock_rdlock
(
profile
->
contexts_rwlock
);
switch_thread_rwlock_rdlock
(
profile
->
contexts_rwlock
);
/* Context exists */
/* Context exists */
if
(
profile
->
contexts_bitmap
[
context_id
%
8
]
&
(
1
<<
(
context_id
/
8
)))
{
if
(
profile
->
contexts_bitmap
[
context_id
/
8
]
&
(
1
<<
(
context_id
%
8
)))
{
for
(
result
=
profile
->
contexts
[
context_id
%
MG_CONTEXT_MODULO
];
result
;
result
=
result
->
next
)
{
for
(
result
=
profile
->
contexts
[
context_id
%
MG_CONTEXT_MODULO
];
result
;
result
=
result
->
next
)
{
if
(
result
->
context_id
==
context_id
)
{
if
(
result
->
context_id
==
context_id
)
{
break
;
break
;
...
@@ -544,10 +544,10 @@ mg_context_t *megaco_choose_context(megaco_profile_t *profile)
...
@@ -544,10 +544,10 @@ mg_context_t *megaco_choose_context(megaco_profile_t *profile)
/* Look for an available context */
/* Look for an available context */
for
(;
profile
->
next_context_id
<
MG_MAX_CONTEXTS
;
profile
->
next_context_id
++
)
{
for
(;
profile
->
next_context_id
<
MG_MAX_CONTEXTS
;
profile
->
next_context_id
++
)
{
if
((
profile
->
contexts_bitmap
[
profile
->
next_context_id
%
8
]
&
(
1
<<
(
profile
->
next_context_id
/
8
)))
==
0
)
{
if
((
profile
->
contexts_bitmap
[
profile
->
next_context_id
/
8
]
&
(
1
<<
(
profile
->
next_context_id
%
8
)))
==
0
)
{
/* Found! */
/* Found! */
int
i
=
profile
->
next_context_id
%
MG_CONTEXT_MODULO
;
int
i
=
profile
->
next_context_id
%
MG_CONTEXT_MODULO
;
profile
->
contexts_bitmap
[
profile
->
next_context_id
%
8
]
|=
1
<<
(
profile
->
next_context_id
/
8
);
profile
->
contexts_bitmap
[
profile
->
next_context_id
/
8
]
|=
1
<<
(
profile
->
next_context_id
%
8
);
ctx
=
malloc
(
sizeof
*
ctx
);
ctx
=
malloc
(
sizeof
*
ctx
);
memset
(
ctx
,
0
,
sizeof
*
ctx
);
memset
(
ctx
,
0
,
sizeof
*
ctx
);
ctx
->
context_id
=
profile
->
next_context_id
;
ctx
->
context_id
=
profile
->
next_context_id
;
...
@@ -591,7 +591,7 @@ void megaco_release_context(mg_context_t *ctx)
...
@@ -591,7 +591,7 @@ void megaco_release_context(mg_context_t *ctx)
}
}
}
}
profile
->
contexts_bitmap
[
context_id
%
8
]
&=
~
(
1
<<
(
context_id
/
8
));
profile
->
contexts_bitmap
[
context_id
/
8
]
&=
~
(
1
<<
(
context_id
%
8
));
memset
(
ctx
,
0
,
sizeof
*
ctx
);
memset
(
ctx
,
0
,
sizeof
*
ctx
);
free
(
ctx
);
free
(
ctx
);
...
@@ -606,8 +606,8 @@ uint32_t mg_rtp_request_id(megaco_profile_t *profile)
...
@@ -606,8 +606,8 @@ uint32_t mg_rtp_request_id(megaco_profile_t *profile)
}
}
for
(;
profile
->
rtpid_next
<
MG_MAX_RTPID
;
profile
->
rtpid_next
++
)
{
for
(;
profile
->
rtpid_next
<
MG_MAX_RTPID
;
profile
->
rtpid_next
++
)
{
if
((
profile
->
rtpid_bitmap
[
profile
->
rtpid_next
%
8
]
&
(
1
<<
(
profile
->
rtpid_next
/
8
)))
==
0
)
{
if
((
profile
->
rtpid_bitmap
[
profile
->
rtpid_next
/
8
]
&
(
1
<<
(
profile
->
rtpid_next
%
8
)))
==
0
)
{
profile
->
rtpid_bitmap
[
profile
->
rtpid_next
%
8
]
|=
1
<<
(
profile
->
rtpid_next
/
8
);
profile
->
rtpid_bitmap
[
profile
->
rtpid_next
/
8
]
|=
1
<<
(
profile
->
rtpid_next
%
8
);
profile
->
rtpid_next
++
;
profile
->
rtpid_next
++
;
return
profile
->
rtpid_next
;
return
profile
->
rtpid_next
;
}
}
...
@@ -618,7 +618,7 @@ uint32_t mg_rtp_request_id(megaco_profile_t *profile)
...
@@ -618,7 +618,7 @@ uint32_t mg_rtp_request_id(megaco_profile_t *profile)
void
mg_rtp_release_id
(
megaco_profile_t
*
profile
,
uint32_t
id
)
void
mg_rtp_release_id
(
megaco_profile_t
*
profile
,
uint32_t
id
)
{
{
profile
->
rtpid_bitmap
[
id
%
8
]
&=
~
(
1
<<
(
id
/
8
));
profile
->
rtpid_bitmap
[
id
/
8
]
&=
~
(
1
<<
(
id
%
8
));
}
}
switch_status_t
megaco_profile_start
(
const
char
*
profilename
)
switch_status_t
megaco_profile_start
(
const
char
*
profilename
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论