Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
71ecf081
提交
71ecf081
authored
11月 18, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3688 revert
上级
4c13e7c0
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
25 行删除
+19
-25
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+8
-3
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-1
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+10
-21
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
71ecf081
...
...
@@ -508,7 +508,6 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Sending BYE to %s
\n
"
,
switch_channel_get_name
(
channel
));
if
(
!
sofia_test_flag
(
tech_pvt
,
TFLAG_BYE
))
{
switch_ivr_parse_all_signal_data
(
session
);
nua_bye
(
tech_pvt
->
nh
,
TAG_IF
(
!
zstr
(
reason
),
SIPTAG_REASON_STR
(
reason
)),
TAG_IF
(
call_info
,
SIPTAG_CALL_INFO_STR
(
call_info
)),
...
...
@@ -522,7 +521,6 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
switch_channel_set_variable
(
channel
,
"sip_hangup_disposition"
,
"send_cancel"
);
}
if
(
!
sofia_test_flag
(
tech_pvt
,
TFLAG_BYE
))
{
switch_ivr_parse_all_signal_data
(
session
);
nua_cancel
(
tech_pvt
->
nh
,
TAG_IF
(
!
zstr
(
reason
),
SIPTAG_REASON_STR
(
reason
)),
TAG_IF
(
!
zstr
(
bye_headers
),
SIPTAG_HEADER_STR
(
bye_headers
)),
TAG_END
());
}
...
...
@@ -1415,7 +1413,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if
(
switch_core_session_in_thread
(
session
))
{
de
->
session
=
session
;
}
sofia_process_dispatch_event
(
&
de
,
SWITCH_TRUE
);
sofia_process_dispatch_event
(
&
de
);
switch_mutex_unlock
(
tech_pvt
->
sofia_mutex
);
goto
end
;
}
...
...
@@ -1907,6 +1905,12 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
case
SWITCH_MESSAGE_INDICATE_PHONE_EVENT
:
{
switch_channel_set_flag
(
channel
,
CF_REQ_MEDIA
);
sofia_glue_do_invite
(
session
);
#if 0
const char *event = "talk";
if (!zstr(msg->string_arg) && strcasecmp(msg->string_arg, event)) {
...
...
@@ -1923,6 +1927,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} else {
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR(event), TAG_END());
}
#endif
}
break
;
case
SWITCH_MESSAGE_INDICATE_SIMPLIFY
:
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
71ecf081
...
...
@@ -1138,5 +1138,5 @@ void sofia_glue_check_dtmf_type(private_object_t *tech_pvt);
void
sofia_glue_parse_rtp_bugs
(
switch_rtp_bug_flag_t
*
flag_pole
,
const
char
*
str
);
char
*
sofia_glue_gen_contact_str
(
sofia_profile_t
*
profile
,
sip_t
const
*
sip
,
sofia_dispatch_event_t
*
de
,
sofia_nat_parse_t
*
np
);
void
sofia_glue_pause_jitterbuffer
(
switch_core_session_t
*
session
,
switch_bool_t
on
);
void
sofia_process_dispatch_event
(
sofia_dispatch_event_t
**
dep
,
switch_bool_t
do_callback
);
void
sofia_process_dispatch_event
(
sofia_dispatch_event_t
**
dep
);
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
71ecf081
...
...
@@ -870,7 +870,7 @@ static void our_sofia_event_callback(nua_event_t event,
if
(
sofia_private
&&
sofia_private
->
is_call
&&
sofia_private
->
de
)
{
sofia_dispatch_event_t
*
qde
=
sofia_private
->
de
;
sofia_private
->
de
=
NULL
;
sofia_process_dispatch_event
(
&
qde
,
SWITCH_TRUE
);
sofia_process_dispatch_event
(
&
qde
);
}
profile
->
last_sip_event
=
switch_time_now
();
...
...
@@ -1192,28 +1192,17 @@ static void our_sofia_event_callback(nua_event_t event,
}
}
void
sofia_process_dispatch_event
(
sofia_dispatch_event_t
**
dep
,
switch_bool_t
do_callback
)
void
sofia_process_dispatch_event
(
sofia_dispatch_event_t
**
dep
)
{
sofia_dispatch_event_t
*
de
=
*
dep
;
nua_handle_t
*
nh
=
de
->
nh
;
nua_t
*
nua
=
de
->
nua
;
sofia_profile_t
*
profile
=
de
->
profile
;
nua_event_t
event
;
*
dep
=
NULL
;
event
=
de
->
data
->
e_event
;
if
(
de
->
session
&&
switch_channel_down_nosig
(
switch_core_session_get_channel
(
de
->
session
)))
{
if
(
event
==
nua_i_invite
)
{
nua_respond
(
nh
,
481
,
"Channel Hanging Up"
,
TAG_END
());
}
do_callback
=
SWITCH_FALSE
;
}
*
dep
=
NULL
;
if
(
do_callback
)
{
our_sofia_event_callback
(
de
->
data
->
e_event
,
de
->
data
->
e_status
,
de
->
data
->
e_phrase
,
de
->
nua
,
de
->
profile
,
de
->
nh
,
nua_handle_magic
(
de
->
nh
),
de
->
sip
,
de
,
(
tagi_t
*
)
de
->
data
->
e_tags
);
}
our_sofia_event_callback
(
de
->
data
->
e_event
,
de
->
data
->
e_status
,
de
->
data
->
e_phrase
,
de
->
nua
,
de
->
profile
,
de
->
nh
,
nua_handle_magic
(
de
->
nh
),
de
->
sip
,
de
,
(
tagi_t
*
)
de
->
data
->
e_tags
);
nua_destroy_event
(
de
->
event
);
su_free
(
nh
->
nh_home
,
de
);
...
...
@@ -1237,7 +1226,7 @@ void *SWITCH_THREAD_FUNC sofia_msg_thread_run(switch_thread_t *thread, void *obj
while
(
switch_queue_pop
(
q
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
&&
pop
)
{
sofia_dispatch_event_t
*
de
=
(
sofia_dispatch_event_t
*
)
pop
;
sofia_process_dispatch_event
(
&
de
,
SWITCH_TRUE
);
sofia_process_dispatch_event
(
&
de
);
switch_cond_next
();
}
...
...
@@ -1288,7 +1277,7 @@ static void sofia_queue_message(sofia_dispatch_event_t *de)
int
idx
=
0
;
if
(
mod_sofia_globals
.
running
==
0
)
{
sofia_process_dispatch_event
(
&
de
,
SWITCH_TRUE
);
sofia_process_dispatch_event
(
&
de
);
return
;
}
...
...
@@ -1351,7 +1340,7 @@ void sofia_event_callback(nua_event_t event,
switch_core_session_t
*
session
;
if
(
!
zstr
(
sofia_private
->
uuid
))
{
if
((
session
=
switch_core_session_
force_
locate
(
sofia_private
->
uuid
)))
{
if
((
session
=
switch_core_session_locate
(
sofia_private
->
uuid
)))
{
if
(
switch_core_session_running
(
session
))
{
switch_core_session_queue_signal_data
(
session
,
de
);
}
else
{
...
...
@@ -7194,6 +7183,8 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
char
sip_acl_authed_by
[
512
]
=
""
;
char
sip_acl_token
[
512
]
=
""
;
profile
->
ib_calls
++
;
if
(
sess_count
>=
sess_max
||
!
sofia_test_pflag
(
profile
,
PFLAG_RUNNING
))
{
nua_respond
(
nh
,
503
,
"Maximum Calls In Progress"
,
SIPTAG_RETRY_AFTER_STR
(
"300"
),
TAG_END
());
goto
fail
;
...
...
@@ -8257,8 +8248,6 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Setting NAT mode based on %s
\n
"
,
is_nat
);
switch_channel_set_variable
(
channel
,
"sip_nat_detected"
,
"true"
);
}
profile
->
ib_calls
++
;
return
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论