Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4526ba30
提交
4526ba30
authored
9月 08, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve sofia recover in some nat cases
上级
d18c3a8a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
22 行删除
+26
-22
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+4
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+18
-21
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+3
-1
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
4526ba30
...
...
@@ -85,6 +85,10 @@ static switch_status_t sofia_on_init(switch_core_session_t *session)
sofia_glue_tech_absorb_sdp
(
tech_pvt
);
}
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERING
)
||
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERING_BRIDGE
))
{
sofia_set_flag
(
tech_pvt
,
TFLAG_RECOVERED
);
}
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
||
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERING
))
{
const
char
*
var
;
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
4526ba30
...
...
@@ -275,6 +275,7 @@ typedef enum {
TFLAG_RECOVERING
,
TFLAG_RECOVERING_BRIDGE
,
TFLAG_T38_PASSTHRU
,
TFLAG_RECOVERED
,
/* No new flags below this line */
TFLAG_MAX
}
TFLAGS
;
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
4526ba30
...
...
@@ -1225,7 +1225,7 @@ static void sofia_perform_profile_start_failure(sofia_profile_t *profile, char *
#define sofia_profile_start_failure(p, xp) sofia_perform_profile_start_failure(p, xp, __FILE__, __LINE__)
#define SQLLEN 1024 *
64
#define SQLLEN 1024 *
32
void
*
SWITCH_THREAD_FUNC
sofia_profile_worker_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
sofia_profile_t
*
profile
=
(
sofia_profile_t
*
)
obj
;
...
...
@@ -1236,7 +1236,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
void
*
pop
;
int
loop_count
=
0
;
switch_size_t
sql_len
=
SQLLEN
;
char
*
tmp
,
*
sqlbuf
=
NULL
;
char
*
sqlbuf
=
NULL
;
char
*
sql
=
NULL
;
if
(
sofia_test_pflag
(
profile
,
PFLAG_SQL_IN_TRANS
))
{
sqlbuf
=
(
char
*
)
malloc
(
sql_len
);
...
...
@@ -1253,7 +1254,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
while
((
mod_sofia_globals
.
running
==
1
&&
sofia_test_pflag
(
profile
,
PFLAG_RUNNING
))
||
qsize
)
{
if
(
sofia_test_pflag
(
profile
,
PFLAG_SQL_IN_TRANS
))
{
if
(
qsize
>
0
&&
(
qsize
>=
1024
||
++
loop_count
>=
profile
->
trans_timeout
)
)
{
if
(
(
qsize
>
0
&&
(
qsize
>=
1024
||
++
loop_count
>=
profile
->
trans_timeout
))
||
sql
)
{
switch_size_t
newlen
;
uint32_t
itterations
=
0
;
switch_size_t
len
=
0
;
...
...
@@ -1262,28 +1263,24 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
//sofia_glue_actually_execute_sql(profile, "begin;\n", NULL);
while
(
switch_queue_trypop
(
profile
->
sql_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
&&
pop
)
{
char
*
sql
=
(
char
*
)
pop
;
while
(
sql
||
(
switch_queue_trypop
(
profile
->
sql_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
&&
pop
))
{
if
(
!
sql
)
{
sql
=
(
char
*
)
pop
;
}
newlen
=
strlen
(
sql
)
+
2
;
if
(
newlen
+
10
<
SQLLEN
)
{
itterations
++
;
if
(
len
+
newlen
+
10
>
sql_len
)
{
sql_len
=
len
+
10
+
SQLLEN
;
if
(
!
(
tmp
=
realloc
(
sqlbuf
,
sql_len
)))
{
abort
();
break
;
}
sqlbuf
=
tmp
;
}
itterations
++
;
if
(
len
+
newlen
+
10
<
sql_len
)
{
sprintf
(
sqlbuf
+
len
,
"%s;
\n
"
,
sql
);
len
+=
newlen
;
switch_safe_free
(
sql
);
}
else
{
break
;
}
free
(
pop
);
}
//printf("TRANS:\n%s\n", sqlbuf);
sofia_glue_actually_execute_sql_trans
(
profile
,
sqlbuf
,
NULL
);
//sofia_glue_actually_execute_sql(profile, "commit;\n", NULL);
...
...
@@ -2860,7 +2857,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
goto
done
;
}
profile
->
trans_timeout
=
5
00
;
profile
->
trans_timeout
=
1
00
;
profile
->
auto_rtp_bugs
=
RTP_BUG_CISCO_SKIP_MARK_BIT_2833
;
// | RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833;
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
4526ba30
...
...
@@ -2059,6 +2059,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
nua_invite
(
tech_pvt
->
nh
,
NUTAG_AUTOANSWER
(
0
),
NUTAG_SESSION_TIMER
(
session_timeout
),
TAG_IF
(
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERED
),
NUTAG_INVITE_TIMER
(
UINT_MAX
)),
TAG_IF
(
invite_full_from
,
SIPTAG_FROM_STR
(
invite_full_from
)),
TAG_IF
(
invite_full_to
,
SIPTAG_TO_STR
(
invite_full_to
)),
TAG_IF
(
tech_pvt
->
redirected
,
NUTAG_URL
(
tech_pvt
->
redirected
)),
...
...
@@ -2087,6 +2088,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
nua_invite
(
tech_pvt
->
nh
,
NUTAG_AUTOANSWER
(
0
),
NUTAG_SESSION_TIMER
(
session_timeout
),
TAG_IF
(
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERED
),
NUTAG_INVITE_TIMER
(
UINT_MAX
)),
TAG_IF
(
invite_full_from
,
SIPTAG_FROM_STR
(
invite_full_from
)),
TAG_IF
(
invite_full_to
,
SIPTAG_TO_STR
(
invite_full_to
)),
TAG_IF
(
tech_pvt
->
redirected
,
NUTAG_URL
(
tech_pvt
->
redirected
)),
...
...
@@ -4644,7 +4646,7 @@ void sofia_glue_tech_untrack(sofia_profile_t *profile, switch_core_session_t *se
}
}
sofia_glue_execute_sql
_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_glue_execute_sql
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_clear_flag
(
tech_pvt
,
TFLAG_TRACKED
);
switch_safe_free
(
sql
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论